Esercitazione XML

XML CASA Introduzione XML XML Come usare Albero XML Sintassi XML Elementi XML Attributi XML Spazi dei nomi XML Visualizzazione XML Richiesta HTTP XML Analizzatore XML XML DOM XPath XML XML XSLT XQuery XML XML XLink Validatore XML DTD XML Schema XML Server XML Esempi XML Quiz XML Certificato XML

XML AJAX

Introduzione AJAX AJAX XMLHttp Richiesta AJAX Risposta dell'AJAX File XML AJAX AJAX PHP AJAX ASP Database AJAX Applicazioni AJAX Esempi AJAX

XML DOM

DOM Introduzione Nodi DOM Accesso DOM Informazioni sul nodo DOM Elenco dei nodi DOM DOM attraversando Navigazione DOM DOM Ottieni valori Nodi di modifica DOM DOM Rimuovere i nodi DOM Sostituisci nodi DOM Crea nodi DOM Aggiungi nodi Clonazione dei nodi DOM Esempi DOM

Esercitazione XPath

Introduzione a XPath Nodi XPath Sintassi XPath Assi XPath Operatori XPath Esempi di XPath

Esercitazione XSLT

Introduzione a XSLT Lingue XSL Trasformazione XSLT XSLT <modello> XSLT <valore-di> XSLT <per-ciascuno> XSLT <ordina> XSLT <se> XSLT <scegli> Applicare XSLT XSLT sul Cliente XSLT sul server XSLT Modifica XML Esempi XSLT

Esercitazione XQuery

Introduzione a XQuery Esempio XQuery XQuery FLWOR XQuery HTML Termini di XQuery Sintassi XQuery Aggiungi XQuery XQuery Seleziona Funzioni XQuery

DTD XML

Introduzione alla DTD Blocchi di costruzione DTD Elementi DTD Attributi DTD Elementi DTD vs Attr Entità DTD Esempi di DTD

Schema XSD

Introduzione all'XSD XSD Come fare per XSD <schema> Elementi XSD Attributi XSD Restrizioni XSD

Complesso XSD

Elementi XSD XSD vuoto Solo elementi XSD Solo testo XSD XSD misto Indicatori XSD XSD <qualsiasi> XSD <qualsiasi attributo> Sostituzione XSD Esempio XSD

Dati XSD

Stringa XSD Data XSD Numerico XSD XSD Varie Riferimento XSD

Servizi Web

Servizi XML XML WSDL SAPONE XML XML RDF RSS XML

Riferimenti

Tipi di nodi DOM Nodo DOM Elenco nodi DOM DOM NamedNodeMap Documento DOM Elemento DOM Attributo DOM Testo DOM DOM CDATA Commento DOM DOM XMLHttpRichiesta Analizzatore DOM Elementi XSLT Funzioni XSLT/XPath

Tipi di nodi DOM XML


Il DOM presenta un documento come una gerarchia di oggetti nodo.


Provalo tu stesso - Esempi

Gli esempi seguenti utilizzano il file XML books.xml .

×

Intestazione


Tipi di nodi

La tabella seguente elenca i diversi tipi di nodo W3C e quali tipi di nodo possono avere come figli:

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


Tipi di nodi - Valori di ritorno

La tabella seguente elenca ciò che le proprietà nodeName e nodeValue restituiranno per ogni tipo di nodo:

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 - Costanti denominate

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