XQuery Outline view does not show annotated functions

Issues related to W3C XQuery.
jakubm
Posts: 12
Joined: Sun Jan 15, 2012 3:48 pm

XQuery Outline view does not show annotated functions

Post 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.
adrian
Posts: 2855
Joined: Tue May 17, 2005 4:01 pm

Re: XQuery Outline view does not show annotated functions

Post 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
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
jakubm
Posts: 12
Joined: Sun Jan 15, 2012 3:48 pm

Re: XQuery Outline view does not show annotated functions

Post 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.
adrian
Posts: 2855
Joined: Tue May 17, 2005 4:01 pm

Re: XQuery Outline view does not show annotated functions

Post by adrian »

Hi,

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

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Radu
Posts: 9057
Joined: Fri Jul 09, 2004 5:18 pm

Re: XQuery Outline view does not show annotated functions

Post by Radu »

Hi,

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

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply