<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet href="../../make-menu.xsl" type="text/xsl"?><html>
   <head>
      <this-is section="functions" page="intro" subpage="unparsed-text"/>
      <!--
           Generated at 2010-10-29T18:20:48.427+01:00--><title>Saxonica: XSLT and XQuery Processing: unparsed-text</title>
      <meta name="coverage" content="Worldwide"/>
      <meta name="copyright" content="Copyright Saxonica Ltd"/>
      <meta name="title" content="Saxonica: XSLT and XQuery Processing: unparsed-text"/>
      <meta name="robots" content="noindex,nofollow"/>
      <link rel="stylesheet" href="../../saxondocs.css" type="text/css"/>
   </head>
   <body class="main">
      <h1>unparsed-text</h1>
      <p>Returns the contents of an external text file, given its URI. The function attempts
    to infer the encoding. First it looks in the HTTP headers if available. Then it examines the start
    of the file looking first for a byte-order-mark, and failing that for an XML declaration. If none
    of this works, it assumes the encoding is UTF-8.</p>
      <p class="subhead">unparsed-text($href as xs:string?) &#8594; xs:string?</p>
      <table>
         <tr>
            <td width="470" align="left" colspan="4" style="border-top:solid 1px #3D5B96; ">
               <p>
                     <i>Arguments</i>
                  </p>
            </td>
         </tr>
         <tr>
            <td width="40">
               <p> </p>
            </td>
            <td width="80" valign="top">
               <p>$href</p>
            </td>
            <td valign="top" width="150">
               <p>xs:string?</p>
            </td>
            <td valign="top" width="200">
               <p/>
            </td>
         </tr>
         <tr>
            <td colspan="2"
                style="border-top:solid 1px #3D5B96; border-bottom:solid 1px #3D5B96;">
               <p>
                     <i>Result</i>
                  </p>
            </td>
            <td style="border-top:solid 1px #3D5B96; border-bottom:solid 1px #3D5B96;"
                colspan="2">
               <p>xs:string?</p>
            </td>
         </tr>
      </table>
      <p class="subhead">unparsed-text($href as xs:string?, $encoding as xs:string) &#8594; xs:string?</p>
      <table>
         <tr>
            <td width="470" align="left" colspan="4" style="border-top:solid 1px #3D5B96; ">
               <p>
                     <i>Arguments</i>
                  </p>
            </td>
         </tr>
         <tr>
            <td width="40">
               <p> </p>
            </td>
            <td width="80" valign="top">
               <p>$href</p>
            </td>
            <td valign="top" width="150">
               <p>xs:string?</p>
            </td>
            <td valign="top" width="200">
               <p/>
            </td>
         </tr>
         <tr>
            <td width="40">
               <p> </p>
            </td>
            <td width="80" valign="top">
               <p>$encoding</p>
            </td>
            <td valign="top" width="150">
               <p>xs:string</p>
            </td>
            <td valign="top" width="200">
               <p/>
            </td>
         </tr>
         <tr>
            <td colspan="2"
                style="border-top:solid 1px #3D5B96; border-bottom:solid 1px #3D5B96;">
               <p>
                     <i>Result</i>
                  </p>
            </td>
            <td style="border-top:solid 1px #3D5B96; border-bottom:solid 1px #3D5B96;"
                colspan="2">
               <p>xs:string?</p>
            </td>
         </tr>
      </table>
      <p class="subhead">Links to W3C specifications</p>
      <p>Namespace: http://www.w3.org/2005/xpath-functions</p>
      <p>Applies to: XPath 2.0, XSLT 2.0, XQuery 1.0 and later versions</p>
      <p>
            <a href="http://www.w3.org/TR/xpath-functions/#func-unparsed-text"
            class="bodylink">XPath 2.0 Specification</a>
         </p>
      <p>
            <a href="http://www.w3.org/TR/xpath-functions-11/#func-unparsed-text"
            class="bodylink">XPath 3.0 Specification</a>
         </p>
      <p class="subhead">Notes on the Saxon implementation</p>
      <p>The current Saxon implementation is not stable: if the function is called twice with the same
         argument, it will read the external file twice, and may return different results if it has changed.</p>
      <table width="100%">
         <tr>
            <td>
               <p align="right"><a class="nav" href="unparsed-text-available.xml">Next</a></p>
            </td>
         </tr>
      </table>
   </body>
</html>