In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
In this issue, the editor will bring you about the relationship between XML DOM and HTML DOM. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.
To describe the difference and relationship between XML DOM and HTML DOM, DOM (DocumentObjectModel, document object Model) defines a set of standard ways to access and manipulate documents. First, let's take a look at the use of XML DOM.
XML DOM
XML DOM (XMLDocumentObjectModel) defines a standard set of methods for accessing and manipulating XML documents.
DOM views XML documents as a tree structure. All elements can be accessed through the DOM tree. You can modify or delete their contents and create new elements. Elements, their text, and their attributes are all considered nodes.
In the following example, we use the DOM reference to get the text from the element:
XmlDoc.getElementsByTagName ("to") [0] .childNodes [0] .nodeValue
◆ xmlDoc- an XML document created by a parser
◆ getElementsByTagName ("to") [0]-* * elements
◆ childNodes [0]-* child elements of the element (text node)
The value of the ◆ nodeValue- node (text itself)
You can learn more about it in 51cto.com 's XML DOM tutorials.
HTML DOM
HTML DOM (HTMLDocumentObjectModel) defines a standard set of methods for accessing and manipulating HTML documents.
All HTML elements can be accessed through HTML DOM.
In the following example, we use the DOM reference to change the text of the HTML element of the id= "to":
Document.getElementById ("to") [xss_clean] =
◆ document-HTML documentation
◆ getElementById ("to")-the HTML element of id= "to" in it
The internal text of the ◆ innerHTML-HTML element
This is what the relationship between XML DOM and HTML DOM shared by the editor is. If you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 250
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.