public class StandardSchemaResolver extends java.lang.Object implements SchemaURIResolver
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
SCHEMA_NATURE |
static java.lang.String |
VALIDATION_PURPOSE |
Constructor and Description |
---|
StandardSchemaResolver(EnterpriseConfiguration config)
Create a StandardSchemaResolver and set the Configuration
|
Modifier and Type | Method and Description |
---|---|
static javax.xml.transform.Source |
fetchResource(java.lang.String pathName,
Configuration config) |
Configuration |
getConfiguration()
Get the configuration used by the resolver
|
javax.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 resolver
|
void |
setResourceResolver(ResourceResolver resolver)
Set the ResourceResolver to be used.
|
public static final java.lang.String SCHEMA_NATURE
public static final java.lang.String VALIDATION_PURPOSE
public StandardSchemaResolver(EnterpriseConfiguration config)
config
- the Configuration, which must bepublic void setConfiguration(Configuration config)
setConfiguration
in interface SchemaURIResolver
config
- the Saxon Configurationpublic Configuration getConfiguration()
public void setResourceResolver(ResourceResolver resolver)
Configuration
resolver
- the ResourceResolver to be usedpublic javax.xml.transform.Source[] resolve(java.lang.String targetNamespace, java.lang.String baseURI, java.lang.String[] locations) throws XPathException
resolve
in interface SchemaURIResolver
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.XPathException
- if the module cannot be located, and if delegation to the default
module resolver is not required.public static javax.xml.transform.Source fetchResource(java.lang.String pathName, Configuration config)
Copyright (c) 2004-2022 Saxonica Limited. All rights reserved.