The Processor class now has a zero-argument
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 example
ItemType.STRING.zeroOrMore()represents the type
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.
Predicate<XdmItem>, so an item type can be used wherever a predicate is expected (such as in a call to
A new method XdmValue.where() is provided to filter an
XdmValueon any predicate — including an
ItemType. For example,
value.where(ItemType.INTEGER)selects those items that are instances of
XdmNodehas a new method getTypeAnnotationName() which returns the name of the type annotation of the node (defaulting to
xs:untypedAtomicfor elements and attributes that have not been schema-validated).
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
comprises a single node. That is, it is now output using the adaptive serialization method.
The class XdmNode has a new convenience method
to find the outermost element (also known as the document element) of a tree.