dom - Why are Nodes and Elements different in XML? What was the rationale? -
After writing the code running on XML for a while, I have always thought that the reason for having both nodes and elements is ? (We know). Both tags (more or less) and represent different ways, just make the code complicated.
Are there any special semantics or practical reasons, or is it true that a committee of DOM Spectac originated?
The node element has a base class - pretty much everything in the XML document is a node, because the example
& lt ;! ENTITY ... & gt; & Lt; Xml a = "myAttribute" & gt; Some text & lt ;! - a comment - & gt; & Lt; / XML & gt; In the example above:
-
& lt ;! ENTITY ... & gt;is a unit < -
& lt; Xml ...is an element -
a = "myAttribute"is a attribute -
some textone Text node is -
& lt ;! - a comment - & gt;is a comment
In all the above examples, myAttribute is also a text node.
Comments
Post a Comment