[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Re: Introducing a comma.

Subject: RE: Re: Introducing a comma.
From: cknell@xxxxxxxxxx
Date: Tue, 18 Nov 2003 13:08:39 -0500
comma in xsl
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:  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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.