Re: [xsl] Re: Re: Re: Reliance on import precedence considered dangerous

Subject: Re: [xsl] Re: Re: Re: Reliance on import precedence considered dangerous
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Sun, 18 Feb 2001 08:44:00 +0000
Hi Dimitre,

> This is a big step forward since you now realise that implementing
> xsl:import with the "virtual" attribute will eliminate the problems
> of having the same stylesheet imported twice.
>
> Now you're changing directions and only complain that because of
> higher import precedence an overriding template from C will also
> override an overriding template from B.

It would definitely address that case. I never argued against that.
I'm sorry that I changed tack without warning mid-thread as I realised
there were actually dangers *across the board* with import precedence,
not only in this special case.

> But this is exactly "as expected" -- this is the behaviour by
> design. Nobody can say that this "came as surprise".

I can :) Well, not so much as a surprise because naturally I know the
Rec absolutely by heart, and of course it's completely documented,
very clearly, and if you read the section carefully then you'll know
exactly what's happening. I'm not 'complaining' about that (though,
yes, my previous point about importing the same stylesheet twice is a
special case of this behaviour that I think should be highlighted in a
Note of some kind in that section, as a similar one is in the
xsl:include section).

> Again to parallel this with an OOPL, ambiguity has to be resolved in
> some way, or to be reported as error. The import precedence in XSLT
> serves to resolve ambiguity.

I understand that. I'm only commenting because thinking through the
implications of this, it doesn't resolve the ambiguity in the way that
I would have expected it to. I guess this isn't that surprising - I
probably have a very weird programming intuition.

To me, it would make more sense if a stylesheet imported into another
stylesheet could only be overridden by the templates (etc.) in the
importing stylesheet, not in other imported stylesheets, so that it
mainly retains its original behaviour, wherever it's imported. I think
that would make it easier to create modular stylesheets.

I'd like to see arguments against this so that I can understand the
rationale for the current state of affairs. I think that one of the
reasons might have been implementation ease, but I don't know whether
it's *incredibly* easier to use the list rather than the tree or just
*a little* easier to use the list rather than the tree.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread