|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A node in the XML parse tree representing an XML element, character content, or attribute.
This is the top class in the interface hierarchy for nodes; see NodeImpl for the implementation hierarchy.
Field Summary | |
static short |
ATTRIBUTE
|
static short |
COMMENT
|
static short |
DOCUMENT
|
static short |
ELEMENT
|
static short |
NAMESPACE
|
static short |
NODE
|
static short |
NONE
|
static short |
NUMBER_OF_TYPES
|
static short |
PI
|
static short |
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 |
Method Summary | |
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 |
void |
defaultAction(Context c)
Perform default action for this kind of node (built-in template rule) |
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 element name |
NodeInfo |
getAncestor(Pattern pat,
Context context)
Get the nearest ancestor node that matches the given pattern |
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. |
java.lang.String |
getDisplayName()
Get the display name of this node. |
org.w3c.dom.Element |
getDocumentElement()
Get the outermost element. |
DocumentInfo |
getDocumentRoot()
Get the root (document) node |
Name |
getExpandedName()
Get the expanded name of this node, following the XPath naming rules |
NodeInfo |
getFirstChild(Pattern pattern,
Context context)
Get the first child node of a given type. |
int |
getIndex()
Get index: that is, the number of preceding sibling nodes at the same level. |
NodeInfo |
getLastChild(Pattern pattern,
Context context)
Get the last child node of a given type |
int |
getLineNumber()
Get line number |
java.lang.String |
getLocalName()
Get the local part of the name of this node. |
NodeInfo |
getNextInDocument(NodeInfo anchor)
Get the next node in document order |
NodeInfo |
getNextSibling(Pattern pattern,
Context context)
Get the next sibling node that matches a given pattern. |
java.lang.String |
getNodeName()
Get the name of this node, following the DOM rules |
short |
getNodeType()
Return the type of node. |
int |
getNumberAny(Pattern count,
Pattern from,
Context c)
Get node number (level="any"). |
java.util.Vector |
getNumberMulti(Pattern count,
Pattern from,
Context c)
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 c)
Get node number (level="single"). |
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 context)
Get the previous node in document order |
NodeInfo |
getPreviousSibling(Pattern pattern,
Context context)
Get the previous sibling of the node that matches a given pattern. |
long |
getSequenceNumber()
Get the node sequence number (in document order). |
java.lang.String |
getSequentialKey()
Get a character string that uniquely identifies this node and that collates nodes into document order |
java.lang.String |
getSystemId()
Get the base URL for the node. |
java.lang.String |
getURI()
Get the URI part of the name of this node. |
java.lang.String |
getValue()
Return the character value of the node. |
boolean |
hasName(Name name)
Test if the name of the node (including namespaces) is equivalent to the given name |
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 element is the outermost element. |
boolean |
isSameNode(NodeInfo other)
Determine whether this is the same node as another node |
Methods inherited from interface org.w3c.dom.Node |
appendChild, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getNamespaceURI, getNextSibling, getNodeValue, getOwnerDocument, getParentNode, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix |
Field Detail |
public static final short NODE
public static final short ELEMENT
public static final short ATTRIBUTE
public static final short TEXT
public static final short DOCUMENT
public static final short PI
public static final short COMMENT
public static final short NAMESPACE
public static final short NUMBER_OF_TYPES
public static final short NONE
Method Detail |
public short getNodeType()
getNodeType
in interface org.w3c.dom.Node
public 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.
nodeType
- One of the specific node types such as ELEMENT or TEXT, or the general
node type NODEpublic boolean isSameNode(NodeInfo other)
public java.lang.String getSystemId()
public int getLineNumber()
public long getSequenceNumber()
public java.lang.String getValue()
public Name getExpandedName()
public java.lang.String getNodeName()
getNodeName
in interface org.w3c.dom.Node
public java.lang.String getLocalName()
getLocalName
in interface org.w3c.dom.Node
public java.lang.String getPrefix()
getPrefix
in interface org.w3c.dom.Node
public java.lang.String getURI()
public java.lang.String getDisplayName()
public java.lang.String getAbsoluteName()
public boolean hasName(Name name)
public java.lang.String getAttributeValue(Name name)
name
- the name of an attributepublic java.lang.String getAttributeValue(java.lang.String name)
name
- the name of an attribute. This must be an unqualified attribute name,
i.e. one with no namespace.public ElementInfo getAncestor(Name name)
name
- The name of the required ancestorpublic NodeInfo getAncestor(Pattern pat, Context context) throws org.xml.sax.SAXException
pattern
- A pattern that the ancestor node must satisfy.public boolean isDocumentElement()
public boolean isAncestor(NodeInfo other)
other
- the other node (the putative descendant of this node)public org.w3c.dom.Element getDocumentElement()
public DocumentInfo getDocumentRoot()
public NodeInfo getNextSibling(Pattern pattern, Context context) throws org.xml.sax.SAXException
pattern
- The match-pattern that the required sibling must matchpublic NodeInfo getNextInDocument(NodeInfo anchor)
anchor:
- the scan stops when it reaches a node that is not a descendant of the specified
anchor nodepublic NodeInfo getFirstChild(Pattern pattern, Context context) throws org.xml.sax.SAXException
pattern:
- identifies the pattern to be matched by the required childpublic NodeInfo getPreviousSibling(Pattern pattern, Context context) throws org.xml.sax.SAXException
pattern
- The match-pattern that the required sibling must matchpublic NodeInfo getPreviousInDocument()
public NodeInfo getPreviousInDocument(Pattern pattern, Context context) throws org.xml.sax.SAXException
pattern:
- identifies a pattern the required nodepublic NodeInfo getLastChild(Pattern pattern, Context context) throws org.xml.sax.SAXException
pattern:
- identifies the pattern to be matched by the required childpublic int getNumberOfChildren()
public NodeInfo[] getAllChildNodes()
public int getIndex()
public int getNumberSimple(Context context)
public int getNumberSimple() throws org.xml.sax.SAXException
public int getNumberSingle(Pattern count, Pattern from, Context c) throws org.xml.sax.SAXException
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 c) throws org.xml.sax.SAXException
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 c) throws org.xml.sax.SAXException
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.public java.lang.String getSequentialKey()
public void defaultAction(Context c) throws org.xml.sax.SAXException
public void copy(Outputter out) throws org.xml.sax.SAXException
public void copyStringValue(Outputter out) throws org.xml.sax.SAXException
public java.lang.String getPath()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |