Re: [xsl] a bit of distraction ' quiz of XSLT 1.0 oddities'

Subject: Re: [xsl] a bit of distraction ' quiz of XSLT 1.0 oddities'
From: andrew welch <andrew.j.welch@xxxxxxxxx>
Date: Tue, 3 Jan 2006 10:11:15 +0000
On 1/3/06, Ragulf Pickaxe <ragulf.pickaxe@xxxxxxxxx> wrote:
> On 1/3/06, andrew welch <andrew.j.welch@xxxxxxxxx> 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

Current Thread