xsl-list
[Top] [All Lists]

Re: [xsl] sequential numbering in xslt

2010-01-11 16:48:29


   <xsl:if test="$documents[1]">

there is the same as

   <xsl:if test="$documents">

or perhaps most explictly

   <xsl:if test="exists($documents)">

it is just checking teh remaining sequence is non empty so as to
terminate teh recursion.

The recursive template you have iterates along the sequence of documents
but doesn't actually do anything with any of the documents.
perhaps inside the 
<car seq="{$current-number}">
you want to do something with $document[1] eg 

<xsl:copy-of select="$document[1]"/>

instead of

<xsl:copy-of select="@*|node()"/>

which copies the child nodes of the current  document node from your
initial input document, not any nodes from the documents in your
collection sequence. as the named template doesn't chnage the current
node so it is still the / node matched by  <xsl:template match="/">

David

--~------------------------------------------------------------------
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>
--~--