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

Re: A better way to build a comma-delimited list

Subject: Re: A better way to build a comma-delimited list
From: John Sands <WonkoWatson@xxxxxxxxx>
Date: Wed, 15 May 2002 17:25:22 -0400
convert xml to comma delimited
Fixed! Thanks Joerg and Tom. I made 2 small changes to the code below:
the "p" variable is not needed; and the substring can start at
position 3 and avoid an extra space at the beginning. Now the output
is perfect. AND the code is simpler. AND I've learned another way to
use xsl:variable. Thanks very much. (This list is amazing.)

John

> -----Original Message-----
> From: Joerg Heinicke  <joerg.heinicke@xxxxxx>
> Sent: Wednesday, May 15, 2002, 12:02:48 PM,
> Subject:  A better way to build a comma-delimited list

> While reading Tom's answer I hope the last lights are switched on in my 
> head. It takes very long today ...

>  > <xsl:text>select </xsl:text>
>  > <xsl:variable name="string">
>  >    <xsl:for-each select="document($pbsdef)/pbsdef/column
>  >              [not(@dbcolumn=preceding-sibling::column/@dbcolumn)]">
>  >       <xsl:variable name="p" select="position()"/>
>  >       <xsl:variable name="dbcolumn" select="@dbcolumn"/>
>  >       <xsl:for-each select="$dbdef[key('dbdef-cols', $dbcolumn)]">
>  >          <xsl:text>, </xsl:text>
>  >          <xsl:value-of select="$dbcolumn"/>
>  >       </xsl:for-each>
>  >    </xsl:for-each>
>  > </xsl:variable>
>  > <xsl:value-of select="substring($string, 2)"/>

> It's only a bit easier than Tom's solution, because you don't need the 
> string-length.

> Joerg


 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.