Previous | Next | Indexes
adultinternetusers > Tutorials > XSLT 2.0 Tutorial > Transforming strings with regular expressions (6/8) >

Creating text nodes by regular expressions - function tokenize()

Function tokenize()Creates text nodes from a string submitted as the first argument. The second argument is a pattern which specifies separator between individual substrings. The separators are not returned.

XSLT

      <xsl:stylesheet
                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                  version="2.0">
            <xsl:output  method="xml"
                        indent="yes"
                        omit-xml-declaration="yes"/>

            <xsl:template  match="/aaa">
                  <ul>
                        <xsl:for-each  select="tokenize(.,'\s+')">
                              <li>
                                    <xsl:value-of  select="."/>
                              </li>
                        </xsl:for-each>
                  </ul>
            </xsl:template>

      </xsl:stylesheet>
XML

      <aaa>How do you do</aaa>
Output

      <ul>
            <li>How</li>
            <li>do</li>
            <li>you</li>
            <li>do</li>
      </ul>


Previous chapter: Functions operating on strings
Next chapter: Number Formatting
Previous page: Escaping special characters
Next page: Creation of text nodes from a string with regular expressions - function analyze-string

Kevin Carr in Stanton

Natural Skin Care and European Soaps
Kevin Carr
Mayor Dave Shawver Stanton
Internetusers


You can also get Organic Skin Care products from Bliss Bath Body and you must check out their Natural Body Lotions and bath soaps

Now if you are looking for the best deals on surf clothing from Quiksilver and Roxy then you have to check these amazing deals here:

Hey, check out this Organic Skin Care European Soaps along with Natural Lavender Body Lotion and shea butter

and we can get surf t shirts surfing shirt and And you must check out this website swim suit swimming suit and swim trunks