Page 1 of 1

Proper set up and usage of XQuery update (Oxygen Author 17.1)

Posted: Mon Mar 06, 2017 12:50 pm
by Welblaud
I need to do some minor changes in my XML file and I know the best way to do it is simply the update function. However, I can’t make it working. I use it a lot in my eXist-db app for other cases but here I can’t even start with that.

Is it possible to do it over an actually opened file? Or is it necessary to load the file with the doc() function?

I have checked nearly twenty times there is no such a choice called Enable XQuery 1.1 for Saxon-EE in the Options, which I have read about in the forums. In the XQuery pane I have selected Saxon-EE XQuery.

When I try to use the very basic:

Code: Select all

declare namespace tei = 'http://www.tei-c.org/ns/1.0';

let $header := tei:TEI//tei:teiHeader
return
update delete node $header
… or any other simple action, it stubbornly throws:

Code: Select all

XPST0003: Unexpected token "rename nodes" beyond end of query
(I don’t know where it comes to the plural nodes but that is marginal.)

I will be very grateful for any hint how to make that working.

Honza Hejzl

Re: Proper set up and usage of XQuery update (Oxygen Author 17.1)

Posted: Mon Mar 06, 2017 12:57 pm
by Welblaud
Correcting typo: the error complaints about

Code: Select all

delete nodes
in this case but that does not matter.

Re: Proper set up and usage of XQuery update (Oxygen Author 17.1)

Posted: Mon Mar 06, 2017 1:09 pm
by Radu
Dear Honza,

If you want to run the XQuery update using Saxon 9, in the Preferences->"XML / XSLT-FO-XQuery / XQuery / Saxon-HE/PE/EE" page there is a checkbox called Enable XQuery Update.
By the way that update keyword you are using is I believe specific to Exist.
Also if you add that XML document in the Oxygen Project view, then right click it there is a "Refactoring->XML Refactoring" tool with various predefined refactoring operations already available.
These operations can be based either on XSLT or on XQuery update and you can create your own XML Refactoring operations:

https://www.oxygenxml.com/demo/XML_Refactoring.html

The plus side to using our XQuery update based refactoring operations is that the DOCTYPE declaration in the XML will be preserved.

Regards,
Radu

Re: Proper set up and usage of XQuery update (Oxygen Author 17.1)

Posted: Mon Mar 06, 2017 3:11 pm
by Welblaud
Dear Radu,

Thanks a lot for the hint about update specificity to eXist-db!

As for the settings, I can’t help, I must be blind :shock:

Here the screen:

ftp://46.28.111.241/screen-oxygen.jpg

Am I on the right place in Preferences?

Re: Proper set up and usage of XQuery update (Oxygen Author 17.1)

Posted: Mon Mar 06, 2017 3:29 pm
by Radu
Hi,

In the XSLT-FO-XQuery page there should be a subpage called XQuery, it's missing on your side...
You seem to be using XML Author (and not XML Editor) and as XML Author does not have the XQuery and XSLT editing features, some preferences pages and settings are not available when using XML Author.

Regards,
Radu