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

Re: how to call extension function for side-effect, p

Subject: Re: how to call extension function for side-effect, portably?
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Wed, 19 Jan 2005 22:03:03 +1100
Re:  how to call extension function for side-effect
On Wed, 19 Jan 2005 00:21:12 -0000, Michael Kay <mike@xxxxxxxxxxxx> wrote:
> saxon:discard-document is deliberately designed to return the document being
> discarded, so you can wrap it round a call of document(), or any other
> reference to the document is actually being used. (It's effect isn't
> immediate, it merely marks the document as being available for garbage
> collection when no longer referenced).
> 
> In general, if you're not using the result of a function but still want it
> called, then you should try to hoodwink the optimizer into thinking that you
> are using it. If it's a Java method that returns void, call it as
> 
> <xsl:sequence select="my:call(xyz)"/>
> 
> or call it as
> 
> <xsl:if test="my:call(xyz) = -1"><a/></xsl:if>
> 
> when you know the result will never be -1.

Of course, this still doesn't guarantee any specific order of
evaluation or even if the extension function will be called only once,
or am I wrong?


Cheers,
Dimitre Novatchev

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.