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

Breaking a string into repeated elements

Subject: Breaking a string into repeated elements
From: jon budar-danoff <jbudardanoff@xxxxxxxxx>
Date: Fri, 7 Jun 2002 12:44:45 -0700 (PDT)
jon budar is
Greetings o helpful list members!

I have a problem to solve which is currently outside of my admittedly
small realm of XSL knowledge.

I have a file which is currently in XML-like format.  I have written a
stylesheet that converts most of it into a real XML format, but there
is
one construct that I just can't quite figure out.

The construct in question looks like this:

<ListOfItems>10, 20, 30, 31</ListOfItems>

and I want to make it look like this:

<ListOfItems howMany="4">
    <Item>10</Item>
    <Item>20</Item>
    <Item>30</Item>
    <Item>31</Item>
</ListOfItems>

Note that the existing <ListOfItems> may be delimited by either spaces,
commas, or commas and spaces.

I figure that I need to use some combination of substring() and some
other string functions, but am unsure of where to start.

Thanks, in advance,
jmb-d


=====
-----------------------------------------------------------------------
In walking, just walk.  In sitting, just sit.  Above all, don't wobble.
    -- Yun-Men

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.