Java parses the differences between XML Node and Element (recommended), nodeelement
Element and Node are confused because they do not understand the entire xml structure. The following is a brief overview:
Think of the xml document tree of w3c.org:
It can be seen that an xml document consists of element nodes, attribute nodes, and text nodes. bookstore is called a document element or root element and is also an element node.
Xml dom specifies a node in this way.
Each component in the XML document is a node.
The entire Document is a Document node. In java, the Document interface is inherited from the Node interface, indicating the entire XML Document
Each XML tag is an ELEMENT node, that is, an 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 a Text node, that is, a Text node. In java, the Text interface inherits from the CharacterData interface, while CharacterData inherits from the Node interface, indicating the Text content of Element or Attr.
Each XML Attribute is an attribute node, that is, an Attr node. In java, the Attr interface inherits from the Node interface.
A Comment is a Comment node. In java, the Comment interface inherits from the CharacterData interface, while CharacterData inherits from the Node interface.
In fact, every object in the xml document is a node. The element must be a node, but the node may not be an element.
The difference between the above java parsing XML Node and Element (recommended) is all the content shared by the editor. I hope to give you a reference, and I hope you can provide more support to the customer's house.