Modules | Implementer Page: set.has-same-node.html Function Syntaxboolean set:has-same-node(node-set, node-set) Template Syntax<xsl:call-template name="set:has-same-node"> <xsl:with-param name="nodes" select="node-set" /> <xsl:with-param name="node" select="node-set" /> </xsl:call-template>
The Implementations
The following XSLT processors support
Implementations of ExamplesFunctionThe following example shows how to use the Source<doc> <city name="Paris" country="France" xmlns:x="one" /> <city name="Madrid" country="Spain" xmlns:x="one" /> <city name="Vienna" country="Austria" xmlns:x="one" /> <city name="Barcelona" country="Spain" xmlns:x="one" /> <city name="Salzburg" country="Austria" xmlns:x="one" /> <city name="Bonn" country="Germany" xmlns:x="one" /> <city name="Lyon" country="France" xmlns:x="one" /> <city name="Hannover" country="Germany" xmlns:x="one" /> <city name="Calais" country="France" xmlns:x="one" /> <city name="Berlin" country="Germany" xmlns:x="one" /> </doc> Stylesheet<!-- Test set:has-same-node --> <xsl:variable name="a1" select="//city[@name='Vienna' or @name='Salzburg']" /> <xsl:variable name="a2" select="//city[@country='Austria']" /> <xsl:template match="/"> <out> Test has-same-node() between two intersecting sets: <xsl:if test="set:has-same-node($a1,$a2)">OK</xsl:if> ; Test has-same-node() between two non-intersecting sets: <xsl:if test="not(set:has-same-node($a1,//city/@name))">OK</xsl:if> ; Test has-same-node() between two identical sets of namespace nodes: <xsl:if test="set:has-same-node((//city[1])/namespace::*,(//city[1])/namespace::*)">OK</xsl:if> ; Test has-same-node() between two disjoint sets of namespace nodes: <xsl:if test="not(set:has-same-node((//city[1])/namespace::*,(//city[2])/namespace::*))">OK</xsl:if> ; </out> </xsl:template> Result<out xmlns:set="http://exslt.org/sets"> Test has-same-node() between two intersecting sets: OK; Test has-same-node() between two non-intersecting sets: OK; Test has-same-node() between two identical sets of namespace nodes: OK; Test has-same-node() between two disjoint sets of namespace nodes: OK; </out> |
http://www.exslt.org/set/functions/has-same-node/index.html last modified 2002-11-12