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

RE: testing attributes

Subject: RE: testing attributes
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Thu, 19 May 2005 14:42:17 +0100
testing attributes
> <xsl:when test="count(//course) &gt; 0">
> 
> Tha's a very expensive test it causes the whole document to 
> be searched
> to arbitray depth to count all the course elements and then 
> you throw it
> all away as you don't really need them. If you are lucky your 
> system (I
> think saxon does this) will spot this idiom and change it to
> <xsl:when test="//course">
> and stop the search when it finds the first course.

That optimization competes in this case with another optimization, which is
that if your stylesheet uses the expression //course then Saxon assumes
you're likely to use it more than once and saves the result just in case.
I'm not sure which one will win in this case without trying it out.

Michael Kay
http://www.saxonica.com/

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.