Description
The functx:sequence-node-equal-any-order function returns a boolean value indicating whether the two arguments have the same nodes, in any order. They are compared based on node identity, not their contents.
Arguments and Return TypeName | Type | Description |
$seq1 |
node()* |
the first sequence of nodes |
$seq2 |
node()* |
the second sequence of nodes |
return value |
xs:boolean |
XSLT Function DeclarationSee XQuery definition. | <xsl:function name="functx:sequence-node-equal-any-order" as="xs:boolean"
xmlns:functx="http://www.functx.com">
<xsl:param name="seq1" as="node()*"/>
<xsl:param name="seq2" as="node()*"/>
<xsl:sequence select="
not( ($seq1 except $seq2, $seq2 except $seq1))
"/>
</xsl:function>
|
Examples<xsl:variable name="in-xml" as="item()*"> | | <authors>
<author>
<fName>Kate</fName>
<lName>Jones</lName>
</author>
<author>
<fName>John</fName>
<lName>Doe</lName>
</author>
</authors> |
| </xsl:variable> | <xsl:variable name="anAuthor" as="item()*"> | | <author>
<fName>Kate</fName>
<lName>Jones</lName>
</author> |
| </xsl:variable> |
XPath Example | Results |
---|
functx:sequence-node-equal-any-order(
$in-xml/author, $in-xml/*) |
true |
functx:sequence-node-equal-any-order(
$in-xml/author,
($in-xml/author[2],$in-xml/author[1])) |
true |
functx:sequence-node-equal-any-order(
$in-xml/author[1],$anAuthor) |
false |
See AlsoHistory |
Recommended Reading:
|