[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: xsl:include

Subject: Re: xsl:include
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 17 Nov 2003 12:36:03 GMT
xsl include priority
> 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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.