Loading TOC...

MarkLogic Server 11.0 Product Documentation
dbk:convert

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 "1.0-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) 
  

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.