<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/xdmp.excelConvert.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>xdmp.excelConvert</api:function-name><api:suggest>xdmp.excelconvert</api:suggest><api:suggest>xdmp</api:suggest><api:suggest>excelconvert</api:suggest><api:function-link mode="xquery" fullname="xdmp:excel-convert">/apidoc/8.0/xdmp:excel-convert.xml</api:function-link><api:function mode="javascript" name="excelConvert" type="builtin" lib="xdmp" category="Document Conversion" hidden="false" bucket="MarkLogic Built-In Functions" prefix="xdmp" namespace="http://marklogic.com/xdmp" fullname="xdmp.excelConvert"><api:summary>
  Converts a Microsoft Excel 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 Office Excel 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.xls", the
    generated names will be "myFile_xls.xhtml" for the xml node and
    "myFile_xls_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. 

    The default value is <code xmlns="http://www.w3.org/1999/xhtml">
    <span class="javascript">null</span></code>.

    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
    
    <span class="javascript">freely add <a href="./xdmp.tidy">xdmp.tidy</a>
    options.</span>
    </dd>
    <dt><p>
    <span class="javascript"><code>sheetID</code></span></p></dt>
    <dd>An integer specifying which sheet of the input Excel document
    to convert. If this option is not set, all sheets are converted. </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>
    <span class="javascript"><code>printAreaOnly</code></span></p></dt>
    <dd>Specify <code>true</code>
    to convert only the print area of the sheet.</dd>
    <dt><p>
    <span class="javascript"><code>sheetBySheet</code></span></p></dt>
    <dd>Specify <code>true</code> to produce
    one document for each sheet. 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,
    specifies to use the tidy "clean" option, and specifies to only
    convert sheet 2 of the document:
    
    <pre class="javascript">
{
  "tidy": true,
  "clean":"yes",
  "sheetID":2
}
</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_xls.xhtml&lt;/part&gt;
  &lt;part&gt;myFile_xls_parts/conv.css&lt;/part&gt;
  &lt;part&gt;myFile_xls_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_xls.xhtml" node, the third is the "myFile_xls_parts/conv.css" node,
  and the fourth is the myFile_xls_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.excelConvert(
                xdmp.documentGet("/space/Hello.xls"),
                "Hello.xls");
var manifest= results.next().value;
var excelAsXHTML = results.next().value;
excelAsXHTML;

=&gt; The excel 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>