Commits

Anonymous committed 3981c3e

XW-412
- Some XMLParsers parse the xwork config file differently, resulting in broken action results

git-svn-id: http://svn.opensymphony.com/svn/xwork/branches/xwork_1-2/src@1318e221344d-f017-0410-9bd5-d282ab1896d7

  • Participants
  • Parent commits 887b51a

Comments (0)

Files changed (1)

File java/com/opensymphony/xwork/config/providers/XmlHelper.java

 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
+import java.util.Iterator;
 import java.util.Map;
 import java.util.LinkedHashMap;
 
             return params;
         }
 
+        
+        
         NodeList childNodes = paramsElement.getChildNodes();
-
         for (int i = 0; i < childNodes.getLength(); i++) {
             Node childNode = childNodes.item(i);
 
             if ((childNode.getNodeType() == Node.ELEMENT_NODE) && "param".equals(childNode.getNodeName())) {
                 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);
                 }
-
             }
         }
-
         return params;
     }
 }