public SchemaCollection(XmlSchemaCollection col) { schemaCollection = col; if (schemaCollection.getNamespaceContext() == null) { // an empty prefix map avoids extra checks for null. schemaCollection.setNamespaceContext(new NamespaceMap()); } }
public SchemaCollection(XmlSchemaCollection col) { schemaCollection = col; if (schemaCollection.getNamespaceContext() == null) { // an empty prefix map avoids extra checks for null. schemaCollection.setNamespaceContext(new NamespaceMap()); } }
public SchemaCollection(XmlSchemaCollection col) { schemaCollection = col; if (schemaCollection.getNamespaceContext() == null) { // an empty prefix map avoids extra checks for null. schemaCollection.setNamespaceContext(new NamespaceMap()); } }
public SchemaCollection(XmlSchemaCollection col) { schemaCollection = col; if (schemaCollection.getNamespaceContext() == null) { // an empty prefix map avoids extra checks for null. schemaCollection.setNamespaceContext(new NamespaceMap()); } }
public SchemaCollection(XmlSchemaCollection col) { schemaCollection = col; if (schemaCollection.getNamespaceContext() == null) { // an empty prefix map avoids extra checks for null. schemaCollection.setNamespaceContext(new NamespaceMap()); } }
/** * Creates a schema from a DataService object, to be used later in WSDL generation. */ @SuppressWarnings ("unchecked") private void createDSSchema(AxisService axisService, DataService dataService) throws DataServiceFault { NamespaceMap map = new NamespaceMap(); map.put(Java2WSDLConstants.DEFAULT_SCHEMA_NAMESPACE_PREFIX, Java2WSDLConstants.URI_2001_SCHEMA_XSD); axisService.setNamespaceMap(map); DataServiceDocLitWrappedSchemaGenerator.populateServiceSchema(axisService); }
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); } }
/** * Retrieve the XML schema with the given namespace. * @param cparams Common parameters used in the schema generator * @param namespace The target namespace of the XML schema * @return The XML schema object */ private static XmlSchema retrieveSchema(CommonParams cparams, String namespace) { Map<String, XmlSchema> schemaMap = cparams.getSchemaMap(); if (!schemaMap.containsKey(namespace)) { XmlSchema schema = new XmlSchema(namespace, cparams.getXmlSchemaCollection()); schema.setNamespaceContext(new NamespaceMap()); schemaMap.put(namespace, schema); schema.setElementFormDefault(new XmlSchemaForm(XmlSchemaForm.QUALIFIED)); schema.setAttributeFormDefault(new XmlSchemaForm(XmlSchemaForm.UNQUALIFIED)); } return schemaMap.get(namespace); }
protected XmlSchema getXmlSchema(String targetNamespace) { XmlSchema xmlSchema; if ((xmlSchema = schemaMap.get(targetNamespace)) == null) { String targetNamespacePrefix; if (targetNamespace.equals(schemaTargetNameSpace) && schema_namespace_prefix != null) { targetNamespacePrefix = schema_namespace_prefix; } else { targetNamespacePrefix = generatePrefix(); } xmlSchema = new XmlSchema(targetNamespace, xmlSchemaCollection); xmlSchema.setAttributeFormDefault(getAttrFormDefaultSetting()); xmlSchema.setElementFormDefault(getElementFormDefaultSetting()); targetNamespacePrefixMap.put(targetNamespace, targetNamespacePrefix); schemaMap.put(targetNamespace, xmlSchema); NamespaceMap prefixmap = new NamespaceMap(); prefixmap.put(DEFAULT_SCHEMA_NAMESPACE_PREFIX, URI_2001_SCHEMA_XSD); prefixmap.put(targetNamespacePrefix, targetNamespace); xmlSchema.setNamespaceContext(prefixmap); } return xmlSchema; }
@Override protected XmlSchema getXmlSchema(String targetNamespace) { XmlSchema xmlSchema; if ((xmlSchema = schemaMap.get(targetNamespace)) == null) { String targetNamespacePrefix; if (targetNamespace.equals(schemaTargetNameSpace) && schema_namespace_prefix != null) { targetNamespacePrefix = schema_namespace_prefix; } else { targetNamespacePrefix = generatePrefix(); } xmlSchema = new XmlSchema(targetNamespace, xmlSchemaCollection); xmlSchema.setAttributeFormDefault(getAttrFormDefaultSetting()); xmlSchema.setElementFormDefault(getElementFormDefaultSetting()); targetNamespacePrefixMap.put(targetNamespace, targetNamespacePrefix); schemaMap.put(targetNamespace, xmlSchema); NamespaceMap prefixmap = new NamespaceMap(); prefixmap.put(DEFAULT_SCHEMA_NAMESPACE_PREFIX, URI_2001_SCHEMA_XSD); prefixmap.put(targetNamespacePrefix, targetNamespace); xmlSchema.setNamespaceContext(prefixmap); } return xmlSchema; }
protected XmlSchema getXmlSchema(String targetNamespace) { XmlSchema xmlSchema; if ((xmlSchema = schemaMap.get(targetNamespace)) == null) { String targetNamespacePrefix; if (targetNamespace.equals(schemaTargetNameSpace) && schema_namespace_prefix != null) { targetNamespacePrefix = schema_namespace_prefix; } else { targetNamespacePrefix = generatePrefix(); } xmlSchema = new XmlSchema(targetNamespace, xmlSchemaCollection); xmlSchema.setAttributeFormDefault(getAttrFormDefaultSetting()); xmlSchema.setElementFormDefault(getElementFormDefaultSetting()); targetNamespacePrefixMap.put(targetNamespace, targetNamespacePrefix); schemaMap.put(targetNamespace, xmlSchema); NamespaceMap prefixmap = new NamespaceMap(); prefixmap.put(DEFAULT_SCHEMA_NAMESPACE_PREFIX, URI_2001_SCHEMA_XSD); prefixmap.put(targetNamespacePrefix, targetNamespace); xmlSchema.setNamespaceContext(prefixmap); } return xmlSchema; }
@Override protected XmlSchema getXmlSchema(String targetNamespace) { XmlSchema xmlSchema; if ((xmlSchema = schemaMap.get(targetNamespace)) == null) { String targetNamespacePrefix; if (targetNamespace.equals(schemaTargetNameSpace) && schema_namespace_prefix != null) { targetNamespacePrefix = schema_namespace_prefix; } else { targetNamespacePrefix = generatePrefix(); } xmlSchema = new XmlSchema(targetNamespace, xmlSchemaCollection); xmlSchema.setAttributeFormDefault(getAttrFormDefaultSetting()); xmlSchema.setElementFormDefault(getElementFormDefaultSetting()); targetNamespacePrefixMap.put(targetNamespace, targetNamespacePrefix); schemaMap.put(targetNamespace, xmlSchema); NamespaceMap prefixmap = new NamespaceMap(); prefixmap.put(DEFAULT_SCHEMA_NAMESPACE_PREFIX, URI_2001_SCHEMA_XSD); prefixmap.put(targetNamespacePrefix, targetNamespace); xmlSchema.setNamespaceContext(prefixmap); } return xmlSchema; }
String jaxbPrefix = JAXB_DEFAULT_NAMESPACE_PREFIX; NamespaceMap prefixMap = new NamespaceMap(); NamespacePrefixList nsList = xsd.getNamespaceContext(); for (String prefix : nsList.getDeclaredPrefixes()) {
explicitNamespaceMappings = Collections.emptyMap(); NamespaceMap nsMap = new NamespaceMap(); for (Map.Entry<String, String> mapping : explicitNamespaceMappings.entrySet()) { nsMap.add(mapping.getValue(), mapping.getKey());
final String namespaceUri, final XmlSchema schema) { NamespaceMap prefixmap = new NamespaceMap(); NamespacePrefixList npl = schema.getNamespaceContext(); for (int i = 0; i < npl.getDeclaredPrefixes().length; i++) {
private void createBridgeXsElement(MessagePartInfo part, QName qn, QName typeName) { XmlSchemaElement el = null; SchemaInfo schemaInfo = serviceInfo.getSchema(qn.getNamespaceURI()); if (schemaInfo != null) { el = schemaInfo.getElementByQName(qn); if (el == null) { createXsElement(schemaInfo.getSchema(), part, typeName, schemaInfo); } else if (!typeName.equals(el.getSchemaTypeName())) { throw new Fault(new Message("CANNOT_CREATE_ELEMENT", LOG, qn, typeName, el.getSchemaTypeName())); } return; } XmlSchema schema = schemas.newXmlSchemaInCollection(qn.getNamespaceURI()); if (qualifiedSchemas) { schema.setElementFormDefault(XmlSchemaForm.QUALIFIED); } schemaInfo = new SchemaInfo(qn.getNamespaceURI(), qualifiedSchemas, false); schemaInfo.setSchema(schema); el = createXsElement(schema, part, typeName, schemaInfo); NamespaceMap nsMap = new NamespaceMap(); nsMap.add(WSDLConstants.CONVENTIONAL_TNS_PREFIX, schema.getTargetNamespace()); nsMap.add(WSDLConstants.NP_SCHEMA_XSD, WSDLConstants.NS_SCHEMA_XSD); schema.setNamespaceContext(nsMap); serviceInfo.addSchema(schemaInfo); }
nsMap = new NamespaceMap(); nsMap.add(ReferenceConstants.WSADDRESSING_PREFIX, ReferenceConstants.WSADDRESSING_NAMESPACE);
if (document == null) { try { NamespaceMap prefixMap = new NamespaceMap(); prefixMap.add("xs", SCHEMA_NS); prefixMap.add("tns", nsURI);
nsMap = new NamespaceMap(); nsMap.add("xs", Constants.URI_2001_SCHEMA_XSD); schema.setNamespaceContext(nsMap);