Re: [xsl] xsl:include is necessary after all

Subject: Re: [xsl] xsl:include is necessary after all
From: Oliver Becker <obecker@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 18 May 2001 14:25:37 +0200 (MET DST)
> For a while now, I've been under the mistaken assumption that xsl:include is
> not strictly necessary--that xsl:import is all you really need.
> http://www.biglist.com/lists/xsl-list/archives/200008/msg00030.html
> 
> I guess my assumption was that priority was resolved first, and then import
> precedence. No, it's the other way around. In other words, when rules
> conflict, the one with higher import precedence overrides all rules with
> lower import precedence, regardless of their priority. The real implication
> of this is that if I have a template matching * in my importing stylesheet,
> then template rules in my imported stylesheet that match specific element
> types will always be ignored.
> http://www.w3.org/TR/xslt#conflict
> 
> If I don't want them to be ignored, then I have to use xsl:include.

Hi Evan,

last time I had to struggle with something similar:
I got two stylesheets from someone else (say A.xsl and B.xsl),
and A.xsl *imports* B.xsl. It was said, A.xsl formats documents
conforming to (say) A.dtd. However, the sample document didn't use
all allowed elements from the DTD.
My XML document contains some additional elements which need to be
processed in a specific way (additional = not in A.dtd), and also 
elements from A.dtd, which were not in the sample document. I put the
rules (templates) for my additional elements into C.xsl which includes 
A.xsl, and added a template matching * to check, if the elements conforming 
to A.dtd which were not in the sample document are processed in some way
by A.xsl. Fine (I thought). 

Not fine. The *-template caught most of the elements since the templates
from B.xsl had no chance to match anything. So I had to modify the xsl:import
in A.xsl to xsl:include. Since A.xsl was not my invention I would rather
leave this stylesheet unchanged.

Is this something the WG should consider when developing XSLT 2.0?

Regards,
Oliver


/-------------------------------------------------------------------\
|  ob|do        Dipl.Inf. Oliver Becker                             |
|  --+--        E-Mail: obecker@xxxxxxxxxxxxxxxxxxxxxxx             |
|  op|qo        WWW:    http://www.informatik.hu-berlin.de/~obecker |
\-------------------------------------------------------------------/


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


Current Thread