chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fguilla...@apache.org
Subject svn commit: r908552 - /incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/xml/stax/StaxReader.java
Date Wed, 10 Feb 2010 15:55:31 GMT
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;
     }



Mime
View raw message