S9API interface
The Processor class now has a zero-argument
constructor (new Processor()) which delivers the most capable processor available,
based on the software and license key found on the classpath. For example if Saxon-EE is on the
classpath and a license key with schema validation capability is located, then a Saxon-EE
configuration is created; while if Saxon-PE is on the classpath, but no license key is found,
it will deliver a Saxon-HE configuration. It is possible to interrogate the returned
Processor to determine its capabilities.
A number of changes have been made to simplify the use of item types and sequence types (particularly useful when defining extension functions):
-
Added the method ItemTypeFactory.parseItemType(String) as a convenient way of constructing an item type such as
map(xs:string, node()*)from its XPath textual representation. -
Added methods to ItemType to construct a
SequenceTypeby adding an occurrence indicator: one(), zeroOrOne(), zeroOrMore(), oneOrMore(). For exampleItemType.STRING.zeroOrMore()represents the typexs:string*. -
Added the method SequenceType.matches(XdmValue) to test whether a value matches a sequence type.
-
The method ItemTypeFactory.getItemType(item), when applied to a function item, now returns an item type that retains the full function signature, rather than simply returning
function(*). This provides a convenient way to create a function item type by copying the signature of an existing function item. -
The results of ItemType.toString() have been tidied up and are better documented.
-
The class
ItemTypenow implementsPredicate<XdmItem>, so an item type can be used wherever a predicate is expected (such as in a call toStep.where()). -
A new method XdmValue.where() is provided to filter an
XdmValueon any predicate — including anItemType. For example,value.where(ItemType.INTEGER)selects those items that are instances ofxs:integer. -
XdmNodehas a new method getTypeAnnotationName() which returns the name of the type annotation of the node (defaulting toxs:untypedandxs:untypedAtomicfor elements and attributes that have not been schema-validated).
The XsltCompiler has two new convenience methods: the compile() and compilePackage() methods now have overloads that take a
java.io.File as their argument.
The SchemaManager has a new convenience method: the load() method now has an overload that takes a java.io.File as its
argument.
The output of the XdmNode method toString() has changed so it is now consistent with the
output of XdmValue.toString() in the case where the XdmValue
comprises a single node. That is, it is now output using the adaptive serialization method.
The class XdmNode has a new convenience method getOutermostElement()
to find the outermost element (also known as the document element) of a tree.