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

RE: null call of document function

Subject: RE: null call of document function
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Mon, 9 Apr 2007 14:46:10 +0100
RE:  null call of document function
> Could you elaborate on the phrase "optimize away"? I 
> understood it all up until there.

If you write an expression and the result isn't used, the XSLT processor is
likely to generate code that doesn't actually evaluate the expression:
that's what I mean by optimizing it away. The same effect can occur at
run-time. For example, if you write

<xsl:if test="doc('a.xml') | doc('b.xml')">

then the xsl:if is testing whether the union of the two calls on doc() is
non-empty. There's a very good chance that the XSLT processor will evaluate
the first call, and if the result is non-empty it will decide that the test
is true and won't bother evaluating the second call on doc(). Which means
that if you're relying on side-effects caused by this call, you're going to
be disappointed.

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.