Logo Search packages:      
Sourcecode: lib-dom-java version File versions  Download package

org::w3c::dom::Element Interface Reference

Inheritance diagram for org::w3c::dom::Element:

org::w3c::dom::Node org::w3c::dom::html::HTMLElement org::w3c::dom::html::HTMLAnchorElement org::w3c::dom::html::HTMLAppletElement org::w3c::dom::html::HTMLAreaElement org::w3c::dom::html::HTMLBaseElement org::w3c::dom::html::HTMLBaseFontElement org::w3c::dom::html::HTMLBlockquoteElement org::w3c::dom::html::HTMLBodyElement org::w3c::dom::html::HTMLBRElement org::w3c::dom::html::HTMLButtonElement org::w3c::dom::html::HTMLDirectoryElement org::w3c::dom::html::HTMLDivElement org::w3c::dom::html::HTMLDListElement org::w3c::dom::html::HTMLFieldSetElement org::w3c::dom::html::HTMLFontElement org::w3c::dom::html::HTMLFormElement org::w3c::dom::html::HTMLFrameElement org::w3c::dom::html::HTMLFrameSetElement org::w3c::dom::html::HTMLHeadElement org::w3c::dom::html::HTMLHeadingElement org::w3c::dom::html::HTMLHRElement org::w3c::dom::html::HTMLHtmlElement org::w3c::dom::html::HTMLIFrameElement org::w3c::dom::html::HTMLImageElement org::w3c::dom::html::HTMLInputElement org::w3c::dom::html::HTMLIsIndexElement org::w3c::dom::html::HTMLLabelElement org::w3c::dom::html::HTMLLegendElement org::w3c::dom::html::HTMLLIElement org::w3c::dom::html::HTMLLinkElement org::w3c::dom::html::HTMLMapElement org::w3c::dom::html::HTMLMenuElement org::w3c::dom::html::HTMLMetaElement org::w3c::dom::html::HTMLModElement org::w3c::dom::html::HTMLObjectElement org::w3c::dom::html::HTMLOListElement org::w3c::dom::html::HTMLOptGroupElement org::w3c::dom::html::HTMLOptionElement org::w3c::dom::html::HTMLParagraphElement org::w3c::dom::html::HTMLParamElement org::w3c::dom::html::HTMLPreElement org::w3c::dom::html::HTMLQuoteElement org::w3c::dom::html::HTMLScriptElement org::w3c::dom::html::HTMLSelectElement org::w3c::dom::html::HTMLStyleElement org::w3c::dom::html::HTMLTableCaptionElement org::w3c::dom::html::HTMLTableCellElement org::w3c::dom::html::HTMLTableColElement org::w3c::dom::html::HTMLTableElement org::w3c::dom::html::HTMLTableRowElement org::w3c::dom::html::HTMLTableSectionElement org::w3c::dom::html::HTMLTextAreaElement org::w3c::dom::html::HTMLTitleElement org::w3c::dom::html::HTMLUListElement

List of all members.


Detailed Description

By far the vast majority of objects (apart from text) that authors encounter when traversing a document are Element nodes. Assume the following XML document:
 <elementExample id="demo">
   <subelement1/>
   <subelement2><subsubelement/></subelement2>
 </elementExample>  

When represented using DOM, the top node is an Element node for "elementExample", which contains two child Element nodes, one for "subelement1" and one for "subelement2". "subelement1" contains no child nodes.

Elements may have attributes associated with them; since the Element interface inherits from Node, the generic Node interface method getAttributes may be used to retrieve the set of all attributes for an element. There are methods on the Element interface to retrieve either an Attr object by name or an attribute value by name. In XML, where an attribute value may contain entity references, an Attr object should be retrieved to examine the possibly fairly complex sub-tree representing the attribute value. On the other hand, in HTML, where all attributes have simple string values, methods to directly access an attribute value can safely be used as a convenience.

Definition at line 36 of file Element.java.


Public Member Functions

Node appendChild (Node newChild) throws DOMException
Node cloneNode (boolean deep)
String getAttribute (String name)
Attr getAttributeNode (String name)
NamedNodeMap getAttributes ()
NodeList getChildNodes ()
NodeList getElementsByTagName (String name)
Node getFirstChild ()
Node getLastChild ()
Node getNextSibling ()
String getNodeName ()
short getNodeType ()
String getNodeValue () throws DOMException
Document getOwnerDocument ()
Node getParentNode ()
Node getPreviousSibling ()
String getTagName ()
boolean hasChildNodes ()
Node insertBefore (Node newChild, Node refChild) throws DOMException
void normalize ()
void removeAttribute (String name) throws DOMException
Attr removeAttributeNode (Attr oldAttr) throws DOMException
Node removeChild (Node oldChild) throws DOMException
Node replaceChild (Node newChild, Node oldChild) throws DOMException
void setAttribute (String name, String value) throws DOMException
Attr setAttributeNode (Attr newAttr) throws DOMException
void setNodeValue (String nodeValue) throws DOMException

Static Public Attributes

static final short ATTRIBUTE_NODE = 2
static final short CDATA_SECTION_NODE = 4
static final short COMMENT_NODE = 8
static final short DOCUMENT_FRAGMENT_NODE = 11
static final short DOCUMENT_NODE = 9
static final short DOCUMENT_TYPE_NODE = 10
static final short ELEMENT_NODE = 1
static final short ENTITY_NODE = 6
static final short ENTITY_REFERENCE_NODE = 5
static final short NOTATION_NODE = 12
static final short PROCESSING_INSTRUCTION_NODE = 7
static final short TEXT_NODE = 3

The documentation for this interface was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index