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

Basic string parsing/splitting question.

Subject: Basic string parsing/splitting question.
From: "Stoaks, Max" <Stoaks_Max@xxxxxxxxxxxxxxxx>
Date: Thu, 10 Jun 2004 13:57:28 -0700
string parsing
Sorry for this basic question...

I have a comma delimited list of tokens in a string that I want to get the first three from (if there are more than three). Else just the first one or two.

I.e. Given this string:
"Dogs, Big Sheep, Little Mice, Ants, Pelicans"

I'd like the result to be:
"Dogs, Big Sheep, Little Mice ..." 

Given:
"Dogs, Big Sheep, Little Mice"
It should just say:
"Dogs, Big Sheep, Little Mice"

Ditto for shorter ones.

Seems like there should be a function to split after the third occurrence of ",", but I don't find that anywhere.

Meanwhile, I'm looking at the EXSLT extensions to see if I can use a tokenizer or something like that.

Any help would be appreciated.

I'm using XalanJ 2.6.

Thanx,
Max

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.