Page 1 of 1

XQuery Outline view does not show annotated functions

Posted: Sun Jan 13, 2013 1:03 pm
by jakubm
When I add annotations to my functions, I no longer see the functions in Outline view.

Particularly the annotations from restxq namespace (http://exquery.org/ns/restxq, see http://exquery.github.com/exquery/exque ... ation.html).

declare
%rest:path(...)
%rest:GET
function myns:foo(...)
{

};

=> myns:foo is not shown in Outline.

Re: XQuery Outline view does not show annotated functions

Posted: Mon Jan 14, 2013 6:49 pm
by adrian
Hello,

Unfortunately, currently(v14.1) Oxygen is not aware of such annotations and the Outline view breaks when encountering one.
I've submitted a request on our issue tracking tool to support them in a future version of Oxygen.

But I'm curious, how do you validate such an XQuery, or how do you use it in Oxygen?
Saxon 9 PE/EE doesn't seem to validate or process an XQuery file with such annotations.

Regards,
Adrian

Re: XQuery Outline view does not show annotated functions

Posted: Mon Jan 14, 2013 7:14 pm
by jakubm
This is a RESTXQ function stored in eXist DB (eXist DB supports RESTXQ).

I have oXygen connected to eXist database, but since it is a REST interface, the query is run by eXist when a certain REST request is recieved by the RESTXQ module. It is not usually "run" from oXygen adhoc (but even RESTXQ module can be imported by other modules and in that case the functions can be used as any other functions). When I use custom transformation scenario with exist 2.0 driver, these functions can be loaded just fine.

Annotations are a part of XQuery 3.0 (http://www.w3.org/TR/xquery-30/#id-annotations) and Saxon and other processors will probably come with annotations of their own (at least %private, which is defined in the spec). With other annotations, the best strategy for oXygen is probably to ignore them, but in some cases, oXygen might not be able to execute the annotated function. This will be the case of annotations such as
%java:method("java.lang.Math.sin") (example from the spec)
which actually tells the processor to call a Java function instead of the XQuery expression in the body of the function.

Nevertheless, there is no reason why Outline view should not work for annotated functions.

Re: XQuery Outline view does not show annotated functions

Posted: Tue Jan 15, 2013 6:51 pm
by adrian
Hi,

Thank you for the detailed explanation. I've mentioned it on our issue tracking tool.

Regards,
Adrian

Re: XQuery Outline view does not show annotated functions

Posted: Fri Jun 26, 2015 2:31 pm
by Radu
Hi,

Just to update this thread, the issue should be fixed in Oxygen 17.0.

Regards,
Radu