XML Tutorial

XML หน้าแรก บทนำ XML XML วิธีใช้งาน XML Tree ไวยากรณ์ XML องค์ประกอบ XML คุณสมบัติ XML XML เนมสเปซ จอแสดงผล XML XML HttpRequest XML Parser XML DOM XML XPath XML XSLT XML XQuery XML XLink เครื่องมือตรวจสอบ XML XML DTD XML Schema XML Server ตัวอย่าง XML แบบทดสอบ XML ใบรับรอง XML

XML AJAX

บทนำ AJAX AJAX XMLHttp คำขอ AJAX การตอบสนอง AJAX ไฟล์ AJAX XML AJAX PHP AJAX ASP ฐานข้อมูล AJAX แอปพลิเคชัน AJAX ตัวอย่าง AJAX

XML DOM

บทนำ DOM โหนด DOM การเข้าถึง DOM ข้อมูลโหนด DOM รายการโหนด DOM DOM Traversing การนำทาง DOM DOM รับค่า DOM เปลี่ยนโหนด DOM ลบโหนด DOM แทนที่โหนด DOM สร้างโหนด DOM เพิ่มโหนด DOM โคลนโหนด ตัวอย่าง DOM

บทช่วย สอนXPath

บทนำ XPath โหนด XPath ไวยากรณ์ XPath แกน XPath ตัวดำเนินการ XPath ตัวอย่าง XPath

กวดวิชาXSLT

บทนำ XSLT ภาษา XSL การแปลง XSLT XSLT <แม่แบบ> XSLT <ค่าของ> XSLT <for-each> XSLT <sort> XSLT <if> XSLT <เลือก> ใช้ XSLT XSLT บนไคลเอนต์ XSLT บนเซิร์ฟเวอร์ XSLT แก้ไข XML ตัวอย่าง XSLT

กวดวิชาXQuery

บทนำ XQuery ตัวอย่าง XQuery XQuery FLWOR XQuery HTML ข้อกำหนด XQuery ไวยากรณ์ XQuery XQuery เพิ่ม XQuery Select ฟังก์ชัน XQuery

XML DTD

บทนำ DTD บล็อกตัวต่อ DTD องค์ประกอบ DTD คุณสมบัติ DTD องค์ประกอบ DTD เทียบกับ Attr หน่วยงาน DTD ตัวอย่าง DTD

ส คีมา XSD

บทนำ XSD XSD วิธีการ XSD <schema> องค์ประกอบ XSD แอตทริบิวต์ XSD ข้อจำกัด XSD

XSD Complex

องค์ประกอบ XSD XSD ว่างเปล่า องค์ประกอบ XSD เท่านั้น XSD Text เท่านั้น XSD ผสม ตัวชี้วัด XSD XSD <ใด ๆ> XSD <anyAttribute> การทดแทน XSD XSD ตัวอย่าง

ข้อมูลXSD

XSD สตริง วันที่ XSD XSD ตัวเลข XSD เบ็ดเตล็ด ข้อมูลอ้างอิง XSD

บริการเว็บ

XML Services XML WSDL XML SOAP XML RDF XML RSS

อ้างอิง

ประเภทโหนด DOM โหนด DOM DOM NodeList DOM NamedNodeMap เอกสาร DOM องค์ประกอบ DOM แอตทริบิวต์ DOM ข้อความ DOM DOM CDATA ความคิดเห็นของ DOM DOM XMLHttpRequest DOM Parser องค์ประกอบ XSLT ฟังก์ชัน XSLT/XPath

XML DOM - วัตถุเอกสาร


วัตถุเอกสารแสดงถึงเอกสาร XML ทั้งหมด


วัตถุเอกสาร XML

ออบเจ็กต์ Document เป็นรูทของแผนผังเอกสาร XML และให้สิทธิ์ในการเข้าถึงข้อมูลของเอกสารหลักแก่เรา

เนื่องจากโหนดองค์ประกอบ โหนดข้อความ ความคิดเห็น คำแนะนำในการประมวลผล ฯลฯ ไม่สามารถอยู่ภายนอกเอกสารได้ อ็อบเจ็กต์ Document จึงมีวิธีสร้างอ็อบเจ็กต์เหล่านี้ ออบเจ็กต์โหนดมีคุณสมบัติ OwnerDocument ซึ่งเชื่อมโยงกับเอกสารที่สร้าง

คุณสมบัติอ็อบเจ็กต์เอกสาร

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

วิธีการอ็อบเจ็กต์เอกสาร

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


DocumentType คุณสมบัติอ็อบเจ็กต์

เอกสารแต่ละฉบับมีแอตทริบิวต์ DOCTYPE ที่มีค่าเป็น null หรืออ็อบเจ็กต์ DocumentType

ออบเจ็กต์ DocumentType มีส่วนต่อประสานกับเอนทิตีที่กำหนดไว้สำหรับเอกสาร 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

DocumentImplementation Object Methods

ออบเจ็กต์ DOMImplementation ดำเนินการที่ไม่ขึ้นกับอินสแตนซ์เฉพาะใดๆ ของโมเดลอ็อบเจ็กต์เอกสาร

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 แสดงถึงคำสั่งการประมวลผล

คำสั่งในการประมวลผลถูกใช้เป็นวิธีการเก็บข้อมูลเฉพาะตัวประมวลผลในข้อความของเอกสาร XML

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