Project

Profile

Help

Should copy-of work with Saxon 9.8 EE in XQuery when streaming is not requested?

Added by Martin Honnen almost 7 years ago

http://saxonica.com/html/documentation/functions/fn/copy-of.html says about the @copy-of@ function: "Since Saxon 9.6 the function is also made available in XQuery". Is that something that should hold unconditionally?

When I try



{copy-of(/root/item)[foo = 'bar']}

with Saxon-EE 9.8.0.3J from the command line (without requesting streaming) I get an error

Analyzing query from .\copy-of-test1.xquery
Static error on line 2 column 12 of copy-of-test1.xquery:
  XPST0017: Cannot find a matching 1-argument function named
  {http://www.w3.org/2005/xpath-functions}copy-of()

while 9.7 EE runs it fine.

It would make testing of code easier if copy-of were supported in all cases as then to test whether code gives the same result with or without streaming would be possible by changing the command line switch. Currently it seems I would have to edit the code to remove any copy-of call to see what the result without streaming is.

Or is the availability of @copy-of@ depending on the license type and EE-T does not support streaming in XQuery and therefore also not @copy-of@?


Replies (1)

RE: Should copy-of work with Saxon 9.8 EE in XQuery when streaming is not requested? - Added by Michael Kay almost 7 years ago

See https://saxonica.plan.io/issues/3356

As far as I can see from the code, 9.8 does not allow copy-of() or snapshot() outside an XSLT environment, regardless of streaming options.

We reorganized the mechanism for defining whcih subsets of the core functions were available in different environments in 9.8, and overlooked that we had previously diverged from the W3C specs as regards these two functions.

    (1-1/1)

    Please register to reply