W3C home > Mailing lists > Public > xsl-editors@w3.org > October to December 2000

Re: XSLT 1.0: xsl:apply-imports when there is no overridden rule

From: James Clark <jjc@jclark.com>
Date: Wed, 06 Dec 2000 17:30:40 +0700
Message-ID: <3A2E1550.D0465909@jclark.com>
To: Kay Michael <Michael.Kay@icl.com>
CC: "'xsl-editors@w3.org'" <xsl-editors@w3.org>
Kay Michael wrote:
 
> Section 5.6 says that "A template rule that is being used to override a
> template rule in an imported stylesheet can use <xsl:apply-imports>"; it
> does not say what happens if there is no such overridden rule. I can think
> of at least three defensible interpretations: signal an error, invoke the
> built-in template rule, or do a no-op.
> 
> A user has reported that Saxon and MSXML3 behave differently in this area.

Section 5.8 says: "The built-in template rules are treated as if they
were imported implicitly before the stylesheet".  So the correct
behaviour is to invoke the built-in template rule.

> The user was actually using xsl:apply-imports from within a template called
> by name, and it might be that it was this that caused the difference. I
> think the spec here can only be read one way, though it could be more
> explicit: the phrase quoted above leaves room for doubt about whether
> <xsl:apply-imports> can correctly be used outside a template rule,

It can be used if and only if the current template rule is non-null.

> neither
> does it explicitly say that <xsl:call-template> leaves the current template
> rule unchanged.

It says that "Whenever a template rule is chosen by matching a pattern,
the template rule becomes the current template rule for the
instantiation of the rule's template. When an xsl:for-each element is
instantiated, the current template rule becomes null for the
instantiation of the content of the xsl:for-each element." I don't see
any room for doubt there about whether xsl:call-template changes the
current template rule.

James
Received on Wednesday, 6 December 2000 05:33:09 GMT

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