|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] How to use for-each to get comma searated list?
I am trying to use the current version of XSL (ala IE5.0 beta2) to
format the values inside a XML element into a comma separated list. The
problem is that I cannot figure out how to not have a comma after the
last element in the list. Any help would be appreciated. Following is
simplified XML file, desired output and my attempt at the XSL file:
-------------
#Following is a simplified XML file
<Doc>
<Section>
<Foo><Value>3.75</Value></Foo>
</Section>
<Section>
<Foo><Value>2.25</Value></Foo>
</Section>
</Doc>
--------------
#Following is a simplified target HTML mapping desired
<BODY>valueList="3.75,2.25"</BODY>
--------------
#Following is my simplified XSL file
<xsl:template match="/">
<BODY>
<xsl:text>valueList="</xsl:text>
<xsl:for-each select="Section/Foo">
<xsl:process select="Value"/>
<xsl:text>,</xsl:text>
</xsl:for-each>
<xsl:text>"</xsl:text>
</BODY>
</xsl:template>
--
Regards,
Farrukh Najmi
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








