|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.icl.saxon.tree.NodeImpl | +--com.icl.saxon.tree.ParentNodeImpl | +--com.icl.saxon.tree.DocumentImpl
A node in the XML parse tree representing the Document itself (or equivalently, the root node of the Document).
Field Summary | |
protected static NodeInfo[] |
emptyArray
|
protected int |
index
|
protected com.icl.saxon.tree.ParentNodeImpl |
parent
|
protected int |
sequence
|
Fields inherited from interface com.icl.saxon.om.NodeInfo |
ATTRIBUTE, COMMENT, DOCUMENT, ELEMENT, NAMESPACE, NODE, NONE, NUMBER_OF_TYPES, PI, TEXT |
Fields inherited from interface org.w3c.dom.Node |
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE |
Constructor Summary | |
DocumentImpl()
|
Method Summary | |
void |
addChild(com.icl.saxon.tree.NodeImpl node,
int index)
Add a child node to this node. |
protected static java.lang.String |
alphaKey(int value)
Construct an alphabetic key from an positive integer; the key collates in the same sequence as the integer |
org.w3c.dom.Node |
appendChild(org.w3c.dom.Node newChild)
Adds the node newChild to the end of the list of children
of this node. |
org.w3c.dom.Node |
cloneNode(boolean deep)
Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes. |
void |
compact(int size)
Compact the space used by this node |
void |
copy(Outputter out)
Copy this node to a given outputter |
void |
copyStringValue(Outputter out)
Copy the string-value of this node to a given outputter |
org.w3c.dom.Attr |
createAttribute(java.lang.String name)
Creates an Attr of the given name. |
org.w3c.dom.Attr |
createAttributeNS(java.lang.String namespaceURI,
java.lang.String qualifiedName)
Creates an attribute of the given qualified name and namespace URI. |
org.w3c.dom.CDATASection |
createCDATASection(java.lang.String data)
Creates a CDATASection node whose value is the specified
string. |
org.w3c.dom.Comment |
createComment(java.lang.String data)
Creates a Comment node given the specified string. |
org.w3c.dom.Document |
createDocument(java.lang.String namespaceURI,
java.lang.String qualifiedName,
org.w3c.dom.DocumentType doctype)
Creates an XML Document object of the specified type with
its document element. |
org.w3c.dom.DocumentFragment |
createDocumentFragment()
Creates an empty DocumentFragment object. |
org.w3c.dom.DocumentType |
createDocumentType(java.lang.String qualifiedName,
java.lang.String publicId,
java.lang.String systemId)
Creates an empty DocumentType node. |
org.w3c.dom.Element |
createElement(java.lang.String tagName)
Creates an element of the type specified. |
org.w3c.dom.Element |
createElementNS(java.lang.String namespaceURI,
java.lang.String qualifiedName)
Creates an element of the given qualified name and namespace URI. |
org.w3c.dom.EntityReference |
createEntityReference(java.lang.String name)
Creates an EntityReference object. |
org.w3c.dom.ProcessingInstruction |
createProcessingInstruction(java.lang.String target,
java.lang.String data)
Creates a ProcessingInstruction node given the specified
name and data strings. |
org.w3c.dom.Text |
createTextNode(java.lang.String data)
Creates a Text node given the specified string. |
void |
defaultAction(Context c)
Perform default action for this kind of node (built-in template rule) |
protected void |
disallowUpdate()
Internal method used to indicate that update operations are not allowed |
void |
dropChildren()
Drop a branch of the tree. |
java.lang.String |
getAbsoluteName()
Get the absolute name of this node. |
NodeInfo[] |
getAllChildNodes()
Get all child nodes of the element (child elements and character nodes). |
ElementInfo |
getAncestor(Name name)
Get the nearest ancestor element with a given name |
NodeInfo |
getAncestor(Pattern pat,
Context c)
Get the nearest ancestor node that matches the given pattern |
java.lang.String[] |
getAssociatedStylesheets(java.lang.String media,
java.lang.String title)
Get the URIs of the stylesheet associated with this document by means of an xml-stylesheet processing instruction. |
org.w3c.dom.NamedNodeMap |
getAttributes()
Return a NamedNodeMap containing the attributes of this node (if
it is an Element ) or null otherwise. |
java.lang.String |
getAttributeValue(Name name)
Find the value of a given attribute of this node. |
java.lang.String |
getAttributeValue(java.lang.String name)
Find the value of a given attribute of this node. |
protected java.lang.String |
getBaseURI(int seq)
Get the system id of an element in the document |
java.lang.StringBuffer |
getCharacterBuffer()
Get the character buffer |
org.w3c.dom.NodeList |
getChildNodes()
Return a NodeList that contains all children of this node. |
int |
getColumnNumber()
Get the column number of the node. |
java.lang.String |
getDisplayName()
Get the display name of this node. |
org.w3c.dom.DocumentType |
getDoctype()
The Document Type Declaration (see DocumentType )
associated with this document. |
org.w3c.dom.Element |
getDocumentElement()
Get the root (outermost) element. |
int |
getDocumentNumber()
Get a unique number identifying this document |
DocumentInfo |
getDocumentRoot()
Get the root (document) node |
org.w3c.dom.Element |
getElementById(java.lang.String elementId)
Returns the Element whose ID is given by
elementId . |
org.w3c.dom.NodeList |
getElementsByTagName(java.lang.String tagname)
Returns a NodeList of all the Elements with
a given tag name in the order in which they are encountered in a
preorder traversal of the Document tree. |
org.w3c.dom.NodeList |
getElementsByTagNameNS(java.lang.String namespaceURI,
java.lang.String localName)
Returns a NodeList of all the Elements with
a given local name and namespace URI in the order in which they are
encountered in a preorder traversal of the Document tree. |
PreparedStyleSheet |
getEmbeddedStylesheet(java.lang.String id)
Prepare an embedded stylesheet within this document |
Name |
getExpandedName()
Get the name of this node, following the XPath rules |
org.w3c.dom.Node |
getFirstChild()
Get the first child node of the element |
NodeInfo |
getFirstChild(Pattern pattern,
Context c)
Get the first child node matching a given pattern |
org.w3c.dom.DOMImplementation |
getImplementation()
The DOMImplementation object that handles this document. |
int |
getIndex()
Get the index of this node, i.e. |
java.util.Hashtable |
getKeyIndex(KeyManager keymanager,
java.lang.String absname)
Get the index for a given key |
org.w3c.dom.Node |
getLastChild()
Get the last child node of the element |
NodeInfo |
getLastChild(Pattern pattern,
Context c)
Get the last child node matching a given pattern |
int |
getLineNumber()
Get the line number of this root node. |
protected int |
getLineNumber(int sequence)
Get the line number for an element. |
java.lang.String |
getLocalName()
Get the local name of this node. |
java.lang.String |
getNamespaceURI()
The namespace URI of this node, or null if it is
unspecified. |
NodeInfo |
getNextInDocument(NodeInfo anchor)
Get the next node in document order |
org.w3c.dom.Node |
getNextSibling()
Get next sibling - always null |
NodeInfo |
getNextSibling(Pattern pattern,
Context c)
Get the next sibling node that matches a given pattern. |
java.lang.String |
getNodeName()
Get the name of this node, following the DOM rules |
int |
getNodeNumber()
Get node number. |
int |
getNodeNumber(Pattern pattern)
Get node number (level="single"). |
int |
getNodeNumberAny(Pattern pattern)
Get node number (level="any"). |
short |
getNodeType()
Return the type of node. |
static java.lang.String |
getNodeTypeName(int type)
Translate numeric node type to a string representation |
java.lang.String |
getNodeValue()
Get the node value as defined in the DOM. |
protected NodeInfo |
getNthChild(int n)
Get the nth child node of the element (numbering from 0) |
int |
getNumberAny(Pattern count,
Pattern from,
Context context)
Get node number (level="any"). |
java.util.Vector |
getNumberMulti(Pattern count,
Pattern from,
Context context)
Get node number (level="multi"). |
int |
getNumberOfChildren()
Get the number of children. |
int |
getNumberSimple()
Get simple node number. |
int |
getNumberSimple(Context context)
Get simple node number. |
int |
getNumberSingle(Pattern count,
Pattern from,
Context context)
Get node number (level="single"). |
org.w3c.dom.Document |
getOwnerDocument()
Return the Document object associated with this node. |
org.w3c.dom.Node |
getParentNode()
Find the parent node of this node. |
java.lang.String |
getPath()
Generate a path to this node |
java.lang.String |
getPrefix()
Get the prefix part of the name of this node. |
NodeInfo |
getPreviousInDocument()
Get the previous node in document order |
NodeInfo |
getPreviousInDocument(Pattern pattern,
Context c)
Get the previous node in document order |
org.w3c.dom.Node |
getPreviousSibling()
Get previous sibling - always null |
NodeInfo |
getPreviousSibling(Pattern pattern,
Context c)
Get the previous sibling of the node that matches a given pattern. |
java.lang.String |
getPublicId()
Get the public identifier of the document entity containing this node. |
long |
getSequenceNumber()
Get the node sequence number (in document order). |
java.lang.String |
getSequentialKey()
Get a character string that uniquely identifies this node |
java.lang.String |
getSystemId()
Get the system id of this node |
java.lang.String |
getUnparsedEntity(java.lang.String name)
Get the unparsed entity with a given name |
java.lang.String |
getURI()
Get the URI part of the name of this node. |
java.lang.String |
getValue()
Return the string-value of the node, that is, the concatenation of the character content of all descendent elements and text nodes. |
boolean |
hasAttributes()
Returns whether this node (if it is an element) has any attributes. |
boolean |
hasChildNodes()
Determine whether the node has any children. |
boolean |
hasFeature(java.lang.String feature,
java.lang.String version)
Test if the DOM implementation implements a specific feature. |
boolean |
hasName(Name name)
Test if the name of the node (including namespaces) is equivalent to the given name |
org.w3c.dom.Node |
importNode(org.w3c.dom.Node importedNode,
boolean deep)
Imports a node from another document to this document. |
org.w3c.dom.Node |
insertBefore(org.w3c.dom.Node newChild,
org.w3c.dom.Node refChild)
Insert the node newChild before the existing child node
refChild . |
boolean |
isa(int nodeType)
Determine whether the node is of a given type. |
boolean |
isAncestor(NodeInfo other)
Determine whether this node is an ancestor of another node |
boolean |
isDocumentElement()
Determine whether this node is the outermost element. |
boolean |
isSameNode(NodeInfo other)
Determine whether this is the same node as another node |
boolean |
isSupported(java.lang.String feature,
java.lang.String version)
Test if the DOM implementation implements a specific feature. |
void |
normalize()
Puts all Text nodes in the full depth of the sub-tree
underneath this Node , including attribute nodes, into a
"normal" form where only structure (e.g., elements, comments,
processing instructions, CDATA sections, and entity references)
separates Text nodes, i.e., there are neither adjacent
Text nodes nor empty Text nodes. |
void |
removeChild(int index)
Remove node at given index. |
org.w3c.dom.Node |
removeChild(org.w3c.dom.Node oldChild)
Remove the child node indicated by oldChild from the
list of children, and returns it. |
void |
removeNode()
Remove this node from the tree. |
void |
renumberChildren()
Renumber the children of a given parent node. |
org.w3c.dom.Node |
replaceChild(org.w3c.dom.Node newChild,
org.w3c.dom.Node oldChild)
Replace the child node oldChild with
newChild in the list of children, and returns the
oldChild node. |
ElementInfo |
selectID(java.lang.String id)
Get the element with a given ID. |
protected void |
setBaseURI(int seq,
java.lang.String uri)
Set the system id of an element in the document |
protected void |
setCharacterBuffer(java.lang.StringBuffer buffer)
Set the character buffer |
protected void |
setDocumentElement(ElementInfo e)
Set the top-level element of the document (variously called the root element or the document element). |
void |
setKeyIndex(KeyManager keymanager,
java.lang.String absname,
java.lang.Object keyindex)
Set the index for a given key. |
protected void |
setLineNumber(int sequence,
int line)
Set the line number for an element. |
void |
setLineNumbering()
Set line numbering on |
void |
setNodeValue(java.lang.String nodeValue)
Set the node value. |
void |
setPrefix(java.lang.String prefix)
Set the namespace prefix of this node. |
protected void |
setSystemId(java.lang.String uri)
Set the system id of this node |
protected void |
setUnparsedEntity(java.lang.String name,
java.lang.String uri)
Set an unparsed entity URI associated with this document. |
boolean |
supports(java.lang.String feature,
java.lang.String version)
Tests whether the DOM implementation implements a specific feature and that feature is supported by this node. |
java.lang.String |
toString()
Diagnostic string representation |
void |
useChildrenArray(com.icl.saxon.tree.NodeImpl[] array)
Supply an array to be used for the array of children. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.icl.saxon.om.NodeInfo |
copyStringValue, defaultAction, getAbsoluteName, getAllChildNodes, getAncestor, getAncestor, getAttributeValue, getAttributeValue, getDisplayName, getFirstChild, getIndex, getLastChild, getLocalName, getNextInDocument, getNextSibling, getNumberAny, getNumberMulti, getNumberOfChildren, getNumberSimple, getNumberSimple, getNumberSingle, getPrefix, getPreviousInDocument, getPreviousInDocument, getPreviousSibling, getSequenceNumber, getURI, getValue, hasName, isa, isAncestor, isDocumentElement, isSameNode |
Methods inherited from interface org.w3c.dom.Node |
appendChild, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getNamespaceURI, getNodeValue, getOwnerDocument, getParentNode, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix |
Field Detail |
protected int sequence
protected static NodeInfo[] emptyArray
protected com.icl.saxon.tree.ParentNodeImpl parent
protected int index
Constructor Detail |
public DocumentImpl()
Method Detail |
protected void setCharacterBuffer(java.lang.StringBuffer buffer)
public final java.lang.StringBuffer getCharacterBuffer()
protected void setDocumentElement(ElementInfo e)
e
- the top-level elementprotected void setSystemId(java.lang.String uri)
public java.lang.String getSystemId()
getSystemId
in interface NodeInfo
getSystemId
in class com.icl.saxon.tree.NodeImpl
com.icl.saxon.om.NodeInfo
protected void setBaseURI(int seq, java.lang.String uri)
protected java.lang.String getBaseURI(int seq)
public void setLineNumbering()
protected void setLineNumber(int sequence, int line)
protected int getLineNumber(int sequence)
public int getLineNumber()
getLineNumber
in interface NodeInfo
getLineNumber
in class com.icl.saxon.tree.NodeImpl
public final short getNodeType()
getNodeType
in interface NodeInfo
public final Name getExpandedName()
getExpandedName
in interface NodeInfo
public final java.lang.String getNodeName()
getNodeName
in interface NodeInfo
getNodeName
in class com.icl.saxon.tree.NodeImpl
public final org.w3c.dom.Node getNextSibling()
getNextSibling
in interface org.w3c.dom.Node
getNextSibling
in class com.icl.saxon.tree.NodeImpl
public final org.w3c.dom.Node getPreviousSibling()
getPreviousSibling
in interface org.w3c.dom.Node
getPreviousSibling
in class com.icl.saxon.tree.NodeImpl
public org.w3c.dom.Element getDocumentElement()
getDocumentElement
in interface NodeInfo
getDocumentElement
in class com.icl.saxon.tree.NodeImpl
public DocumentInfo getDocumentRoot()
getDocumentRoot
in interface NodeInfo
getDocumentRoot
in class com.icl.saxon.tree.NodeImpl
public int getNodeNumber(Pattern pattern)
public int getNodeNumber()
public int getNodeNumberAny(Pattern pattern)
pattern
- a Pattern that identifies which nodes should be counted (ignored)public java.lang.String getSequentialKey()
getSequentialKey
in interface NodeInfo
getSequentialKey
in class com.icl.saxon.tree.NodeImpl
public int getDocumentNumber()
getDocumentNumber
in interface DocumentInfo
public ElementInfo selectID(java.lang.String id) throws org.xml.sax.SAXException
selectID
in interface DocumentInfo
id
- The unique ID of the required element, previously registered using registerID()public java.util.Hashtable getKeyIndex(KeyManager keymanager, java.lang.String absname) throws org.xml.sax.SAXException
getKeyIndex
in interface DocumentInfo
keymanager
- The key manager managing this keyabsname
- The absolute name of the key (unique with the key manager)SAXExcetpion
- If the index is under construction, throws an
exception, as this implies a key defined in terms of itself.public void setKeyIndex(KeyManager keymanager, java.lang.String absname, java.lang.Object keyindex) throws org.xml.sax.SAXException
setKeyIndex
in interface DocumentInfo
keymanager
- The key manager managing this keyabsname
- The absolute 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 Vector of nodes having that key value. Or the String
"under construction", indicating that the index is being built.protected void setUnparsedEntity(java.lang.String name, java.lang.String uri)
public java.lang.String getUnparsedEntity(java.lang.String name)
getUnparsedEntity
in interface DocumentInfo
name
- the name of the entitypublic java.lang.String[] getAssociatedStylesheets(java.lang.String media, java.lang.String title) throws org.xml.sax.SAXException
getAssociatedStylesheets
in interface DocumentInfo
media
- The required medium, or null to match any mediumtitle
- The required title, or null to match the preferred stylesheetorg.xml.sax.SAXException
- if there is such a processing instruction and it is invalidpublic PreparedStyleSheet getEmbeddedStylesheet(java.lang.String id) throws org.xml.sax.SAXException
getEmbeddedStylesheet
in interface DocumentInfo
id
- The id of the required embedded stylesheetpublic void copy(Outputter out) throws org.xml.sax.SAXException
copy
in interface NodeInfo
public java.lang.String getPath()
getPath
in interface NodeInfo
public java.lang.String toString()
toString
in class com.icl.saxon.tree.NodeImpl
public org.w3c.dom.DocumentType getDoctype()
DocumentType
)
associated with this document. For HTML documents as well as XML
documents without a document type declaration this returns
null
. The DOM Level 2 does not support editing the
Document Type Declaration, therefore docType
cannot be
altered in any way, including through the use of methods, such as
insertNode
or removeNode
, which are
inherited from the Node
interface.getDoctype
in interface org.w3c.dom.Document
public org.w3c.dom.DOMImplementation getImplementation()
DOMImplementation
object that handles this document.
A DOM application may use objects from multiple implementations.getImplementation
in interface org.w3c.dom.Document
public org.w3c.dom.Element createElement(java.lang.String tagName) throws org.w3c.dom.DOMException
Element
interface, so attributes
can be specified directly on the returned object.createElement
in interface org.w3c.dom.Document
public org.w3c.dom.DocumentFragment createDocumentFragment()
DocumentFragment
object.createDocumentFragment
in interface org.w3c.dom.Document
DocumentFragment
.public org.w3c.dom.Text createTextNode(java.lang.String data)
Text
node given the specified string.createTextNode
in interface org.w3c.dom.Document
data
- The data for the node.Text
object.public org.w3c.dom.Comment createComment(java.lang.String data)
Comment
node given the specified string.createComment
in interface org.w3c.dom.Document
data
- The data for the node.Comment
object.public org.w3c.dom.CDATASection createCDATASection(java.lang.String data) throws org.w3c.dom.DOMException
CDATASection
node whose value is the specified
string.createCDATASection
in interface org.w3c.dom.Document
data
- The data for the CDATASection
contents.CDATASection
object.org.w3c.dom.DOMException
- NOT_SUPPORTED_ERR: Raised if this document is an HTML document.public org.w3c.dom.ProcessingInstruction createProcessingInstruction(java.lang.String target, java.lang.String data) throws org.w3c.dom.DOMException
ProcessingInstruction
node given the specified
name and data strings.createProcessingInstruction
in interface org.w3c.dom.Document
target
- The target part of the processing instruction.data
- The data for the node.ProcessingInstruction
object.org.w3c.dom.DOMException
- INVALID_CHARACTER_ERR: Raised if the specified target contains an
illegal character.
public org.w3c.dom.Attr createAttribute(java.lang.String name) throws org.w3c.dom.DOMException
Attr
of the given name. Note that the
Attr
instance can then be set on an Element
using the setAttributeNode
method.
createAttributeNS
method.createAttribute
in interface org.w3c.dom.Document
name
- The name of the attribute.Attr
object with the nodeName
attribute set to name
, and localName
,
prefix
, and namespaceURI
set to
null
.org.w3c.dom.DOMException
- INVALID_CHARACTER_ERR: Raised if the specified name contains an
illegal character.public org.w3c.dom.EntityReference createEntityReference(java.lang.String name) throws org.w3c.dom.DOMException
EntityReference
object. In addition, if the
referenced entity is known, the child list of the
EntityReference
node is made the same as that of the
corresponding Entity
node. If any descendant of the
Entity
node has an unbound namespace prefix , the
corresponding descendant of the created EntityReference
node is also unbound; (its namespaceURI
is
null
). The DOM Level 2 does not support any mechanism to
resolve namespace prefixes.createEntityReference
in interface org.w3c.dom.Document
name
- The name of the entity to reference.EntityReference
object.org.w3c.dom.DOMException
- INVALID_CHARACTER_ERR: Raised if the specified name contains an
illegal character.
public org.w3c.dom.NodeList getElementsByTagName(java.lang.String tagname)
NodeList
of all the Elements
with
a given tag name in the order in which they are encountered in a
preorder traversal of the Document
tree.getElementsByTagName
in interface org.w3c.dom.Document
tagname
- The name of the tag to match on. The special value "*"
matches all tags.NodeList
object containing all the matched
Elements
.public org.w3c.dom.Node importNode(org.w3c.dom.Node importedNode, boolean deep) throws org.w3c.dom.DOMException
importNode
in interface org.w3c.dom.Document
org.w3c.dom.DOMException
- NOT_SUPPORTED_ERR: Raised if the type of node being imported is not
supported.public org.w3c.dom.Element createElementNS(java.lang.String namespaceURI, java.lang.String qualifiedName) throws org.w3c.dom.DOMException
createElementNS
in interface org.w3c.dom.Document
namespaceURI
- The namespace URI of the element to create.qualifiedName
- The qualified name of the element type to
instantiate.Element
object with the following
attributes: Attribute ValueNode.nodeName
qualifiedName
Node.namespaceURI
namespaceURI
Node.prefix
prefix, extracted
from qualifiedName
, or null
if there is no
prefixNode.localName
local name , extracted from
qualifiedName
Element.tagName
qualifiedName
org.w3c.dom.DOMException
- INVALID_CHARACTER_ERR: Raised if the specified qualified name
contains an illegal character.
qualifiedName
is
malformed, if the qualifiedName
has a prefix and the
namespaceURI
is null
or an empty string,
or if the qualifiedName
has a prefix that is "xml" and
the namespaceURI
is different from "
http://www.w3.org/XML/1998/namespace " .public org.w3c.dom.Attr createAttributeNS(java.lang.String namespaceURI, java.lang.String qualifiedName) throws org.w3c.dom.DOMException
createAttributeNS
in interface org.w3c.dom.Document
namespaceURI
- The namespace URI of the attribute to create.qualifiedName
- The qualified name of the attribute to
instantiate.Attr
object with the following attributes:
Attribute ValueNode.nodeName
qualifiedName
Node.namespaceURI
namespaceURI
Node.prefix
prefix, extracted from
qualifiedName
, or null
if there is no
prefixNode.localName
local name , extracted from
qualifiedName
Attr.name
qualifiedName
org.w3c.dom.DOMException
- INVALID_CHARACTER_ERR: Raised if the specified qualified name
contains an illegal character.
qualifiedName
is
malformed, if the qualifiedName
has a prefix and the
namespaceURI
is null
or an empty string,
if the qualifiedName
has a prefix that is "xml" and the
namespaceURI
is different from "
http://www.w3.org/XML/1998/namespace ", or if the
qualifiedName
is "xmlns" and the
namespaceURI
is different from "
http://www.w3.org/2000/xmlns/ ".public org.w3c.dom.NodeList getElementsByTagNameNS(java.lang.String namespaceURI, java.lang.String localName)
NodeList
of all the Elements
with
a given local name and namespace URI in the order in which they are
encountered in a preorder traversal of the Document
tree.getElementsByTagNameNS
in interface org.w3c.dom.Document
namespaceURI
- The namespace URI of the elements to match on.
The special value "*" matches all namespaces.localName
- The local name of the elements to match on. The
special value "*" matches all local names.NodeList
object containing all the matched
Elements
.public org.w3c.dom.Element getElementById(java.lang.String elementId)
Element
whose ID
is given by
elementId
. If no such element exists, returns
null
. Behavior is not defined if more than one element
has this ID
. The DOM implementation must have
information that says which attributes are of type ID. Attributes with
the name "ID" are not of type ID unless so defined. Implementations
that do not know whether attributes are of type ID or not are expected
to return null
.getElementById
in interface org.w3c.dom.Document
elementId
- The unique id
value for an element.public boolean hasFeature(java.lang.String feature, java.lang.String version)
hasFeature
in interface org.w3c.dom.DOMImplementation
feature
- The name of the feature to test (case-insensitive).version
- This is the version number of the feature to test.true
if the feature is implemented in the
specified version, false
otherwise.public org.w3c.dom.DocumentType createDocumentType(java.lang.String qualifiedName, java.lang.String publicId, java.lang.String systemId) throws org.w3c.dom.DOMException
DocumentType
node.createDocumentType
in interface org.w3c.dom.DOMImplementation
qualifiedName
- The qualified name of the document type to be
created.publicId
- The external subset public identifier.systemId
- The external subset system identifier.DocumentType
node with
Node.ownerDocument
set to null
.org.w3c.dom.DOMException
- INVALID_CHARACTER_ERR: Raised if the specified qualified name
contains an illegal character.
qualifiedName
is
malformed.public org.w3c.dom.Document createDocument(java.lang.String namespaceURI, java.lang.String qualifiedName, org.w3c.dom.DocumentType doctype) throws org.w3c.dom.DOMException
Document
object of the specified type with
its document element.createDocument
in interface org.w3c.dom.DOMImplementation
namespaceURI
- The namespace URI of the document element to
create.qualifiedName
- The qualified name of the document element to be
created.doctype
- The type of document to be created or null
.Document
object.org.w3c.dom.DOMException
- public long getSequenceNumber()
getSequenceNumber
in class com.icl.saxon.tree.NodeImpl
public int getNumberOfChildren()
getNumberOfChildren
in class com.icl.saxon.tree.NodeImpl
public NodeInfo[] getAllChildNodes()
getAllChildNodes
in class com.icl.saxon.tree.NodeImpl
public org.w3c.dom.Node getFirstChild()
getFirstChild
in class com.icl.saxon.tree.NodeImpl
public org.w3c.dom.Node getLastChild()
getLastChild
in class com.icl.saxon.tree.NodeImpl
protected final NodeInfo getNthChild(int n)
public java.lang.String getValue()
public void copyStringValue(Outputter out) throws org.xml.sax.SAXException
copyStringValue
in class com.icl.saxon.tree.NodeImpl
public void defaultAction(Context c) throws org.xml.sax.SAXException
public void useChildrenArray(com.icl.saxon.tree.NodeImpl[] array)
public void addChild(com.icl.saxon.tree.NodeImpl node, int index)
public void removeChild(int index)
public void renumberChildren()
public void dropChildren()
public void compact(int size)
public java.lang.String getNodeValue()
getNodeValue
in class com.icl.saxon.tree.NodeImpl
public boolean isSameNode(NodeInfo other)
isSameNode
in interface NodeInfo
public java.lang.String getPrefix()
getPrefix
in interface NodeInfo
public java.lang.String getURI()
getURI
in interface NodeInfo
public java.lang.String getDisplayName()
getDisplayName
in interface NodeInfo
public java.lang.String getAbsoluteName()
getAbsoluteName
in interface NodeInfo
public java.lang.String getLocalName()
getLocalName
in interface NodeInfo
public boolean hasName(Name name)
hasName
in interface NodeInfo
public int getColumnNumber()
public java.lang.String getPublicId()
public final int getIndex()
getIndex
in interface NodeInfo
com.icl.saxon.om.NodeInfo
public final org.w3c.dom.Node getParentNode()
getParentNode
in interface org.w3c.dom.Node
public final boolean isa(int nodeType)
Note, this can also be done by testing the node using "instanceof". But this is inconvenient when passing the class as a parameter to another routine.
isa
in interface NodeInfo
nodeType
- One of the specific node types such as ELEMENT or TEXT, or the general
node type NODEpublic java.lang.String getAttributeValue(Name name)
getAttributeValue
in interface NodeInfo
name
- the name of an attributepublic java.lang.String getAttributeValue(java.lang.String name)
getAttributeValue
in interface NodeInfo
name
- the name of an attribute. This must be an unqualified attribute name,
i.e. one with no namespace prefix.public final ElementInfo getAncestor(Name name)
getAncestor
in interface NodeInfo
name
- The name of the required ancestor.public final NodeInfo getAncestor(Pattern pat, Context c) throws org.xml.sax.SAXException
getAncestor
in interface NodeInfo
pattern
- A pattern that the ancestor node must satisfy.public boolean isDocumentElement()
isDocumentElement
in interface NodeInfo
public boolean isAncestor(NodeInfo other)
isAncestor
in interface NodeInfo
other
- the other node (the putative descendant of this node)public final NodeInfo getNextSibling(Pattern pattern, Context c) throws org.xml.sax.SAXException
getNextSibling
in interface NodeInfo
pattern
- The match-pattern that the required sibling must matchpublic NodeInfo getNextInDocument(NodeInfo anchor)
getNextInDocument
in interface NodeInfo
anchor:
- the scan stops when it reaches a node that is not a descendant of the specified
anchor nodepublic final NodeInfo getFirstChild(Pattern pattern, Context c) throws org.xml.sax.SAXException
getFirstChild
in interface NodeInfo
pattern
- the pattern to be matchedpublic final NodeInfo getPreviousSibling(Pattern pattern, Context c) throws org.xml.sax.SAXException
getPreviousSibling
in interface NodeInfo
pattern
- The match-pattern that the required sibling must matchpublic NodeInfo getPreviousInDocument()
getPreviousInDocument
in interface NodeInfo
public final NodeInfo getPreviousInDocument(Pattern pattern, Context c) throws org.xml.sax.SAXException
getPreviousInDocument
in interface NodeInfo
pattern:
- identifies a pattern the required nodepublic final NodeInfo getLastChild(Pattern pattern, Context c) throws org.xml.sax.SAXException
getLastChild
in interface NodeInfo
pattern
- the pattern to be matchedpublic int getNumberSimple(Context context)
getNumberSimple
in interface NodeInfo
context
- Used for remembering previous result, for performancepublic int getNumberSimple()
getNumberSimple
in interface NodeInfo
public int getNumberSingle(Pattern count, Pattern from, Context context) throws org.xml.sax.SAXException
getNumberSingle
in interface NodeInfo
count
- Pattern that identifies which nodes should be counted. Default (null) is the element
name if the current node is an element, or "node()" otherwise.from
- Pattern that specifies where counting starts from. Default (null) is the root node.
(This parameter does not seem useful but is included for the sake of XSLT conformance.)public int getNumberAny(Pattern count, Pattern from, Context context) throws org.xml.sax.SAXException
getNumberAny
in interface NodeInfo
count
- Pattern that identifies which nodes should be counted. Default (null) is the element
name if the current node is an element, or "node()" otherwise.from
- Pattern that specifies where counting starts from. Default (null) is the root node.
Only nodes after the first (most recent) node that matches the 'from' pattern are counted.public java.util.Vector getNumberMulti(Pattern count, Pattern from, Context context) throws org.xml.sax.SAXException
getNumberMulti
in interface NodeInfo
count
- Pattern that identifies which nodes (ancestors and their previous siblings)
should be counted. Default (null) is the element
name if the current node is an element, or "node()" otherwise.from
- Pattern that specifies where counting starts from. Default (null) is the root node.
Only nodes below the first (most recent) node that matches the 'from' pattern are counted.protected static java.lang.String alphaKey(int value)
value
- The positive integer key value (negative values are treated as zero).public void removeNode() throws org.xml.sax.SAXException
public static java.lang.String getNodeTypeName(int type)
public void setNodeValue(java.lang.String nodeValue) throws org.w3c.dom.DOMException
setNodeValue
in interface org.w3c.dom.Node
public org.w3c.dom.NodeList getChildNodes()
NodeList
that contains all children of this node. If
there are no children, this is a NodeList
containing no
nodes.getChildNodes
in interface org.w3c.dom.Node
public org.w3c.dom.NamedNodeMap getAttributes()
NamedNodeMap
containing the attributes of this node (if
it is an Element
) or null
otherwise. (DOM method)getAttributes
in interface org.w3c.dom.Node
public org.w3c.dom.Document getOwnerDocument()
Document
object associated with this node. (DOM mehod)getOwnerDocument
in interface org.w3c.dom.Node
public org.w3c.dom.Node insertBefore(org.w3c.dom.Node newChild, org.w3c.dom.Node refChild) throws org.w3c.dom.DOMException
newChild
before the existing child node
refChild
. DOM method: always fails.insertBefore
in interface org.w3c.dom.Node
newChild
- The node to insert.refChild
- The reference node, i.e., the node before which the
new node must be inserted.org.w3c.dom.DOMException
- NO_MODIFICATION_ALLOWED_ERR: Always raised.public org.w3c.dom.Node replaceChild(org.w3c.dom.Node newChild, org.w3c.dom.Node oldChild) throws org.w3c.dom.DOMException
oldChild
with
newChild
in the list of children, and returns the
oldChild
node. Always fails.replaceChild
in interface org.w3c.dom.Node
newChild
- The new node to put in the child list.oldChild
- The node being replaced in the list.org.w3c.dom.DOMException
- NO_MODIFICATION_ALLOWED_ERR: Always raised.public org.w3c.dom.Node removeChild(org.w3c.dom.Node oldChild) throws org.w3c.dom.DOMException
oldChild
from the
list of children, and returns it. DOM method: always fails.removeChild
in interface org.w3c.dom.Node
oldChild
- The node being removed.org.w3c.dom.DOMException
- NO_MODIFICATION_ALLOWED_ERR: Always raised.public org.w3c.dom.Node appendChild(org.w3c.dom.Node newChild) throws org.w3c.dom.DOMException
newChild
to the end of the list of children
of this node. DOM method: always fails.appendChild
in interface org.w3c.dom.Node
newChild
- The node to add.org.w3c.dom.DOMException
- public boolean hasChildNodes()
hasChildNodes
in interface org.w3c.dom.Node
true
if the node has any children,
false
if the node has no children.public org.w3c.dom.Node cloneNode(boolean deep)
cloneNode
in interface org.w3c.dom.Node
deep
- If true
, recursively clone the subtree under
the specified node; if false
, clone only the node
itself (and its attributes, if it is an Element
).public void normalize()
Text
nodes in the full depth of the sub-tree
underneath this Node
, including attribute nodes, into a
"normal" form where only structure (e.g., elements, comments,
processing instructions, CDATA sections, and entity references)
separates Text
nodes, i.e., there are neither adjacent
Text
nodes nor empty Text
nodes.normalize
in interface org.w3c.dom.Node
public boolean supports(java.lang.String feature, java.lang.String version)
feature
- The name of the feature to test. This is the same name
which can be passed to the method hasFeature
on
DOMImplementation
.version
- This is the version number of the feature to test. In
Level 2, version 1, this is the string "2.0". If the version is not
specified, supporting any version of the feature will cause the
method to return true
.true
if the specified feature is supported
on this node, false
otherwise.public java.lang.String getNamespaceURI()
null
if it is
unspecified.
ELEMENT_NODE
and
ATTRIBUTE_NODE
and nodes created with a DOM Level 1
method, such as createElement
from the
Document
interface, this is always null
.
Per the Namespaces in XML Specification an attribute does not
inherit its namespace from the element it is attached to. If an
attribute is not explicitly given a namespace, it simply has no
namespace.getNamespaceURI
in interface org.w3c.dom.Node
public void setPrefix(java.lang.String prefix) throws org.w3c.dom.DOMException
setPrefix
in interface org.w3c.dom.Node
protected void disallowUpdate() throws org.w3c.dom.DOMException
public boolean hasAttributes()
hasAttributes
in interface org.w3c.dom.Node
true
if this node has any attributes,
false
otherwise.public boolean isSupported(java.lang.String feature, java.lang.String version)
isSupported
in interface org.w3c.dom.Node
feature
- The name of the feature to test (case-insensitive).version
- This is the version number of the feature to test.true
if the feature is implemented in the
specified version, false
otherwise.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |