[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] concating strings in a loop


Subject: RE: [xsl] concating strings in a loop
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Fri, 6 Feb 2004 11:20:28 -0000

In XSLT 2.0, use the string-join() function or the separator attribute
of xsl:value-of.

In 1.0, use

<xsl:if test="position()!=last()">,</xsl:if>

Michael Kay

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Herwig Posedu
> Sent: 06 February 2004 10:02
> To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] concating strings in a loop 
> 
> 
> hi!
> i want to display a list of persons "comma-seperarted" on my 
> pdf-file. how can i concate those person-names seperated with 
> a "," but in that 
> way, that after the last name is no ",".
> i did it like this
> 
> <xsl:for-each select="person">
> <xsl:value-of select="name" />
> ,<fo:inline color="white">.</fo:inline>
> </xsl:for-each>
> -> the output for example is: mike, john,
> -> i want to have: mike, john
> how can i concate the strings and substring it, so that the 
> last comma 
> will be removed
> 
> thx for help
> -- 
> Herwig Posedu
> 
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


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



Current Thread
Keywords