xsl-list
[Top] [All Lists]

Re: a bit of distraction ' quiz of XSLT 1.0 oddities'

2006-01-03 03:11:15
On 1/3/06, Ragulf Pickaxe <ragulf(_dot_)pickaxe(_at_)gmail(_dot_)com> wrote:
On 1/3/06, andrew welch <andrew(_dot_)j(_dot_)welch(_at_)gmail(_dot_)com> 
wrote:
An 'oddity' I've had to deal with a few times:

<Snip/>


What is the output?

I have not used import very often, but looking up a bit, I would say:
I am in second.xsl!

The reason for this is that second.xsl is imported after first.xsl and
therefore has a higher precedence, and import precedence is considered
before priority in matches (if I read it correctly).

Correct.  The very first rule in conflict resolution is to get rid of
all templates with lower import precedence - this is decided
ultimately by the order of the imports.  It doesn't matter about the
priority attribute, or the fact that match="node" is a better match
than match="*", it's all down to the order of the import statements.

The oddity (im my mind) is that "order of occurence" is the very last
all-else-has-failed-and-we-have-to-choose-one technique for templates
in the same stylesheet, but the very first for imported templates.

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