Comment 2 for bug 1070704

Revision history for this message
Sorin Marian Nasoi (sorin.marian.nasoi) wrote :

I have committed a partial fix for the reported issue.

The problem with enabling the FOTS feature will be fixed only after the HOF is fully implemented and enabled by default thus not needing the additional "declare option hof".

Please see detail below.

Here is what happens:
wrt.
"As a note - the "declare option" and associated namespaces are actually not required in the test query at all"
Not actually true: as a general rule whenever a test has a dependency on XQuery 3.0, the Zorba FOTS adds both:
- the XQuery 3.0 declaration (if the test does not have it already)
- the "declare option hof"
That is because one does not know if the query actually uses a HOF function thus really needing the "declare option hof" or not.
Checking if the test is using a HOF functionality would be a very time consuming operation because it would have to be done for all tests that have a XQuery 3.0 dependency.
But this would not solve the issue from the reported test case because:

the first part is indeed added by the Zorba FOTS driver:

import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq';
   .....
variable $queryID := xqxq:prepare-main-module('
xquery version ''3.0'';

declare namespace op = ''http://www.zorba-xquery.com/options/features'';
declare namespace f = ''http://www.zorba-xquery.com/features'';
declare option op:enable ''f:hof'';

and the second part comes from the test itself that can not be changed:
import schema namespace s="http://www.w3.org/XQueryTest/substitution";
[...]