元素节点和文本节点的区别

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 语言 data </open-tag> 是一个元素.
根据我上面的 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.

这篇关于元素节点和文本节点的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

How to send data to COM PORT using JAVA?(如何使用 JAVA 向 COM PORT 发送数据?)
How to make a report page direction to change to quot;rtlquot;?(如何使报表页面方向更改为“rtl?)
Use cyrillic .properties file in eclipse project(在 Eclipse 项目中使用西里尔文 .properties 文件)
Is there any way to detect an RTL language in Java?(有没有办法在 Java 中检测 RTL 语言?)
How to load resource bundle messages from DB in Java?(如何在 Java 中从 DB 加载资源包消息?)
How do I change the default locale settings in Java to make them consistent?(如何更改 Java 中的默认语言环境设置以使其保持一致?)