You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ch...@apache.org on 2005/10/17 09:43:03 UTC

svn commit: r325855 - /webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMElementImpl.java

Author: chinthaka
Date: Mon Oct 17 00:42:54 2005
New Revision: 325855

URL: http://svn.apache.org/viewcvs?rev=325855&view=rev
Log:
Fixing a bug in attribute namespace declaration. Thanks Ruchith for pointing this out.

Modified:
    webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMElementImpl.java

Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMElementImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMElementImpl.java?rev=325855&r1=325854&r2=325855&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMElementImpl.java (original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMElementImpl.java Mon Oct 17 00:42:54 2005
@@ -408,6 +408,11 @@
         if (attributes == null) {
             this.attributes = new HashMap(5);
         }
+        OMNamespace namespace = attr.getNamespace();
+        if ( namespace != null && this.findNamespace(namespace.getName(), namespace.getPrefix()) == null) {
+            this.declareNamespace(namespace.getName(), namespace.getPrefix());
+        }
+
         attributes.put(attr.getQName(), attr);
         return attr;
     }
@@ -784,7 +789,7 @@
         } catch (XMLStreamException e) {
             // can not throw out an exception here. Can't do anything other than logging
             // and swallowing this :(
-            logger.error("Can not serialize OM Element "+ this.getLocalName(), e);
+            logger.error("Can not serialize OM Element " + this.getLocalName(), e);
         }
 
         return new String(baos.toByteArray());