X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=tests%2Fxpath-pt%2Fxquery%2FF2.xql;fp=tests%2Fxpath-pt%2Fxquery%2FF2.xql;h=e143a6886e7573aef8432a617ed74c403fcdf8ea;hb=0b725bb9913ff83cf73c5489f3b8582b881e6681;hp=0000000000000000000000000000000000000000;hpb=83aa6cf8a120ea6681402ce42ae56631fca1ddf4;p=SXSI%2Fxpathcomp.git diff --git a/tests/xpath-pt/xquery/F2.xql b/tests/xpath-pt/xquery/F2.xql new file mode 100644 index 0000000..e143a68 --- /dev/null +++ b/tests/xpath-pt/xquery/F2.xql @@ -0,0 +1,15 @@ +declare namespace fun = 'have.more.fun'; + +declare function fun:closure($input as node()*, $result as node()*) as node()* +{ + let $current := $input/preceding-sibling::bidder[position()=1 and number(increase) <= 10] + let $new := $current except $result + let $all := ($result,$new) + + return + if(exists($new)) + then ($new, fun:closure($new,$all)) + else () +}; + +doc()//bidder[number(increase) <= 10 and (preceding-sibling::bidder[position()=1 and number(increase) > 10] or fun:closure(.,())/preceding-sibling::bidder[position()=1 and number(increase) > 10])] \ No newline at end of file