EXSLT - exsl:node-set - Use Case 1

Category: example
XML Definition: exsl.node-set.xml
Function or Template: function

This use case shows the result of using exsl:node-set() to convert a result tree fragment to a node-set.

Use Case

Source (view)

<doc>
   <one />
   <two />
   <three />
   <four />
</doc>

Stylesheet (view)

<!--  Test exslt:node-set applied to a result tree fragment  -->
<xsl:variable name="tree">
   <a>
      <b>
         <c>
            <d />
         </c>
      </b>
   </a>
</xsl:variable>
<xsl:template match="/">
   <out>
      <xsl:value-of select="count(exslt:node-set(//*))" />
   </out>
</xsl:template>

Result (view)

<out xmlns:exslt="http://exslt.org/common">5</out>

Change History

Previous Version: ..NaN.html

VersionModifiedByDetails
12001-04-28Mike Kay

Tests node-set to node-set conversion.

http://www.exslt.org/exsl/functions/node-set/exsl.node-set.use-case.1.html last modified 2001-04-28