net.sf.saxon.tree
public final class DocumentImpl extends ParentNodeImpl implements DocumentInfo, MutableDocumentInfo
A DocumentImpl object may either represent a real document node, or it may represent an imaginary container for a parentless element.
Constructor Summary | |
---|---|
DocumentImpl()
Create a DocumentImpl |
Method Summary | |
---|---|
void | copy(Receiver out, int whichNamespaces, boolean copyAnnotations, int locationId)
Copy this node to a given outputter |
void | deIndex(NodeImpl node)
Remove a node from any indexes when it is detached from the tree |
protected void | deregisterID(String id)
Remove the entry for a given ID (when nodes are deleted). |
void | generateId(FastStringBuffer buffer)
Get a character string that uniquely identifies this node |
AxisIterator | getAllElements(int fingerprint)
Get a list of all elements with a given name fingerprint |
String | getBaseURI()
Get the base URI of this root node. |
int | getColumnNumber(int sequence)
Get the column number for an element. |
Configuration | getConfiguration()
Get the configuration previously set using setConfiguration |
ElementImpl | getDocumentElement()
Get the root (outermost) element. |
long | getDocumentNumber()
Get the unique document number |
DocumentInfo | getDocumentRoot()
Get the root (document) node |
int | getLineNumber(int sequence)
Get the line number for an element. |
int | getLineNumber()
Get the line number of this root node. |
NamePool | getNamePool()
Get the name pool used for the names in this document |
NodeInfo | getNextSibling()
Get next sibling - always null |
int | getNodeKind()
Return the type of node. |
DocumentImpl | getPhysicalRoot()
Get the physical root of the tree. |
NodeInfo | getPreviousSibling()
Get previous sibling - always null |
NodeInfo | getRoot()
Get the root node |
String | getSystemId()
Get the system id of this root node |
String | getSystemId(int seq)
Get the system id of an element in the document |
int | getTypeAnnotation()
Get the type annotation of this node, if any. |
String[] | getUnparsedEntity(String name)
Get the unparsed entity with a given name |
Iterator<String> | getUnparsedEntityNames()
Get the list of unparsed entities defined in this document |
void | graftLocationMap(DocumentImpl original)
Copy the system ID and line number map from another document
(used when grafting a simplified stylesheet) |
boolean | isImaginary()
Ask whether this is an imaginary document node |
Builder | newBuilder()
Get a Builder suitable for building nodes that can be attached to this document. |
protected void | registerID(NodeInfo e, String id)
Register a unique element ID. |
void | replaceStringValue(CharSequence stringValue)
Replace the string-value of this node
|
void | resetIndexes()
This method is called before performing a batch of updates; it allows all cached data that
might be invalidated by such updates to be cleared |
NodeInfo | selectID(String id, boolean getParent)
Get the element with a given ID. |
void | setBaseURI(String uri)
Set the base URI of this document node |
void | setConfiguration(Configuration config)
Set the Configuration that contains this document |
void | setDocumentElement(ElementImpl e)
Set the top-level element of the document (variously called the root element or the
document element). |
void | setImaginary(boolean imaginary)
Set whether this is an imaginary document node |
void | setLineAndColumn(int sequence, int line, int column)
Set the line number for an element. |
void | setLineNumbering()
Set line numbering on |
void | setSystemId(String uri)
Set the system id (base URI) of this node |
void | setSystemId(int seq, String uri)
Set the system id of an element in the document |
void | setUnparsedEntity(String name, String uri, String publicId)
Set an unparsed entity URI associated with this document. |
Parameters: node the node to be removed from all indexes
Parameters: id The id value
Parameters: buffer a buffer into which will be placed a string based on the document number
Parameters: fingerprint the fingerprint of the required element name
Returns: an iterator over all the elements with this name
Returns: the base URI
Parameters: sequence the sequence number of the element
Returns: the column number for an element. Return -1 if line numbering is off, or if the element was added subsequent to document creation by use of XQuery update
Returns: the Saxon configuration
Returns: the Element node for the outermost element of the document.
Returns: the DocumentInfo representing this document
Parameters: sequence the sequence number of the element
Returns: the line number for an element. Return -1 if line numbering is off, or if the element was added subsequent to document creation by use of XQuery update
Returns: 0 always
Returns: null
Returns: Type.DOCUMENT (always)
Returns: the document node, which may be imaginary
Returns: null
Returns: the NodeInfo representing the root of this tree
Parameters: seq the sequence number of the element
Returns: the systemId (base URI) of the element
Returns: the type annotation, as the integer name code of the type name
Parameters: name the name of the entity
Returns: if the entity exists, return an array of two Strings, the first holding the system ID of the entity, the second holding the public ID if there is one, or null if not. If the entity does not exist, return null.
Returns: an Iterator, whose items are of type String, containing the names of all unparsed entities defined in this document. If there are no unparsed entities or if the information is not available then an empty iterator is returned
Parameters: original the document whose system ID and line number maps are to be grafted onto this tree
Returns: true if this is an imaginary node - the tree is really rooted at the topmost element
Returns: a new TreeBuilder
Parameters: e The Element having a particular unique ID value id The unique ID value
Parameters: stringValue the new string value
Parameters: id The unique ID of the required element, previously registered using registerID() getParent
Returns: The NodeInfo for the given ID if one has been registered, otherwise null.
Parameters: uri the new base URI
Parameters: config the Saxon configuration
Parameters: e the top-level element
Parameters: imaginary if true, this is an imaginary node - the tree is really rooted at the topmost element
Parameters: sequence the sequence number of the element line the line number of the element column the column number of the element
Parameters: seq the sequence number of the element uri the system identifier (base URI) of the element
Parameters: name the entity name uri the system identifier of the unparsed entity publicId the public identifier of the unparsed entity