<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet type="text/xsl" href="../../../style/function.xsl" ?><exslt:function xmlns:exslt="http://exslt.org/documentation" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:vcf="http://www.ietf.org/internet-drafts/draft-dawson-vcard-xml-dtd-03.txt" version="1" module="str" status="new">
   <exslt:name>tokenize</exslt:name>
   <rdf:Description ID="str:tokenize">
      <dc:subject>EXSLT</dc:subject>
      <dc:subject>str</dc:subject>
      <dc:subject>tokenize</dc:subject>
      <exslt:revision>
         <rdf:Description ID="str:tokenize.1">
            <exslt:version>1</exslt:version>
            <dc:creator rdf:parseType="Resource">
               <vcf:fn>
         Jeni Tennison
      </vcf:fn>
               <vcf:email>mail@jenitennison.com</vcf:email>
               <vcf:url>http://www.jenitennison.com/</vcf:url>
            </dc:creator>
            <dc:date>2001-06-03</dc:date>
            <dc:description>
               <html:div>
         The <html:code>str:tokenize</html:code> function splits a string at the occurrences of given characters.
      </html:div>
            </dc:description>
         </rdf:Description>
      </exslt:revision>
      <exslt:revision>
         <rdf:Description ID="str:tokenize.1.1">
            <exslt:version>1.1</exslt:version>
            <dc:creator rdf:parseType="Resource">
               <vcf:fn>Jeni Tennison</vcf:fn>
               <vcf:email>mail@jenitennison.com</vcf:email>
               <vcf:url>http://www.jenitennison.com/</vcf:url>
            </dc:creator>
            <dc:date>2001-06-21</dc:date>
            <dc:description>
               <html:div>
                  Added Javascript and MSXML implementations.
               </html:div>
            </dc:description>
         </rdf:Description>
      </exslt:revision>
      <exslt:revision>
         <rdf:Description ID="str:tokenize.1.2">
            <exslt:version>1.2</exslt:version>
            <dc:creator rdf:parseType="Resource">
               <vcf:fn>Jeni Tennison</vcf:fn>
               <vcf:email>mail@jenitennison.com</vcf:email>
               <vcf:url>http://www.jenitennison.com/</vcf:url>
            </dc:creator>
            <dc:date>2001-11-18</dc:date>
            <dc:description>
               <html:div>
                  Indicated behaviour when second argument is an empty string; str:tokenize() should return a list of tokens, each containing a single character.
               </html:div>
            </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="str:tokenize.1.3">
            <exslt:version>1.3</exslt:version>
            <dc:creator email="craig.stewart@nottingham.ac.uk" 
                        url="">Craig Stewart</dc:creator>
            <dc:date>2002-08-21</dc:date>
            <dc:description xmlns="http://www.w3.org/1999/xhtml">Added 4XSLT and libxslt 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="str:tokenize.1.4">
            <exslt:version>1.4</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">Updated 4XSLT version to 0.12.0a3.</dc:description>
         </rdf:Description>
      </exslt:revision>
   </rdf:Description>
   <exslt:doc>
      <html:div>
         <html:p>
         The <html:code>str:tokenize</html:code> function splits up a string and returns a node set of <html:code>token</html:code> elements, each containing one token from the string.
      </html:p>
         <html:p>
         The first argument is the string to be tokenized.  The second argument is a string consisting of a number of characters.  Each character in this string is taken as a delimiting character.  The string given by the first argument is split at any occurrence of any of these characters.  For example:
      </html:p>
         <html:pre>
str:tokenize('2001-06-03T11:40:23', '-T:')      
      </html:pre>
         <html:p>
         Gives the node set consisting of:
      </html:p>
         <html:pre>
&lt;token&gt;2001&lt;/token&gt;
&lt;token&gt;06&lt;/token&gt;
&lt;token&gt;03&lt;/token&gt;
&lt;token&gt;11&lt;/token&gt;
&lt;token&gt;40&lt;/token&gt;
&lt;token&gt;23&lt;/token&gt;
</html:pre>
         <html:p>
         If the second argument is omitted, the default is the string <html:code>'&amp;#x9;&amp;#xA;&amp;#xD;&amp;#x20;'</html:code> (i.e. whitespace characters).  Thus:
      </html:p>
         <html:pre>
str:tokenize('date math str')      
      </html:pre>
         <html:p>
         Gives the node set consisting of:
      </html:p>
         <html:pre>
&lt;token&gt;date&lt;/token&gt;
&lt;token&gt;math&lt;/token&gt;
&lt;token&gt;str&lt;/token&gt;
</html:pre>
        <html:p>
          If the second argument is an empty string, the function returns a set of <html:code>token</html:code> elements, each of which holds a single character. Thus:
        </html:p>
        <html:pre>
str:tokenize('foo', '')          
        </html:pre>
        <html:p>
          Gives the node set consisting of:
        </html:p>
        <html:pre>
