Package com.saxonica.ee.config
Class StandardSchemaResolver
- java.lang.Object
-
- com.saxonica.ee.config.StandardSchemaResolver
-
- All Implemented Interfaces:
SchemaURIResolver
public class StandardSchemaResolver extends java.lang.Object implements SchemaURIResolver
The default schema resolver used when no other is requested
-
-
Constructor Summary
Constructors Constructor Description StandardSchemaResolver()
Default constructor.StandardSchemaResolver(EnterpriseConfiguration config)
Create a StandardSchemaResolver and set the Configuration
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Configuration
getConfiguration()
Get the configuration used by the resolverjavax.xml.transform.Source[]
resolve(java.lang.String targetNamespace, java.lang.String baseURI, java.lang.String[] locations)
Resolve a URI identifying a schema document, given the target namespace URI and a set of associated location hints.void
setConfiguration(Configuration config)
Set the configuration information for use by the resolvervoid
setURIResolver(javax.xml.transform.URIResolver resolver)
Set the URIResolver to be used.
-
-
-
Constructor Detail
-
StandardSchemaResolver
public StandardSchemaResolver()
Default constructor. Must be followed by a call of setConfiguration()
-
StandardSchemaResolver
public StandardSchemaResolver(EnterpriseConfiguration config)
Create a StandardSchemaResolver and set the Configuration- Parameters:
config
- the Configuration, which must be
-
-
Method Detail
-
setConfiguration
public void setConfiguration(Configuration config)
Set the configuration information for use by the resolver- Specified by:
setConfiguration
in interfaceSchemaURIResolver
- Parameters:
config
- the Saxon Configuration
-
getConfiguration
public Configuration getConfiguration()
Get the configuration used by the resolver- Returns:
- the configuration
-
setURIResolver
public void setURIResolver(javax.xml.transform.URIResolver resolver)
Set the URIResolver to be used. Defaults to the URIResolver associated with theConfiguration
- Parameters:
resolver
- the URIResolver to be used
-
resolve
public javax.xml.transform.Source[] resolve(java.lang.String targetNamespace, java.lang.String baseURI, java.lang.String[] locations) throws XPathException
Resolve a URI identifying a schema document, given the target namespace URI and a set of associated location hints.- Specified by:
resolve
in interfaceSchemaURIResolver
- Parameters:
targetNamespace
- the target namespaces of the module to be imported. The "null namespace" is identified by a zero-length string. In the case of an xsd:include directive, where no target namespace is specified, the parameter is null. For the standard schema resolver, if the target namespace is already present in the schema cache, an empty array is returned (so the existing schema is used unchanged); otherwise, the URIs listed in the location hint(s) are dereferenced and returned in the form of StreamSource objects.baseURI
- The base URI of the module containing the "import schema" declaration; null if no base URI is knownlocations
- The set of URIs identified as schema location hints. In most cases (xsd:include, xsd:import, xsi:schemaLocation, xsl:import-schema) there is only one URI in this list. With an XQuery "import module" declaration, however, a list of URIs may be specified. The StandardSchemaResolver returns one Source object for each location, using the URIResolver registered with the configuration to interpret the location hint.- Returns:
- an array of Source objects each identifying a schema document to be loaded. These need not necessarily correspond one-to-one with the location hints provided. Any element of the returned array that is null is ignored.
- Throws:
XPathException
- if the module cannot be located, and if delegation to the default module resolver is not required.
-
-