xsl-list
[Top] [All Lists]

RE: Priority and import precedence

2005-01-31 08:55:21

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 

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>