XML example tutorial: Detailed explanation of nodeName, nodeValue and nodeType attributes

黄舟
Release: 2017-03-11 17:14:11
Original
2199 people have browsed it

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!