S9API interface
Extensive changes have been made to integrate catalog-based URI resolution using the open-source
XmlResolver
developed by Norm Tovey-Walsh.
-
When resolving URIs referring to XML documents, the preferred approach now is to implement the new class
ResourceResolver
. The existing JAXP classURIResolver
is still accepted in public-facing APIs for backwards compatibility, but is no longer used internally. The newResourceResolver
is provided with more information about the nature of the request, which may be useful for some applications. -
Specifically, classes such as
XPathContext
,Controller
, andConfiguration
no longer havegetURIResolver()
andsetURIResolver()
methods. -
On s9api classes such as
XsltCompiler
andXQueryEvaluator
, thegetURIResolver()
andsetURIResolver()
are retained but deprecated; they map internally to calls ongetResourceResolver()
andsetResourceResolver()
-
There is now a consistent strategy for fallback from one resolver to another. If the resolver on a local class such as
XsltCompiler
returns null, then the centralConfiguration
level resolver is called; if this returns null, then a system default resolver is called. The default resolver on local classes returns null. The default resolver atConfiguration
level invokes the externalXmlResolver
(though by default, there is no catalog, so this returns null). The system default resolver uses standard JDK methods for resolvinghttp
,https
, andfile
URIs, and also includes code for handlingdata
andclasspath
URIs -
The configuration property
RECOGNIZE_URI_QUERY_PARAMETERS
now applies to all calls on the doc() and document() functions, even if a user-defined URI resolver is in use. -
If the Saxon serialization extension property
next-in-chain
is used, the relevant URI is now resolved using the Configuration-level common resource resolver, not the Transformer-level resolver. -
In previous releases, well-known W3C resources such as the DTD for XHTML were resolved to local copies held within Saxon. These copies are now held in the
XmlResolver
. They will therefore not be used if the Configuration-levelResourceResolver
is replaced with a user-written resolver, unless it delegates to the catalog-basedXmlResolver
.
The xsl:source-document
instruction now allows the document URI to contain a fragment identifier.