XML DOM - วัตถุNamedNodeMap
วัตถุ NamedNodeMap แสดงรายการโหนดที่ไม่เรียงลำดับ
วัตถุ NamedNodeMap
โหนดใน NamedNodeMap สามารถเข้าถึงได้ผ่านชื่อของพวกเขา
NamedNodeMap ช่วยให้ตัวเองทันสมัยอยู่เสมอ หากองค์ประกอบถูกลบหรือเพิ่ม ในรายการโหนดหรือเอกสาร XML รายการจะถูกอัพเดตโดยอัตโนมัติ
หมายเหตุ:ในแผนผังโหนดที่มีชื่อ โหนดจะไม่ถูกส่งกลับในลำดับใดโดยเฉพาะ
NamedNodeMap คุณสมบัติอ็อบเจ็กต์
Property | Description |
---|---|
length | Returns the number of nodes in the list |
NamedNodeMap Object Methods
Method | Description |
---|---|
getNamedItem() | Returns the node with the specific name |
getNamedItemNS() | Returns the node with the specific name and namespace |
item() | Returns the node at the specified index |
removeNamedItem() | Removes the node with the specific name |
removeNamedItemNS() | Removes the node with the specific name and namespace |
setNamedItem() | Sets the specified node (by name) |
setNamedItemNS() | Sets the specified node (by name and namespace) |