private XmlSchema addNameSpaces(int i) { XmlSchema schema = (XmlSchema) schemaList.get(i); NamespaceMap map = (NamespaceMap) namespaceMap.clone(); NamespacePrefixList namespaceContext = schema.getNamespaceContext(); String prefixes[] = namespaceContext.getDeclaredPrefixes(); for (int j = 0; j < prefixes.length; j++) { String prefix = prefixes[j]; map.add(prefix, namespaceContext.getNamespaceURI(prefix)); } schema.setNamespaceContext(map); return schema; }
private XmlSchema addNameSpaces(int i) { XmlSchema schema = (XmlSchema) schemaList.get(i); NamespaceMap map = (NamespaceMap) namespaceMap.clone(); NamespacePrefixList namespaceContext = schema.getNamespaceContext(); String prefixes[] = namespaceContext.getDeclaredPrefixes(); for (int j = 0; j < prefixes.length; j++) { String prefix = prefixes[j]; map.add(prefix, namespaceContext.getNamespaceURI(prefix)); } schema.setNamespaceContext(map); return schema; }
nsMap.add("xsd", XmlSchemaConstants.XSD_NAMESPACE_URI); nsMap.add("tns", schAgain.getTargetNamespace()); schAgain.setNamespaceContext(nsMap);
nsMap.add("xsd", Constants.URI_2001_SCHEMA_XSD); nsMap.add("tns", schAgain.getTargetNamespace()); schAgain.setNamespaceContext(nsMap);
/** * 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); }
@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; }
@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; }
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; }
private SchemaInfo createSchemaIfNeeded(String namespace, NamespaceMap nsMap) { SchemaInfo schemaInfo = serviceInfo.getSchema(namespace); if (schemaInfo == null) { XmlSchema xmlSchema = schemas.newXmlSchemaInCollection(namespace); if (qualifiedSchemas) { xmlSchema.setElementFormDefault(XmlSchemaForm.QUALIFIED); } xmlSchema.setNamespaceContext(nsMap); schemaInfo = new SchemaInfo(namespace); schemaInfo.setSchema(xmlSchema); serviceInfo.addSchema(schemaInfo); } return schemaInfo; }
xsd.setNamespaceContext(prefixMap);
nsMap.add(WSDLConstants.CONVENTIONAL_TNS_PREFIX, serviceInfo.getTargetNamespace()); schema.setNamespaceContext(nsMap); serviceInfo.addSchema(schemaInfo); return schemaInfo;
nsMap.add(WSDLConstants.CONVENTIONAL_TNS_PREFIX, serviceInfo.getTargetNamespace()); schema.setNamespaceContext(nsMap); serviceInfo.addSchema(schemaInfo); return schemaInfo;
nsMap.add(WSDLConstants.CONVENTIONAL_TNS_PREFIX, serviceInfo.getTargetNamespace()); schema.setNamespaceContext(nsMap); serviceInfo.addSchema(schemaInfo); return schemaInfo;
schema.setNamespaceContext(prefixmap); return coxbPrefix;
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.add(ReferenceConstants.WSADDRESSING_PREFIX, ReferenceConstants.WSADDRESSING_NAMESPACE); s.setNamespaceContext(nsMap); } else { nsMap.add(ReferenceConstants.WSADDRESSING_PREFIX,
prefixMap.add("tns", nsURI); XmlSchema schemaDef = xsDef.getSchema(); schemaDef.setNamespaceContext(prefixMap); Document[] docs = schemaDef.getAllSchemas(); document = docs[docs.length-1];
prefixMap.add("tns", nsURI); XmlSchema schemaDef = xsDef.getSchema(); schemaDef.setNamespaceContext(prefixMap); Document[] docs = schemaDef.getAllSchemas(); document = docs[docs.length-1];
nsMap = new NamespaceMap(); nsMap.add("xs", Constants.URI_2001_SCHEMA_XSD); schema.setNamespaceContext(nsMap); } else { nsMap.add("xs", Constants.URI_2001_SCHEMA_XSD);