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:58:26 UTC

svn commit: r1387879 - in /ofbiz/branches/release11.04: ./ framework/base/src/org/ofbiz/base/util/UtilXml.java

Author: jleroux
Date: Thu Sep 20 06:58:25 2012
New Revision: 1387879

URL: http://svn.apache.org/viewvc?rev=1387879&view=rev
Log:
"Applied fix from trunk for revision: 1387878" 
------------------------------------------------------------------------
r1387878 | jleroux | 2012-09-20 08:57:10 +0200 (jeu., 20 sept. 2012) | 5 lines

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/branches/release11.04/   (props changed)
    ofbiz/branches/release11.04/framework/base/src/org/ofbiz/base/util/UtilXml.java

Propchange: ofbiz/branches/release11.04/
------------------------------------------------------------------------------
  Merged /ofbiz/trunk:r1387878

Modified: ofbiz/branches/release11.04/framework/base/src/org/ofbiz/base/util/UtilXml.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release11.04/framework/base/src/org/ofbiz/base/util/UtilXml.java?rev=1387879&r1=1387878&r2=1387879&view=diff
==============================================================================
--- ofbiz/branches/release11.04/framework/base/src/org/ofbiz/base/util/UtilXml.java (original)
+++ ofbiz/branches/release11.04/framework/base/src/org/ofbiz/base/util/UtilXml.java Thu Sep 20 06:58:25 2012
@@ -803,7 +803,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;
                 }
@@ -822,7 +822,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);