W3C home > Mailing lists > Public > xsl-editors@w3.org > July to September 1999

Recursion among top-level elements

From: Kay Michael <Michael.Kay@icl.com>
Date: Tue, 3 Aug 1999 12:42:48 +0100
Message-ID: <93CB64052F94D211BC5D0010A800133170F033@wwmess3.bra01.icl.co.uk>
To: "'xsl-editors@w3.org'" <xsl-editors@w3.org>
The XSLT specification (section 12.4) discusses the possibility of cycles
existing among global variable declarations, but it does not seem to deal
with other possibilities for circular definitions.

Example1: there is nothing to stop a global variable definition calling
xsl:apply-templates; and there is nothing to stop the match pattern in
xsl:template referencing a global variable. In general therefore, when
xsl:apply-templates is called within a global variable definition it will be
impossible to determine which template to invoke.

Example2: there is nothing to stop a global variable definition referencing
a key, and there is nothing to stop any of the patterns in a key definition
from referencing a global variable.

I don't think it will be possible to fix these problems without some fairly
severe limiting of the current freedom to define things in any order.

Many of the problems could be solved by a ban on forwards references, e.g. a
global variable definition can only refer to a global variable, named
template, attribute set, or key that has been previously declared in the

The problem with xsl:apply-templates remains: I think it is necessary either
to stop template match patterns referring to global variables, or to stop
global variable definitions invoking xsl:apply-templates.

Mike Kay
Received on Tuesday, 3 August 1999 08:49:21 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:44:16 UTC