Difference between Element node and Text Node(元素节点和文本节点的区别)
问题描述
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE people SYSTEM "validator.dtd">
<people>
<student>
<name>John</name>
<course>Computer Technology</course>
<semester>6</semester>
<scheme>E</scheme>
</student>
<student>
<name>Foo</name>
<course>Industrial Electronics</course>
<semester>6</semester>
<scheme>E</scheme>
</student>
</people>
使用简单的 XML 语言 是一个元素.
根据我上面的 XML,<student>... </student> 是一个元素,其他标签也是如此.
In simple XML language <open-tag> data </open-tag> is an element.
As per my XML above, <student> ... </student> is an element and so are the other tags.
在DOM解析中,有一个Element节点和一个Text节点.参考我正在使用的书,<student>是一个Element节点和<name>,<course> 和其他嵌套标签是 Text 节点.
In DOM parsing, there is an Element node and a Text node. Referring to the book I am using, <student> is an Element node and <name>, <course> and the other nested tags are Text nodes.
所以,如果我正确理解 DOM,所有外部标签都是 Elements 而包含实际数据的标签是 Text 节点?
So, if I am understanding DOM properly, all the outer tags are Elements and the tags that contain the actual data are Text nodes ?
推荐答案
XML 中存在的所有 XML 元素都是一个元素节点.XML 元素中的文本是文本节点.
All the XML elements present in a XML is an element node. The text present in the XML elements are text nodes.
这篇关于元素节点和文本节点的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:元素节点和文本节点的区别
基础教程推荐
- 使用堆栈算法进行括号/括号匹配 2022-01-01
- REST Web 服务返回 415 - 不支持的媒体类型 2022-01-01
- 无法复制:“比较方法违反了它的一般约定!" 2022-01-01
- Struts2 URL 无法访问 2022-01-01
- Spring AOP错误无法懒惰地为此建议构建thisJoinPoin 2022-09-13
- 如何对 Java Hashmap 中的值求和 2022-01-01
- 修改 void 函数的输入参数,然后读取 2022-01-01
- RabbitMQ:消息保持“未确认"; 2022-01-01
- 存储 20 位数字的数据类型 2022-01-01
- 问题http://apache.org/xml/features/xinclude测试日志4j 2 2022-01-01
