xsl-list
[Top] [All Lists]

RE: testing attributes

2005-05-19 06:42:17
<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/



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>