Helen
Helen

Reputation: 171

writing xquery that can search all documents in marklogic using oxygenXML

I'm using marklogicn 9.0-8 on windows 10. I have oxygenXML editor 21 enterprise version. I want to use oxygen connecting to marklgoc, then I can write xquery code inside oxygen, this xquery code can search/look at all the documents inside marklogic database through the connection, not just doing transform for one xml file.

I'm not sure how to configure the oxygen to marklogic and how to make it work. It seems that I wrote an xquery code, and when I run it, it always ask for an xml file to do transform. But I want the xquery code to just run against all the documents inside the marklogic database.

Does anyone have any resources/videos that can show how to do this? I'm not even sure if oxygenXML can support xquery to work on all documents inside marklogic database.

Thanks, helen

Upvotes: 1

Views: 205

Answers (2)

Shon
Shon

Reputation: 700

SyncroSoft have posted instructions on configuring a MarkLogic connection for the Enterprise edition:

https://www.oxygenxml.com/doc/versions/21.0/ug-editor/topics/configure-marklogic-connection.html

Basically you want to configure your MarkLogic instance as a Data Source in oXygen XML Preferences, by adding it as a Data Source and entering the correct authentication credentials.

You can then use your new Data Source in Database Explorer, in query executions and transformation scenarios, and even in the XQuery Debugger Perspective; you can view a video tutorial for remote debugging:

https://www.oxygenxml.com/doc/versions/21.0/ug-editor/topics/xquery-debugging-with-marklogic.html

Please be aware there's a crucial step I don't see covered in the above instructions which is that you'll need to grab from MarkLogic's site the XCC.jar to enable the XML Contentbase Connector:

https://developer.marklogic.com/products/xcc

Note: The marklogic-xcc-9.0.x.jar file must be added to your CLASSPATH.

According to the MarkLogic XCC Developer's Guide, XDBC and XCC use the same wire protocol to communicate with MarkLogic Server.

You'll then be able to execute queries against a database as configured in your XDBC server specifications directly within oXygen--just as you would with MarkLogic's Query Console.

Upvotes: 2

Radu Coravu
Radu Coravu

Reputation: 1924

The first thing you must do is to create an MarkLogic connection. Afterwards, create or open an XQuery file. Create an XQuery transformation scenario and make sure to select the name of the MarkLogic connection as the "Transformer". Afterwards, just run the transformation scenario and the XQuery will actually query the database.

The Xpath/XQuery Builder view in Oxygen can also be used to execute queries against the MarkLogic server.

Upvotes: 0

Related Questions