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

Focus & function callsites

John Snelson john.snelson at oracle.com
Fri Feb 15 14:55:02 PST 2008


  Focus & function callsites
Hi Frans,

You have not taken into account the document order sort and duplicate 
elimination that happens because local:function() is called on the right 
hand side of the "/" operator. This eliminates one of the results that 
you were expecting to see.

John

Frans Englich wrote:
> Hi,
> 
> I need a hand here, what is this query supposed to evaluate to?
> 
> 	declare variable $root := <root><c/></root>;
> 
> 	declare function local:function($arg)
> 	{
> 	    $root[$arg]
> 	};
> 
> 	$root//local:function(.)
> 
> My conclusion is(ignoring whitespace):
> 
> <root>
>     <c/>
> </root>
> <root>
>     <c/>
> </root>
> 
> because $root// returns two nodes: <root><c/> and <c/>, and hence 
> local:function is invoked twice with $arg being those values.
> 
> Since the effective boolean value of a node is true, $root is returned both 
> times.
> 
> X-Hive & Saxon disagree with me. What am I missing?
> 
> 
> Cheers,
> 
> 		Frans
> _______________________________________________
> http://x-query.com/mailman/listinfo/talk
> http://x-query.com/mailman/listinfo/talk


-- 
John Snelson, Oracle Corporation            http://snelson.org.uk/john
Berkeley DB XML:        http://www.oracle.com/database/berkeley-db/xml
XQilla:                                  http://xqilla.sourceforge.net


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.