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 -Knotentypen


Das DOM stellt ein Dokument als Hierarchie von Knotenobjekten dar.


Probieren Sie es selbst aus - Beispiele

Die folgenden Beispiele verwenden die XML-Datei books.xml .

×

Header


Knotentypen

Die folgende Tabelle listet die verschiedenen W3C-Knotentypen auf und welche Knotentypen sie möglicherweise als Kinder haben:

Node Type Description Children
Document Represents the entire document (the root-node of the DOM tree) Element (max. one), ProcessingInstruction, Comment, DocumentType
DocumentFragment Represents a "lightweight" Document object, which can hold a portion of a document Element, ProcessingInstruction, Comment, Text, CDATASection, EntityReference
DocumentType Provides an interface to the entities defined for the document None
ProcessingInstruction Represents a processing instruction None
EntityReference Represents an entity reference Element, ProcessingInstruction, Comment, Text, CDATASection, EntityReference
Element Represents an element Element, Text, Comment, ProcessingInstruction, CDATASection, EntityReference
Attr Represents an attribute Text, EntityReference
Text Represents textual content in an element or attribute None
CDATASection Represents a CDATA section in a document (text that will NOT be parsed by a parser) None
Comment Represents a comment None
Entity Represents an entity Element, ProcessingInstruction, Comment, Text, CDATASection, EntityReference
Notation Represents a notation declared in the DTD None


Knotentypen - Rückgabewerte

Die folgende Tabelle listet auf, was die Eigenschaften nodeName und nodeValue für jeden Knotentyp zurückgeben:

Node Type nodeName returns nodeValue returns
Document #document null
DocumentFragment #document fragment null
DocumentType doctype name null
EntityReference entity reference name null
Element element name null
Attr attribute name attribute value
ProcessingInstruction target content of node
Comment #comment comment text
Text #text content of node
CDATASection #cdata-section content of node
Entity entity name null
Notation notation name null

NodeTypes - Benannte Konstanten

NodeType Named Constant
1 ELEMENT_NODE
2 ATTRIBUTE_NODE
3 TEXT_NODE
4 CDATA_SECTION_NODE
5 ENTITY_REFERENCE_NODE
6 ENTITY_NODE
7 PROCESSING_INSTRUCTION_NODE
8 COMMENT_NODE
9 DOCUMENT_NODE
10 DOCUMENT_TYPE_NODE
11 DOCUMENT_FRAGMENT_NODE
12 NOTATION_NODE