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

RE: saxon:try()

Subject: RE: saxon:try()
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Fri, 4 Jan 2008 14:59:50 -0000
RE:  saxon:try()
>     Florent>   But I think that the ex:error-safe instruction should
>     Florent> be exactly predictable, deterministic.  If an expression
>     Florent> stands lexically outside of the instruction, if it
>     Florent> produces an exception, it shouldn't be caught (but that's
>     Florent> only my humble point of view).
> 
> But that goes against the declarative nature of XSLT.
> 
> xsl:variable declares the definition of a value. It doesn't 
> indicate execution at all.
> 
> The reference to the variable, which is inside the ex:try, is 
> the most logical place to think of the evaluation occuring.

You can do it that way - treating a variable reference rather like a
function call - but it gets difficult if one reference to a variable is
inside a try/catch and another isn't (or is in a different try/catch). Do
you catch the error twice? 

I think it's easier to use the more conventional model where the variable is
treated as if it is eagerly evaluated. That doesn't actually stop lazy
evaluation internally - you just have to make the try/catch environment of
an expression part of the closure that you retain until the evaluation is
performed, just as you retain the other parts of its context already.

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.