System Programming Interfaces

The XPath API has been extended with a method that allows the sort order for the results of an expression to be specified. Previously, there was no way of sorting sequences except in an XSLT context, or by use of rather complex internal Saxon classes. Expressions generated using the XPath API can also now be used directly in conjunction with the applyTemplates mechanism in the Controller, for use by applications doing rule-based processing from Java. The getExpression method of XPathExpression, which provided an escape from the packaged XPath API into the internal Saxon interfaces, has been replaced by rawIterator(), which fulfils the same purpose.

The interface that handles the setting of variables accessed by the XPath engine from its environment has been generalized to remove the assumption that the variables are defined in XSLT. This means that variables can now be used in the freestanding XPath API, as well as in saxon:expression and saxon:evaluate.