Re: [xsl] New to XSL

Subject: Re: [xsl] New to XSL
From: Jon Gorman <jonathan.gorman@xxxxxxxxx>
Date: Tue, 20 Dec 2005 10:58:33 -0600
On 12/20/05, Richard Zhang <richard_zhang@xxxxxxxxxx> wrote:
> Hi,
>
> I am new to XSLT and want to do the following but do not know if it is
> possible or not. Any help or references to sources would be greatly
> appreciated.
>
> I have an XML file with the following element:
>
> <textarea sep=" &#x000A; &#x000D:"
>   10 20 30 40 50
> </textarea>

GMail is mangling this a bit, so let me make sure I'm guessing right.
For each token delimited by spaces you want to to create a new element
containing the token and the contents of the sep attribute.

The first part (splitting the string) is an faq:
http://www.dpawson.co.uk/xsl/sect2/N7240.html#d9312e343.

Second part would merely be <xsl:value-of select="@sep" />

Of course, a more interesting variation is using sep to indicate the
deliminator,

So if I had <textarea sep=",">10,20,30,40,50</textarea>
I'd get something like <datanum>10</datanum><datanum>20</datanum>.

That's just a variation of the faq that should be pretty easy to
figure out from the above faq reference.

> Is this possible with XSLT?

Yup, and frequently done.  Like many things, I'm sure it's easier in XSLT
2.0.

Current Thread