com.sun.xml.tree
Interface NodeEx
- All Known Subinterfaces:
- ElementEx
- All Known Implementing Classes:
- com.sun.xml.tree.NodeBase
- public abstract interface NodeEx
- extends Node, XmlWritable
This interface defines accessors to inherited attributes of nodes,
and provides support for using XML Namespaces.
Fields inherited from class 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 |
int |
getIndexOf(Node maybeChild)
Returns the index of the node in the list of children, such
that item() will return that child. |
java.lang.String |
getInheritedAttribute(java.lang.String name)
Returns the value of a given attribute, tracing up through
ancestors if needed. |
java.lang.String |
getInheritedAttribute(java.lang.String uri,
java.lang.String name)
Returns the value of a given attribute, tracing up through
ancestors if needed and conforming to the XML Namespaces
draft for associating URIs with name prefixes. |
java.lang.String |
getLanguage()
Returns the language id (value of xml:lang
attribute) applicable to this node, if known. |
Methods inherited from interface org.w3c.dom.Node |
appendChild,
cloneNode,
getAttributes,
getChildNodes,
getFirstChild,
getLastChild,
getNextSibling,
getNodeName,
getNodeType,
getNodeValue,
getOwnerDocument,
getParentNode,
getPreviousSibling,
hasChildNodes,
insertBefore,
removeChild,
replaceChild,
setNodeValue |
getInheritedAttribute
public java.lang.String getInheritedAttribute(java.lang.String name)
- Returns the value of a given attribute, tracing up through
ancestors if needed. In the XML standard, two attributes are
inherited: xml:lang and xml:space. A very
similar mechanism is involved with Cascading Style Sheets (CSS).
XML Namespaces also use inheritance, using attributes with
names like xmlns:foo to declare namespace prefixes.
- Parameters:
name
- The name of the attribute to be found. Colons in
this are ignored.- Returns:
- the value of the identified attribute, or null if no
such attribute is found.
getInheritedAttribute
public java.lang.String getInheritedAttribute(java.lang.String uri,
java.lang.String name)
- Returns the value of a given attribute, tracing up through
ancestors if needed and conforming to the XML Namespaces
draft for associating URIs with name prefixes.
- Parameters:
uri
- The namespace for the name; may be null to indicate
the document's default namespace.name
- The "local part" of the name, without a colon.- Returns:
- the value of the identified attribute, or null if no
such attribute is found.
getLanguage
public java.lang.String getLanguage()
- Returns the language id (value of
xml:lang
attribute) applicable to this node, if known. Traces up
through ancestors as needed.
- Returns:
- the value of the xml:lang attribute, or
null if no such attribute is found.
getIndexOf
public int getIndexOf(Node maybeChild)
- Returns the index of the node in the list of children, such
that item() will return that child.
- Parameters:
maybeChild
- the node which may be a child of this one- Returns:
- the index of the node in the set of children, or
else -1 if that node is not a child of this node.
Submit Feedback to xml-feedback@java.sun.com
Copyright © 1998-1999 Sun Microsystems, Inc. All Rights Reserved.
Sun Microsystems, Inc.
901 San Antonio Road
Palo Alto, California, 94303, U.S.A.