This package provides Saxon's preferred Java API for XSLT, XQuery, XPath, and XML Schema processing. The interface is designed to hide as much as possible of the detail of the implementation. However, the API architecture faithfully reflects the internal architecture of the Saxon product, unlike standard APIs such as JAXP and XQJ which in many cases force compromises in the design and performance of the application.
An application starts by loading a
Processor, which allows configuration options
to be set. As far as possible, an application should instantiate a single
The interfaces for XSLT, XQuery, and XPath processing all follow the same pattern. There is a three-stage
execution model: first a compiler is created using a factory method in the
The compiler holds compile-time options and the static context information. Then the compiler's
compile() method is called to create an executable, a representation of the compiled stylesheet,
query, or expression. This is thread-safe and immutable once created. To run the query or transformation,
first call the
load() method to create a run-time object called variously an
XPathSelector. This holds run-time context
such as parameter settings and the initial context node; the object is therefore not shareable and should
only be run in a single thread; indeed it should normally only be used once. This object also provides
methods allowing the transformation or query to be executed.
In Saxon-EE the
Processor owns a
SchemaManager that holds
the cache of schema components and can be used to load new schema components from source schema documents.
It can also be used to create a
SchemaValidator, which in turn is used to validate
Source documents can be constructed using a
DocumentBuilder, which holds all the options
and parameters to control document building.
The output of a transformation, or of any other process that generates an XML tree, can be sent to a
Destination. There are a number of implementations of this interface, including a
Serializer which translates the XML document tree into lexical XML form.
There are classes to represent the objects of the XDM data model, including
XdmAtomicValue. These can be manipulated using methods based on the Java 8 streams
processing model: for details see package
Interface Summary Interface Description ActionA completely general functional interface for functions that take no arguments, return void, and potentially throw a
ContentHandlerthat builds a Saxon tree, and allows the node at the root of the tree to be retrieved on completion.
BuildingStreamWriterA BuildingStreamWriter allows a document to be constructed by calling the methods defined in the
XMLStreamWriterinterface; after the document has been constructed, its root node may be retrieved by calling the
Destinationrepresents a place where XDM values can be sent.
ExtensionFunctionThis is an interface for simple external/extension functions. LocationSaxon interface to represent a location, typically the location of an expression within a query or stylesheet. MessageListenerA user-written implementation of the MessageListener interface may be registered with the XsltTransformer to receive notification of xsl:message output. MessageListener2 Deprecated. StaticError XmlProcessingErrorThe XmlProcessingError class contains information about an error detected during compilation or execution of a stylesheet, query, XPath expression, or schema
Class Summary Class Description AbstractDestinationAn abstract class providing reusable code for implementing the
AbstractXsltTransformerA class that exists to contain common code shared between XsltTransformer and Xslt30Transformer BuildingStreamWriterImplThis class is an implementation of
XMLStreamWriter, allowing a document to be constructed by means of a series of XMLStreamWriter method calls such as writeStartElement(), writeAttribute(), writeCharacters(), and writeEndElement().
DestinationHelperA helper class for implementing the
DocumentBuilderA document builder holds properties controlling how a Saxon document tree should be built, and provides methods to invoke the tree construction. DOMDestinationThis class represents a Destination (for example, the destination of the output of a transformation) in which the results are written to a newly constructed DOM tree in memory. ItemTypeAn item type, as defined in the XPath/XQuery specifications. ItemType.BuiltInAtomicItemTypeItemType representing a built-in atomic type ItemTypeFactoryThis class is used for creating ItemType objects. JsonBuilderA
JsonBuilderis used to parse JSON documents
Messagerepresents the output of an
NullDestinationA NullDestination is a Destination that discards all output sent to it. ProcessorThe
Processorclass serves three purposes: it allows global Saxon configuration options to be set; it acts as a factory for generating XQuery, XPath, and XSLT compilers; and it owns certain shared resources such as the Saxon NamePool and compiled schemas.
QNameThe QName class represents an instance of xs:QName, as defined in the XPath 2.0 data model. RawDestination SAXDestinationThis class represents a
Destination(for example, the destination of the output of a transformation) in which events representing the XML document are sent to a user-supplied SAX2
ContentHandler, as if the
ContentHandlerwere receiving the document directly from an XML parser.
SchemaManagerThe SchemaManager is used to load schema documents, and to set options for the way in which they are loaded. SchemaValidatorA
SchemaValidatoris an object that is used for validating instance documents against a schema.
SequenceTypeA SequenceType is the combination of an ItemType and an OccurrenceIndicator SerializerA
Serializertakes a tree representation of XML and turns it into lexical XML markup.
TeeDestinationA TeeDestination allows writing to two destinations at once. WhitespaceStrippingPolicyWhitespaceStrippingPolicy is class defining the possible policies for handling whitespace text nodes in a source document. XdmArrayAn array in the XDM data model. XdmAtomicType XdmAtomicValueThe class XdmAtomicValue represents an item in an XPath sequence that is an atomic value. XdmDestination XdmEmptySequenceThe class
XdmEmptySequencerepresents an empty sequence in the XDM Data Model.
XdmExternalObjectThe class XdmExternalObject represents an XDM item that wraps an external (Java or .NET) object. XdmFunctionItemThe class XdmFunctionItem represents a function item XdmItemThe class XdmItem represents an item in a sequence, as defined by the XDM data model. XdmMapA map in the XDM data model. XdmNodeThis class represents a node in the XDM data model. XdmSequenceIterator<T extends XdmItem>An iterator over an XPath sequence. XdmValueA value in the XDM data model. XPathCompilerAn
XPathCompilerobject allows XPath queries to be compiled.
XPathExecutableAn XPathExecutable represents the compiled form of an XPath expression. XPathSelectorAn XPathSelector represents a compiled and loaded XPath expression ready for execution. XQueryCompilerAn
XQueryCompilerobject allows XQuery 1.0 queries to be compiled.
XQueryEvaluatorrepresents a compiled and loaded query ready for execution.
XQueryExecutableAn XQueryExecutable represents the compiled form of a query. Xslt30TransformerAn
Xslt30Transformerrepresents a compiled and loaded stylesheet ready for execution.
XsltCompilerAn XsltCompiler object allows XSLT stylesheets to be compiled. XsltExecutableAn XsltExecutable represents the compiled form of a stylesheet. XsltExecutable.ParameterDetailsInner class containing information about a global parameter to a compiled stylesheet XsltPackageAn XsltPackage object represents the result of compiling an XSLT 3.0 package, as represented by an XML document containing an
XsltTransformerrepresents a compiled and loaded stylesheet ready for execution.
Enum Summary Enum Description AxisThis is an enumeration class containing constants representing the thirteen XPath axes HostLanguageIdentifies a host language in which XPath expressions appear. OccurrenceIndicatorRepresents one of the possible occurrence indicators in a SequenceType. Serializer.PropertyEnumeration class defining the permitted serialization properties UnprefixedElementMatchingPolicyAn enumeration defining possible strategies for resolving unprefixed element names appearing as name tests in the steps of a path expression or XSLT match pattern ValidationModeEnumeration class defining different schema validation (or construction) modes XdmNodeKindEnumeration class defining the seven kinds of node defined in the XDM model
Exception Summary Exception Description SaxonApiExceptionAn exception thrown by the Saxon s9api API. SaxonApiUncheckedExceptionAn unchecked exception thrown by the Saxon API.