Subject: Re: [xsl] how concat() attributes of several elements From: Joerg Heinicke <joerg.heinicke@xxxxxx> Date: Tue, 11 Jun 2002 17:30:35 +0200 |
<xsl:template match="map"> <xsl:variable name="cities"> <xsl:for-each select="location"> <xsl:value-of select="@city"/> </xsl:for-each> </xsl:variable> <xsl:text>concatenated cities: </xsl:text> <xsl:value-of select="$cities"/> </xsl:template>
Hello,
I am struggling with unupdateable characteristics of xsl variables. If I have the following xml fragment.
<map> <location country="us" city="washington"/> <location country="us" city="detroit"/> <location country="us" city="dallas"/> </mapr>
How could I concatenate all the city attributes so that the result is "washingtondetroitdallas" and assign it to a variable. In java I would normally set up a for loop and concat the result of the first iteration to the subsequent iteration and so on...
Thanks
System Development VIRBUS AG Fon +49(0)341-979-7419 Fax +49(0)341-979-7409 joerg.heinicke@xxxxxxxxx www.virbus.de
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] how concat() attributes of se, Lloyd, Colin | Thread | Re: [xsl] how concat() attributes o, David Carlisle |
[xsl] how concat() attributes of se, Lloyd, Colin | Date | RE: [xsl] how concat() attributes o, Andrew Welch |
Month |