Added test cases
[SXSI/xpathcomp.git] / tests / xpath-pt / xquery / F1.xql
1 declare namespace fun = 'have.more.fun';
2
3 declare function fun:closure($input as node()*, $result as node()*) as node()*
4 {
5    let $current := $input/following-sibling::bidder[position()=1 and number(increase) <= 10]
6    let $new := $current except $result 
7    let $all := ($result,$new) 
8  
9    return
10       if(exists($new)) 
11       then ($new, fun:closure($new,$all))
12       else ()
13 };
14
15 doc()//bidder[number(increase) <= 10 and (following-sibling::bidder[position()=1 and number(increase) > 10] or fun:closure(.,())/following-sibling::bidder[position()=1 and number(increase) > 10])]