<?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="doc"/>
      <!--
           Generated at 2010-10-29T18:20:48.427+01:00--><title>Saxonica: XSLT and XQuery Processing: doc</title>
      <meta name="coverage" content="Worldwide"/>
      <meta name="copyright" content="Copyright Saxonica Ltd"/>
      <meta name="title" content="Saxonica: XSLT and XQuery Processing: doc"/>
      <meta name="robots" content="noindex,nofollow"/>
      <link rel="stylesheet" href="../../saxondocs.css" type="text/css"/>
   </head>
   <body class="main">
      <h1>doc</h1>
      <p>Retrieves an XML document located at the specified URI, parses it, and returns its document node</p>
      <p class="subhead">doc($uri as xs:string?) &#8594; document-node()?</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>$uri</p>
            </td>
            <td valign="top" width="150">
               <p>xs:string?</p>
            </td>
            <td valign="top" width="200">
               <p>The URI of the required document (relative to the static base URI)</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>document-node()?</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-doc" class="bodylink">XPath 2.0 Specification</a>
         </p>
      <p>
            <a href="http://www.w3.org/TR/xpath-functions-11/#func-doc" class="bodylink">XPath 3.0 Specification</a>
         </p>
      <p class="subhead">Notes on the Saxon implementation</p>
      <p>By default the URI is dereferenced using the conventional URL behaviour, as implement by the Java runtime
      library; this behaviour can be modified by means of a user-supplied URIResolver.</p>
      <p>If the same URI is requested repeatedly, Saxon retains the document node in memory and returns the same instance each time.</p>
      <p>The way the URI is handled depends on the <code>URIResolver</code> in use. The standard
    URI resolver has an option (set using -p on the command line, or via options on the <code>Configuration</code>
    or <code>TransformerFactory</code> classes) to recognize query parameters in the URI. These are keyword=value
    pairs, separated by semicolons or ampersand characters, giving options for parsing the file located
    via the URI. The options that are then recognized are:</p>
      <ul>
         <li>
            <p>
                  <code>validation=strict|lax|preserve|strip</code>: determines how the input document will be validated.
    The options "strict" and "lax" require Saxon-EE.</p>
         </li>
         <li>
            <p>
                  <code>strip-space=yes|no|ignorable</code>: determines whether whitespace-only text nodes will be 
	stripped from the
    source document. (Such nodes are stripped if this is requested either using this option, or using
    xsl:strip-space declarations in the stylesheet.) The value "ignorable" causes whitespace text nodes
	to be stripped if they belong to an element defined in a DTD or schema as having element-only content.</p>
         </li>
         <li>
            <p>
                  <code>parser=full.class.name</code>: determines the name of the parser (XMLReader) to be used to parse this
    input file. For example, <code>parser=org.ccil.cowan.tagsoup.Parser</code> causes John Cowan's
    TagSoup parser for HTML to be used.</p>
         </li>
      </ul>
      <table width="100%">
         <tr>
            <td>
               <p align="right"><a class="nav" href="doc-available.xml">Next</a></p>
            </td>
         </tr>
      </table>
   </body>
</html>