我正在用Java工作,我很想知道; 元素和节点之间有什么区别?
Node对象是整个DOM的主要数据类型.
节点可以是元素节点,属性节点,文本节点或"节点类型"一章中解释的任何其他节点类型.
XML元素是从(包括)元素的开始标记到(包括)元素的结束标记的所有内容.
不同的W3C规范定义了不同的"节点"类型集.
因此,DOM规范定义了以下类型的节点:
An element is a type of node. Many other types of nodes exist and serve different purposes.
- An element is a type of node. Many other types of nodes exist and serve different purposes.
(最大的一个的), ,,An element is a type of node. Many other types of nodes exist and serve different purposes.
An element is a type of node. Many other types of nodes exist and serve different purposes.
An element is a type of node. Many other types of nodes exist and serve different purposes.
An element is a type of node. Many other types of nodes exist and serve different purposes.
- ,An element is a type of node. Many other types of nodes exist and serve different purposes.
,An element is a type of node. Many other types of nodes exist and serve different purposes.
,
An element is a type of node. Many other types of nodes exist and serve different purposes.
,,An element is a type of node. Many other types of nodes exist and serve different purposes.
An element is a type of node. Many other types of nodes exist and serve different purposes.
An element is a type of node. Many other types of nodes exist and serve different purposes.
An element is a type of node. Many other types of nodes exist and serve different purposes.
- 没有小孩
An element is a type of node. Many other types of nodes exist and serve different purposes.
- ,An element is a type of node. Many other types of nodes exist and serve different purposes.
,An element is a type of node. Many other types of nodes exist and serve different purposes.
,
An element is a type of node. Many other types of nodes exist and serve different purposes.
,,An element is a type of node. Many other types of nodes exist and serve different purposes.
An element is a type of node. Many other types of nodes exist and serve different purposes.
An element is a type of node. Many other types of nodes exist and serve different purposes.
An element is a type of node. Many other types of nodes exist and serve different purposes.
- ,An element is a type of node. Many other types of nodes exist and serve different purposes.
,An element is a type of node. Many other types of nodes exist and serve different purposes.
,An element is a type of node. Many other types of nodes exist and serve different purposes.
,,An element is a type of node. Many other types of nodes exist and serve different purposes.
An element is a type of node. Many other types of nodes exist and serve different purposes.
An element is a type of node. Many other types of nodes exist and serve different purposes.
An element is a type of node. Many other types of nodes exist and serve different purposes.
- An element is a type of node. Many other types of nodes exist and serve different purposes.
,An element is a type of node. Many other types of nodes exist and serve different purposes.
An element is a type of node. Many other types of nodes exist and serve different purposes.
- 没有小孩
An element is a type of node. Many other types of nodes exist and serve different purposes.
- 没有小孩
An element is a type of node. Many other types of nodes exist and serve different purposes.
- 没有小孩
An element is a type of node. Many other types of nodes exist and serve different purposes.
- 没有小孩
An element is a type of node. Many other types of nodes exist and serve different purposes.
- ,An element is a type of node. Many other types of nodes exist and serve different purposes.
,An element is a type of node. Many other types of nodes exist and serve different purposes.
,
An element is a type of node. Many other types of nodes exist and serve different purposes.
,,An element is a type of node. Many other types of nodes exist and serve different purposes.
An element is a type of node. Many other types of nodes exist and serve different purposes.
An element is a type of node. Many other types of nodes exist and serve different purposes.
An element is a type of node. Many other types of nodes exist and serve different purposes.
- 没有小孩
的XML信息集(通过XPath的使用)具有一组更小的节点的:
文件信息项
元素信息项
属性信息项
处理指令信息项
未扩展的实体参考信息项
字符信息项
评论信息项目
文件类型声明信息项
未分析的实体信息项
符号信息项
命名空间信息项
XPath具有以下节点类型:
根节点
元素节点
文本节点
属性节点
命名空间节点
处理指令节点
评论节点
您的问题 " 元素和节点之间的区别是什么 " 的答案是:
An element is a type of node. Many other types of nodes exist and serve different purposes.
Node是DOM树的一部分,Element是特定类型的Node
例如
你有一个foo元素(也是一个Node,因为Element继承自Node)和一个文本节点'This is Text',它是foo元素/节点的子节点
节点可以是许多不同类型的东西:一些文本,一个注释,一个元素,一个实体等.元素是一种特殊的节点.
如各种XML 规范中所述,a element
是由开始标记和结束标记以及其间的内容组成的,或者是空元素标记(没有内容或结束标记).换句话说,这些都是元素:
stuff
虽然您听到的"节点"使用的含义大致相同,但每个XML规范都没有精确的定义.它通常用于指代DOM之类的节点,这些节点可能与XML密切相关或使用XML进行表示.
xml文档由嵌套元素组成.元素从其开始标记开始,以其结束标记结束.你可能看到的和
在HTML中.开始标记和结束标记之间的所有内容都是元素的内容.如果元素由自闭标签(例如
)定义,则其内容为空.
打开标签还可以指定属性,例如..在此示例中,属性名称为"class",其值为 "rant".
XML语言没有"节点"这样的东西.阅读规范,这个词不会出现.
有些人非正式地使用"节点"这个词来表示元素,这是令人困惑的,因为一些解析器也赋予这个词一个技术含义(识别"文本节点"和"元素节点").确切的含义取决于解析器,因此除非您说明正在使用的解析器,否则该单词的定义不明确.如果你的意思是元素,说'元素'.
节点是元素和属性的基类(基本上也是所有其他XML表示).
元素是唯一一种节点可以有子节点和属性.
Document还有子节点,但
没有属性,没有文本,只有一个子元素.