MarkLogic Support


This tutorial shows you, step by step, how to configure the MarkLogic support in oXygen XML Editor, browse and edit resources through WebDAV, as well as running XQuery interrogations.

An XDBC application server must be running in order to be able to connect to the MarkLogic server using oXygen. More information about how to configure an XDBC server can be found in MarkLogic documentation: oXygen uses XCC connector to interact with MarkLogic XDBC server and requires the basic authentication schema to be set. Starting with version MarkLogic 4.0 the default authentication method when you create a HTTP or WebDAV Server is digest, so make sure to change it to basic.

The tutorial assumes that you have a basic knowledge of databases, XML technologies and of oXygen XML Editor tool. The explanations and screenshots are given for the standalone version of oXygen XML Editor. However the same set of features are available in Eclipse plugin version of the product with minor interface differences.

How to Configure the MarkLogic Support in oXygen

oXygen currently supports MarkLogic version 4.0 or higher. Debugging is available only starting with MarkLogic 4.0 or higher.

To connect oXygen to a MarkLogic database, you need to configure a 'data source' and a 'connection'.

To configure the data source, you need the MarkLogic driver, available at:

Then go to Preferences / Data Sources and press the New button (the icon that looks like a plus sign). Insert a unique data source name and select MarkLogic in the Type drop-down list.

MarkLogic Data Source Configuration Dialog

Press the Add Files button and add the following MarkLogic specific driver file:

  • marklogic-xcc-{server_version}

More information about configuring a MarkLogic datasource can be found in the user manual:

Once you have created the data source you may proceed further by defining one or more connection based on it. The connections can be configured on the same Preferences / Data Source page.

MarkLogic Connection Configuration Dialog

Start by choosing a unique connection name and set the Data Source combo box to the preconfigured MarkLogic data source. In the XDBC Host field specify the name or IP address of the XDBC server.

In the WebDAV URL field you can specify an URL pointing to a MarkLogic WebDAV server. This URL will be used for browsing and editing resource. The WebDAV URL has the following structure: http://<host>:<port>.

Sometimes you need to work with two database servers (for example, a development sever and a production server) so it makes sense to define a connection on each database server to be further used when executing XQuery or browsing/editing the database resources. If the two database servers have the same version you only need to configure a data source and add two connections for it.

Data Source Explorer View

Once we finished the configuration of the connection (and have specified a WebDAV URL) we are able to browse the database content using the Data Source Explorer view from the Database perspective.

Database Perspective

XQuery Support

MarkLogic supports XQuery interrogations over the stored XML content. For example, if you want to create a XQuery to generate a report with the billing contact data from the latest purchase notifications. You can open an XQuery editor (New / XQuery), configure the transformation scenario to match the MarkLogic connection for the transformer field, write the XQuery and then execute it.

When editing MarkLogic XQuery modules, the Content Completion Assistant presents the latest built-in XQuery functions in accordance with the server version.

MarkLogic XQuery Support

Remote XQuery Debugging on MarkLogic Server

XQuery Debugger for MarkLogic

oXygen enables debugging of real applications that use XQuery (for example, web applications that trigger XQuery executions). oXygen connects to a MarkLogic server, shows you the running XQuery scripts and allows you to debug them. By setting the server in debug mode you will be able to intercept all the XQuery scripts run on that server.

The remote debugging support allows also collaborative debugging, two or more developers can connect to the same debugging session.

When entering in the XQuery Debugging mode oXygen provides a special layout that display the XML source (optional) and the XQuery documents side by side. It can also show the debugging output and specific XQuery debugging views and toolbars that allow you to set breakpoints, inspect variable bindings, evaluate expressions in the request context.

MarkLogic XQuery Debugger

More details about the oXygen Xquery Debugger can be found here:

Video Tutorials
Upcoming Events
Content Management Strategies/DITA North America 2015
DITA North America 2015
April 20-22, 2015
Chicago, Illinois, US
" oXygen XML Editor is the premier text editor for XML geeks, and an indispensable tool for O'Reilly's Production group. My team uses oXygen XML Editor for everything from simple XML editing to Schema validation and XSLT transformations. The digital production staff especially loves oXygen's built-in EPUB support, which eliminates a great deal of the grunt work that is usually entailed in editing EPUB files. The more we use oXygen, the more realize what a powerful tool it can be in digital and XML-based workflows."
Adam Witwer
Director of Content and Publishing Operations
O'Reilly Media