attCode
protected int[] attCode
attParent
protected int[] attParent
attValue
protected String[] attValue
charBuffer
protected char[] charBuffer
charBufferLength
protected int charBufferLength
commentBuffer
protected StringBuffer commentBuffer
depth
protected short[] depth
lastLevelOneNode
protected int lastLevelOneNode
length
protected int[] length
nameCode
protected int[] nameCode
namespaceCode
protected int[] namespaceCode
namespaceParent
protected int[] namespaceParent
nodeType
protected byte[] nodeType
numberOfAttributes
protected int numberOfAttributes
numberOfNamespaces
protected int numberOfNamespaces
numberOfNodes
protected int numberOfNodes
offset
protected int[] offset
prior
protected int[] prior
addAttribute
protected void addAttribute(int parent0,
int code0,
String type0,
String value0)
addNamespace
protected void addNamespace(int parent0,
int nscode0)
addNode
protected void addNode(short type0,
int depth0,
int offset0,
int length0,
int nameCode0)
adoptNode
public Node adoptNode(Node source)
throws DOMException
Attempts to adopt a node from another document to this document.
source
- The node to move into this document.
- The adopted node, or
null
if this operation
fails, such as when the source node comes from a different
implementation.
appendChars
protected void appendChars(char[] chars,
int start,
int length)
copy
public void copy(Outputter out)
throws TransformerException
Copy this node to a given outputter
- copy in interface NodeInfo
diagnosticDump
public void diagnosticDump()
Produce diagnostic print of main tree arrays
ensureAttributeCapacity
protected void ensureAttributeCapacity()
ensureNamespaceCapacity
protected void ensureNamespaceCapacity()
ensureNodeCapacity
protected void ensureNodeCapacity()
ensurePriorIndex
protected void ensurePriorIndex()
On demand, make an index for quick access to preceding-sibling nodes
getAllElements
protected AxisEnumeration getAllElements(int fingerprint)
Get a list of all elements with a given name. This is implemented
as a memo function: the first time it is called for a particular
element type, it remembers the result for next time.
getAttributeNode
protected TinyAttributeImpl getAttributeNode(int nr)
Make a (transient) attribute node from the array of attributes
getBaseURI
public String getBaseURI()
Get the base URI of this root node. For a root node the base URI is the same as the
System ID.
- getBaseURI in interface NodeInfo
- getBaseURI in interface TinyNodeImpl
getDocumentURI
public String getDocumentURI()
The location of the document or
null
if undefined or if
the
Document
was created using
DOMImplementation.createDocument
. No lexical checking is
performed when setting this attribute; this could result in a
null
value returned when using
Node.baseURI
.
Beware that when the
Document
supports the feature
"HTML" [
DOM Level 2 HTML]
, the href attribute of the HTML BASE element takes precedence over
this attribute when computing
Node.baseURI
.
getDomConfig
public org.w3c.dom.DOMConfiguration getDomConfig()
The configuration used when Document.normalizeDocument()
is invoked.
getInputEncoding
public String getInputEncoding()
An attribute specifying the encoding used for this document at the time
of the parsing. This is null
when it is not known, such
as when the Document
was created in memory.
getKeyIndex
public Hashtable getKeyIndex(KeyManager keymanager,
int fingerprint)
Get the index for a given key
- getKeyIndex in interface DocumentInfo
keymanager
- The key manager managing this keyfingerprint
- The fingerprint of the name of the key (unique with the key manager)
- The index, if one has been built, in the form of a Hashtable that
maps the key value to a set of nodes having that key value. If no index
has been built, returns null.
getLineNumber
protected int getLineNumber(int sequence)
Get the line number for an element. Return -1 if line numbering is off.
getNamespaceNode
protected TinyNamespaceImpl getNamespaceNode(int nr)
Make a (transient) namespace node from the array of namespace declarations
getNodeType
public final short getNodeType()
Return the type of node.
- getNodeType in interface NodeInfo
getSequenceNumber
public long getSequenceNumber()
Get the node sequence number (in document order). Sequence numbers are monotonic but not
consecutive.
- getSequenceNumber in interface TinyNodeImpl
getStrictErrorChecking
public boolean getStrictErrorChecking()
An attribute specifying whether error checking is enforced or not. When
set to false
, the implementation is free to not test
every possible error case normally defined on DOM operations, and not
raise any DOMException
on DOM operations or report
errors while using Document.normalizeDocument()
. In case
of error, the behavior is undefined. This attribute is
true
by default.
getSystemId
protected String getSystemId(int seq)
Get the system id of an element in the document
getUnparsedEntity
public String getUnparsedEntity(String name)
Get the unparsed entity with a given name
- getUnparsedEntity in interface DocumentInfo
name
- the name of the entity
- the URI of the entity if there is one, or empty string if not
getXmlEncoding
public String getXmlEncoding()
An attribute specifying, as part of the
XML declaration, the encoding of this document. This is
null
when
unspecified or when it is not known, such as when the
Document
was created in memory.
getXmlStandalone
public boolean getXmlStandalone()
An attribute specifying, as part of the
XML declaration, whether this document is standalone. This is
false
when
unspecified.
Note: No verification is done on the value when setting
this attribute. Applications should use
Document.normalizeDocument()
with the "validate"
parameter to verify if the value matches the
validity
constraint for standalone document declaration as defined in [
XML 1.0].
getXmlVersion
public String getXmlVersion()
An attribute specifying, as part of the
XML declaration, the version number of this document. If there is no declaration and if
this document supports the "XML" feature, the value is
"1.0"
.
isUsingNamespaces
protected boolean isUsingNamespaces()
determine whether this document uses namespaces
normalizeDocument
public void normalizeDocument()
This method acts as if the document was going through a save and load
cycle, putting the document in a "normal" form.
renameNode
public Node renameNode(Node n,
String namespaceURI,
String qualifiedName)
throws DOMException
Rename an existing node of type ELEMENT_NODE
or
ATTRIBUTE_NODE
.
n
- The node to rename.namespaceURI
- The new namespace URI.qualifiedName
- The new qualified name.
- The renamed node. This is either the specified node or the new
node that was created to replace the specified node.
selectID
public NodeInfo selectID(String id)
Get the element with a given ID.
- selectID in interface DocumentInfo
id
- The unique ID of the required element, previously registered using registerID()
- The NodeInfo (always an Element) for the given ID if one has been registered,
otherwise null.
setDocumentURI
public void setDocumentURI(String documentURI)
The location of the document or
null
if undefined or if
the
Document
was created using
DOMImplementation.createDocument
. No lexical checking is
performed when setting this attribute; this could result in a
null
value returned when using
Node.baseURI
.
Beware that when the
Document
supports the feature
"HTML" [
DOM Level 2 HTML]
, the href attribute of the HTML BASE element takes precedence over
this attribute when computing
Node.baseURI
.
setKeyIndex
public void setKeyIndex(KeyManager keymanager,
int fingerprint,
Hashtable keyindex)
Set the index for a given key. The method is synchronized because the same document
can be used by several stylesheets at the same time.
- setKeyIndex in interface DocumentInfo
keymanager
- The key manager managing this keyfingerprint
- The fingerprint of the name of the key (unique with the key manager)keyindex
- the index, in the form of a Hashtable that
maps the key value to a set of nodes having that key value. Or the String
"under construction", indicating that the index is being built.
setLineNumber
protected void setLineNumber(int sequence,
int line)
Set the line number for an element. Ignored if line numbering is off.
setLineNumbering
public void setLineNumbering()
Set line numbering on
setStrictErrorChecking
public void setStrictErrorChecking(boolean strictErrorChecking)
An attribute specifying whether error checking is enforced or not. When
set to false
, the implementation is free to not test
every possible error case normally defined on DOM operations, and not
raise any DOMException
on DOM operations or report
errors while using Document.normalizeDocument()
. In case
of error, the behavior is undefined. This attribute is
true
by default.
setSystemId
public void setSystemId(String uri)
Set the system id of this node
- setSystemId in interface TinyNodeImpl
setSystemId
protected void setSystemId(int seq,
String uri)
Set the system id of an element in the document
setUnparsedEntity
protected void setUnparsedEntity(String name,
String uri)
Set an unparsed entity URI associated with this document. For system use only, while
building the document.
setXmlStandalone
public void setXmlStandalone(boolean xmlStandalone)
throws DOMException
An attribute specifying, as part of the
XML declaration, whether this document is standalone. This is
false
when
unspecified.
Note: No verification is done on the value when setting
this attribute. Applications should use
Document.normalizeDocument()
with the "validate"
parameter to verify if the value matches the
validity
constraint for standalone document declaration as defined in [
XML 1.0].
setXmlVersion
public void setXmlVersion(String xmlVersion)
throws DOMException
An attribute specifying, as part of the
XML declaration, the version number of this document. If there is no declaration and if
this document supports the "XML" feature, the value is
"1.0"
. If this document does not support the "XML"
feature, the value is always
null
. Changing this
attribute will affect methods that check for invalid characters in
XML names. Application should invoke
Document.normalizeDocument()
in order to check for
invalid characters in the
Node
s that are already part of
this
Document
.
DOM applications may use the
DOMImplementation.hasFeature(feature, version)
method
with parameter values "XMLVersion" and "1.0" (respectively) to
determine if an implementation supports [
XML 1.0]. DOM
applications may use the same method with parameter values
"XMLVersion" and "1.1" (respectively) to determine if an
implementation supports [
XML 1.1]. In both
cases, in order to support XML, an implementation must also support
the "XML" feature defined in this specification.
Document
objects supporting a version of the "XMLVersion" feature must not
raise a
NOT_SUPPORTED_ERR
exception for the same version
number when using
Document.xmlVersion
.
truncate
protected void truncate(int nodes)
Truncate the tree: used in preview mode to delete an element after it has
been processed