[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message]

Re: Context item dependant function in a step of apathexpression

Michael Kay mike at saxonica.com
Mon Aug 20 20:12:56 PDT 2007


  Re: Context item dependant function in a step of
	apathexpression
> As I've said, this makes perfect sense. But... I couldn't 
> find anything in the specs that could explain such a 
> behaviour. Roughly, I couldn't see anything that precisely 
> says that a path expression processing should/could be 
> stopped when a step returns an empty sequence. I conceed that 
> my interpretation of what we are dealing with might be wrong 
> though, and I'd welcome any clarification.

The XPath spec describes it fairly informally: 

Each operation E1/E2 is evaluated as follows: Expression E1 is evaluated,
and if the result is not a (possibly empty) sequence of nodes, a type error
is raised [err:XPTY0019]. Each node resulting from the evaluation of E1 then
serves in turn to provide an inner focus for an evaluation of E2...

So E2 is evaluated once for each node in the result of E1, which means that
if the result of E1 is empty, then E2 is evaluated zero times. 

The formal semantics has a more rigorous treatment.

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



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-2007 All Rights Reserved.