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

Re: New to XSL

Subject: Re: New to XSL
From: Jon Gorman <jonathan.gorman@xxxxxxxxx>
Date: Tue, 20 Dec 2005 10:58:33 -0600
Re:  New to XSL
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

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.