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

Building a nodeset by recursion


Subject: Building a nodeset by recursion
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Tue, 20 Jul 1999 11:40:59 +0100

I have a little XSL challenge for the functional programming experts.

In the SAXON XSL Compiler (which is written in XSL) I want to implement
xsl:include. So I want to assign a variable to the set of top-level nodes in
this (stylesheet) document and in all the documents it references using
xsl:include, recursively.

Easy enough with an assignment statement and a global variable:

<xsl:variable name="top-level" select="*[false()]"/> <!-- initialise to
empty -->

<xsl:apply-templates select="/" mode="gather"/>

<xsl:template match="/" mode="gather">
<xsl:assign name="top-level" select="$top-level | /*/*"/>
<xsl:apply-templates select="document(/*/xsl:include/@href)" mode="gather"/>
</xsl:template>

How do I do this in standard XSL, without variable assignment?

Mike Kay


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



Current Thread
Keywords
xsl