Tutoriel XML

ACCUEIL XML Introduction XML XML Comment utiliser Arbre XML Syntaxe XML Éléments XML Attributs XML Espaces de noms XML Affichage XML Requête HTTP XML Analyseur XML DOM XML XPath XML XML XSLT XQuery XML XMLXLink Validateur XML DTD XML Schéma XML Serveur XML Exemples XML XML Quiz Certificat XML

XMLAJAX

Présentation d'AJAX AJAX XMLHttp Requête AJAX Réponse AJAX Fichier XML AJAX PHP AJAX ASP AJAX Base de données AJAX Applications AJAX Exemples AJAX

DOM XML

Présentation du DOM Nœuds DOM Accès au DOM Informations sur le nœud DOM Liste des nœuds DOM Traversée du DOM Navigation DOM DOM Obtenir des valeurs Nœuds de changement DOM DOM Supprimer les nœuds DOM Remplacer les nœuds DOM Créer des nœuds DOM Ajouter des nœuds Nœuds de clonage DOM Exemples DOM

Tutoriel XPath

Présentation de XPath Nœuds XPath Syntaxe XPath Axes XPath Opérateurs XPath Exemples XPath

Tutoriel XSLT

Présentation de XSLT Langages XSL Transformation XSLT XSLT <modèle> XSLT <valeur-de> XSLT <pour-chaque> XSLT <sort> XSLT <si> XSLT <choisir> Appliquer XSLT XSLT sur le client XSLT sur le serveur XSLT Éditer XML Exemples XSLT

Tutoriel XQuery

Présentation de XQuery Exemple XQuery XQuery FLWOR XQuery HTML Termes XQuery Syntaxe XQuery Ajouter XQuery Sélection XQuery Fonctions XQuery

DTD XML

Présentation de la DTD Blocs de construction DTD Éléments DTD Attributs DTD Éléments DTD vs Attr Entités DTD Exemples de DTD

Schéma XSD

Présentation XSD Comment XSD XSD <schéma> Éléments XSD Attributs XSD Restrictions XSD

Complexe XSD

Éléments XSD XSD vide Éléments XSD uniquement Texte XSD uniquement XSD Mixte Indicateurs XSD XSD <tout> XSD <anyAttribute> Remplacement XSD Exemple XSD

Données XSD

Chaîne XSD Date XSD Numérique XSD Divers XSD Référence XSD

Services Web

Services XML XMLWSDL SAVON XML XML RDF XML RSS

Les références

Types de nœuds DOM Nœud DOM Liste de nœuds DOM DOM NamedNodeMap Documents DOM Élément DOM Attribut DOM Texte DOM DOM CDATA DOM Comment DOM XMLHttpRequest Analyseur DOM Éléments XSLT Fonctions XSLT/XPath

Types de nœud XML DOM


Le DOM présente un document comme une hiérarchie d'objets nœuds.


Essayez-le vous-même - Exemples

Les exemples ci-dessous utilisent le fichier XML books.xml .

×

Entête


Types de nœuds

Le tableau suivant répertorie les différents types de nœuds W3C et les types de nœuds qu'ils peuvent avoir comme enfants :

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


Types de nœud - Valeurs de retour

Le tableau suivant répertorie ce que les propriétés nodeName et nodeValue renverront pour chaque type de nœud :

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 - Constantes nommées

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