&lt;token&gt;f&lt;/token&gt;
&lt;token&gt;o&lt;/token&gt;
&lt;token&gt;o&lt;/token&gt;
</html:pre>       
         <html:p>
            The template version of this function returns a result tree fragment consisting of a number of <html:code>token</html:code> elements.
         </html:p>
      </html:div>
   </exslt:doc>
   <exslt:definition>
      <exslt:return type="node-set">
         <html:div/>
      </exslt:return>
      <exslt:arg name="string" type="string" default="''" optional="no">
         <html:div/>
      </exslt:arg>
      <exslt:arg name="delimiters" type="string" default="'&amp;#x9;&amp;#xA;&amp;#xD;&amp;#x20;'" optional="yes">
         <html:div/>
      </exslt:arg>
   </exslt:definition>
   <exslt:implementations>
      <exslt:vendor-implementation
              version="1"
              vendor="4XSLT, from 4Suite."
              vendor-url="http://4Suite.org"
              vendor-version="0.12.0a3" />
      <exslt:vendor-implementation
              version="1"
              vendor="libxslt from Daniel Veillard et al."
              vendor-url="http://xmlsoft.org/XSLT/"
              vendor-version="1.0.19" />
      <exslt:implementation src="str.tokenize.function.xsl" language="exslt:exslt" version="1">
         <exslt:doc>
            <html:div xmlns="http://www.w3.org/1999/xhtml">
               This implementation relies on the <a href="http://www.exslt.org/exsl/functions/node-set">
                  <code>exsl:node-set()</code>
               </a> function.
            </html:div>
         </exslt:doc>
      </exslt:implementation>
      <exslt:implementation src="str.tokenize.template.xsl" language="exslt:xslt" version="1"/>
      <exslt:implementation src="str.tokenize.js" language="exslt:javascript" version="1">
         <rdf:Description ID="str:tokenize.msxsl">
            <dc:subject>EXSLT</dc:subject>
            <dc:subject>str</dc:subject>
            <dc:subject>tokenize</dc:subject>
            <dc:subject>Javascript</dc:subject>
            <exslt:revision>
               <rdf:Description ID="str:tokenize.js.1">
                  <exslt:version>1</exslt:version>
                  <dc:creator rdf:parseType="Resource">
                     <vcf:fn>Chris Bayes</vcf:fn>
                     <vcf:email>chris@bayes.co.uk</vcf:email>
                     <vcf:url>http://www.bayes.co.uk</vcf:url>
                  </dc:creator>
                  <dc:date>2001-06-21</dc:date>
               </rdf:Description>
            </exslt:revision>
            <exslt:revision>
               <rdf:Description ID="str:tokenize.js.2">
                  <exslt:version>2</exslt:version>
                  <dc:creator rdf:parseType="Resource">
                     <vcf:fn>Chris Bayes</vcf:fn>
                     <vcf:email>chris@bayes.co.uk</vcf:email>
                     <vcf:url>http://www.bayes.co.uk</vcf:url>
                  </dc:creator>
                  <dc:date>2001-06-26</dc:date>
                  <dc:description>
                     Now creates <html:code>token</html:code> elements rather than text nodes.
                  </dc:description>
               </rdf:Description>
            </exslt:revision>
         </rdf:Description>
      </exslt:implementation>
      <exslt:implementation src="str.tokenize.msxsl.xsl" language="exslt:msxsl" version="1">
         <rdf:Description ID="str:tokenize.msxsl">
            <dc:subject>EXSLT</dc:subject>
            <dc:subject>str</dc:subject>
            <dc:subject>tokenize</dc:subject>
            <dc:subject>MSXML</dc:subject>
            <exslt:revision>
               <rdf:Description ID="str:tokenize.msxsl.1">
                  <exslt:version>1</exslt:version>
                  <dc:creator rdf:parseType="Resource">
                     <vcf:fn>Chris Bayes</vcf:fn>
                     <vcf:email>chris@bayes.co.uk</vcf:email>
                     <vcf:url>http://www.bayes.co.uk</vcf:url>
                  </dc:creator>
                  <dc:date>2001-06-21</dc:date>
               </rdf:Description>
            </exslt:revision>
            <exslt:revision>
               <rdf:Description ID="str:tokenize.msxsl.2">
                  <exslt:version>2</exslt:version>
                  <dc:creator rdf:parseType="Resource">
                     <vcf:fn>Chris Bayes</vcf:fn>
                     <vcf:email>chris@bayes.co.uk</vcf:email>
                     <vcf:url>http://www.bayes.co.uk</vcf:url>
                  </dc:creator>
                  <dc:date>2001-06-26</dc:date>
                  <dc:description>
                     Now creates <html:code>token</html:code> elements rather than text nodes.
                  </dc:description>
               </rdf:Description>
            </exslt:revision>
         </rdf:Description>
      </exslt:implementation>
   </exslt:implementations>
   <exslt:use-cases>
      <exslt:use-case type="example" xslt="str.tokenize.1.xsl" data="str.tokenize.data.1.xml">
         <rdf:Description ID="str:tokenize.use-case">
            <dc:subject>EXSLT</dc:subject>
            <dc:subject>str</dc:subject>
            <dc:subject>tokenize</dc:subject>
            <dc:subject>example</dc:subject>
            <exslt:revision>
               <rdf:Description ID="str:tokenize.use-case.1">
                  <exslt:version/>
                  <dc:creator rdf:parseType="Resource">
                     <vcf:fn>Chris Bayes</vcf:fn>
                     <vcf:email>chris@bayes.co.uk</vcf:email>
                     <vcf:url>http://www.bayes.co.uk</vcf:url>
                  </dc:creator>
                  <dc:date>2001-06-26</dc:date>
                  <dc:description/>
               </rdf:Description>
            </exslt:revision>
         </rdf:Description>
      </exslt:use-case>
   </exslt:use-cases>
</exslt:function>
