<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/xdmp.gunzip.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>xdmp.gunzip</api:function-name><api:suggest>xdmp.gunzip</api:suggest><api:suggest>xdmp</api:suggest><api:suggest>gunzip</api:suggest><api:function-link mode="xquery" fullname="xdmp:gunzip">/apidoc/8.0/xdmp:gunzip.xml</api:function-link><api:function mode="javascript" name="gunzip" type="builtin" lib="xdmp" category="Document Conversion" hidden="false" bucket="MarkLogic Built-In Functions" prefix="xdmp" namespace="http://marklogic.com/xdmp" fullname="xdmp.gunzip"><api:summary>
  Get a node from a gzip node. Gunzips and returns the file in
  memory as a document node (for XML and JSON formats), a text node (for text formats),
  or a binary node (for binary formats).
  The format is determined by the <code xmlns="http://www.w3.org/1999/xhtml">format</code> option.
</api:summary><api:params><api:param name="gzipnode" type="binary()" optional="false"><api:param-description>
    The gzip node.
  </api:param-description><api:param-name>gzipnode</api:param-name><api:param-type>binary()</api:param-type></api:param><api:param name="options" type="(element()|map:map)?" optional="false"><api:param-description>
    The options 
                <span class="javascript" xmlns="http://www.w3.org/1999/xhtml">object</span>
    for gunzipping this gzip document.
    

    <p xmlns="http://www.w3.org/1999/xhtml">The 
           <code class="javascript">xdmp.gunzip</code>
       options include:
    </p>
    <blockquote xmlns="http://www.w3.org/1999/xhtml"><dl>
    <dt>
    
    <p class="javascript">defaultNamespace</p>
    </dt>

    <dd>(XML only) The namespace to use if there is no namespace at the root node of
    the document. The default value is "".</dd>

    <dt>
    <p class="javascript">repair</p></dt>
    <dd>A value of <code>full</code> specifies that malformed XML
        content be repaired.  A value of <code>none</code> specifies that
        malformed XML content is rejected. If no repair option is explicitly specified, 
        the default is implicitly specified by the 
        
        <p class="javascript">language of the caller. From JavaScript, 
        if no repair option is explicitly specified, the default is <code>none</code>.</p>
        This option has no effect on binary, text or JSON documents.</dd>

    <dt><p class="javascript">format</p></dt>
    <dd>A value of <code>text</code> specifies to get the document as a
        text document, regardless of the URI specified. A value of
        <code>binary</code> specifies to get the document as a binary
        document, regardless of the URI specified. A value of <code>xml</code>
        specifies to get the document as an XML document, regardless of the
         URI specified. A value of <code>json</code> specifies to get the document as
         a JSON document, regardless of the URI specified.
    </dd>
    <dt>
        <p class="javascript">defaultLanguage</p>
    </dt>
    <dd>(XML only) The language to specify in an <code>xml:lang</code> attribute
    on the root element node if the root element node does not already have
    an <code>xml:lang</code> attribute. If this option is not specified, then
    nothing is added to the root element node.</dd>
    <dt>
        <p class="javascript">encoding</p>
    </dt>
    <dd>Specifies the encoding to use when reading the document into MarkLogic
    Server.  Supported values include <code>UTF-8</code> and
    <code>ISO-8859-1</code>.  All encodings will be translated into UTF-8
    from the specified encoding.  The string specified for the
    <code>encoding</code> option will be matched to an encoding name according
    to the Unicode Charset Alias Matching rules
    (<a href="http://www.unicode.org/reports/tr22/#Charset_Alias_Matching">http:
    //www.unicode.org/reports/tr22/#Charset_Alias_Matching</a>).
    An automatic encoding detector will be used if the value <code>auto</code>
    is specified.
    If no encoding can be detected, the encoding defaults to UTF-8.
    If no encoding option is specified, the encoding defaults to the
    encoding specified in the http header (if using with one of the http
    functions, for example, 
                            <code class="javascript">xdmp.httpGet</code>),
    otherwise it defaults
    to UTF-8; any encoding http headers are ignored if there is any
    value specified for the <code>encoding</code> option.</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>
  <p xmlns="http://www.w3.org/1999/xhtml"> You must tell the format of the node after gunzipping.
  You need to specify a <code>format</code> in the <code>options</code>
  <span class="javascript">object</span> </p>
</api:usage><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
xdmp.gunzip(fn.doc("/gzip/tmp.gz"),
  {
    "format" : "binary"
  })

=&gt; the gunzip node from the "/gzip/tmp.gz" gzip node

</pre></api:example></api:function></api:function-page>