gml.setNamespace(gmlNamespace); gml.setSchemaLocation(baseURL.toString() + "/" + gmlLocation); gml.setResolvedSchema(gmlConfiguration.getXSD().getSchema()); xsd.getContents().add(gml);
public XSDSchema imported(XSDImport xsdImport) { xsdImport.setResolvedSchema(this); getReferencingDirectives().add(xsdImport); propogateComponents(xsdImport.getSchema()); return this; }
public XSDSchema imported(XSDImport xsdImport) { xsdImport.setResolvedSchema(this); getReferencingDirectives().add(xsdImport); propogateComponents(xsdImport.getSchema()); return this; }
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.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; } }
@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); } } }
imprt.setResolvedSchema(resolved);
wfsImport.setNamespace(getWfsSchema().getTargetNamespace()); wfsImport.setSchemaLocation(getWfsSchema().getSchemaLocation()); wfsImport.setResolvedSchema(getWfsSchema()); schema.getContents().add(wfsImport); final XSDSchemaImpl wfsSchema = (XSDSchemaImpl) getWfsSchema();