You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2008/05/09 20:02:01 UTC

svn commit: r654899 - /cxf/trunk/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java

Author: dkulp
Date: Fri May  9 11:02:01 2008
New Revision: 654899

URL: http://svn.apache.org/viewvc?rev=654899&view=rev
Log:
[CXF-1581] Fix problems with ?wsdl with sun stax implemenations

Modified:
    cxf/trunk/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java

Modified: cxf/trunk/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java?rev=654899&r1=654898&r2=654899&view=diff
==============================================================================
--- cxf/trunk/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java (original)
+++ cxf/trunk/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java Fri May  9 11:02:01 2008
@@ -516,7 +516,15 @@
                         declareNamespace = false;
                     }
                 } else {
-                    writer.writeAttribute(attrPrefix, attr.getNamespaceURI(), name, attr.getNodeValue());
+                    String attns = attr.getNamespaceURI();
+                    String value = attr.getNodeValue();
+                    if (attns == null || attns.length() == 0) {
+                        writer.writeAttribute(name, value);
+                    } else if (attrPrefix == null || attrPrefix.length() == 0) {
+                        writer.writeAttribute(attns, name, value);
+                    } else {
+                        writer.writeAttribute(attrPrefix, attns, name, value);
+                    }                    
                 }
             }
         }