<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/xdmp.wordConvert.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>xdmp.wordConvert</api:function-name><api:suggest>xdmp.wordconvert</api:suggest><api:suggest>xdmp</api:suggest><api:suggest>wordconvert</api:suggest><api:function-link mode="xquery" fullname="xdmp:word-convert">/apidoc/8.0/xdmp:word-convert.xml</api:function-link><api:function mode="javascript" name="wordConvert" type="builtin" lib="xdmp" category="Document Conversion" hidden="false" bucket="MarkLogic Built-In Functions" prefix="xdmp" namespace="http://marklogic.com/xdmp" fullname="xdmp.wordConvert"><api:summary>
  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.
</api:summary><api:params><api:param name="doc" type="node()" optional="false"><api:param-description>
  Microsoft Word document to convert to HTML, as binary node().
  </api:param-description><api:param-name>doc</api:param-name><api:param-type>Node</api:param-type></api:param><api:param name="filename" type="xs:string" optional="false"><api:param-description>
    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).
  </api:param-description><api:param-name>filename</api:param-name><api:param-type>String</api:param-type></api:param><api:param name="options" type="(element()|map:map)?" optional="true"><api:param-description>

    The options 
                <span class="javascript" xmlns="http://www.w3.org/1999/xhtml">object</span>
    for this conversion. 

    In addition to the options shown below, you can
    
    <span class="javascript" xmlns="http://www.w3.org/1999/xhtml">freely add <code>xdmp.tidy</code> options.</span>
    <p xmlns="http://www.w3.org/1999/xhtml">Options include:</p>
    <blockquote xmlns="http://www.w3.org/1999/xhtml"><dl>
    <dt><p>
    <span class="javascript"><code>tidy</code></span></p></dt>
    <dd>Specify <code>true</code> to run tidy on the document and
    <code>false</code> not to run tidy. If you run tidy, you can also
    specify any 
    <a class="javascript" href="./xdmp.tidy">xdmp.tidy options</a>.
    </dd>
    <dt><p>
    <span class="javascript"><code>compact</code></span></p></dt>
    <dd>Specify <code>true</code> to produce
    "compact" HTML, that is, without style information. The default is
    <code>false</code>.</dd>
    <dt><p>Sample Options:</p></dt>
    <dd>The following is a sample options 
    <span class="javascript">object</span>
    which specifies that tidy should be used to clean the generated html
    and specifies to use the tidy "clean" option for the conversion:
    
<pre class="javascript">
{
  "tidy":true,
  // "clean" is a 'tidy' package option (which is passed through) and 
  // uses "yes"/"no"
  "clean":"yes" 
}
</pre>
</dd>
    </dl>
    </blockquote>
  </api:param-description><api:param-name>options</api:param-name><api:param-type>Object?</api:param-type></api:param></api:params><api:return>ValueIterator</api:return><api:usage>
  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.
  <p xmlns="http://www.w3.org/1999/xhtml">Therefore, given the following manifest: </p>
  <pre xmlns="http://www.w3.org/1999/xhtml">
&lt;parts&gt;
  &lt;part&gt;myFile_doc.xhtml&lt;/part&gt;
  &lt;part&gt;myFile_doc_parts/conv.css&lt;/part&gt;
  &lt;part&gt;myFile_doc_parts/toc.xml&lt;/part&gt;
&lt;/parts&gt;
</pre>
  <p xmlns="http://www.w3.org/1999/xhtml">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.</p>

</api:usage><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
var results = xdmp.wordConvert(
                xdmp.documentGet("/space/Hello.doc"),
                "Hello.doc");
var manifest= results.next().value;
var wordAsXHTML = results.next().value;
wordAsXHTML;

=&gt; The word document converted as xhtml.  The results variable
   is a ValueIterator, where the first item is the manifest, and the 
   remaining items are the converted nodes.
</pre></api:example></api:function></api:function-page>