Interface org.w3c.dom.Node | Level 1 |
Jeder Knoten hat einen Namen, der mit getNodeName() ermittelt werden kann, sowie einen Wert, der mit getValue() festgestellt werden kann. Die folgende Tabelle zeigt, wie der Name und der Wert in Abhängigkeit vom Knotentyp belegt sind.
Tabelle 69.1: Knotentyp Name Wert Attr Attributname Attributwert CDATASection "#cdata-section" Inhalt des CDATA-Abschnitts Comment "#comment" Text des Kommentars Document "#document" null DocumentFragment "#document-fragment" null DocumentType Name des Dokumententyps null Element Elementname null Entity Name der Entity null EntityReference Name der Referenz null Notation Name der Notation null ProcessingInstruction Inhalt ohne Target Anweisung Text "#text" Der Text selbst
Datenelemente | |
---|---|
public static final short | ATTRIBUTE_NODE |
public static final short | CDATA_SECTION_NODE |
public static final short | COMMENT_NODE |
public static final short | DOCUMENT_FRAGMENT_NODE |
public static final short | DOCUMENT_NODE |
public static final short | DOCUMENT_TYPE_NODE |
public static final short | ELEMENT_NODE |
public static final short | ENTITY_NODE |
public static final short | ENTITY_REFERENCE_NODE |
public static final short | NOTATION_NODE |
public static final short | PROCESSING_INSTRUCTION_NODE |
public static final short | TEXT_NODE |
Methoden | |
---|---|
public Node | appendChild(Node newChild) |
public Node | cloneNode(boolean deep) |
public NamedNodeMap | getAttributes() |
public NodeList | getChildNodes() |
public Node | getFirstChild() |
public Node | getLastChild() |
public String | getLocalName() ![]() |
public String | getNameSpaceURI() ![]() |
public Node | getNextSibling() |
public String | getNodeName() |
public short | getNodeType() |
public String | getNodeValue() |
public Document | getOwnerDocument() |
public Node | getParentNode() |
public String | getPrefix() ![]() |
public Node | getPreviousSibling() |
public boolean | hasAttributes() ![]() |
public boolean | hasChildNodes() |
public Node | insertBefore(Node newChild, Node refChild) |
public boolean | isSupported(String feature, String version) ![]() |
public boolean | normalize() ![]() |
public Node | removeChild(Node oldChild) |
public Node | replaceChild(Node newChild, Node oldChild) |
public void | setNodeValue(String nodeValue) |
public void | setPrefix(String prefix) ![]() |
Bei deep wird eine rekursive (tiefe) Kopie erzeugt, d. h., auch der gesamte Unterbaum wird kopiert. In beiden Fällen wird kein Wert für den Vaterknoten gesetzt, d. h., getParentNode() liefert null.