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

XML DOM - Objek Dokumen


Objek Dokumen mewakili seluruh dokumen XML.


Objek Dokumen XML

Objek Dokumen adalah akar dari pohon dokumen XML, dan memberi kita akses utama ke data dokumen.

Karena node elemen, node teks, komentar, instruksi pemrosesan, dll. tidak dapat berada di luar dokumen, objek Dokumen juga berisi metode untuk membuat objek ini. Objek Node memiliki properti ownerDocument yang mengaitkannya dengan Dokumen tempat mereka dibuat.

Properti Objek Dokumen

Property Description
childNodes Returns a NodeList of child nodes for the document
doctype Returns the Document Type Declaration associated with the document
documentElement Returns the root node of the document
documentURI Sets or returns the location of the document
domConfig Returns the configuration used when normalizeDocument() is invoked
firstChild Returns the first child node of the document
implementation Returns the DOMImplementation object that handles this document
inputEncoding Returns the encoding used for the document (when parsing)
lastChild Returns the last child node of the document
nodeName Returns the name of a node (depending on its type)
nodeType Returns the node type of a node
nodeValue Sets or returns the value of a node (depending on its type)
xmlEncoding Returns the XML encoding of the document
xmlStandalone Sets or returns whether the document is standalone
xmlVersion Sets or returns the XML version of the document

Metode Objek Dokumen

Method Description
adoptNode(sourcenode) Adopts a node from another document to this document, and returns the adopted node
createAttribute(name) Creates an attribute node with the specified name, and returns the new Attr object
createAttributeNS(uri,name) Creates an attribute node with the specified name and namespace, and returns the new Attr object
createCDATASection() Creates a CDATA section node
createComment() Creates a comment node
createDocumentFragment() Creates an empty DocumentFragment object, and returns it
createElement() Creates an element node
createElementNS() Creates an element node with a specified namespace
createEntityReference(name) Creates an EntityReference object, and returns it
createProcessingInstruction(target,data) Creates a ProcessingInstruction object, and returns it
createTextNode() Creates a text node
getElementById(id) Returns the element that has an ID attribute with the given value. If no such element exists, it returns null
getElementsByTagName() Returns a NodeList of all elements with a specified name
getElementsByTagNameNS() Returns a NodeList of all elements with a specified name and namespace
importNode(nodetoimport,deep) Imports a node from another document to this document. This method creates a new copy of the source node. If the deep parameter is set to true, it imports all children of the specified node. If set to false, it imports only the node itself. This method returns the imported node
normalizeDocument()  
renameNode() Renames an element or attribute node


Properti Objek Jenis Dokumen

Setiap dokumen memiliki atribut DOCTYPE yang nilainya null atau objek DocumentType.

Objek DocumentType menyediakan antarmuka ke entitas yang ditentukan untuk dokumen XML.

Property Description
name Returns the name of the DTD
publicId Returns the public identifier of the DTD
systemId Returns the system identifier of the external DTD

Metode Objek Implementasi Dokumen

Objek DOMIimplementation melakukan operasi yang independen dari setiap contoh tertentu dari model objek dokumen.

Method Description
createDocument(nsURI, name, doctype) Creates a new DOM Document object of the specified doctype
createDocumentType(name, pubId, systemId) Creates an empty DocumentType node
getFeature(feature, version) Returns an object which implements the APIs of the specified feature and version, if the is any
hasFeature(feature, version) Checks whether the DOM implementation implements a specific feature and version

ProcessingInstruction Object Properties

Objek ProcessingInstruction mewakili instruksi pemrosesan.

Instruksi pemrosesan digunakan sebagai cara untuk menyimpan informasi khusus prosesor dalam teks dokumen XML.

Property Description
data Sets or returns the content of this processing instruction
target Returns the target of this processing instruction