XML DOM Basics
XML DOM Operations
XML DOM Objects
XML DOM Useful Resources
Selected Reading
- XML DOM - Accessing
- XML DOM - Navigation
- XML DOM - Traversing
- XML DOM - Loading
- XML DOM - Methods
- XML DOM - Node Tree
- XML DOM - Nodes
- XML DOM - Model
- XML DOM - Overview
- XML DOM - Home
XML DOM Operations
- XML DOM - Clone Node
- XML DOM - Remove Node
- XML DOM - Replace Node
- XML DOM - Add Node
- XML DOM - Create Node
- XML DOM - Set Node
- XML DOM - Get Node
XML DOM Objects
- DOM - DOMException Object
- DOM - XMLHttpRequest Object
- DOM - Comment Object
- DOM - CDATASection Object
- DOM - Attribute Object
- DOM - Element Object
- DOM - Notation Object
- DOM - EntityReference Object
- DOM - Entity Object
- DOM - ProcessingInstruction
- DOM - DocumentType Object
- DOM - DOMImplementation
- DOM - NamedNodeMap Object
- DOM - NodeList Object
- DOM - Node Object
XML DOM Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
XML DOM - Accessing
XML DOM - Accessing
在本章中,我们将研究如何进入作为《禁止杀伤人员地雷公约》文件信息单位的XML DOM节点。 XML DOM的代号结构允许开发商在树木周围收集具体信息,同时获取信息。
Accessing Nodes
下面是你可以接触节点的三种方式:
采用getElementsByTagName ()方法
通过树苗的 lo或 trav树
通过利用 no子关系挖掘 no树
getElementsByTagName ()
这种方法通过明确姓名,可以查阅通知。 它还允许查阅Node List和Node List Length的资料。
Syntax
甲型六氯环己烷法有以下合成物:
node.getElementByTagName("tagname");
如果有,
Example
下面是说明使用方法的简单方案。
<!DOCTYPE html> <html> <body> <span> <b>FirstName:</b> <span id = "FirstName"></span><br> <b>LastName:</b> <span id = "LastName"></span><br> <b>Category:</b> <span id = "Employee"></span><br> </span> <script> if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.open("GET","/dom/node.xml",false); xmlhttp.send(); xmlDoc = xmlhttp.responseXML; document.getElementById("FirstName").innerHTML = xmlDoc.getElementsByTagName("FirstName")[0].childNodes[0].nodeValue; document.getElementById("LastName").innerHTML = xmlDoc.getElementsByTagName("LastName")[0].childNodes[0].nodeValue; document.getElementById("Employee").innerHTML = xmlDoc.getElementsByTagName("Employee")[0].attributes[0].nodeValue; </script> </body> </html>
In the above example, we are accessing the information of the nodes FirstName, LastName and Employee.
xmlDoc.getElementsByTagName (“FirstName”) [0].childNodes[0]. 价值: 这条线使用“获得”方法获取儿童节点的价值。
xmlDoc.getElementsByTagName(“Employee”)[0].attributes [0].node 价值: 这条线可使用以下方法的属性价值:Employee 获取ElementByTagName()方法。
Traversing Through Nodes
本章涉及:
with example.Navigating Through Nodes
本章涉及:
,有实例。 Advertisements