Re: Splitting a stirng

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 UTC