Re: Processing Modes...

Subject: Re: Processing Modes...
From: Geoff Nolan <gjn@xxxxxxxxx>
Date: Thu, 14 Jan 1999 23:18:38 +1100
James Clark wrote:

> 2. The mode on the xsl:template is the mode specified on the
> xsl:apply-templates (or neither has a mode)
> 
> Then eliminate rules by importance (import order).
> 
> Then eliminate rules by priority.
> 
> Finally if there's more than one rule left, either give an error or
> choose the rule that's last in the stylesheet; f there are no rules
> left, use the built-in rule.


Dear XSL-ers,

I'm a little hazy on what is meant by "importance". The link on the
defined term just goes back to the top of the draft in w3c.org. From
what is said here I am assuming that the most "important" rule is the
one last imported by <xsl:import>.

This would imply that a general rule in an imported stylesheet fragment
would override a specific rule in the local document (or earlier
import).

Certainly in our own stylesheet equivalents, a more specific match
"chapter/intro/para" would always take precedence over a general match
"para", irrespective of whether one or the other was included from a
fragment. I'd certainly be reluctant to include a fragment which might
blow away my own very specific templates. I'm also dubious about a
methodology which imposes order dependence on rule selection, since it
is conceivable that two external fragments could interract so that
importing in either order causes functionality in the first imported to
be lost.

Could there not be an additional rule above "importance" stating that
the rules with the greatest number of "/" (ie. parent/child) relations
should be given priority and (if more than one) that those with the
greatest number of "//" (ancestor//descendant) relations should be
chosen.

I realise this is something of a return to some aspects of "specificity"
as used in earlier drafts, but I feel such a distinction could be highly
useful.

Now, I might be reworking old ground, or I might be misreading the spec,
but I'd appreciate if someone could enlighten this poor newbie.

Thanks,
Geoff Nolan


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread