<?xml version="1.0"?>
<exslt:function xmlns:exslt="http://exslt.org/documentation" 
                version="4" module="exsl" status="revised">

<exslt:name>node-set</exslt:name>

<rdf:Description xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
                 xmlns:dc="http://purl.org/dc/elements/1.1/"
                 ID="exsl:node-set">
   <dc:subject>EXSLT</dc:subject>
   <dc:subject>common</dc:subject>
   <dc:subject>node-set</dc:subject>
   <dc:rights>public domain</dc:rights>
   <exslt:revision>
      <rdf:Description xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
                       xmlns:dc="http://purl.org/dc/elements/1.1/"
                       ID="exsl:node-set.4">
         <exslt:version>4</exslt:version>
         <dc:creator email="jeni@jenitennison.com" 
                     url="http://www.jenitennison.com">Jeni Tennison</dc:creator>
         <dc:date>2002-06-10</dc:date>
         <dc:description xmlns="http://www.w3.org/1999/xhtml">Made explicit that <code>exsl:node-set()</code> should not have any side effects.</dc:description>
      </rdf:Description>
   </exslt:revision>
   <exslt:revision>
      <rdf:Description xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
                       xmlns:dc="http://purl.org/dc/elements/1.1/"
                       ID="exsl:node-set.4.1">
         <exslt:version>4.1</exslt:version>
         <dc:creator email="craig.stewart@nottingham.ac.uk" 
                     url="">Craig Stewart</dc:creator>
         <dc:date>2002-08-20</dc:date>
         <dc:description xmlns="http://www.w3.org/1999/xhtml">Added Xalan-J implementation to the list.</dc:description>
      </rdf:Description>
   </exslt:revision>
   <exslt:revision>
      <rdf:Description xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
                       xmlns:dc="http://purl.org/dc/elements/1.1/"
                       ID="exsl:node-set.4.2">
         <exslt:version>4.2</exslt:version>
         <dc:creator email="craig.stewart@nottingham.ac.uk" 
                     url="">Craig Stewart</dc:creator>
         <dc:date>2002-11-12</dc:date>
         <dc:description xmlns="http://www.w3.org/1999/xhtml">Fixed an error in the description of the function and updated the 4XSLT version to 0.12.0a3 and that it now supports v4 of exsl:node-set.</dc:description>
      </rdf:Description>
   </exslt:revision>
</rdf:Description>

<exslt:user-doc xmlns="">
   <section>
      <para>
         The <function>exsl:node-set</function> function returns a node-set from a result tree fragment (which is what you get when you use the content of <markup>xsl:variable</markup> rather than its <markup>select</markup> 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.
      </para>
      <para>
         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.
      </para>
   </section>
</exslt:user-doc>

<exslt:doc xmlns="http://www.w3.org/1999/xhtml">
   <div>
      <p>
         The purpose of the <code>exsl:node-set</code> function is to return a node-set from a result tree fragment.  If the argument is a node-set already, it is simply returned as is.  If the argument to <code>exsl:node-set</code> is not a node-set or a result tree fragment, then it is converted to a string as by the <a href="http://www.w3.org/TR/xpath#function-string" class="offsite"><code>string()</code></a> function, and the function returns a node-set consisting of a single text node with that string value.
      </p>
      <p class="note">
        The <code>exsl:node-set</code> function does not have side-effects: the result tree fragment used as an argument is still available as a result tree fragment after it is passed as an argument to <code>exsl:node-set</code>.
      </p>
   </div>
</exslt:doc>

<exslt:definition>
   <exslt:return type="node-set" />
   <exslt:arg name="RTF" type="object" default="/.." />
</exslt:definition>

<exslt:implementations>
   <exslt:vendor-implementation
           version="4"
           vendor="4XSLT, from 4Suite."
           vendor-url="http://4Suite.org"
           vendor-version="0.12.0a3" />
   <exslt:vendor-implementation
           version="2"
           vendor="SAXON from Michael Kay"
           vendor-url="http://users.iclway.co.uk/mhkay/saxon/index.html"
           vendor-version="6.3" />
   <exslt:vendor-implementation
           version="2"
           vendor="jd.xslt from Johannes D&#246;bler"
           vendor-url="http://www.aztecrider.com/xslt/"
           vendor-version="1.0.8" />
   <exslt:vendor-implementation
           version="2"
           vendor="libxslt from Daniel Veillard; implementation by Thomas Broyer"
           vendor-url="http://xmlsoft.org/XSLT/"
           vendor-version="1.0.19" />
   <exslt:vendor-implementation
           version="4"
           vendor="Xalan-J from Apache"
           vendor-url="http://xml.apache.org/xalan-j"
           vendor-version="2.4.D1" />
</exslt:implementations>

<exslt:use-cases>
   <exslt:use-case type="example" data="exsl.node-set.data.1.xml" 
                   xslt="exsl.node-set.1.xsl" 
                   result="exsl.node-set.result.1.xml">
      <rdf:Description xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
                       xmlns:dc="http://purl.org/dc/elements/1.1/"
                       ID="exsl:node-set.use-case.1">
         <dc:subject>EXSLT</dc:subject>
         <dc:subject>common</dc:subject>
         <dc:subject>node-set</dc:subject>
         <exslt:revision>
            <rdf:Description xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
                             xmlns:dc="http://purl.org/dc/elements/1.1/"
                             ID="exsl:node-set.use-case.1.1">
               <exslt:version>1</exslt:version>
               <dc:creator email="mhkay@iclway.co.uk">Mike Kay</dc:creator>
               <dc:date>2001-04-28</dc:date>
               <dc:description>Tests node-set to node-set conversion.</dc:description>
            </rdf:Description>
         </exslt:revision>
      </rdf:Description>
      <exslt:doc>
         <para>
            This use case shows the result of using <code>exsl:node-set()</code> to convert a result tree fragment to a node-set.
         </para>
      </exslt:doc>
   </exslt:use-case>
   <exslt:use-case type="example" data="exsl.node-set.data.2.xml" 
                   xslt="exsl.node-set.2.xsl" 
                   result="exsl.node-set.result.2.xml">
      <rdf:Description xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
                       xmlns:dc="http://purl.org/dc/elements/1.1/"
                       ID="exsl:node-set.use-case.2">
         <dc:subject>EXSLT</dc:subject>
         <dc:subject>common</dc:subject>
         <dc:subject>node-set</dc:subject>
         <exslt:revision>
            <rdf:Description xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
                             xmlns:dc="http://purl.org/dc/elements/1.1/"
                             ID="exsl:node-set.use-case.2.1">
               <exslt:version>1</exslt:version>
               <dc:creator email="mhkay@iclway.co.uk">Mike Kay</dc:creator>
               <dc:date>2001-04-28</dc:date>
               <dc:description>Tests result tree fragment to node-set conversion.</dc:description>
            </rdf:Description>
         </exslt:revision>
      </rdf:Description>
      <exslt:doc>
         <para>
            This use case shows the result of using <code>exsl:node-set()</code> to convert a result tree fragment to a node-set.
         </para>
      </exslt:doc>
   </exslt:use-case>
</exslt:use-cases>

</exslt:function>
