W3C home > Mailing lists > Public > www-xsl-fo@w3.org > May 2002

Re: Formatting a phone number using xsl

From: Max Froumentin <mf@w3.org>
Date: Fri, 31 May 2002 17:12:41 +0200
To: "Tanguay, Lyne" <ltanguay@minacom.com>
Cc: "'www-xsl-fo@w3.org'" <www-xsl-fo@w3.org>
Message-ID: <86it54bbbq.fsf@sophia.inria.fr>

"Tanguay, Lyne" <ltanguay@minacom.com> writes:

> We have no choice but to use a "for-each" loop to display multiple 
> fields that compose the phone number.  
> We want the "-" to act as the separation character. 
> But when we do so, we get this result, for ex: 011-1-666-7777-
> How can we prevent from having the last "-".

Hi Lyne,

Something like this should work:

 <xsl:template match="phone">
    <xsl:for-each select="*">
       <xsl:value-of select="@value"/>
       <xsl:if test="position()!=last()">

Received on Friday, 31 May 2002 11:13:46 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:09:54 UTC