net.sf.saxon.om
Class DocumentPool
java.lang.Object
net.sf.saxon.om.DocumentPool
- Serializable
public final class DocumentPool
extends java.lang.Object
implements Serializable
An object representing the collection of documents handled during
a single transformation.
The function of allocating document numbers is performed
by the DocumentNumberAllocator in the Configuration, not by the DocumentPool. This has a
number of effects: in particular it allows operations involving multiple
documents (such as generateId() and document()) to occur in a free-standing
XPath environment.
add
public void add(DocumentInfo doc,
String uri)
Add a document to the pool
doc
- The DocumentInfo for the document in questionuri
- The document-uri property of the document.
discard
public DocumentInfo discard(DocumentInfo doc)
Release a document from the document pool. This means that if the same document is
loaded again later, the source will need to be re-parsed, and nodes will get new identities.
doc
- the document to be discarded from the pool
- the document supplied in the doc parameter
find
public DocumentInfo find(String uri)
Get the document with a given document-uri
uri
- The document-uri property of the document.
- the DocumentInfo with the given document-uri property if it exists,
or null if it is not found.
getDocumentURI
public String getDocumentURI(NodeInfo doc)
Get the URI for a given document node, if it is present in the pool. This supports the
document-uri() function.
- The uri of the document node, if present in the pool, or the systemId of the document node otherwise