Commits

Anonymous committed 12a6194

Some XMLParsers parse the xwork config file differently, resulting in broken action results
o porting over from branch_1-2

Issue Number: XW-412

git-svn-id: http://svn.opensymphony.com/svn/xwork/branches/2.0@1373e221344d-f017-0410-9bd5-d282ab1896d7

Comments (0)

Files changed (1)

src/java/com/opensymphony/xwork2/config/providers/XmlHelper.java

                 Element paramElement = (Element) childNode;
                 String paramName = paramElement.getAttribute("name");
 
-
-                if (paramElement.getChildNodes().item(0) != null) {
-                    String paramValue = paramElement.getChildNodes().item(0).getNodeValue();
-                    if (paramValue != null) {
-                        paramValue = paramValue.trim();
-                    } else {
-                        paramValue = "";
-                    }
-                    params.put(paramName, paramValue);
+                StringBuffer paramValue = new StringBuffer();
+                for (int j=0; j <paramElement.getChildNodes().getLength(); j++) {
+                	if (paramElement.getChildNodes().item(j) != null && 
+                			paramElement.getChildNodes().item(j).getNodeType() == Node.TEXT_NODE) {
+                		String val = paramElement.getChildNodes().item(j).getNodeValue();
+                		if (val != null) {
+                			paramValue .append(val.trim());
+                		} 
+                	}
+                }
+                String val = paramValue.toString().trim();
+                if (val.length() > 0) {
+                	params.put(paramName, val);
                 }
-
             }
         }