You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2012/09/20 08:57:11 UTC

svn commit: r1387878 - /ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilXml.java

Author: jleroux
Date: Thu Sep 20 06:57:10 2012
New Revision: 1387878

URL: http://svn.apache.org/viewvc?rev=1387878&view=rev
Log:
Closes "UtilXml firstChildElement should use getNodeName instead of getLocalName " https://issues.apache.org/jira/browse/OFBIZ-4441

The previous solution was not complete and prevented SOAP call to work correctly (see http://markmail.org/message/sz5esi3j6ombmrte).
This guarantee best of both worlds: uses getLocalName for SOAP if not null, else fall-backs to getNodeName

Modified:
    ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilXml.java

Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilXml.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilXml.java?rev=1387878&r1=1387877&r2=1387878&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilXml.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilXml.java Thu Sep 20 06:57:10 2012
@@ -805,7 +805,7 @@ public class UtilXml {
         if (node != null) {
             do {
                 if (node.getNodeType() == Node.ELEMENT_NODE && (childElementName == null ||
-                        childElementName.equals(node.getNodeName()))) {
+                        childElementName.equals(node.getLocalName() != null ? node.getLocalName() : node.getNodeName()))) {
                     Element childElement = (Element) node;
                     return childElement;
                 }
@@ -824,7 +824,7 @@ public class UtilXml {
         if (node != null) {
             do {
                 if (node.getNodeType() == Node.ELEMENT_NODE && (childElementName == null ||
-                        childElementName.equals(node.getNodeName()))) {
+                        childElementName.equals(node.getLocalName() != null ? node.getLocalName() : node.getNodeName()))) {
                     Element childElement = (Element) node;
 
                     String value = childElement.getAttribute(attrName);