Changes specific to .NET
The classes Step and Predicate are now
available on .NET. As on Java these
classes can be used to navigate XML documents from the Saxon API. The extensions
are designed to make it easier to manipulate the inputs and outputs of the XPath, XSLT,
XQuery, and XSD processors directly in the Java or .NET code. (These were introduced for
the Java s9api interface in Saxon 9.9, and more information can be found in the 9.9
change log in the "S9API interface" category.) In the .NET API, Step and
Predicate are wrapper classes for Funcs, which map an
XdmItem to an IEnumerable of XdmItem objects,
or to a boolean value respectively. The Steps
and Predicates classes provide
a library of useful predefined Step and Predicate functions.
For use with the above classes, the XdmValue class
has a number of new methods. The Select method makes use of the
Step class to apply a function to the items of the XDM value, to produce an
IEnumerable of XDM items. The Concat method provides a way
to concatenate two IEnumerable objects of XdmItems.
The methods Where, AnyMatch and AllMatch provide
a way to filter the items of the XdmValue by some predicate.
In addition, the XdmNode class now has a
Select method which applies a step navigation to the node object. The class also
has new Children methods: the first has a single Predicate
argument to filter the child nodes, while the other versions can be used to select the
child nodes with a specified name.
The XdmItem class has a new IsNode
method to provide an simple way to determine if the item is a node or some other type.
The Processor class now has the
BindExtensions method which provides a simple way to load reflexive
extension functions written in C# or VB.NET, as an alternative dynamic loading. The
method passes Saxon a reference to the containing type.
The enum type HostLanguage is added which provides a better way to identify the origins of an error.
For the XPath, XQuery, and XSLT compilers it is now possible to set the error list as an
IList of XmlProcessingError objects. This new
error class provides more informative details about the error detected.
The XsltCompiler class now has a
ClearParameter method to clear the values of all stylesheet parameters
previously set.