xdmp:word-convert( $doc as node(), $filename as xs:string, [$options as (element()|map:map)?] ) as node()*
Converts a Microsoft Word document to XHTML. Returns several nodes, including a parts node, the converted document xml node, and any other document parts (for example, css files and images). The first node is the parts node, which contains a manefest of all of the parts generated as result of the conversion. Does not convert Microsoft Office 2007 and later documents.
Parameters | |
---|---|
doc | Microsoft Word document to convert to HTML, as binary node(). |
filename | The root for the name of the converted files and directories. If the specified filename includes an extension, then the extension is appended to the root with an underscore. The directory for other parts of the conversion (images, for example) has the string "_parts" appended to the root. For example, if you specify a filename of "myFile.doc", the generated names will be "myFile_doc.xhtml" for the xml node and "myFile_doc_parts" for the directory containing the any other parts generated by the conversion (images, css files, and so on). |
options |
The options node
for this conversion. The node for the options must
be in the xdmp:word-convert namespace.
In addition to the options shown below, you can
specify xdmp:tidy options by entering the
tidy option elements in the xdmp:tidy namespace.
Options include:
|
This function requires separate converter installation package in MarkLogic version 8 releases starting with 8.0-8, see MarkLogic Converters Installation Changes in Version 8 Releases Starting at 8.0-8 in the Installation Guide for All Platforms.
The convert functions return several nodes. The first node is a manifest containing the various parts of the conversion. Typically there will be an xml part, a css part, and some image parts. Each part is returned as a separate node in the order shown in the manifest.
Therefore, given the following manifest:
<parts> <part>myFile_doc.xhtml</part> <part>myFile_doc_parts/conv.css</part> <part>myFile_doc_parts/toc.xml</part> </parts>
the first node of the returned query is the manifest, the second is the "myFile_doc.xhtml" node, the third is the "myFile_doc_parts/conv.css" node, and the fourth is the myFile_doc_parts/toc.xml node.
let $results := xdmp:word-convert( xdmp:document-get("myFile.doc"), "myFile.doc" ), $manifest := $results[1] return $results[2 to last()] => all of the converted nodes