[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: Re: [xsl] Introducing a comma.


Subject: RE: Re: [xsl] Introducing a comma.
From: cknell@xxxxxxxxxx
Date: Tue, 18 Nov 2003 13:08:39 -0500

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@xxxxxxxxxx - email



-----Original Message-----
From:     David Carlisle <davidc@xxxxxxxxx>
Sent:     Tue, 18 Nov 2003 17:33:38 GMT
To:       xsl-list@xxxxxxxxxxxxxxxxxxxxxx
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



Current Thread
Keywords