W3C home > Mailing lists > Public > www-xsl-fo@w3.org > March 2002

Re: Splitting a stirng

From: Dave Pawson <DaveP@dpawson.freeserve.co.uk>
Date: Wed, 20 Mar 2002 18:29:50 -0800
Message-Id: <5.1.0.14.2.20020320182844.01d6bad0@pop.freeserve.net>
To: Brenda Bell <bbell@juicesoftware.com>, "'www-xsl-fo@w3.org'" <www-xsl-fo@w3.org>
At 11:02 20/03/2002 -0500, Brenda Bell wrote:

>I have an XML document with an element whose content is a string 
>containing "fields" delimited by semi-colons.  Example:
>
>         <PACKEDINFO>123;ABC;0;X</PACKEDINFO>
>
>I want to transform this element into something that looks like this:
>
>         <UNPACKEDINFO>
>                 <INFO1>123</INFO1>
>                 <INFO2>ABC</INFO2>
>                 <INFO3>0</INFO3>
>                 <INFO4>X</INFO4>
>         </UNPACKEDINFO>
>
>Can I do this with XSL?  I'm familiar with the substring functions and 
>while I've never used them, I've read the documentation on the param and 
>variable elements.


I'm lazy, I trust Saxon which clearly states my bias.

Try saxon:tokenise()

That will do what is needed here.

I just hope it gets into xslt 2.0.

HTH DaveP
Received on Wednesday, 20 March 2002 13:30:07 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 3 October 2007 16:06:09 GMT