JAXP interface (transformation, XPath, schema processing)
It is now possible to set the
Configuration used by a
DocumentBuilderFactory using the
setAttribute() method with the attribute
FeatureKeys.CONFIGURATION. By reading this attribute on a
and setting it on a
DocumentBuilderFactory, it is possible to ensure that all documents
use the same Configuration without introducing any compile-time dependencies on Saxon.
A wider range of JAXP-defined options is now supported on the
For example, a request to perform XInclude processing is now accepted (though it will only work if the underlying
XML parser is Xerces).
It is now possible to provide a user-written URI resolver for use by the XSLT unparsed-text() function. This
must be an instance of
net.sf.saxon.trans.UnparsedTextURIResolver, and it is set as a property of
Controller object (Saxon's implementation of the JAXP
Transformer). One use case for
this feature is to allow access to unparsed text files to be disabled when an untrusted stylesheet is run.
There have been some changes to the handling of
xsl:message output in XSLT:
- The class nominated to
xsl:messageoutput is no longer required to be an instance of
Emitter, it can now be any instance of
Emitteris a subclass, so existing code should still work). The sequence of calls to this Receiver has been clarified: there is a single
open()call at the start of the transformation, and a single
close()call at the end; and each evaluation of an
xsl:messageinstruction starts with a
startDocument()call and ends with
startDocument()event has a
propertiesargument indicating whether
terminate="yes"was specified, and the
locationIdon calls such as
characters()can be used to identify the location in the stylesheet where the message data originated (this is achieved by passing the supplied
locationIdin a call to
getPipelineConfiguration().getLocator().getSystemId(locationId), or to
getLineNumber()on the same object).
- A new class
net.sf.saxon.event.MessageWarnercan be selected for receiving message output; this class follows the JAXP specification by passing the message output to the
warning()method of the current
ErrorListener, or to the
terminate="yes"is specified. For backwards compatibility reasons this has not been made the default behavior.