問題描述
<?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.
這篇關于元素節點和文本節點的區別的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!