functx:index-of-node

The position of a node in a sequence, based on node identity

Description

The functx:index-of-node function returns one or more integers representing the position of an XML node within a sequence of nodes. It is based entirely on node identity, not the value or content of the nodes.

Parameters

Description

nodes:node()

the node sequence

noteToFind:node()

the node to find in the sequence

Examples

XPath

Results

functx:index-of-node($in-xml/author,$in-xml/author[1])

1

functx:index-of-node($in-xml/author,$in-xml/author[2])

2

functx:index-of-node($in-xml/author, $in-xml/author[lName=’Doe’])

2

See Also