Try
position() != last()
Ryan Puddephatt
Web Developer
TFX Group
1 Michaelson Square
Livingston
West Lothian
Scotand
EH54 7DP
* rpuddephatt(_at_)teleflex(_dot_)com
( 01506 407 110
7 01506 407 108
-----Original Message-----
From: Mark Williams [mailto:mark(_at_)skwirel(_dot_)com]
Sent: 14 December 2005 12:38
To: XSL-List
Subject: [xsl] for-each checking count of nodes
Hi,
My XML looks something like:
<?xml version="1.0" ?>
<Root>
<DATA>
<Table Name ="clients">
<data>
<name>Jones</name>
<dob> 19/11/1962</dob>
</data>
<data>
<name>Davies</name>
<dob> 10/12/1963</dob>
</data>
</Table>
</Root>
In the xsl I need to output a line after I have outputted each client's
data.
I have tried to do it this way:
<xsl:for-each select="DATA/Table[(_at_)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() <
count(DATA/Table[(_at_)Name='clients']/data/name)">
<fo:block white-space-collapse="false" font-family="Helvetica"
font-size="10pt" space-after="0.05pt">___________________</fo:block>
</xsl:if>
</xsl:for-each>
Can anyone please tell me what is wrong with my xsl:if statement as the
line is never outputted.
Many thanks,
Mark Williams
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--