XML -zelfstudie

XML HOME XML-introductie XML Hoe te gebruiken XML-structuur XML-syntaxis XML-elementen XML-kenmerken XML-naamruimten XML-weergave XML HTTP-verzoek XML-parser XML-DOM XML XPath XML XSLT XML XQuery XML XLink XML-validator XML-DTD XML Schema XML-server XML-voorbeelden XML-quiz XML-certificaat

XML AJAX

Ajax-introductie AJAX XMLHttp Ajax-verzoek Ajax-reactie AJAX XML-bestand AJAX PHP Ajax ASP AJAX-database AJAX-toepassingen Ajax-voorbeelden

XML-DOM

DOM-introductie DOM-knooppunten DOM-toegang DOM Node Info Lijst met DOM-knooppunten DOM doorkruisen DOM-navigatie DOM Waarden ophalen DOM-wijzigingsknooppunten DOM Knooppunten verwijderen DOM Knooppunten vervangen DOM Knooppunten maken DOM Knooppunten toevoegen DOM-kloonknooppunten DOM-voorbeelden

XPath- zelfstudie

XPath-introductie XPath-knooppunten XPath-syntaxis XPath-assen XPath-operators XPath-voorbeelden

XSLT- zelfstudie

XSLT-introductie XSL-talen XSLT-transformatie XSLT <sjabloon> XSLT <waarde-van> XSLT <voor elk> XSLT <sorteren> XSLT <if> XSLT <kiezen> XSLT toepassen XSLT op de client XSLT op de server XSLT Bewerk XML XSLT-voorbeelden

XQuery- zelfstudie

XQuery-introductie XQuery-voorbeeld XQuery FLWOR XQuery HTML XQuery-voorwaarden XQuery-syntaxis XQuery toevoegen XQuery selecteren XQuery-functies

XML -DTD

DTD Introductie DTD-bouwstenen DTD-elementen DTD-kenmerken DTD Elements vs Attr DTD-entiteiten DTD-voorbeelden

XSD- schema

XSD-introductie XSD Hoe kan ik? XSD <schema> XSD-elementen XSD-kenmerken XSD-beperkingen

XSD- complex

XSD-elementen XSD Leeg Alleen XSD-elementen Alleen XSD-tekst XSD gemengd XSD-indicatoren XSD <elke> XSD <anyAttribute> XSD-vervanging XSD-voorbeeld

XSD- gegevens

XSD-string XSD-datum XSD Numeriek XSD Diversen XSD-referentie

Webservices _

XML-services XML-WSDL XML SOAP XML-RDF XML-RSS

Referenties

Typen DOM-knooppunten DOM Node DOM-knooppuntlijst DOM NamedNodeMap DOM-document DOM-element DOM-kenmerk DOM-tekst DOM CDATA DOM-opmerking DOM XMLHttpRequest DOM-parser XSLT-elementen XSLT/XPath-functies

XML DOM- knooppunttypen


De DOM presenteert een document als een hiërarchie van knooppuntobjecten.


Probeer het zelf - Voorbeelden

De onderstaande voorbeelden gebruiken het XML-bestand books.xml .

×

koptekst


Knooppunttypen

De volgende tabel geeft een overzicht van de verschillende W3C-knooppunttypen en welke typen knooppunten ze als kinderen kunnen hebben:

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


Knooppunttypen - Retourwaarden

In de volgende tabel wordt weergegeven wat de eigenschappen nodeName en nodeValue voor elk knooppunttype retourneren:

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 - benoemde constanten

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