Skip to content

Commit

Permalink
teiiddes-1633: Added check... if tns in XSDFeature is null, then chec…
Browse files Browse the repository at this point in the history
…k the XSDComplexTypeDefinitionImpl instance.
  • Loading branch information
tejones committed Jun 24, 2013
1 parent baa99e0 commit f6d0884
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import org.eclipse.xsd.XSDParticle;
import org.eclipse.xsd.XSDSchema;
import org.eclipse.xsd.XSDTypeDefinition;
import org.eclipse.xsd.impl.XSDComplexTypeDefinitionImpl;
import org.teiid.core.designer.ModelerCoreException;
import org.teiid.core.designer.id.ObjectID;
import org.teiid.core.designer.util.CoreArgCheck;
Expand Down Expand Up @@ -120,7 +121,11 @@ private void addChildren( final XmlDocumentEntity docParent,
if (parentXsdComp instanceof XSDFeature) {
final XSDFeature feature = (XSDFeature)parentXsdComp;
if (feature.isGlobal() || XSDForm.QUALIFIED_LITERAL.equals(feature.getForm())) {
final String uri = feature.getTargetNamespace();
String uri = feature.getTargetNamespace();
//If the TNS is null in the XSDFeature, check the XSDComplexTypeDefintionImpl
if (uri == null && xsdComponent != null && xsdComponent instanceof XSDComplexTypeDefinitionImpl) {
uri = ((XSDComplexTypeDefinitionImpl)xsdComponent).getTargetNamespace();
}
if (uri != null) {
final XmlNamespace ns = (XmlNamespace)this.uriToNamespaceMap.get(uri);
if (ns != null) elem.setNamespace(ns);
Expand Down Expand Up @@ -476,7 +481,7 @@ public int buildDocument( final XmlElement rootElement,
// this.factor = new Double(0 - (1/(4500d/9200) ) ).intValue();
// }

initializeRecursionStack(root);
// initializeRecursionStack(root);
nodeCount = 0;

// Recursively build document from schema
Expand Down

0 comments on commit f6d0884

Please sign in to comment.