On 17/06/2011 09:56, Alexander Ulrich wrote:
Hi,

Now in more than 140 characters. I'm currently playing with Saxon's implementation 
of the higher-order features of XQuery 3.0. From Section 3.1.5.4 "Evaluating Partial 
Function Applications" I understand that both functions and function items can
be partially applied by calling them with an argument placeholder '?'.

This looks like a bug (or a feature in the spec that hasn't been implemented, depending how you look at it.)

Unfortunately the only W3C tests currently available in this area are the ones that Saxonica submitted, so if I overlook a feature then it's unlikely the tests will alert me to the fact!

Regards,

Michael Kay
Saxonica
For functions this works fine:

$ cat partial.xs 
declare function local:f($x, $y, $z) { $x + $y + $z };
let $g := local:f(23, ?, 5)
return $g(42)
$ saxon -qversion:3.0 -q:partial.xs 
Saxon evaluation license expires in 28 days
<?xml version="1.0" encoding="UTF-8"?>70

For function items resulting from an inline function however I get a syntax
error:

$ cat partial2.xs
let $f := function($x, $y, $z) { $x + $y + $z }
let $g := $f(23, ?, 5)
return $g(42) 
$ saxon -qversion:3.0 -q:partial2.xs
Saxon evaluation license expires in 28 days
Error on line 2 column 18 of partial.xs:
  XPST0003 XQuery syntax error near #... $y + $z } let $g := $f(23, ?,#:
    Unexpected token "?" in path expression
Static error(s) in query

The same error occurs for function items resulting from a literal function item:

$ cat partial3.xs 
let $f := fn:substring#3(?, 2, 4) 
return $f("foobar")
$ saxon -qversion:3.0 -q:partial3.xs 
Saxon evaluation license expires in 28 days
Error on line 1 column 25 of partial3.xs:
  XPST0003 XQuery syntax error in #let $f := fn:substring#3(?,#:
    Unexpected token "?" in path expression
Static error(s) in query

Is this an error on my side or am I misreading the standard? Admittedly, I'm
very new to XQuery...

(All using Saxon-PE 9.3.0.5J)

Best regards,
Alex
------------------------------------------------------------------------------ EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________ saxon-help mailing list archived at http://saxon.markmail.org/ saxon-help@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/saxon-help