Page 1 of 1

xquery editor xquery version support

Posted: Fri Feb 26, 2010 10:25 pm
by spencerb
Let me start by saying I'm not sure this is the right place to post this question. I am using the oXygen XQuery editor (in the eclipse plug in, but I've seen this issue in oXygen as well) to create my xquery code. I am writing code with the version: xquery version "1.0-ml". Apparently this editor doesn't support this version of xquery as the version is underlined in red by the editor and I get this error:

[Saxon-PE XQuery 9.2.0.3] XQuery static error in #xquery version "1.0-ml";#: Unsupported XQuery version 1.0-ml

My question: Is 1.0-ml not yet supported, and if so are there plans for it to be? (in other words...don't worry about it) Or is it that I have my environment set up incorrectly and there is something I need to do so the version is recognized?

Re: xquery editor xquery version support

Posted: Mon Mar 01, 2010 6:57 pm
by adrian
Hello,

"1.0-ml" is the XQuery syntax used by MarkLogic for which Oxygen offers content completion but no validation.
As far as I know the MarkLogic XCC API which is used in Oxygen still doesn't offer validation support. When the API will have validation, we will add support for it in Oxygen.

Now, to get the content completion support in Oxygen you need to create a MarkLogic data source:
http://www.oxygenxml.com/doc/ug-oxygen/ ... datasource

and database connection:
http://www.oxygenxml.com/doc/ug-oxygen/ ... ction.html

Then create a transformation scenario(Document -> Transformation -> Configure Transformation Scenario, New) and select the MarkLogic database connection from the Transformer combo. Close all dialogs with OK.

As a result of the association with the above transformation scenario the validation will report that "Validation support is not available" but invoking the content completion(Ctrl + Space) should provide a list of the MarkLogic supported functions and namespace prefixes. They are provided by Oxygen, the MarkLogic server is not queried.

Let us know if you need further information.

Regards,
Adrian

Re: xquery editor xquery version support

Posted: Mon Mar 01, 2010 9:25 pm
by spencerb
Adrian,

Thank you for your response! It has been very helpful. I'm very excited about having code completion. One question though. Is there any way to apply this transform to all XQuery files in a directory or do I need to apply the transform every time I open a new XQuery file and also on all the existing files?

Re: xquery editor xquery version support

Posted: Tue Mar 02, 2010 1:29 am
by spencerb
So I was poking around the <oXygen/> plug-in and realized that you can apply a transformation to a folder, not just the file. Awesome. Thanks so much Adrian. The only questions I have now are 1) is it possible to get content completion in my own namespaces (short of writing my own XCC)? and 2) Where is the more appropriate place to post these questions?

Re: xquery editor xquery version support

Posted: Tue Mar 02, 2010 12:14 pm
by adrian
Hi,

You can either apply a transformation scenario to a folder or associate it to the folder for future transformations. Just right click on a folder in Project view, Configure Transformation Scenario, select a scenario and press OK. Be aware that the scenario will be associated with all files inside that folder even if they are of a different content type for which the transformation type would not apply.

1. The list of proposed functions and namespaces is hard-coded for a specific XQuery engine(database connection) type. However you can declare namespaces and functions in a module and then import the module in the current XQuery and all the namespaces and functions should be offered in the content completion list.

2. Questions and feedback can be addressed to support (at) oxygenxml.com

Regards,
Adrian