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

xsl:import vs xsl:include

Subject: xsl:import vs xsl:include
From: Mike Brown <mike@xxxxxxxx>
Date: Thu, 6 Sep 2001 14:27:13 -0600 (MDT)
xsl import vs xsl include
Pranav wrote:
>           Can anyone please tell me the difference between <xsl:include> and
> <xsl:import> ?
>           I am also interested to know that in what situation we should use
> <xsl:include> and in what situation we should use <xsl:import>.

xsl:include just helps you modularize your stylesheets as far as splitting
them into separate files. The templates in these files all match with the
same precedence, so you can't have in one file, say,

  <xsl:include href="file2.xsl"/>
  <xsl:template match="foo">

and in file2.xsl
  <xsl:template match="foo">

because there would be a conflict.

xsl:import works the same way, but using imports you can have template rules
that match the same nodes:

  <xsl:import href="file2.xsl"/>
  <xsl:template match="foo"> <!-- overrides file2.xsl's version -->

So when you do an apply-templates select="foo", this one will match.
If you don't want to use that one, you do apply-imports.

So what imports do is gives you a way to put, in your imported stylesheets,
the "default" templates for various nodes, and in the stylesheets containing
the xsl:import you are providing the "overriding" templates.

   - Mike
____________________________________________________________________________
  mike j. brown, fourthought.com  |  xml/xslt: http://skew.org/xml/
  denver/boulder, colorado, usa   |  personal: http://hyperreal.org/~mike/

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


Current Thread
  • [no subject]
    • Pranav - Thu, 6 Sep 2001 16:00:04 -0400 (EDT)
      • Utah Ingersoll - Thu, 6 Sep 2001 16:08:05 -0400 (EDT)
        • Mike Brown - Thu, 6 Sep 2001 16:37:10 -0400 (EDT)
      • Mike Brown - Thu, 6 Sep 2001 16:34:06 -0400 (EDT) <=
      • Michael Kay - Fri, 7 Sep 2001 05:18:25 -0400 (EDT)

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.