Re: Predicates on root node

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 UTC