<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/fn.unparsedText.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>fn.unparsedText</api:function-name><api:suggest>fn.unparsedtext</api:suggest><api:suggest>fn</api:suggest><api:suggest>unparsedtext</api:suggest><api:function-link mode="xquery" fullname="fn:unparsed-text">/apidoc/8.0/fn:unparsed-text.xml</api:function-link><api:function mode="javascript" name="unparsedText" type="builtin" lib="fn" category="XSLTBuiltins" bucket="W3C-Standard Functions" hidden="false" prefix="fn" namespace="http://www.w3.org/2005/xpath-functions" fullname="fn.unparsedText"><api:summary>
  Reads a file stored in the database as either text or binary file and
  returns its contents as a string.
</api:summary><api:params><api:param name="href" type="xs:string" optional="false"><api:param-description>
  The $href is a string containing a URI reference. It must identify a resource
  that can be read as text. If the URI is a relative URI then it is resolved
  relative to the base URI from the static context.
  </api:param-description><api:param-name>href</api:param-name><api:param-type>String</api:param-type></api:param><api:param name="encoding" type="xs:string" optional="true"><api:param-description>
  If $encoding parameter is present and the URI points to a "text" file, the
  encoding is ignored since all the files are in UTF-8 in the database. However,
  if the URI points to a binary file, then an attempt is made to convert
  it from the specified encoding and the string value of the results of the
  conversion is returned. If the conversion fails, an exception is returned.
  The $encoding parameter must be passed when the URI resolves to a binary
  resource.  An automatic encoding detector will be used if the
  value <code xmlns="http://www.w3.org/1999/xhtml">auto</code> is specified.  If $encoding is not present, 
  the encoding defaults to UTF-8.
  </api:param-description><api:param-name>encoding</api:param-name><api:param-type>String</api:param-type></api:param></api:params><api:return>String?</api:return><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
fn.unparsedText("http://marklogic.com/test.xml","UTF-8");
</pre>
</api:example></api:function></api:function-page>