tricky transformation
Posted: Tue Mar 15, 2005 11:37 am
Hi,
I need an idea how to write a transformation for the following xml Dokument
<names>
<name>Jeffrey</name>
<name>George</name>
<name>Mike</name>
</name>
so that, when I use fop, the following line is created.
Jeffrey, George, Mike.
My problem is, that behind every name a comma is set, but behind the last one a dot.
I tried to do it like this:
<xsl:template match="names">
<fop:block>
<xsl:apply-templates/>
</fop:block>
</xsl:template>
<xsl:template match="name">
<xsl:value-of select="."/>,
</xsl:template>
but as you can see, this version sets a comma after every name, even after the last one.
Thanks a lot for any ideas, how to solve this problem.
I need an idea how to write a transformation for the following xml Dokument
<names>
<name>Jeffrey</name>
<name>George</name>
<name>Mike</name>
</name>
so that, when I use fop, the following line is created.
Jeffrey, George, Mike.
My problem is, that behind every name a comma is set, but behind the last one a dot.
I tried to do it like this:
<xsl:template match="names">
<fop:block>
<xsl:apply-templates/>
</fop:block>
</xsl:template>
<xsl:template match="name">
<xsl:value-of select="."/>,
</xsl:template>
but as you can see, this version sets a comma after every name, even after the last one.
Thanks a lot for any ideas, how to solve this problem.