Subject: Re: [xsl] working out where the last() is From: "andrew welch" <andrew.j.welch@xxxxxxxxx> Date: Fri, 6 Oct 2006 11:30:51 +0100 |
Hi,
I have some XML data which contains an areaserved node as follows:
<areaserved> <district name="South Hams"> <town name="Dartmouth"> <settlement name="Kingswear"/> </town> <town name="Totnes"/> </district> <district name="Torbay"/> </areaserved>
I am trying to write some XSLT to transform this to a list as follows:
Kingswear, Totnes, Torbay
In 1.0 you don't have the string-join() function so you need to add the comma yourself:
<xsl:for-each select="//*[not(*)]/@name"> <xsl:value-of select="."/> <xsl:if test="position() != last()">, </xsl:if> </xsl:for-each>
cheers andrew
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] working out where the las, Alexander Johannesen | Thread | RE: [xsl] working out where the las, Michael Kay |
Re: [xsl] working out where the las, Alexander Johannesen | Date | RE: [xsl] working out where the las, Michael Kay |
Month |