functx:sequence-node-equal

Whether two sequences contain the same XML nodes, in the same order

Description

The functx:sequence-node-equal function returns a boolean value indicating whether the two arguments have the same nodes, in the same order. They are compared based on node identity, not their contents.

Parameters

Description

seq1:node()

the first sequence of nodes

seq2:node()

the second sequence of nodes

Examples

XPath

Results

Explanation

functx:sequence-node-equal($in-xml/author/, $in-xml//*)

true

functx:sequence-node-equal($in-xml/author, ($in-xml/author[2],$in-xml/author[1]))

false

The order of the nodes is different.

functx:sequence-node-equal($in-xml/author[1], $anAuthor)

false

Although the nodes have the same content, they are not the same node.

XPath

Results

functx:sequence-node-equal($in-xml/author/, $in-xml//*)

true

functx:sequence-node-equal($in-xml/author, ($in-xml/author[2],$in-xml/author[1]))

false

functx:sequence-node-equal($in-xml/author[1], $anAuthor)

false

See Also