imprt.setNamespace(importee.getTargetNamespace()); schema.getContents().add(imprt);
gml.setNamespace(gmlNamespace); gml.setSchemaLocation(baseURL.toString() + "/" + gmlLocation); gml.setResolvedSchema(gmlConfiguration.getXSD().getSchema());
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#setNamespace */setNamespace/*}*/(/*{@link #*/someOtherSchemaURI/*}*/); someOtherImport./*{@link XSDImport#setSchemaLocation */setSchemaLocation/*}*/(someOtherSchemaURI);
someOtherImport./*{@link XSDImport#setNamespace */setNamespace/*}*/(/*{@link #*/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.setNamespace(namespace); xsdImport.setSchemaLocation(schemaFileString); xsdImport.setResolvedSchema(externalSchema);
/** Imports the WFS 1.0.0 schema as a dependency. */ private static XSDSchema importWfsSchema(XSDSchema schema) throws IOException { XSDSchema wfsSchema = org.geotools.wfs.v1_1.WFS.getInstance().getSchema(); if (wfsSchema == null || !(wfsSchema instanceof XSDSchemaImpl)) { return schema; } XSDImport wfsImport = XSDFactory.eINSTANCE.createXSDImport(); wfsImport.setNamespace(org.geotools.wfs.v1_1.WFS.NAMESPACE); wfsImport.setResolvedSchema(wfsSchema); schema.getContents().add(wfsImport); schema.getQNamePrefixToNamespaceMap().put("wfs", org.geotools.wfs.v1_1.WFS.NAMESPACE); synchronized (wfsSchema.eAdapters()) { ((XSDSchemaImpl) wfsSchema).imported(wfsImport); } // make sure that GML 3.1 namespace is used schema.getQNamePrefixToNamespaceMap().put("gml", GML.NAMESPACE); return schema; } }
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.setNamespace(namespace); 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.setNamespace(namespace);
xsdImport.setNamespace(namespace);
.put("wfs", getWfsSchema().getTargetNamespace()); XSDImport wfsImport = factory.createXSDImport(); wfsImport.setNamespace(getWfsSchema().getTargetNamespace()); wfsImport.setSchemaLocation(getWfsSchema().getSchemaLocation()); wfsImport.setResolvedSchema(getWfsSchema());
xsdImport.setNamespace(componentNamespace); directive = xsdImport;