EXSLT - exsl:node-set

Implementer Page: exsl.node-set.html
Function Package: exsl.node-set.zip

Function Syntax

node-set exsl:node-set(object)

The exsl:node-set function returns a node-set from a result tree fragment (which is what you get when you use the content of xsl:variable rather than its select attribute to give a variable value). This enables you to process the XML that you create within a variable, and therefore do multi-step processing.

You can also use this function to turn a string into a text node, which is helpful if you want to pass a string to a function that only accepts a node-set.


The following XSLT processors support exsl:node-set:

The following processors support earlier versions of exsl:node-set:

There are currently no third-party implementations of exsl:node-set.



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


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


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


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

http://www.exslt.org/exsl/functions/node-set/index.html last modified 2002-11-12