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

Re: Optimizing XSLT iteration

Subject: Re: Optimizing XSLT iteration
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Mon, 08 Oct 2007 01:11:15 +0200
Re:  Optimizing XSLT iteration
Hi Sujata,

See my comments below,



Sujata Gohad wrote:
In order to convert it to SVG format:

<?xml version=' 1.0' encoding='UTF-8'?>
<?xml-stylesheet href="hvm_to_svg.css" type="text/css"? >

Does this actually work? Are you calling an XSLT stylesheet as being type "text/css" and you call it ***.css? Your processor (which one are you using?) seems quite forgiving (or maybe I am missing something ;)


....
            <xsl:for-each select="component">
                <xsl:for-each select="trace">
                    <path >
                        <xsl:attribute name="class"> trace</xsl:attribute >
                        <xsl:attribute name="d">
                            <xsl:for-each select="locus[position()=1]">

This nested for-each is probably easier written and easier maintainable when you write it as apply-template/template matching pairs. This way you make use of the features of XSLT and let it choose the best execution path, instead of telling the processor what you think is best.


XSLT profiler shows that 80% of the time is spent in enumerating the
"locus" elements?

Is there a way to faster iteration of the "locus" elements?

That sounds about right. In the source snippet you showed, just about 95% of all your lines are about "locus" elements, no? So, to be fair, the processing of those elements should take about 95%, if the ratio would apply. Perhaps your code is even quicker than the apply-template approach? But I wouldn't bet on it. But even if the code runs quicker, it would still be 80% or something that is spend on the locus elements.


Cheers,
-- Abel Braaksma

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.