S9API interface

A new class JsonBuilder has been added, analagous to the DocumentBuilder. It can be instantiated from a Processor using Processor.newJsonBuilder(), and allows JSON documents to be parsed, returning an XdmValue, typically an XdmMap or XdmArray.

The DocumentBuilder class has two new methods parse(Source, Destination) and parse(File, Destination) allowing parsed documents to be sent directly to a destination such as a Serializer without building a tree in memory.

The preferred way of capturing xsl:message output is the new method Xslt30Transformer.setMessageHandler(Consumer <Message> messageHandler) (see AbstractXsltTransformer.setMessageHandler()) which encapsulates all the information about a message in the new Message object.

The interfaces comprising the recently-introduced Push API have been reorganised, largely in the interests of making them work in C# as well as Java (C# does not allow inner interfaces within an interface). The main factory method Processor.newPush() is unchanged, but the detailed interfaces have been moved to a new package, as follows:

Old name New name
net.sf.saxon.s9api.Push net.sf.saxon.s9api.push.Push
net.sf.saxon.s9api.Push.Document net.sf.saxon.s9api.push.Document
net.sf.saxon.s9api.Push.Element net.sf.saxon.s9api.push.Element
net.sf.saxon.s9api.Push.Container net.sf.saxon.s9api.push.Container

The class StaticError has been folded into XmlProcessingError. Any remaining references to StaticError can generally be replaced with references to XmlProcessingError. The name StaticError had become misleading because its instances were in many cases dynamic errors.

New methods firstItem() and lastItem() have been added to XdmStream.