This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: DSSSL->XSLT; problems implementing node-list-first/node-list-rest
- To: AKillian at wiley dot co dot uk
- Subject: Re: [xsl] DSSSL->XSLT; problems implementing node-list-first/node-list-rest
- From: Jeni Tennison <mail at jenitennison dot com>
- Date: Tue, 27 Mar 2001 10:41:52 +0100
- CC: xsl-list at lists dot mulberrytech dot com
- Organization: Jeni Tennison Consulting Ltd
- References: <OF04699602.707F9CFD-ON80256A1B.0061B305@wiley.co.uk>
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi Aidan,
I think that your problem rests in the fact that when you first call
the proc-nl template, you're passing a result tree fragment (i.e. a
single root node) whereas in later calls you're passing a node set
containing a number of item elements.
You could pass all the item elements each time, so change the first
call (in the list-matching template) to:
<xsl:call-template name="proc-nl">
<xsl:with-param name="nl" select="saxon:nodeSet($sorted)/*" />
</xsl:call-template>
and change the proc-nl template to:
<xsl:template name="proc-nl">
<xsl:param name="nl"/>
<called>
<xsl:for-each select="$nl">
<xsl:message>
<xsl:copy-of select="."/>
</xsl:message>
</xsl:for-each>
</called>
<xsl:if test="$nl">
<xsl:apply-templates select="$nl[1]"/>
<foo>bar</foo>
<xsl:call-template name="proc-nl">
<with-param name="nl" select="$nl[position() != 1]"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
Or change the proc-nl template so that it creates a new result tree
fragment to pass each time. In other words, change the recursive call
within the proc-nl template to:
<xsl:call-template name="proc-nl">
<with-param name="nl">
<xsl:copy-of
select="saxon:nodeSet($nl)/*[position() != 1]" />
</xsl:with-param>
</xsl:call-template>
I hope that helps,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list