Author: woodroy
Date: Thu Apr 24 11:07:46 2008
New Revision: 651330

URL: http://svn.apache.org/viewvc?rev=651330&view=rev
Log:
WSCOMMONS-326 (supplement)
Contributor: Roy Wood
Additional changes for proper functioning of SAXOMBuilder and StAXBuilder

Modified:
    
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/SAXOMBuilder.java
    
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXBuilder.java

Modified: 
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/SAXOMBuilder.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/SAXOMBuilder.java?rev=651330&r1=651329&r2=651330&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/SAXOMBuilder.java
 (original)
+++ 
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/SAXOMBuilder.java
 Thu Apr 24 11:07:46 2008
@@ -20,6 +20,7 @@
 package org.apache.axiom.om.impl.builder;
 
 import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMAttribute;
 import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMException;
@@ -104,12 +105,21 @@
             nextElem = createNextElement(localName);
         else
             nextElem.setLocalName(localName);
-        nextElem
-                .setNamespace(nextElem.findNamespace(namespaceURI, null));
+        
+        nextElem.setNamespace(nextElem.findNamespace(namespaceURI, null));
+        
         int j = atts.getLength();
-        for (int i = 0; i < j; i++)
+        for (int i = 0; i < j; i++) {
             nextElem.addAttribute(atts.getLocalName(i), atts.getValue(i),
                                   nextElem.findNamespace(atts.getURI(i), 
null));
+        
+            OMAttribute attr = nextElem.addAttribute(atts.getLocalName(i), 
+                                                                               
         atts.getValue(i),
+                                                                               
         nextElem.findNamespace(atts.getURI(i), null));
+                                                                               
         
+            attr.setAttributeType(atts.getType(i));
+        }
+        
         lastNode = nextElem;
         nextElem = null;
     }

Modified: 
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXBuilder.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXBuilder.java?rev=651330&r1=651329&r2=651330&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXBuilder.java
 (original)
+++ 
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXBuilder.java
 Thu Apr 24 11:07:46 2008
@@ -20,6 +20,7 @@
 package org.apache.axiom.om.impl.builder;
 
 import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMAttribute;
 import org.apache.axiom.om.OMConstants;
 import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMDocument;
@@ -216,8 +217,10 @@
             // todo if the attributes are supposed to namespace qualified all 
the time
             // todo then this should throw an exception here
 
-            node.addAttribute(parser.getAttributeLocalName(i),
+            OMAttribute attr = 
node.addAttribute(parser.getAttributeLocalName(i),
                               parser.getAttributeValue(i), namespace);
+            attr.setAttributeType(parser.getAttributeType(i));
+            
         }
     }
 


Reply via email to