Rule conflict resolution

Subject: Rule conflict resolution
From: Aneel Nazareth <anazaret@xxxxxxxxxxxx>
Date: Thu, 05 Nov 1998 16:50:19 -0500
Hello all,
I'm working on an XSL processor, and I have a question about conflict
resolution for template rules.

It seems to me that the precedence for template rules is static (independent
of context). This means that the XSL processor should be able to simply sort
the rules once and go down the list in order whenever rules are applied. This
also means that, if the stylesheet author wanted to do so, she could sort the
rules into the same order by hand ahead of time.

My question is this: why not just keep the rules in the order that they are
found (document order). (Presumably reverse document order, so you'd put
general rules first and specific rules later, but that's beside the point).
This allows the functionality of the current system, and also allows the user
more control over the order of rule application, if desired.

The Drawback that I see in this scheme is that it imposes a particular
organization on the stylesheet, while the author might prefer to organize it
differently. Are there other reasons to not do this?
begin:          vcard
fn:             Aneel Nazareth
n:              Nazareth;Aneel
email;internet: anazaret@xxxxxxxxxxxx
tel;work:       x234
x-mozilla-cpt:  ;0
x-mozilla-html: FALSE
version:        2.1
end:            vcard

Current Thread