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 aj...@apache.org on 2005/11/07 12:57:47 UTC

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

Author: ajith
Date: Mon Nov  7 03:57:33 2005
New Revision: 331258

URL: http://svn.apache.org/viewcvs?rev=331258&view=rev
Log:
Slighlty modified the serializer to seriallize the empty namespace
 If the OMElement is not associated with a namespace, we deliberately associate it with the empty namespace. If the OMElement is associated with a namespace, even by inheritance then it wouldn't change it's association. kind of ugly but perfectly legal and gets the thing done!

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

Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMSerializerUtil.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMSerializerUtil.java?rev=331258&r1=331257&r2=331258&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMSerializerUtil.java (original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMSerializerUtil.java Mon Nov  7 03:57:33 2005
@@ -131,6 +131,14 @@
             }
         } else {
             writer.writeStartElement(element.getLocalName());
+            /////////////////////////////////////////////////////
+            // A sort of a hack. If the OMElement is not associated with
+            // a namespace, we deliberately associate it with the empty namespace
+            // If the OMElement is associated with a namespace, even by inheritance
+            // then it shouldn't be here!!!!. kind of ugly but perfectly legal
+            //and gets the thing done!
+            writer.writeDefaultNamespace("");
+            /////////////////////////////////////////////////////
         }
 
         // add the namespaces
@@ -192,15 +200,15 @@
         serializeByPullStream(element,omOutput,false);
     }
 
-     public static void serializeByPullStream(OMElement element, org.apache.axis2.om.impl.OMOutputImpl omOutput,boolean cache) throws XMLStreamException {
+    public static void serializeByPullStream(OMElement element, org.apache.axis2.om.impl.OMOutputImpl omOutput,boolean cache) throws XMLStreamException {
         StreamingOMSerializer streamingOMSerializer = new StreamingOMSerializer();
         if (cache){
-               streamingOMSerializer.serialize(element.getXMLStreamReader(),
-                omOutput);
+            streamingOMSerializer.serialize(element.getXMLStreamReader(),
+                    omOutput);
         }else{
             XMLStreamReader xmlStreamReaderWithoutCaching = element.getXMLStreamReaderWithoutCaching();
             streamingOMSerializer.serialize(xmlStreamReaderWithoutCaching,
-                omOutput);
+                    omOutput);
         }
     }
 }