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

Perl "join()"-like operation?

Subject: Perl "join()"-like operation?
From: Kyle Downey <kyle.downey@xxxxxxxxxxxxxxx>
Date: 25 Feb 00 18:05:37 EST
perl join
I'm using XSLT to generate SQL code (well, actually, I'm using it to generate
Java code with JDBC statements that include SQL, but that's not material to my
problem). This means generating text like this:

insert into TBAR (CODE_C, TIME_Z, NUM_I) values ('foo', '1/1/2000', 1)

I have XML code that contains the columns in a list, and can iterate over it
using <xsl:for-each> without any trouble. The catch is that nasty little comma
separator. In Java, I would normally either track the number I'm at in the
loop and add the comma only if not on the last element, or just truncate the
whole string by one once through to save on the if() each time through the
loop. But what about XSLT?

Basically, I need an operation that joins the text results of a select with a
given string, such as a comma, or I need a way to check to see if I'm on the
last iteration and not add the comma then.

Any suggestions? TIA.

regards,
kd


 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.