Tutorial XML

RUMAH XML Pengantar XML XML Cara menggunakan Pohon XML Sintaks XML Elemen XML Atribut XML Ruang Nama XML Tampilan XML XML HttpRequest Pengurai XML XML DOM XML XPath XML XSLT XML XQuery XML XLink Validator XML XML DTD Skema XML Server XML Contoh XML Kuis XML Sertifikat XML

XML AJAX

Pengenalan AJAX AJAX XMLHttp Permintaan AJAX Tanggapan AJAX File XML AJAX AJAX PHP AJAX ASP Basis Data AJAX Aplikasi AJAX Contoh AJAX

XML DOM

Pengenalan DOM Node DOM Mengakses DOM Info Simpul DOM Daftar Simpul DOM Melintasi DOM Navigasi DOM DOM Dapatkan Nilai DOM Ubah Node DOM Hapus Node DOM Ganti Node DOM Buat Node DOM Tambahkan Node Node Klon DOM Contoh DOM

Tutorial XPath

Pengenalan XPath Node XPath Sintaks XPath Sumbu XPath Operator XPath Contoh XPath

Tutorial XSLT

Pengenalan XSLT Bahasa XSL Transformasi XSLT XSLT <templat> XSLT <nilai-dari> XSLT <untuk-setiap> XSLT <sort> XSLT <jika> XSLT <pilih> Terapkan XSLT XSLT di Klien XSLT di Server XSLT Sunting XML Contoh XSLT

Tutorial XQuery

Pengenalan XQuery Contoh XQuery XQuery FLWOR HTML XQuery Persyaratan XQuery Sintaks XQuery Tambahkan XQuery XQuery Pilih Fungsi XQuery

XML DTD

Pengenalan DTD Blok Bangunan DTD Elemen DTD Atribut DTD Elemen DTD vs Attr Entitas DTD Contoh DTD

Skema XSD

Pengenalan XSD XSD Bagaimana caranya? XSD <skema> Elemen XSD Atribut XSD Pembatasan XSD

Kompleks XSD

Elemen XSD XSD Kosong Elemen XSD Saja Hanya Teks XSD Campuran XSD Indikator XSD XSD <apa saja> XSD <anyAttribute> Pergantian XSD Contoh XSD

Data XSD

String XSD Tanggal XSD XSD Numerik XSD Lain-lain Referensi XSD

Layanan Web

Layanan XML XML WSDL XML SOAP XML RDF XML RSS

Referensi

Jenis Node DOM Simpul DOM Daftar Simpul DOM DOM BernamaNodeMap Dokumen DOM Elemen DOM Atribut DOM Teks DOM DOM CDATA Komentar DOM DOM XMLHttpRequest Pengurai DOM Elemen XSLT Fungsi XSLT/XPath

Jenis Node XML DOM


DOM menyajikan dokumen sebagai hierarki objek simpul.


Cobalah Sendiri - Contoh

Contoh di bawah ini menggunakan file XML books.xml .

×

tajuk


Tipe Node

Tabel berikut mencantumkan jenis simpul W3C yang berbeda, dan jenis simpul mana yang mungkin mereka miliki sebagai turunan:

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


Jenis Node - Nilai Kembali

Tabel berikut mencantumkan apa yang akan dikembalikan oleh nodeName dan properti nodeValue untuk setiap jenis node:

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 - Konstanta Bernama

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