SAXONICA

Saxon Documentation
Full Contents
About Saxon
Changes in this Release
Notices
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:item-at()

saxon:item-at($seq as item()*, $index as numeric?) ==> item()?

This function returns the item at a given position in a sequence. The index counts from one. If the index is an empty sequence, or less than one, or not a whole number, or greater than the length of the sequence, the result is an empty sequence.

This function is provided largely because it is used internally by the Saxon optimizer. For user applications, it is better to use `$seq[$index]` which will return the same result provided there are no context-dependencies in `$index`, or `subsequence($seq, $index, 1)` which will return the same result in all cases where `$index` evaluates to an integer.

Example:

    saxon:item-at(10 to 20, 8)

will return 17.

Next