[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] Priority and import precedence


Subject: RE: [xsl] Priority and import precedence
From: "Andrew Welch" <ajwelch@xxxxxxxxxxxxxxx>
Date: Mon, 31 Jan 2005 15:55:21 -0000

> > Is there a reason for this?
>
> Apart from the consistency argument above, the answer to "why
> did you do it that way" questions can only be answered by
> people on the original WG, most of whom aren't so active on
> this list these days, I think:-)
>
> Importing works well in cases of simple overrides, but if you
> need finer control over which templates get executed I find
> it's often better to use xsl:include and then control
> individual templates with priority. But then you lose
> apply-import functionality, unless you are using xslt2 when
> you can use next-match which is more or less the same thing
> but without the dependency on import.

What confused me here was that as A imports both B and C, I considered
templates in B and C to be of equal priority.  With that in mind I
thought I could put a template in B, give it a priority of say 10 and be
satisfied it would beat any templates defined in C.

It just seems really strange that the ordering of the import statements
should be more important that the priority attribute.  Maybe there
should be a processor warning 'Warning: priority attribute ignored
because of import precedence'... As you say, I think the best option is
to not use xsl:import/xsl:apply-imports and use
xsl:include/xsl:next-match instead.

cheers
andrew


Current Thread