[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: tokenize and split

Subject: Re: tokenize and split
From: Andy Chambers <achambers.home@xxxxxxxxxxxxxx>
Date: Fri, 6 Feb 2009 14:09:40 +0000
Re:  tokenize and split
On Fri, Feb 6, 2009 at 12:06 PM, Martin Honnen <Martin.Honnen@xxxxxx> wrote:
> Andy Chambers wrote:
>>
>
> Try whether
>  <xsl:stylesheet
>    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>    xmlns:fn="http://www.w3.org/2005/xpath-functions"
>    version="1.0">
>
>  ...
>
>
>          <xsl:choose>
>                <xsl:when test="function-available('str:split')">
>                  <xsl:copy-of select="str:split('a b c', ' ')[1]"/>
>                </xsl:when>
>                <xsl:when test="function-available('fn:tokenize')">
>                  <xsl:copy-of select="fn:tokenize('a b c', ' ')[1]"/>
>                </xsl:when>
>
> works with Xalan.

Thanks Martin,

That works great.  Just in case this comes up in a future search, I did
have to add the "str" namespace too.

<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:str="http://exslt.org/strings"
		xmlns:fn="http://www.w3.org/2005/xpath-functions"
		extension-element-prefixes="fn str">

--
Andy

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.