xsl-list
[Top] [All Lists]

Re: xsl:include

2003-11-17 05:36:03

Seems to make no difference if I use xsl:import


In your case it doesn't make any difference what templates you define in
the included (or imported) document as your main document never applies
templates: you don't have a single call to xsl:apply-templates anywhere.

The only template that is ever going to run is the template matching /
as that is called implictly by the system to start the transform.

Your doc1.xsl has a template matching / so if that imports doc2.xsl
the one in doc1 will have higher import precedence so nothing in doc2
will affect anything. If you include doc2 then as it is, doc2 does not
define a template for the root node, just an element called <rootnode/>
but this will never fire as you are not applying templates.
You could make doc2 define a template for the root node match="/"
Then if you use xsl:include your combined stylesheet will have two
templates matching / which is an error but your xslt system may recover
by running one of them, or you could avoid the error by adding
priority="10"
to the template that you want to win. Or alternatively rather than raise
the priority of the template you want to win you can lower the priority
of the one you want to lose, as I now notice you have done, setting it
to -1, but as I say above priority only has an effect of the templates
are matching the same nodes, and currently you only have one template
matching the root node.



David

-- 
http://www.dcarlisle.demon.co.uk/matthew

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

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



<Prev in Thread] Current Thread [Next in Thread>