ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1685890 - /webservices/axiom/branches/attrs-aspects/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomElementSupport.aj
Date Tue, 16 Jun 2015 19:09:39 GMT
Author: veithen
Date: Tue Jun 16 19:09:38 2015
New Revision: 1685890

URL: http://svn.apache.org/r1685890
Log:
Some final fixes for the namespace declaration code. Tests all pass now.

Modified:
    webservices/axiom/branches/attrs-aspects/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomElementSupport.aj

Modified: webservices/axiom/branches/attrs-aspects/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomElementSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/attrs-aspects/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomElementSupport.aj?rev=1685890&r1=1685889&r2=1685890&view=diff
==============================================================================
--- webservices/axiom/branches/attrs-aspects/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomElementSupport.aj
(original)
+++ webservices/axiom/branches/attrs-aspects/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomElementSupport.aj
Tue Jun 16 19:09:38 2015
@@ -31,6 +31,7 @@ import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
 
+import org.apache.axiom.core.AttributeMatcher;
 import org.apache.axiom.core.CoreAttribute;
 import org.apache.axiom.core.CoreParentNode;
 import org.apache.axiom.core.IdentityMapper;
@@ -326,13 +327,19 @@ public aspect AxiomElementSupport {
 
     public final OMNamespace AxiomElement.addNamespaceDeclaration(String uri, String prefix)
{
         OMNamespace ns = new OMNamespaceImpl(uri, prefix);
-        addNamespaceDeclaration(ns);
+        try {
+            coreAppendAttribute(((AxiomNodeFactory)getOMFactory()).createNamespaceDeclaration(ns),
NodeMigrationPolicy.MOVE_ALWAYS);
+        } catch (NodeMigrationException ex) {
+            throw AxiomExceptionUtil.translate(ex);
+        }
         return ns;
     }
     
     public final void AxiomElement.addNamespaceDeclaration(OMNamespace ns) {
         try {
-            coreAppendAttribute(((AxiomNodeFactory)getOMFactory()).createNamespaceDeclaration(ns),
NodeMigrationPolicy.MOVE_ALWAYS);
+            coreSetAttribute(AttributeMatcher.NAMESPACE_DECLARATION,
+                    ((AxiomNodeFactory)getOMFactory()).createNamespaceDeclaration(ns),
+                    NodeMigrationPolicy.MOVE_ALWAYS, true, null, ReturnValue.NONE);
         } catch (NodeMigrationException ex) {
             throw AxiomExceptionUtil.translate(ex);
         }



Mime
View raw message