| 欧网销售-⑨ |
 |
 |
| 欧网销售-② |
 |
 |
| 欧网销售-④ |
 |
 |
| 欧网销售-③ |
 |
 |
| 欧网技术-① |
 |
 |
| 欧网备案-⑤ |
 |
 |
| 欧网网维-⑧ |
 |
 |
|
|
|
首页 >> 我的知识库 >> >> XPath 初学者入门教程:XPath 节点 |
|
|
XPath 初学者入门教程:XPath 节点 |
|
[ 作者: | 文章来源: 网页教学网 | 点击数: 1181 | 更新时间: 2007-10-13 17:40:02 ] |
在XPath中,有七种类型的节点:元素、属性、文本、命名空间、处理指令、注释以及文档节点(或成为根节点)。 [南通服务器网]
XPath 术语 Www~Spdns~com
节点(Node) Spdns@com
在XPath中,有七种类型的节点:元素、属性、文本、命名空间、处理指令、注释以及文档(根)节点。XML文档是被作为节点树来对待的。树的根被称为文档节点或者根节点。 Spdns@com
请看下面这个XML文档: Spdns
以下为引用的内容:
Harry Potter J K. Rowling 2005 29.99
|
Spdns_com
上面的XML文档中的节点例子: 中.国.南通服务器网
以下为引用的内容: (文档节点) J K. Rowling(元素节点) lang="en"(属性节点) |
中.国南通服务器网
基本值(或称原子值,Atomic value) 中.国.南通服务器网
基本值是无父或无子的节点。 Spdns^com
基本值的例子: 南通服务器网
J K. Rowling 中国南通服务器网
"en" Spdns
项目(Item) 中国南通服务器网
项目是基本值或者节点。 南通服务器网
节点关系 Www@Spdns@com
父(Parent) 中国.南通服务器网
每个元素以及属性都有一个父。 中国南通服务器网
在下面的例子中,book元素是title、author、year以及price元素的父: 中国.南通服务器网
以下为引用的内容:
Harry Potter J K. Rowling 2005 29.99
|
中.国.南通服务器网
子(Children) Www^Spdns^com
节点元素可有零个、一个或多个子。 Spdns^com
在下面的例子中,title、author、year以及price元素都是book元素的子: Www.Spdns.com
以下为引用的内容:
Harry Potter J K. Rowling 2005 29.99
|
[南通服务器网]
同胞(Sibling) Spdns_com
拥有相同的父的节点 中.国.南通服务器网
在下面的例子中,title、author、year以及price元素都是同胞: 中.国南通服务器网
以下为引用的内容:
Harry Potter J K. Rowling 2005 29.99
|
Spdns_com
先辈(Ancestor) Spdns_com
某节点的父、父的父,等等。 Www^Spdns^com
在下面的例子中,title元素的先辈是book元素和bookstore元素: Spdns@com
以下为引用的内容:
Harry Potter J K. Rowling 2005 29.99
|
Www~Spdns~com
后代(Descendant) 中国.南通服务器网
某个节点的子,子的子,等等。 中国南通服务器网,为中文网南通服务器网
以下为引用的内容:
Harry Potter J K. Rowling 2005 29.99
Spdns.com
|
南通服务器网
|
|
|
|
|