SAXONICA

Saxon Documentation
Full Contents
About Saxon
Changes in this Release
Conditions of Use
Using XSLT 2.0
Using XQuery
Handling Source Documents
XML Schema Processing
XPath API for Java
Saxon on .NET
Extensibility
Saxon Extensions
| Introduction
| EXSLT Extensions
| Extension attributes (XSLT only)
| Additional serialization parameters
» | Extension functions
| Extension instructions
Sample Saxon Applications
The Saxon SQL Extension
XSLT Elements
XPath 2.0 Expression Syntax
Function Library
Standards Conformance

# saxon:leading()

saxon:leading($nodes-1 as node()*, $stored-expression as jt:net.sf.saxon.functions.Evaluate-PreparedExpression) ==> node()*

This function returns a sequence containing all those nodes from nodes-1 up to and excluding the first one (in order of the input sequence) for which $stored-expression evaluates to false. A stored expression may be obtained as the result of calling the saxon:expression function.

The stored expression is evaluated for each node in $nodes-1 in turn, with that node as the context node, with the context position equal to the position of that node in $nodes-1 (taken in document order), and with the context size equal to the size of $nodes-1.

Example:

    saxon:leading(following-sibling::*, saxon:expression('self::para'))

will return the <para> elements following the current node, stopping at the first element that is not a </para>

Note: this function is quite different from the EXSLT leading() function, though both fulfil a similar purpose.

Next