In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces the relevant knowledge of "what is the difference between node and element in xml". The editor shows you the operation process through an actual case, the operation method is simple and fast, and it is practical. I hope this article "what is the difference between node and element in xml" can help you solve the problem.
The difference between node and element in xml is: Element is an element, is a small-scale definition, is a part of data, and must be a node containing complete information is an element; while Node is a node, relative to the TREE data structure, a node is not necessarily an element, an element must be a node.
The operating environment of this tutorial: windows10 system, xml3.0 version, Dell G3 computer.
What is the difference between node and element in xml
The difference between an element (Element) and a node (Node). An element is a small definition. It must be a node with complete information to be an element, such as
...
. But a node is not necessarily an element, and an element must be a node.
What is node:
NODE is relative to the data structure of TREE. TREE is made up of NODE. You can refer to the tree diagram of discrete mathematics in this section.
What is element?
ELEMENT is a concept in XML, which is an element, and is one of the components of the data in XML.
The difference between an Element and a Node is that an element is a small definition and must be an element that contains complete information, such as
...
. But a node is not necessarily an element, and an element must be a node.
The reason why you are confused about Element and Node is that you don't know the whole structure of xml. Here is a brief overview:
As can be seen from the above figure, an xml document is composed of element nodes, attribute nodes, and text nodes, where bookstore is called a document element or root element, and is also an element node.
This is how XML DOM defines a node.
Each component in an XML document is a node.
The whole document is a document node, that is, the Document node. In java, the Document interface inherits from the Node interface and represents the entire XML document
Each XML tag is an element node, the ELEMENT node. In Java, the Element interface inherits from the Node interface to represent an element in the XML document.
The text contained in the XML element is the text node, the Text node. In java, the Text interface inherits from the CharacterData interface, while CharacterData inherits from the Node interface, representing the text content of Element or Attr
Each XML attribute is an attribute node, namely Attr node. The Attr interface inherits from the Node interface in java. Comments belong to the comment node, that is, the Comment node. The Comment interface inherits from the CharacterData interface in java, while CharacterData inherits from the Node interface
So in fact, every object in an xml document is a node. An element must be a node, and a node may not be an element.
This is the end of the content about "what is the difference between node and element in xml". Thank you for reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.
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: 0
*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.