Author: dandiep
Date: Sat Apr  8 22:23:58 2006
New Revision: 392679

URL: http://svn.apache.org/viewcvs?rev=392679&view=rev
Log:
Fix critical bug where we were traversing up and reading the <wsdl> 
targetNamespace. 

Modified:
    
webservices/commons/trunk/modules/XmlSchema/src/org/apache/ws/commons/schema/SchemaBuilder.java

Modified: 
webservices/commons/trunk/modules/XmlSchema/src/org/apache/ws/commons/schema/SchemaBuilder.java
URL: 
http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/XmlSchema/src/org/apache/ws/commons/schema/SchemaBuilder.java?rev=392679&r1=392678&r2=392679&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/XmlSchema/src/org/apache/ws/commons/schema/SchemaBuilder.java
 (original)
+++ 
webservices/commons/trunk/modules/XmlSchema/src/org/apache/ws/commons/schema/SchemaBuilder.java
 Sat Apr  8 22:23:58 2006
@@ -61,6 +61,12 @@
         // get all the attributes along with the namespace declns
 
         setNamespaceAttributes(schema, schemaEl);
+        
+        // only populate it if it isn't already in there
+        if(!collection.namespaces.containsKey(schema.targetNamespace)){
+            collection.namespaces.put(schema.targetNamespace, schema);
+        }
+        
         schema.setElementFormDefault(this.getFormDefault(schemaEl,
                 "elementFormDefault"));
         schema.setAttributeFormDefault(this.getFormDefault(schemaEl,
@@ -253,10 +259,6 @@
                 schema.targetNamespace = contain;
         } else {
             putNamespace("", schema.targetNamespace);
-        }
-        // only populate it if it isn't already in there
-        if(!collection.namespaces.containsKey(schema.targetNamespace)){
-            collection.namespaces.put(schema.targetNamespace, schema);
         }
     }
 


Reply via email to