<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet href="../../make-menu.xsl" type="text/xsl"?><html>
   <head>
      <this-is section="extensions" page="functions" subpage="discarddocument"/>
      <!--
           Generated at 2011-12-09T20:47:22.916Z--><title>Saxonica: XSLT and XQuery Processing: saxon:discard-document()</title>
      <meta name="coverage" content="Worldwide"/>
      <meta name="copyright" content="Copyright Saxonica Ltd"/>
      <meta name="title"
            content="Saxonica: XSLT and XQuery Processing: saxon:discard-document()"/>
      <meta name="robots" content="noindex,nofollow"/>
      <link rel="stylesheet" href="../../saxondocs.css" type="text/css"/>
   </head>
   <body class="main">
      <h1>saxon:discard-document()</h1>
      <p><b>saxon:discard-document($doc as document-node()) ==&gt; document-node()</b></p>
      <p>This function removes a document from Saxon's internal document pool. The document
remains in memory for the time being, but will be released from memory by the Java garbage collector
when all references to nodes in the document tree have gone out of scope. This has the benefit
of releasing memory, but the drawback is that if the same document is loaded again during the same
transformation, it will be reparsed from the source text, and different node identifiers will be allocated.
The function returns the document node that was supplied as an argument, allowing it to be used in a 
call such as <code>select="saxon:discard-document(document('a.xml'))"</code>.
</p>
      <table width="100%">
         <tr>
            <td>
               <p align="right"><a class="nav" href="eval.xml">Next</a></p>
            </td>
         </tr>
      </table>
   </body>
</html>