[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Difference between import and include
Khalid, 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 implementation. 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. -Jeff -----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 Hi, 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 Khalid XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|