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

RE: Difference between import and include

Subject: RE: Difference between import and include
From: Jeff Beadle <Jbeadle@xxxxxxxx>
Date: Mon, 28 Jan 2002 13:18:36 -0500
difference between import and include

xsl:include means to include the referenced xsl document (b.xsl) within your
referencing document (a.xsl).  You cannot have two templates with the same
matching signature: name, or (match and/or mode).

xsl:import, in essence, means that if b.xsl "imports" a.xsl then b.xsl
is--in effect--sub-classing a.xsl.
If a.xsl has a template named "X" and b.xsl has a template named "X", then
xslt processor will use the call the "X" template from the b.xsl document.  

Basically, (this is from the msxml sdk) "importing a style sheet is the same
as including it except that definitions and template rules in the importing
style sheet take precedence over those in the imported style sheet."

In brief,
I consider xsl:include to be good for sharing utility templates (and such)
between xsl documents, and xsl:import for more of an xslt framework

How the processors actually handle the two xslt elements is kind of cool,
you may want to refer Mike Kay's book (Professional XSLT 1st or 2nd Ed.) for
a good explanation.


-----Original Message-----
From: Khalid [mailto:k_ali@xxxxxxxxxxxxxxx]
Sent: Monday, January 28, 2002 12:46 PM
To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
Subject:  Difference between import and include

Can some one tell me the difference between include or import?
Basically I was wondering that is it possible to use either one of the xsl:
commands to inlude or import a spcific xsl template at a particular point in
the xsl file,kind of like calling a method inside of a method e.g

function mainXSLT(){
 print some stuff
 print some other stuff
 call the include or import able xsl file
 print some other stuff

Thanks in advance

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

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

Current Thread


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.
First Name
Last Name
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.