gml.setSchemaLocation(baseURL.toString() + "/" + gmlLocation); gml.setResolvedSchema(gmlConfiguration.getXSD().getSchema()); xsd.getContents().add(gml);
protected void addImport(String namespace, String schemaLocation) { XSDImport xsdImport = XSDFactory.eINSTANCE.createXSDImport(); xsdImport.setNamespace(namespace); xsdImport.setSchemaLocation(schemaLocation); xsdSchema.getContents().add(0, xsdImport); }
protected void addImport(String namespace, String schemaLocation) { XSDImport xsdImport = XSDFactory.eINSTANCE.createXSDImport(); xsdImport.setNamespace(namespace); xsdImport.setSchemaLocation(schemaLocation); xsdSchema.getContents().add(0, xsdImport); }
protected void importXMI() { Map<String, String> namespaces = this.xsdSchema.getQNamePrefixToNamespaceMap(); if (namespaces.put(XMI_PREFIX, XMI_URI) == null) { XSDImport xmiImport = XSDFactory.eINSTANCE.createXSDImport(); xmiImport.setNamespace(XMI_URI); xmiImport.setSchemaLocation(EcorePackage.eNS_URI.equals(xsdSchema.getTargetNamespace()) ? XMI_SCHEMA_LOCATION : "platform:/plugin/org.eclipse.emf.ecore/model/" + XMI_SCHEMA_LOCATION); this.xsdSchema.getContents().add(0, xmiImport); } } }
protected void importXMI() { Map<String, String> namespaces = this.xsdSchema.getQNamePrefixToNamespaceMap(); if (namespaces.put(XMI_PREFIX, XMI_URI) == null) { XSDImport xmiImport = XSDFactory.eINSTANCE.createXSDImport(); xmiImport.setNamespace(XMI_URI); xmiImport.setSchemaLocation(EcorePackage.eNS_URI.equals(xsdSchema.getTargetNamespace()) ? XMI_SCHEMA_LOCATION : "platform:/plugin/org.eclipse.emf.ecore/model/" + XMI_SCHEMA_LOCATION); this.xsdSchema.getContents().add(0, xmiImport); } } }
/** * Add import statement to schema. * * @param schema Output schema * @param factory XSD factory used to produce schema * @param namespace Import name space * @param schemaLocation The schema to be imported */ private void addImport( XSDSchema schema, XSDFactory factory, String namespace, String schemaLocation) { synchronized (Schemas.class) { XSDImport xsdImport = factory.createXSDImport(); xsdImport.setNamespace(namespace); xsdImport.setSchemaLocation(schemaLocation); schema.getContents().add(xsdImport); } }
someOtherImport./*{@link XSDImport#setSchemaLocation */setSchemaLocation/*}*/(someOtherSchemaURI);
someOtherImport./*{@link XSDImport#setSchemaLocation */setSchemaLocation/*}*/(someOtherSchemaURI);
protected void importGMLSchema(XSDSchema schema, XSDFactory factory, String baseUrl) { XSDImport imprt = factory.createXSDImport(); imprt.setNamespace(gmlNamespace); imprt.setSchemaLocation(ResponseUtils.buildSchemaURL(baseUrl, gmlSchemaLocation)); XSDSchema gmlSchema = gmlSchema(); imprt.setResolvedSchema(gmlSchema); schema.getContents().add(imprt); }
xsdImport.setSchemaLocation(schemaFileString); xsdImport.setResolvedSchema(externalSchema);
void buildSchemaImports( Collection<NamespaceInfo> namespaces, XSDSchema schema, XSDFactory factory) { Map<String, String> params = params( "service", "wfs", "request", "DescribeFeatureType", "version", wfs.getVersion()); // String schemaLocation = ResponseUtils.appendQueryString(ResponseUtils.appendPath( // baseURL, "wfs"), // "service=wfs&request=DescribeFeatureType&version=" + wfs.getVersion() + // "&namespace="); for (NamespaceInfo namespace : namespaces) { XSDImport imprt = factory.createXSDImport(); imprt.setNamespace(namespace.getURI()); params.put("namespace", namespace.getPrefix()); imprt.setSchemaLocation(buildURL(baseURL, "wfs", params, URLType.SERVICE)); synchronized (Schemas.class) { schema.getContents().add(imprt); } } }
imprt.setSchemaLocation(schemaLocation);
@Override protected void importGMLSchema(XSDSchema schema, XSDFactory factory, String baseUrl) { synchronized (Schemas.class) { XSDImport imprt; try { imprt = factory.createXSDImport(); imprt.setNamespace(gmlNamespace); // imprt.setNamespace( WFS.getInstance().getSchema().getTargetNamespace() ); imprt.setSchemaLocation( ResponseUtils.buildSchemaURL(baseUrl, gmlSchemaLocation)); // imprt.setResolvedSchema(WFS.getInstance().getSchema()); imprt.setResolvedSchema(GML.getInstance().getSchema()); schema.getContents().add(imprt); schema.getQNamePrefixToNamespaceMap().put("wfs", WFS.NAMESPACE); // imprt = Schemas.importSchema(schema, WFS.getInstance().getSchema()); final XSDSchemaImpl xsdSchema = (XSDSchemaImpl) WFS.getInstance().getSchema(); synchronized (xsdSchema.eAdapters()) { xsdSchema.imported(imprt); } // ((XSDSchemaImpl)schema).resolveSchema(WFS.NAMESPACE); // schema.getContents().add(imprt); } catch (IOException e) { throw new RuntimeException(e); } } }
xsdImport.setSchemaLocation(ePackage.getNsURI());
xsdImport.setSchemaLocation(ePackage.getNsURI());
XSDImport wfsImport = factory.createXSDImport(); wfsImport.setNamespace(getWfsSchema().getTargetNamespace()); wfsImport.setSchemaLocation(getWfsSchema().getSchemaLocation()); wfsImport.setResolvedSchema(getWfsSchema()); schema.getContents().add(wfsImport);