com.icl.saxon.jdom

Class DocumentWrapper

public class DocumentWrapper extends NodeWrapper implements DocumentInfo

The root node of an XPath tree. (Or equivalently, the tree itself).

This class should have been named Root; it is used not only for the root of a document, but also for the root of a result tree fragment, which is not constrained to contain a single top-level element.

Author: Michael H. Kay

Field Summary
protected StringbaseURI
protected HashtablekeyTable
protected NamePoolnamePool
Constructor Summary
DocumentWrapper(Document doc, String baseURI)
Method Summary
HashtablegetKeyIndex(KeyManager keyManager, int fingerprint)
Get the index for a given key
NamePoolgetNamePool()
Get the name pool used for the names in this document
StringgetUnparsedEntity(String name)
Get the unparsed entity with a given name
NodeInfoselectID(String id)
Get the element with a given ID, if any
voidsetKeyIndex(KeyManager keyManager, int fingerprint, Hashtable index)
Set the index for a given key
voidsetNamePool(NamePool pool)
Set the name pool used for all names in this document

Field Detail

baseURI

protected String baseURI

keyTable

protected Hashtable keyTable

namePool

protected NamePool namePool

Constructor Detail

DocumentWrapper

public DocumentWrapper(Document doc, String baseURI)

Method Detail

getKeyIndex

public Hashtable getKeyIndex(KeyManager keyManager, int fingerprint)
Get the index for a given key

Parameters: keymanager The key manager managing this key fingerprint The fingerprint of the name of the key (unique with the key manager)

Returns: The index, if one has been built, in the form of a Hashtable that maps the key value to a list of nodes having that key value. If no index has been built, returns null.

getNamePool

public NamePool getNamePool()
Get the name pool used for the names in this document

getUnparsedEntity

public String getUnparsedEntity(String name)
Get the unparsed entity with a given name

Parameters: name the name of the entity

Returns: null: JDOM does not provide access to unparsed entities

selectID

public NodeInfo selectID(String id)
Get the element with a given ID, if any

Parameters: id the required ID value

Returns: null: JDOM does not provide any information about attribute types.

setKeyIndex

public void setKeyIndex(KeyManager keyManager, int fingerprint, Hashtable index)
Set the index for a given key

Parameters: keymanager The key manager managing this key fingerprint The fingerprint of the name of the key (unique with the key manager) index the index, in the form of a Hashtable that maps the key value to a list of nodes having that key value

setNamePool

public void setNamePool(NamePool pool)
Set the name pool used for all names in this document