You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by hu...@apache.org on 2006/07/19 11:37:23 UTC

svn commit: r423415 - /webservices/commons/trunk/modules/XmlSchema/src/org/apache/ws/commons/schema/XmlSchemaSerializer.java

Author: hughesj
Date: Wed Jul 19 02:37:22 2006
New Revision: 423415

URL: http://svn.apache.org/viewvc?rev=423415&view=rev
Log:
WSCOMMONS-61: When the targetNamespace is absent the effective namespace for use in QName objects is "". Emptystring isn't listed in the schema_ns as it isn't explicitly defined in the schema. Therefore looking up a prefix for the "" namespace returns null and a "temporary" 'genXXX' prefix is genereated. This fix prevents the temporary namespace being created when the namespace is "". The "" prefix is used.

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

Modified: webservices/commons/trunk/modules/XmlSchema/src/org/apache/ws/commons/schema/XmlSchemaSerializer.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/org/apache/ws/commons/schema/XmlSchemaSerializer.java?rev=423415&r1=423414&r2=423415&view=diff
==============================================================================
--- webservices/commons/trunk/modules/XmlSchema/src/org/apache/ws/commons/schema/XmlSchemaSerializer.java (original)
+++ webservices/commons/trunk/modules/XmlSchema/src/org/apache/ws/commons/schema/XmlSchemaSerializer.java Wed Jul 19 02:37:22 2006
@@ -2529,7 +2529,8 @@
         String typeName = (type.length > 1) ? type[1] : type[0];
         String prefixStr;
 
-        Object prefix = schema_ns.get(namespace);
+        // If the namespace is "" then the prefix is also ""
+        Object prefix = ("".equals(namespace)) ? "" : schema_ns.get(namespace);
 
         if (prefix == null) {
             int magicNumber = new java.util.Random().nextInt(999);



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org