|
[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
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








