Subject: Re: Confused using a loop...
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 28 Mar 2007 15:43:48 +0100
|
> To do this, I think I need to
> use a recursive template with a parameter.
not necessarily, it would be easier just to do
select="(some/x/path)[position() <= $numberOfItemsToList]">
which will just select the first $numberOfItemsToList items.
If you do want a numeric parameter, don't do
<xsl:param name="i">1</xsl:param>
which makes a result tree fragment, with a root node with a text node
child with string value the decimal representation of the number. If you
use this in a numeric context it has to be coerced back to a number.
<xsl:param name="i" select="1"/>
which defines the parameter to be the number 1.
David
|