Author: ruchithf
Date: Tue Sep 12 00:24:51 2006
New Revision: 442503

URL: http://svn.apache.org/viewvc?view=rev&rev=442503
Log:
create the child with the same default namespace when the parent element has a 
default namespace

Modified:
    webservices/wss4j/trunk/src/org/apache/ws/security/util/WSSecurityUtil.java

Modified: 
webservices/wss4j/trunk/src/org/apache/ws/security/util/WSSecurityUtil.java
URL: 
http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/org/apache/ws/security/util/WSSecurityUtil.java?view=diff&rev=442503&r1=442502&r2=442503
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/security/util/WSSecurityUtil.java 
(original)
+++ webservices/wss4j/trunk/src/org/apache/ws/security/util/WSSecurityUtil.java 
Tue Sep 12 00:24:51 2006
@@ -510,11 +510,14 @@
      */
     private static Element createElementInSameNamespace(Element parent,
             String localName) {
+        
+        String qName = localName;
+        
         String prefix = parent.getPrefix();
-        if (prefix == null) {
-            prefix = "";
+        if (prefix != null || prefix.length() > 0) {
+            qName = prefix + ":" + localName;
         }
-        String qName = prefix + ":" + localName;
+         
         String nsUri = parent.getNamespaceURI();
         return parent.getOwnerDocument().createElementNS(nsUri, qName);
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to