Re: [xsl] Create word elements from a string

Subject: Re: [xsl] Create word elements from a string
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Wed, 28 Oct 2009 16:49:28 -0400
At 2009-10-28 13:44 -0700, Larry Hayashi wrote:
Is there a function in XSLT 1.1

XSLT 1.1 was formally abandoned in August 2001 and should not be used ... read the notice in the status section of this document:

that will extract words from a string?
I'd like to be able to take <text>Jill ran up the hill.</text> and get
the following:


In XSLT 2.0 you can use tokenize().

I hope this helps.

. . . . . . . . . . . Ken

T:\ftemp>type larry.xsl
<?xml version="1.0" encoding="US-ASCII"?>
<xsl:stylesheet xmlns:xsl="";

<xsl:output indent="yes"/>

<xsl:template match="/">
    <xsl:for-each select="tokenize('Jill ran up the hill.','\s+')">
        <xsl:value-of select="."/>


T:\ftemp>xslt2 larry.xsl larry.xsl con
<?xml version="1.0" encoding="UTF-8"?>

Upcoming:  hands-on XSLT, XQuery and XSL-FO Washington DC Nov 2009
Interested in other classes?
Crane Softwrights Ltd.
Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
Video lesson:
Video overview:
G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Male Cancer Awareness Nov'07
Legal business disclaimers:

Current Thread