xsd.setTargetNamespace(namespace); xsd.getQNamePrefixToNamespaceMap().put(prefix, namespace);
protected void createOtherSchema(EPackage ePackage) { XSDSchema otherSchema = XSDFactory.eINSTANCE.createXSDSchema(); otherSchema.setTargetNamespace(ePackage.getNsURI()); otherSchema.setSchemaForSchemaQNamePrefix("xsd"); Map<String, String> namespaces = otherSchema.getQNamePrefixToNamespaceMap(); namespaces.put(getUniqueNsPrefix(ePackage), otherSchema.getTargetNamespace()); namespaces.put(otherSchema.getSchemaForSchemaQNamePrefix(), XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001); ePackageToXSDSchemaMap.put(ePackage, otherSchema); // map(otherSchema, ePackage); }
protected void createOtherSchema(EPackage ePackage) { XSDSchema otherSchema = XSDFactory.eINSTANCE.createXSDSchema(); otherSchema.setTargetNamespace(ePackage.getNsURI()); otherSchema.setSchemaForSchemaQNamePrefix("xsd"); Map<String, String> namespaces = otherSchema.getQNamePrefixToNamespaceMap(); namespaces.put(getUniqueNsPrefix(ePackage), otherSchema.getTargetNamespace()); namespaces.put(otherSchema.getSchemaForSchemaQNamePrefix(), XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001); ePackageToXSDSchemaMap.put(ePackage, otherSchema); // map(otherSchema, ePackage); }
protected void createSchema() { xsdSchema = XSDFactory.eINSTANCE.createXSDSchema(); addOutput(xsdSchema); // addInput(xsdSchema); xsdSchema.setTargetNamespace(ePackage.getNsURI()); xsdSchema.setSchemaForSchemaQNamePrefix("xsd"); Map<String, String> namespaces = xsdSchema.getQNamePrefixToNamespaceMap(); namespaces.put(getUniqueNsPrefix(ePackage), xsdSchema.getTargetNamespace()); namespaces.put(xsdSchema.getSchemaForSchemaQNamePrefix(), XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001); map(xsdSchema, ePackage); }
protected void createSchema() { xsdSchema = XSDFactory.eINSTANCE.createXSDSchema(); addOutput(xsdSchema); // addInput(xsdSchema); xsdSchema.setTargetNamespace(ePackage.getNsURI()); xsdSchema.setSchemaForSchemaQNamePrefix("xsd"); Map<String, String> namespaces = xsdSchema.getQNamePrefixToNamespaceMap(); namespaces.put(getUniqueNsPrefix(ePackage), xsdSchema.getTargetNamespace()); namespaces.put(xsdSchema.getSchemaForSchemaQNamePrefix(), XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001); map(xsdSchema, ePackage); }
protected static void ensureSchemaElement(XSDSchema schema) { Document document = schema.getDocument(); Element schemaElement = document.getDocumentElement(); if (schemaElement == null) { String targetNamespace = getDefaultNamespace(schema); schema.setTargetNamespace(targetNamespace); Map qNamePrefixToNamespaceMap = schema.getQNamePrefixToNamespaceMap(); qNamePrefixToNamespaceMap.put("tns", targetNamespace); if (XSDEditorPlugin.getDefault().isQualifyXMLSchemaLanguage()) { String prefix = XSDEditorPlugin.getDefault().getXMLSchemaPrefix(); schema.setSchemaForSchemaQNamePrefix(prefix); qNamePrefixToNamespaceMap.put(prefix, XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001); } else { qNamePrefixToNamespaceMap.put(null, XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001); } schema.updateElement(); ensureXMLDirective(document); } }
protected void createEMFSchema() { emfSchema = XSDFactory.eINSTANCE.createXSDSchema(); emfSchema.setTargetNamespace(EMF_SCHEMA_URI); emfSchema.setSchemaForSchemaQNamePrefix("xsd"); Map<String, String> namespaces = emfSchema.getQNamePrefixToNamespaceMap(); namespaces.put(EMF_SCHEMA_PREFIX, emfSchema.getTargetNamespace()); namespaces.put(emfSchema.getSchemaForSchemaQNamePrefix(), XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001); XSDSimpleTypeDefinition list = XSDFactory.eINSTANCE.createXSDSimpleTypeDefinition(); list.setName(REFERENCE_TYPE_NAME); XSDSimpleTypeDefinition union = XSDFactory.eINSTANCE.createXSDSimpleTypeDefinition(); union.getMemberTypeDefinitions().add(emfSchema.getSchemaForSchema().resolveSimpleTypeDefinition("IDREF")); union.getMemberTypeDefinitions().add(emfSchema.getSchemaForSchema().resolveSimpleTypeDefinition("QName")); union.getMemberTypeDefinitions().add(emfSchema.getSchemaForSchema().resolveSimpleTypeDefinition("anyURI")); list.setItemTypeDefinition(union); list.getContents().add(union); emfSchema.getContents().add(list); }
protected void createEMFSchema() { emfSchema = XSDFactory.eINSTANCE.createXSDSchema(); emfSchema.setTargetNamespace(EMF_SCHEMA_URI); emfSchema.setSchemaForSchemaQNamePrefix("xsd"); Map<String, String> namespaces = emfSchema.getQNamePrefixToNamespaceMap(); namespaces.put(EMF_SCHEMA_PREFIX, emfSchema.getTargetNamespace()); namespaces.put(emfSchema.getSchemaForSchemaQNamePrefix(), XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001); XSDSimpleTypeDefinition list = XSDFactory.eINSTANCE.createXSDSimpleTypeDefinition(); list.setName(REFERENCE_TYPE_NAME); XSDSimpleTypeDefinition union = XSDFactory.eINSTANCE.createXSDSimpleTypeDefinition(); union.getMemberTypeDefinitions().add(emfSchema.getSchemaForSchema().resolveSimpleTypeDefinition("IDREF")); union.getMemberTypeDefinitions().add(emfSchema.getSchemaForSchema().resolveSimpleTypeDefinition("QName")); union.getMemberTypeDefinitions().add(emfSchema.getSchemaForSchema().resolveSimpleTypeDefinition("anyURI")); list.setItemTypeDefinition(union); list.getContents().add(union); emfSchema.getContents().add(list); }
schema.setTargetNamespace(gmlSchema().getTargetNamespace()); } else if (ns2featureTypeInfos.entrySet().size() == 1) { schema.setTargetNamespace(targetNamespace); schema.getQNamePrefixToNamespaceMap().put(targetPrefix, targetNamespace); schema.setTargetNamespace(ns.getURI());
schema.setTargetNamespace(targetNS);
schema.setTargetNamespace(targetNS);
xsdSchema.setTargetNamespace(tnsValue);
schema.setTargetNamespace(ns.getURI()); schema.getQNamePrefixToNamespaceMap().put(ns.getPrefix(), ns.getURI());
public Element createElement() { if (schema == null) // kb Note: This case is not supposed to happen. { // cs ... why do we do this if its not supposed to happen? // Is there a scenario where this is a usefull fallback? // Under what conditions does this code get executed (i.e. why would schema == null)? schema = XSDFactory.eINSTANCE.createXSDSchema(); schema.setSchemaForSchemaQNamePrefix("xsd"); schema.setTargetNamespace("http://tempuri.org/"); java.util.Map qNamePrefixToNamespaceMap = schema.getQNamePrefixToNamespaceMap(); qNamePrefixToNamespaceMap.put("", schema.getTargetNamespace()); qNamePrefixToNamespaceMap.put(schema.getSchemaForSchemaQNamePrefix(), org.eclipse.xsd.util.XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001); adopt(schema); schema.updateElement(true); return schema.getElement(); } else { element = schema.getElement(); if (element == null) { adopt(schema); schema.updateElement(true); element = schema.getElement(); } return element; } }
xsdSchema.setTargetNamespace(dialog.getTargetNamespace()); xsdSchema.update();
xsdSchema.setTargetNamespace(targetNamespace);
xsdSchema.setTargetNamespace(targetNamespace);
protected XSDSchema createXMISchema() xmiSchema.setTargetNamespace(XMI_URI); xmiSchema.setSchemaForSchemaQNamePrefix("xsd");
prototypeSchema./*{@link XSDSchema#setTargetNamespace */setTargetNamespace/*}*/("http://www.example.com/PrototypicalSchema"); prototypeSchema./*{@link XSDSchema#setElementFormDefault */setElementFormDefault/*}*/(XSDForm.QUALIFIED_LITERAL); prototypeSchema./*{@link XSDSchema#setAttributeFormDefault */setAttributeFormDefault/*}*/(XSDForm.QUALIFIED_LITERAL);
prototypeSchema./*{@link XSDSchema#setTargetNamespace */setTargetNamespace/*}*/("http://www.example.com/PrototypicalSchema"); prototypeSchema./*{@link XSDSchema#setElementFormDefault */setElementFormDefault/*}*/(XSDForm.QUALIFIED_LITERAL); prototypeSchema./*{@link XSDSchema#setAttributeFormDefault */setAttributeFormDefault/*}*/(XSDForm.QUALIFIED_LITERAL);