SAXONICA

Saxon Documentation
Full Contents
About Saxon
Changes in this Release
Conditions of Use
Using XSLT 2.0
Using XQuery
Handling Source Documents
XML Schema Processing
The XPath API
Saxon on .NET
Extensibility
Saxon Extensions
| Introduction
| EXSLT Extensions
| Extension attributes (XSLT only)
| Additional serialization parameters
» | Extension functions
| Extension instructions
Sample Saxon Applications
The Saxon SQL Extension
XSLT Elements
XPath 2.0 Expression Syntax
Function Library
Standards Conformance

# saxon:discard-document()

discard-document(document-node())

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 `select="saxon:discard-document(document('a.xml'))"`.

Next