JAXP interface (transformation, XPath, schema processing)
It is now possible to set the Configuration
used by a TransformerFactory
or DocumentBuilderFactory
using the setAttribute()
method with the attribute
name CONFIGURATION. By reading this attribute on a TransformerFactory
,
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 DocumentBuilderFactory
interface.
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
the 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.
xsl:message
There have been some changes to the handling of xsl:message
output in XSLT:
- The class nominated to
receive
xsl:message
output is no longer required to be an instance ofEmitter
, it can now be any instance ofnet.sf.saxon.event.Receiver
(of whichEmitter
is a subclass, so existing code should still work). The sequence of calls to this Receiver has been clarified: there is a singleopen()
call at the start of the transformation, and a singleclose()
call at the end; and each evaluation of anxsl:message
instruction starts with astartDocument()
call and ends withendDocument()
. ThestartDocument()
event has aproperties
argument indicating whetherterminate="yes"
was specified, and thelocationId
on calls such asstartElement()
andcharacters()
can be used to identify the location in the stylesheet where the message data originated (this is achieved by passing the suppliedlocationId
in a call togetPipelineConfiguration().getLocator().getSystemId(locationId)
, or togetLineNumber()
on the same object). - A new class
net.sf.saxon.event.MessageWarner
can be selected for receiving message output; this class follows the JAXP specification by passing the message output to thewarning()
method of the currentErrorListener
, or to theerror()
method ifterminate="yes"
is specified. For backwards compatibility reasons this has not been made the default behavior.