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

> > 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.
> 
> 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.

I agree that invoking the built-in template rule is probably the right
behavior. However, I don't agree that the current spec clearly implies this.
5.6 says that the only rules considered are those "imported into the
stylesheet element containing the current template rule", while 5.8 uses the
phrase "imported implicitly before the stylesheet". Neither "imported into"
nor "imported before" is formally defined, and it certainly isn't obvious
that one implies the other. In 5.8 the phrase "the stylesheet" can only be
read as meaning the whole stylesheet tree, not any particular "stylesheet
element" (what I prefer to call a stylesheet module), so one could well
argue that the built-in rules do NOT appear in the subtree rooted at the
stylesheet module containing the current template rule (which is my reading
of "imported into").

> > neither does it explicitly say that <xsl:call-template> leaves the 
> current template rule unchanged.
> 
> I don't see
> any room for doubt there about whether xsl:call-template changes the
> current template rule.

I agree with you that this is the only possible reading, but I've got a user
who doesn't see it that way, and the argument would be easier if it was
spelt out more explicitly.

Mike Kay

Received on Wednesday, 6 December 2000 06:56:03 UTC