You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by fg...@apache.org on 2010/02/10 16:55:31 UTC

svn commit: r908552 - /incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/xml/stax/StaxReader.java

Author: fguillaume
Date: Wed Feb 10 15:55:30 2010
New Revision: 908552

URL: http://svn.apache.org/viewvc?rev=908552&view=rev
Log:
CMIS-106: Enhance XML parser compatibility

Modified:
    incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/xml/stax/StaxReader.java

Modified: incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/xml/stax/StaxReader.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/xml/stax/StaxReader.java?rev=908552&r1=908551&r2=908552&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/xml/stax/StaxReader.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/xml/stax/StaxReader.java Wed Feb 10 15:55:30 2010
@@ -13,6 +13,7 @@
  *
  * Authors:
  *     Bogdan Stefanescu, Nuxeo
+ *     Michael Durig, Day
  */
 package org.apache.chemistry.xml.stax;
 
@@ -307,14 +308,15 @@
 
     @Override
     public String getAttributeValue(String namespaceURI, String localName) {
-        if (namespaceURI == null) {
-            namespaceURI = "";
-        }
-        String val = super.getAttributeValue(namespaceURI, localName);
-        if (val == null
-                && (namespaceURI.length() != 0 && namespaceURI.equals(getDefaultNamespaceURI()))) {
-            // try with empty namespace
-            val = getAttributeValue("", localName);
+        String val;
+        if (namespaceURI == null || "".equals(namespaceURI)) {
+            val = getAttributeValue(localName);
+        } else {
+            val = super.getAttributeValue(namespaceURI, localName);
+            if (val == null && namespaceURI.equals(getDefaultNamespaceURI())) {
+                // try without namespace
+                val = getAttributeValue(localName);
+            }
         }
         return val;
     }