01: package org.geotools.ml.bindings;
02:
03: import org.eclipse.xsd.XSDSchema;
04: import org.eclipse.xsd.util.XSDSchemaLocationResolver;
05:
06: public class MLSchemaLocationResolver implements
07: XSDSchemaLocationResolver {
08:
09: public String resolveSchemaLocation(XSDSchema xsdSchema,
10: String namespaceURI, String schemaLocationURI) {
11: if (schemaLocationURI == null) {
12: return null;
13: }
14:
15: //if no namespace given, assume default for the current schema
16: if (((namespaceURI == null) || "".equals(namespaceURI))
17: && (xsdSchema != null)) {
18: namespaceURI = xsdSchema.getTargetNamespace();
19: }
20:
21: if (ML.NAMESPACE.equals(namespaceURI)) {
22: if (schemaLocationURI.endsWith("mails.xsd")) {
23: return getClass().getResource("mails.xsd").toString();
24: }
25: }
26:
27: return null;
28: }
29: }
|