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

Re: Predicates on root node

From: James Clark <jjc@jclark.com>
Date: Tue, 27 Jul 1999 17:56:04 +0700
Message-ID: <379D9044.429823A@jclark.com>
To: Kay Michael <Michael.Kay@icl.com>
CC: "'xsl-editors@w3.org'" <xsl-editors@w3.org>
Why not just write the template for the document element? The main point
of having a template rule for the root is so that it can work regardless
of the document element.

Kay Michael wrote:
> 
> When processing secondary documents using document(), it would be useful to
> be able to apply predicates to determine which template to execute, for
> example, if "intray" is a set of references to invoices and purchase-orders,
> one might write:
> 
> <xsl:apply-templates select="document(intray/@href)"/>
> 
> <xsl:template match="/[invoice]">
> ...
> </xsl:template>
> 
> <xsl:template match="/[purchase-order]">
> ...
> </xsl:template>
> 
> But there seems to be no way of applying a predicate to a pattern that
> matches the root node of a document.
> 
> I can't see any intrinsic reason for this restriction.
> 
> Mike Kay
Received on Tuesday, 27 July 1999 07:51:10 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:59:49 GMT