home contribute faq download

FunctX XSLT Functions


Whether an XML node is in a sequence, based on node identity



The functx:is-node-in-sequence function returns a boolean value indicating whether or not a node is in the specified sequence, based on node identity. It does not identify nodes that are descendants of nodes in the sequence; see functx:is-node-among-descendants for that purpose. If $node or $seq is the empty sequence, it returns false.

Nodes are identified based on node identity, not their contents. For a similar function based on the contents of a node, see functx:is-node-in-sequence-deep-equal.

Arguments and Return Type

$node node()? the node to test
$seq node()* the sequence of nodes to search
return value xs:boolean

XSLT Function Declaration

See XQuery definition.
<xsl:function name="functx:is-node-in-sequence" as="xs:boolean"
  <xsl:param name="node" as="node()?"/>
  <xsl:param name="seq" as="node()*"/>

  <xsl:sequence select="
   some $nodeInSeq in $seq satisfies $nodeInSeq is $node



<xsl:variable name="in-xml" as="item()*">
   <price value="29.99" discount="10.00"/>
   <price value="39.99" discount="6.00"/>
   <price value="49.99" discount=""/>
<xsl:variable name="aPrice" as="item()*">
<price value="49.99" discount=""/>
XSLT ExampleResults

See Also

functx:is-node-in-sequence-deep-equalWhether an XML node is in a sequence, based on contents and attributes
functx:is-value-in-sequenceWhether an atomic value appears in a sequence


Published OnLast UpdatedContributor(s)
2006-06-272007-02-26Priscilla Walmsley, Datypic, pwalmsley@datypic.com, http://www.datypic.com
Datypic XSLT Services

Recommended Reading: