<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/xdmp.unquote.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>xdmp.unquote</api:function-name><api:suggest>xdmp.unquote</api:suggest><api:suggest>xdmp</api:suggest><api:suggest>unquote</api:suggest><api:function-link mode="xquery" fullname="xdmp:unquote">/apidoc/8.0/xdmp:unquote.xml</api:function-link><api:function mode="javascript" name="unquote" type="builtin" lib="xdmp" category="Extension" subcategory="XML" hidden="false" bucket="MarkLogic Built-In Functions" prefix="xdmp" namespace="http://marklogic.com/xdmp" fullname="xdmp.unquote"><api:summary>
  Parses a string as XML, returning one or more document nodes.
</api:summary><api:params><api:param name="arg" type="xs:string"><api:param-description>
    Input to be unquoted.
  </api:param-description><api:param-name>arg</api:param-name><api:param-type>String</api:param-type></api:param><api:param name="default-namespace" type="xs:string?" optional="true"><api:param-description>
    Default namespace for nodes in the first parameter.
  </api:param-description><api:param-name>default-namespace</api:param-name><api:param-type>String?</api:param-type></api:param><api:param name="options" type="xs:string*" optional="true"><api:param-description>
    The options for getting this document.
    The default value is ().
    <p xmlns="http://www.w3.org/1999/xhtml">Options include:</p>
    <blockquote xmlns="http://www.w3.org/1999/xhtml"><dl>
    <dt>"repair-full"</dt>
    <dd>Specifies that malformed XML content be repaired.
        XML content with multiple top-level elements will be
        parsed as multiple documents.
        This option has no effect on binary or text documents.</dd>
    <dt>"repair-none"</dt>
    <dd>Specifies that malformed XML content be rejected.
        XML content will be parsed as a single document, so
        a maximum of one document node will be returned.
        This option has no effect on binary or text documents.</dd>
    <dt>"format-text"</dt>
    <dd>Specifies to get the document as a text document,
        regardless of the URI specified.</dd>
    <dt>"format-binary"</dt>
    <dd>Specifies to get the document as a binary document,
        regardless of the URI specified.</dd>
    <dt>"format-xml"</dt>
    <dd>Specifies to get the document as an XML document,
        regardless of the URI specified.</dd>
    <dt>"format-json"</dt>
    <dd>Specifies to get the document as a JSON document,
        regardless of the URI specified.</dd>
    <dt>"default-language=<em>xx</em>"</dt>
    <dd> If the root element node specified in the first parameter does not
    already have an <code>xml:lang</code> attribute, the language to
    specify in an <code>xml:lang</code> attribute on the root element node.
    If <code>default-language</code> is not specified, then nothing is
    added to the root element node. Some examples are
    <code>default-language=en</code> and <code>default-language=fr</code>.</dd>
    </dl></blockquote>
  </api:param-description><api:param-name>options</api:param-name><api:param-type>String[]</api:param-type></api:param></api:params><api:return>ValueIterator</api:return><api:usage>
  <p xmlns="http://www.w3.org/1999/xhtml">If no format is specified in $options, it is inferred from the input.
  If the first non-whitespace character is either '{' or '[' it is JSON.
  Otherwise it is XML.</p>
  <p xmlns="http://www.w3.org/1999/xhtml">If neither "repair-full" nor "repair-none" is present,
  the default is specified by the XQuery version of the caller.
  In XQuery version <code>1.0</code> and <code>1.0-ml</code> the default is
  "repair-none".  In XQuery version <code>0.9-ml</code> the default is
  "repair-full".</p>
  <p xmlns="http://www.w3.org/1999/xhtml">If $arg is the empty string, <code>xdmp:unquote</code> returns an empty
  document node.</p>
</api:usage><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
xdmp.unquote("&lt;foo/&gt;");
=&gt; &lt;foo/&gt;
  It returns this as a document node.
</pre></api:example><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
  xdmp.unquote('&lt;foo&gt;hello&lt;/foo&gt;', null,
          ["repair-none", "default-language=en"]);
  =&gt; &lt;foo xml:lang="en"&gt;hello&lt;/foo&gt;
  It returns this as a document node and does
  not perform tag repair on the node.
</pre></api:example><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
  xdmp.unquote('&lt;foo&gt;hello&lt;/foo&gt;', "bar",
          ["repair-none", "default-language=en"]);
  =&gt; &lt;foo xml:lang="en" xmlns="bar"&gt;hello&lt;/foo&gt;
  It returns this as a document node and does
  not perform tag repair on the node.  Note that
  the node is in the "bar" namespace.
</pre></api:example></api:function></api:function-page>