Format and Indent XQuery

Are you missing a feature? Request its implementation here.
Steve Mallen
Posts: 4
Joined: Tue Jun 19, 2007 5:27 pm
Location: Brighton

Format and Indent XQuery

Post 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
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post 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
Steve Mallen
Posts: 4
Joined: Tue Jun 19, 2007 5:27 pm
Location: Brighton

Post by Steve Mallen »

Sorin,

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

-Steve/
cefn
Posts: 15
Joined: Thu Jul 12, 2007 6:20 pm
Location: Ipswich, UK

Re: Format and Indent XQuery

Post 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.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Format and Indent XQuery

Post 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
feickertmd
Posts: 12
Joined: Tue Nov 23, 2010 8:00 pm

Re: Format and Indent XQuery

Post by feickertmd »

Still not done in v17!!!
Costin
Posts: 828
Joined: Mon Dec 05, 2011 6:04 pm

Re: Format and Indent XQuery

Post 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
Costin Sandoi
oXygen XML Editor and Author Support
feickertmd
Posts: 12
Joined: Tue Nov 23, 2010 8:00 pm

Re: Format and Indent XQuery

Post 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.
Costin
Posts: 828
Joined: Mon Dec 05, 2011 6:04 pm

Re: Format and Indent XQuery

Post 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
Costin Sandoi
oXygen XML Editor and Author Support
Post Reply