You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wss4j-dev@ws.apache.org by ru...@apache.org on 2006/09/12 09:24:52 UTC

svn commit: r442503 - /webservices/wss4j/trunk/src/org/apache/ws/security/util/WSSecurityUtil.java

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: wss4j-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: wss4j-dev-help@ws.apache.org