protected void addImport(XmlSchema xmlSchema, QName schemaTypeName) { NamespacePrefixList map = xmlSchema.getNamespaceContext(); if (map == null || ((map instanceof NamespaceMap) && ((NamespaceMap) map).values() == null) || schemaTypeName == null) { return; } if (map instanceof NamespaceMap && !((NamespaceMap) map).values(). contains(schemaTypeName.getNamespaceURI())) { XmlSchemaImport importElement = new XmlSchemaImport(xmlSchema); importElement.setNamespace(schemaTypeName.getNamespaceURI()); if (!xmlSchema.getItems().contains(importElement)) { xmlSchema.getItems().add(importElement); } ((NamespaceMap) xmlSchema.getNamespaceContext()). put(generatePrefix(), schemaTypeName.getNamespaceURI()); } }
protected void addImport(XmlSchema xmlSchema, QName schemaTypeName) { NamespacePrefixList map = xmlSchema.getNamespaceContext(); if (map == null || ((map instanceof NamespaceMap) && ((NamespaceMap) map).values() == null) || schemaTypeName == null) { return; } if (map instanceof NamespaceMap && !((NamespaceMap) map).values(). contains(schemaTypeName.getNamespaceURI())) { XmlSchemaImport importElement = new XmlSchemaImport(xmlSchema); importElement.setNamespace(schemaTypeName.getNamespaceURI()); if (!xmlSchema.getItems().contains(importElement)) { xmlSchema.getItems().add(importElement); } ((NamespaceMap) xmlSchema.getNamespaceContext()). put(generatePrefix(), schemaTypeName.getNamespaceURI()); } }
private void addSchemaNameSpace(XmlSchema schema) { String targetNameSpace = schema.getTargetNamespace(); String prefix = schema.getNamespaceContext().getPrefix(targetNameSpace); if (namespaceMap == null) { namespaceMap = new NamespaceMap(); } if (!namespaceMap.values().contains(targetNameSpace)) { // i.e this target namespace not exists in the namesapce map // find a non exists prefix to add this target namesapce while ((prefix == null) || namespaceMap.keySet().contains(prefix)) { prefix = "ns" + nsCount++; } namespaceMap.put(prefix, targetNameSpace); } }
private void addSchemaNameSpace(XmlSchema schema) { String targetNameSpace = schema.getTargetNamespace(); String prefix = schema.getNamespaceContext().getPrefix(targetNameSpace); if (namespaceMap == null) { namespaceMap = new NamespaceMap(); } if (!namespaceMap.values().contains(targetNameSpace)) { // i.e this target namespace not exists in the namesapce map // find a non exists prefix to add this target namesapce while ((prefix == null) || namespaceMap.keySet().contains(prefix)) { prefix = "ns" + nsCount++; } namespaceMap.put(prefix, targetNameSpace); } }
if (!((NamespaceMap) xmlSchema.getNamespaceContext()).values(). contains(tgtNamespace)) { XmlSchemaImport importElement = new XmlSchemaImport(xmlSchema);
if (!((NamespaceMap) xmlSchema.getNamespaceContext()).values(). contains(tgtNamespace)) { XmlSchemaImport importElement = new XmlSchemaImport(xmlSchema);
if (!((NamespaceMap) xmlSchema.getNamespaceContext()).values(). contains(tgtNamespace)) { XmlSchemaImport importElement = new XmlSchemaImport(xmlSchema);
if (!((NamespaceMap) xmlSchema.getNamespaceContext()).values(). contains(tgtNamespace)) { XmlSchemaImport importElement = new XmlSchemaImport(xmlSchema);
if (typeTable.getComplexSchemaType(propertyName) != null && !((NamespaceMap) xmlSchema.getNamespaceContext()).values(). contains(typeTable.getComplexSchemaType(propertyName).getNamespaceURI())) { XmlSchemaImport importElement = new XmlSchemaImport(xmlSchema);
if (typeTable.getComplexSchemaType(propertyName) != null && !((NamespaceMap) xmlSchema.getNamespaceContext()).values(). contains(typeTable.getComplexSchemaType(propertyName).getNamespaceURI())) { XmlSchemaImport importElement = new XmlSchemaImport(xmlSchema);
if (typeTable.getComplexSchemaType(propertyName) != null && !((NamespaceMap) xmlSchema.getNamespaceContext()).values(). contains(typeTable.getComplexSchemaType(propertyName).getNamespaceURI())) { XmlSchemaImport importElement = new XmlSchemaImport(xmlSchema);
if (typeTable.getComplexSchemaType(propertyName) != null && !((NamespaceMap) xmlSchema.getNamespaceContext()).values(). contains(typeTable.getComplexSchemaType(propertyName).getNamespaceURI())) { XmlSchemaImport importElement = new XmlSchemaImport(xmlSchema);