You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by ve...@apache.org on 2009/04/10 22:02:12 UTC
svn commit: r764027 - in
/webservices/commons/trunk/modules/axiom/modules/axiom-api/src:
main/java/org/apache/axiom/om/impl/OMStAXWrapper.java
test/resources/conformance/null-namespace.xml
Author: veithen
Date: Fri Apr 10 20:02:12 2009
New Revision: 764027
URL: http://svn.apache.org/viewvc?rev=764027&view=rev
Log:
Modified OMStAXWrapper#getNamespaceURI() to always return null for null namespaces, as required by the specs and as Woodstox does.
Added:
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/resources/conformance/null-namespace.xml (with props)
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/OMStAXWrapper.java
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/OMStAXWrapper.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/OMStAXWrapper.java?rev=764027&r1=764026&r2=764027&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/OMStAXWrapper.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/OMStAXWrapper.java Fri Apr 10 20:02:12 2009
@@ -281,7 +281,12 @@
|| (currentEvent == END_ELEMENT)
|| (currentEvent == NAMESPACE)) {
OMNamespace ns = ((OMElement) getNode()).getNamespace();
- returnStr = (ns == null) ? null : ns.getNamespaceURI();
+ if (ns == null) {
+ returnStr = null;
+ } else {
+ String namespaceURI = ns.getNamespaceURI();
+ returnStr = namespaceURI.length() == 0 ? null : namespaceURI;
+ }
} else {
throw new IllegalStateException();
}
Added: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/resources/conformance/null-namespace.xml
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/resources/conformance/null-namespace.xml?rev=764027&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/resources/conformance/null-namespace.xml (added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/resources/conformance/null-namespace.xml Fri Apr 10 20:02:12 2009
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<a xmlns="urn:ns">
+ <b xmlns="">
+ <c/>
+ </b>
+</a>
\ No newline at end of file
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/resources/conformance/null-namespace.xml
------------------------------------------------------------------------------
svn:eol-style = native