functx:index-of-deep-equal-node

The position of a node in a sequence, based on contents and attributes

Description

The functx:index-of-deep-equal-node function returns one or more integers representing the position of an XML node within a sequence of nodes. Rather than being based on node identity, it is based on the equality of the name and content of the nodes, as defined by the built-in fn:deep-equal function. If $nodes does not contain a match, the function returns the empty sequence.

Parameters

Description

nodes:node()

the node sequence

nodeToFind:node()

the node to find in the sequence

Examples

XPath

Results

functx:index-of-deep-equal-node($in-xml/author,$anAuthor)

2

functx:index-of-deep-equal-node($in-xml/author,$anotherAuthor)

()

functx:index-of-deep-equal-node($in-xml/author/lName,$anAuthor/lName)

2

See Also