RE: [xsl] for-each checking count of nodes

Subject: RE: [xsl] for-each checking count of nodes
From: Ryan Puddephatt <rpuddephatt@xxxxxxxxxxxx>
Date: Wed, 14 Dec 2005 12:41:37 +0000

position() != last()

Ryan Puddephatt
Web Developer
TFX Group
1 Michaelson Square
West Lothian
EH54 7DP
* rpuddephatt@xxxxxxxxxxxx
( 01506 407 110
7  01506 407 108

-----Original Message-----
From: Mark Williams [mailto:mark@xxxxxxxxxxx] 
Sent: 14 December 2005 12:38
To: XSL-List
Subject: [xsl] for-each checking count of nodes


My XML looks something like:

<?xml version="1.0" ?>
<Table Name ="clients">
<dob> 19/11/1962</dob>
<dob> 10/12/1963</dob>

In the xsl I need to output a line after I have outputted each client's

I have tried to do it this way:

<xsl:for-each select="DATA/Table[@Name='clients']/data">
<fo:block font-family="Helvetica" font-size="10pt"
space-after="0.05pt"><xsl:value-of select="name" /></fo:block>
<fo:block font-family="Helvetica" font-size="10pt"
space-after="0.05pt"><xsl:value-of select="dob" /></fo:block>
<xsl:if test="position() &lt;
<fo:block white-space-collapse="false" font-family="Helvetica"
font-size="10pt" space-after="0.05pt">___________________</fo:block>

Can anyone please tell me what is wrong with my xsl:if statement as the
line is never outputted.

Many thanks,

Mark Williams

Current Thread