Skip to main content

Using MarkLogic Content Pump (mlcp)

Install the transformation module

This section walks you through installing the transform module(s) created in Create the XQuery transform module or Create the JavaScript transform module.

These instructions assume you use the XDBC App Server and Documents database pre-configured on port 8000. This procedure installs the module using Query Console. You can use another method.

For more detailed instructions on using Query Console, see the Query Console User Guide.

  1. Navigate to Query Console in your browser: http://yourhost:8000/qconsole/

  2. Create a new query by clicking the "+" at the top of the query editor.

  3. Select XQuery in the Query Type dropdown.

  4. Install the XQuery and/or JavaScript module by copying one of the following scripts into the new query. Modify the first parameter of xdmp:document-load to match the path to the transform module you previously created.

    1. To install the XQuery module, use the following script:

      xquery version "1.0-ml";
      xdmp:document-load("/space/mlcp/txform/transform.xqy",
          <options xmlns="xdmp:document-load">
            <uri>/example/mlcp-transform.xqy</uri>
            <repair>none</repair>
            <permissions>{xdmp:default-permissions()}</permissions>
          </options>)
    2. To install the JavaScript module, use the following script:.

      xquery version "1.0-ml";
      xdmp:document-load("/space/mlcp/txform/transform.sjs",
          <options xmlns="xdmp:document-load">
            <uri>/example/mlcp-transform.sjs</uri>
            <repair>none</repair>
            <permissions>{xdmp:default-permissions()}</permissions>
          </options>)
  5. Select the modules database of your XDBC App Server in the Content Source dropdown at the top of the query editor. If you use the XDBC App Server on port 8000, this is the database named Modules.

  6. Click the Run button. Your module is installed in the modules database.

  7. To confirm installation of your module, click the Explore button at the top of the query editor and note your module installed with URI /example/mlcp-transform.xqy or /example/mlcp-transform.sjs.