Sorry if another version of this appears without the stylesheet. I expected
this stylesheet to work just the way the example shown in the spec does, but
the comma appears after all instances of <in>. Can anyone see what I'm missing?
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes" encoding="UTF-8" />
<xsl:template match="/signature">
<signature>
<xsl:apply-templates />
</signature>
</xsl:template>
<xsl:template match="*">
<xsl:choose>
<xsl:when test="name() = 'in'">
<xsl:copy-of select="." />
<xsl:if test="not(position() = last())">
<xsl:text>,</xsl:text>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="." />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
--
Charles Knell
cknell(_at_)onebox(_dot_)com - email
-----Original Message-----
From: David Carlisle <davidc(_at_)nag(_dot_)co(_dot_)uk>
Sent: Tue, 18 Nov 2003 17:33:38 GMT
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] Introducing a comma.
The code to do exactly that example is in the xslt spec.
http://www.w3.org/TR/xslt#section-Conditional-Processing-with-xsl:if
David
--
http://www.dcarlisle.demon.co.uk/matthew
________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list