This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Importing stylesheet


Adam Van Den Hoven wrote:

[snip]

> ... I'm wondering if the templates in an included stylesheet
> have access to all the included stylesheets or only the ones it includes in
> itself.
> 
> In a related question, what happens when the same stylesheet is included in
> multiple places in an include chain. I've had it where my final stylesheet
> depends on transforms from two other stylesheets, so it included both. As it
> turns out, the third stylesheet was also dependant on the second. The import
>  tree looked something like
> 
>     +--B
> A--|
>     +--C --B
> (Man that looks crappy on my machine)
> 
> Everything worked fine but MSXML3SP1 seemed to be painfully slow. Eventually
> I realized that C was unnecessary on its own so every was suddenly a lot
> faster but I'm still curious about the effects on performance this should
> have..

Hi Adam,

I think you're actually asking about imported, not included, stylesheets.

The very brief answer is: Be aware that importing more than one stylesheet that
imports and overrides some templates of a fixed (the same) stylesheet -- this is
generally not working correctly.

As Jeni Tennisson and David Carlisle pointed out in ("Reliance on import precedence
considered dangerous" http://sources.redhat.com/ml/xsl-list/2001-02/msg00996.html, 
and http://sources.redhat.com/ml/xsl-list/2001-02/msg01003.html), 
only the overrides in the last imported stylesheet will be used.

The reason for this problem is that in XSLT QName resolution is carried out
statically (by offset from the beginning of the outermost stylesheet).

To overcome this serious limitation, use generic templates:
http://lists.fourthought.com/pipermail/exslt/2001-May/000169.html
http://www.vbxml.com/downloads/default.asp?id=v2001611171627
http://sources.redhat.com/ml/xsl-list/2001-06/msg01147.html

Generic templates use unique template references, therefore the above problem does
not exist by definition.

Generic templates are the basis for true polymorphism in XSLT.


Hope this helped.

Cheers,
Dimitre Novatchev. 



__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]