[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: CHILDREN PROBLEM


Subject: Re: CHILDREN PROBLEM
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 29 Jul 1999 09:48:53 +0100 (BST)

> but I don't know how
> to test that a node is the last children in the xsl file

You can test if you are at the last by
<xsl:if test="position()=last()"/>

but probably that isn't what you want to do, normally you would do
something like

....stuff to put before the list
<xsl:apply-templates select="animal"/>
....stuff to put after the list


ie rather than process the list one at a time asking each time if you
are at the end, it is usually more convenent to specify what you want to
put around that branch of the tree, and inbetween, select the elements
you want in that branch.

David


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread
Keywords
xsl