[207113] New XML Wizard doesn't handle a root from 'no target namespace' when children have namespaces
diff --git a/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDImpl.java b/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDImpl.java
index 154fe0d..38bec38 100644
--- a/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDImpl.java
+++ b/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDImpl.java
@@ -1151,14 +1151,16 @@
} else if("http://www.w3.org/2000/xmlns".equals(info.uri)) {
info.prefix = "xmlns";
} else {
- int n = 1;
- if(info.prefix == null || info.prefix.equals("")) {
- info.prefix = "p";
- }
- String prefix = info.prefix;
- while(isDataInNamespaceList(namespaceList, 1, info.prefix)) {
- info.prefix = prefix + n++;
- }
+ if(info.uri != null && info.uri != "") {
+ int n = 1;
+ if(info.prefix == null || info.prefix.equals("")) {
+ info.prefix = "p";
+ }
+ String prefix = info.prefix;
+ while(isDataInNamespaceList(namespaceList, 1, info.prefix)) {
+ info.prefix = prefix + n++;
+ }
+ }
}
URI relative = URI.createURI(xsdSchema.getSchemaLocation(), true);
URI absolute = URI.createURI(schema.getSchemaLocation(), true);