Page 1 of 1

Format and Indent XQuery

Posted: Wed Jul 25, 2007 4:18 pm
by Steve Mallen
Hi,

We are using Oxygen 8.2 to run and debug XQuery against a Mark Logic 3.2 database. This works really well, but there are a couple of things that would make the experience even better:

1) It would be really great if Oxygen could format and indent XQuery code.
2) There still seems to be no XQuery validation support with Mark Logic 3.2 and Oxygen 8.2

Many thanks,
-Steve Mallen

Posted: Wed Jul 25, 2007 5:23 pm
by sorin_ristache
Hello,

Format and indent for XQuery files will be implemented in a future version of oXygen. The version number which will add this feature was not planned.

XQuery validation support can be implemented in oXygen only if the MarkLogic server has validation support. There is no version of the MarkLogic server yet with validation support.


Regards,
Sorin

Posted: Wed Jul 25, 2007 5:57 pm
by Steve Mallen
Sorin,

Many thanks for the quick reply. We will nag Mark Logic to implement validation support asap :)

-Steve/

Re: Format and Indent XQuery

Posted: Fri Nov 14, 2008 5:45 pm
by cefn
I agree that formatting XQuery is very important.

It's mainly XQuery and RelaxNG support that recommends Oxygen to our project, so it would be good to see development in this area.

Re: Format and Indent XQuery

Posted: Fri Nov 14, 2008 6:00 pm
by sorin_ristache
Hello,

Format and indent (pretty print) was not implemented yet for XQuery files but we will consider it for a future version of Oxygen.


Regards,
Sorin

Re: Format and Indent XQuery

Posted: Thu Jun 04, 2015 9:12 pm
by feickertmd
Still not done in v17!!!

Re: Format and Indent XQuery

Posted: Thu Jun 04, 2015 9:36 pm
by Costin
Hello,

Actually, format and indenting XQuery documents is already possible in version 17, for XQuery files which are in compliance with W3C XQuery 1.0, XQuery Update Facility 1.0, and XQuery 3.0 specifications.

You can pretty print XQuery documents from oXygen menu Document > Source > Format and Indent, or by using the related button in the toolbar.

The format and indent for XQuery functionality is also mentioned in our User-Guide, at:
http://www.oxygenxml.com/doc/versions/1 ... print.html

Regards,
Costin

Re: Format and Indent XQuery

Posted: Tue Jun 30, 2015 9:31 pm
by feickertmd
Thanks for the tip, Costin. Is there any way to customize the formatting? By default, it will place a line feed between curly braces and a one-line command, which I would only do for multi-line code.

So this:

Code: Select all

<name>{$person/first-name}</name>
Becomes this:

Code: Select all

<name>{
$person/first-name
}</name>

That makes the code a little harder to read at a glance. It would be better if such a format only applied for multi-line expressions, like FLOWRs.

Re: Format and Indent XQuery

Posted: Wed Jul 01, 2015 3:27 pm
by Costin
Hi,

I am happy to let you know that this behavior was also corrected in a subsequent maintenance build of oXygen (2015051321).
Here is the relevant excerpt from the build notes:
XQuery/Format and Indent: Improved line breaking when formatting expressions placed between curly brackets.
Therefore, updating to the latest build available on our website should solve the issue related to the insertion of the line feed while pretty-printing XQuery files.

Regards,
Costin