Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 16th, 2008, 04:13 AM
Authorized User
 
Join Date: Mar 2008
Location: , , .
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Default Performance for <xsl:import> and <xsl:include>

Hi,

Is there any performance issues if we use <xsl:import> or <xsl:include>. Also are these two tags only helped to provide more clear code or any more advantages for using these two tags. Thanks in advance for your help.

Reply With Quote
  #2 (permalink)  
Old April 16th, 2008, 05:21 AM
samjudson's Avatar
Friend of Wrox
Points: 8,687, Level: 40
Points: 8,687, Level: 40 Points: 8,687, Level: 40 Points: 8,687, Level: 40
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2007
Location: Newcastle, , United Kingdom.
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

<xsl:include> is literally like if you cut and pasted the included stylesheet into the one with the xsl:include line in, so other than a small hit to actually find and read the stylesheet its not going to make any difference.

xsl:import is slightly more complicated in that it has a lower precedence than the importing stylesheet, so if there are conflicting templates it may take longer to work out which one to call.

Having said that all of these things are effectively 'static' i.e. they don't change at runtime, so once your processor has run through the stylesheet and compiled it the actually processing will make no difference. Some processors (e.g. Saxon) even provides the facility to save the compiled stylesheet out if you are going to be running it over and over again, which I suspect will improve performance greatly.

Both top-level declarations (the technical term, much better than using 'tag' which can be misleading) have many benefits over simply making the code cleaner. They provide facilities for re-use, as well as the precedence facilities of xsl:include allowing you to effectively 'overload' a particular template in the parent stylesheet, in a similar style of abstract classes and class inheritance in object oriented programming languages.

/- Sam Judson : Wrox Technical Editor -/
Reply With Quote
  #3 (permalink)  
Old April 16th, 2008, 08:06 AM
Authorized User
 
Join Date: Mar 2008
Location: , , .
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thx for your detailed response.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
embedded <xsl:element> into <xsl:with-param> petergoodman XSLT 2 July 9th, 2008 06:36 AM
Can you use <xsl: import> and transform to a pdf? wiegandn XSLT 1 August 8th, 2007 01:23 PM
<xsl:for-each> inside another <xsl:for-each> suersh79 XSLT 2 December 29th, 2006 01:24 AM
<xsl:choose> and <xsl:otherwise> problem djmarquette XSLT 4 January 21st, 2005 01:56 PM
HELP: XSL -> HTML <select selected=true> jedbartlett XSLT 4 October 7th, 2004 11:16 PM



All times are GMT -4. The time now is 11:25 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.