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

RE: Which is more efficient?

Subject: RE: Which is more efficient?
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Tue, 11 Mar 2003 11:08:25 -0000
michael kay compile stylesheet intended
> Which of these is the most efficient way of rendering html?  

Answers to such questions are always dependent on the XSLT processor you
are using, and the simple answer is to measure it: in this case I
suspect that you will find that the difference in execution time is
insignificant, though the shorter stylesheet will probably be faster to
compile.

To look at it another way: do you have a performance problem? If you do,
this change isn't going to solve it. If you don't, why are you worrying
about it?

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx 




> It's obvious which one is easier to code, but which one would 
> actually parse more quickly?  In the abbreviated examples 
> below, the difference, of course would be negligible...but 
> consider a page of a few thousand lines of rendered HTML.
> 
> SCENARIO #1:
> ----------------------
> <?xml version = "1.0" encoding = "UTF-8"?>
> <xsl:stylesheet version = "1.0" xmlns:xsl = 
> "http://www.w3.org/1999/XSL/Transform">
> <xmlRoot>
> <table 
> border="1" cellspacing="1">
> <tr>
> <td>abc</td>
> </tr>
> </table>
> </xmlRoot>
> </xsl:stylesheet>
> 
> 
> SCENARIO #2:
> ----------------------
> <?xml version = "1.0" encoding = "UTF-8"?>
> <xsl:stylesheet version = "1.0" xmlns:xsl = 
> "http://www.w3.org/1999/XSL/Transform">
> <xmlRoot>
> 
> <xsl:element name="table">
> <xsl:attribute name="border">
> <xsl:text>1</xsl:text>
> </xsl:attribute>
> <xsl:attribute name="cellspacing">
> <xsl:text>1</xsl:text>
> </xsl:attribute>
> <xsl:element name="tr">
> <xsl:element name="td">
> <xsl:text>abc</xsl:text>
> </xsl:element>
> </xsl:element>
> </xsl:element>
> </xmlRoot>
> </xsl:stylesheet>
> 
> --------------------------------------------------------------
> ----------------
> This e-mail transmission may contain information that is 
> proprietary, privileged and/or confidential and is intended 
> exclusively for the person(s) to whom it is addressed. Any 
> use, copying, retention or disclosure by any person other 
> than the intended recipient or the intended recipient's 
> designees is strictly prohibited. If you are not the intended 
> recipient or their designee, please notify the sender 
> immediately by return e-mail and delete all copies. 
> 
> 
> ==============================================================
> ================
> 
> 
>  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

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.