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

RE: for-each checking count of nodes

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

position() != last()

Ryan Puddephatt
Web Developer
TFX Group
1 Michaelson Square
Livingston
West Lothian
Scotand
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:  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[@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;
count(DATA/Table[@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

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.