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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]