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

Re: Splitting a stirng

From: Stephen Clarke <any@longusername.worldonline.co.uk>
Date: Wed, 20 Mar 2002 18:17:50 -0000
Message-ID: <021001c1d03b$9085cbe0$42e7403e@steve>
To: "Brenda Bell" <bbell@juicesoftware.com>, <www-xsl-fo@w3.org>
Hi Brenda,

----- Original Message -----
From: "Brenda Bell" <bbell@juicesoftware.com>
To: <www-xsl-fo@w3.org>
Sent: Wednesday, March 20, 2002 4:02 PM
Subject: Splitting a stirng

> I have an XML document with an element whose content is a string
> "fields" delimited by semi-colons.  Example:
> I want to transform this element into something that looks like this:
> <INFO1>123</INFO1>
> <INFO3>0</INFO3>
> <INFO4>X</INFO4>
> Can I do this with XSL?  I'm familiar with the substring functions and
> I've never used them, I've read the documentation on the param and
> elements.
> If I were doing this in a programming language like VB, I'd set a variable
> to the contents of <PACKEDINFO>, pop off the part before the first
> semi-colon, create my new element and remove the text up to and including
> the first semi-colon from the string setting me up for my next iteration.
> Any comments on how I can do this with XSL would be greatly appreciated.
> guess my biggest question is whether I should use a param or variable --
> having difficulty distinguishing between them -- and whether I can change
> param or variable's value by simply declaring it again.  I'm very

funny , i was just reading about substring today.

maybe this will give you some clue. Have you tried anything like this?

123 = substring-before( /top/node, ";" )
ABC = substring-before( substring-after( /top/padkedinfo, ";" ), ";" )

 <info1><xsl:value-of select="substring-before( /top/packedinfo,
';' )"/><info1>


could be wrong i'm just a beginner.
Received on Wednesday, 20 March 2002 13:18:02 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:58:25 UTC