This page was generated
July 7, 2010
4:03 PM
XQuery Built-In and Modules Function Reference

Module: DocBook Conversion

The DocBook conversion module is part of the conversion processing pipeline. These functions are used to manipulate DocBook as part of conversion processing.

To use the DocBook module as part of your own XQuery module, include the following line in your XQuery prolog:

import module namespace dbk = "http://marklogic.com/cpf/docbook" at "/MarkLogic/conversion/docbook.xqy"

You will need to ensure that the DocBook module is loaded into the same modules database as the importing module.

The library namespace prefix dbk is not predefined in the server.

Function Summary
dbk:convert Convert XHTML to DocBook lite vocabulary, if possible.
Function Detail
dbk:convert(
$doc as node()?,
$options as element()?
)  as   node()*
Summary:

Convert XHTML to DocBook lite vocabulary, if possible. The section structuring depends on the presence of div elements with mlsection markers, as produced by xhtml:restructure.

Parameters:
$doc : The contents of the XHTML document.
$options : Conversion options in the "dbk:docbook" namespace. There are two options are defined: "wrap-text", a boolean value which causes "phrase" elements to be inserted where XHTML "span" elements were found. The default is false. "preserve-styles", a boolean value which causes the XHTML "class" attributes to be mapped to "role" attributes in the output. The default is false.

Example:
  xquery version "0.9-ml"
  import module namespace dbk = "http://marklogic.com/cpf/docbook" 
		  at "/MarkLogic/conversion/docbook.xqy"

  let $options := 
     <options xmlns="dbk:convert">
       <wrap-text>false</wrap-text>
       <preserve-styles>true</preserve-styles>
     </options>
  return dbk:convert(fn:doc("http://example.com/mydoc.xhtml"), $options)