XML -Tutorial

XML-HOME XML-Einführung XML-Wie zu verwenden XML-Baum XML-Syntax XML-Elemente XML-Attribute XML-Namespaces XML-Anzeige XML-HttpRequest XML-Parser XML-DOM XML-XPath XML-XSLT XML-XQuery XML-XLink XML-Validierer XML-DTD XML-Schema XML-Server XML-Beispiele XML-Quiz XML-Zertifikat

XML-AJAX

AJAX-Einführung AJAX-XMLHttp AJAX-Anfrage AJAX-Antwort AJAX-XML-Datei AJAX-PHP AJAX ASP AJAX-Datenbank AJAX-Anwendungen AJAX-Beispiele

XML-DOM

DOM-Einführung DOM-Knoten DOM-Zugriff DOM-Knoten-Info DOM-Knotenliste DOM-Traversierung DOM-Navigation DOM Get-Werte DOM-Änderungsknoten DOM-Knoten entfernen DOM-Ersetzungsknoten DOM-Knoten erstellen DOM-Knoten hinzufügen DOM-Klonknoten DOM-Beispiele

XPath -Tutorial

XPath-Einführung XPath-Knoten XPath-Syntax XPath-Achsen XPath-Operatoren XPath-Beispiele

XSLT -Tutorial

XSLT-Einführung XSL-Sprachen XSLT-Transformation XSLT <Vorlage> XSLT <Wert von> XSLT <für-jeden> XSLT <sortieren> XSLT <wenn> XSLT <auswählen> XSLT anwenden XSLT auf dem Client XSLT auf dem Server XSLT XML bearbeiten XSLT-Beispiele

XQuery- Tutorial

XQuery-Einführung XQuery-Beispiel XQuery FLWOR XQuery-HTML XQuery-Bedingungen XQuery-Syntax XQuery hinzufügen XQuery-Auswahl XQuery-Funktionen

XML -DTD

DTD-Einführung DTD-Bausteine DTD-Elemente DTD-Attribute DTD-Elemente vs. Attr DTD-Entitäten DTD-Beispiele

XSD- Schema

XSD-Einführung XSD-Anleitung XSD <Schema> XSD-Elemente XSD-Attribute XSD-Einschränkungen

XSD- Komplex

XSD-Elemente XSD leer Nur XSD-Elemente Nur XSD-Text XSD gemischt XSD-Indikatoren XSD <beliebig> XSD <beliebiges Attribut> XSD-Ersetzung XSD-Beispiel

XSD -Daten

XSD-String XSD-Datum XSD Numerisch XSD Sonstiges XSD-Referenz

Webdienste _

XML-Dienste XML-WSDL XML-SOAP XML-RDF XML-RSS

Verweise

DOM-Knotentypen DOM-Knoten DOM-Knotenliste DOM NamedNodeMap DOM-Dokument DOM-Element DOM-Attribut DOM-Text DOM-CDATA DOM-Kommentar DOM-XMLHttpRequest DOM-Parser XSLT-Elemente XSLT/XPath-Funktionen

XML DOM - Das Node -Objekt


Das Node-Objekt

Das Node-Objekt repräsentiert einen einzelnen Knoten in der Dokumentstruktur.

Ein Knoten kann ein Elementknoten, ein Attributknoten, ein Textknoten oder ein beliebiger anderer Knotentyp sein, der im Kapitel Knotentypen erläutert wird .

Beachten Sie, dass, obwohl alle Objekte die Node-Eigenschaften/Methoden für den Umgang mit Eltern und Kindern erben, nicht alle Objekte Eltern oder Kinder haben können. Beispielsweise haben Textknoten möglicherweise keine untergeordneten Elemente, und das Hinzufügen von untergeordneten Elementen zu solchen Knoten führt zu einem DOM-Fehler.

Knotenobjekteigenschaften

Property Description
attributes A NamedNodeMap containing the attributes of this node (if it is an Element)
baseURI Returns the absolute base URI of a node
childNodes Returns a NodeList of child nodes for a node
firstChild Returns the first child of a node
lastChild Returns the last child of a node
nextSibling Returns the node immediately following a node
nodeName Returns the name of a node, depending on its type
nodeType Returns the type of a node
nodeValue Sets or returns the value of a node, depending on its type
ownerDocument Returns the root element (document object) for a node
parentNode Returns the parent node of a node
prefix Sets or returns the namespace prefix of a node
previousSibling Returns the node immediately before a node
textContent Sets or returns the textual content of a node and its descendants


Knotenobjektmethoden

Method Description
appendChild() Appends a new child node to the end of the list of children of a node
cloneNode() Clones a node
compareDocumentPosition() Compares the placement of two nodes in the DOM hierarchy (document)
getFeature(feature,version) Returns a DOM object which implements the specialized APIs of the specified feature and version
getUserData(key) Returns the object associated to a key on a this node. The object must first have been set to this node by calling setUserData with the same key
hasAttributes() Returns true if the specified node has any attributes, otherwise false
hasChildNodes() Returns true if the specified node has any child nodes, otherwise false
insertBefore() Inserts a new child node before an existing child node
isDefaultNamespace(URI) Returns whether the specified namespaceURI is the default
isEqualNode() Tests whether two nodes are equal
isSameNode() Tests whether the two nodes are the same node
lookupNamespaceURI() Returns the namespace URI associated with a given prefix
lookupPrefix() Returns the prefix associated with a given namespace URI
normalize() Puts all Text nodes underneath a 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
removeChild() Removes a specified child node from the current node
replaceChild() Replaces a child node with a new node
setUserData(key,data,handler) Associates an object to a key on a node