This article introduces the nodeName, nodeValue and nodeType attributes in detail
nodeName The attribute contains the name of a node.
The nodeName of the element node is the label name
The nodeName of the attribute node is the attribute name
The nodeName of the text node is always #text
The nodeName of the document node is always #document
Comment: nodeName contains The tag name of an XML element is always uppercase
nodeValue
For text nodes, the nodeValue attribute contains the text.
For attribute nodes, the nodeValue attribute contains the attribute value.
The nodeValue property is not available for document nodes and element nodes.
nodeType
The nodeType property returns the type of node.
The most important node types are:
Element type Node type
Element element 1
Attribute attr 2
Text text 3
Comments comments 8
Document 9
The above is the detailed content of XML example tutorial: Detailed explanation of nodeName, nodeValue and nodeType attributes. For more information, please follow other related articles on the PHP Chinese website!