Description
The functx:is-node-in-sequence-deep-equal function returns a boolean value indicating whether or not a node has the same contents as a node in a sequence. It determines whether the nodes have the same content using the built-in fn:deep-equal function. If $node or $seq is the empty sequence, it returns false.
For a similar function based on the identity of a node rather than its contents, see functx:is-node-in-sequence.
Arguments and Return TypeName | Type | Description |
$node |
node()? |
the node to test |
$seq |
node()* |
the sequence of nodes to search |
return value |
xs:boolean |
XSLT Function DeclarationSee XQuery definition. | <xsl:function name="functx:is-node-in-sequence-deep-equal" as="xs:boolean"
xmlns:functx="http://www.functx.com">
<xsl:param name="node" as="node()?"/>
<xsl:param name="seq" as="node()*"/>
<xsl:sequence select="
some $nodeInSeq in $seq satisfies deep-equal($nodeInSeq,$node)
"/>
</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>John</fName>
<lName>Doe</lName>
</author> |
| </xsl:variable> |
XPath Example | Results |
---|
functx:is-node-in-sequence-deep-equal(
$in-xml/author[1],$in-xml/author) |
true |
functx:is-node-in-sequence-deep-equal(
$anAuthor,$in-xml/author) |
true |
functx:is-node-in-sequence-deep-equal(
$in-xml/author[1],$in-xml) |
false |
See AlsoHistory |
Recommended Reading:
|