当前位置: 首页 > 网络学院 > XML相关教程 > Xquery > XQuery 术语
In XQuery, there are seven kinds of nodes: element, attribute, text, namespace, processing-instruction, comment, and document (root) nodes.
在XQuery中,有7中不同的节点:元素、属性、文本、命名空间、处理指令、注释、文档(根目录)节点。
In XQuery, there are seven kinds of nodes: element, attribute, text, namespace, processing-instruction, comment, and document (root) nodes. XML documents are treated as trees of nodes. The root of the tree is called the document node (or root node).
在XQuery里,有7中不同的节点:元素、属性、文本、命名空间、处理指令、注释、文档(根目录)节点,XML文档是节点树状结构。“树根”称作文档节点(或根节点)。
Look at the following XML document:
先看看下面这个XML文档:
<?xml version="1.0" encoding="ISO-8859-1"?> <bookstore> <book> </bookstore> |
Example of nodes in the XML document above:
上述XML文档中的节点案例:
<bookstore> (document node) <author>J K. Rowling</author> (element node) lang="en" (attribute node) |
Atomic values are nodes with no children or parent.
“原子值”属性值只没有子节点和父节点。
Example of atomic values:
“原子值”属性值案例:
J K. Rowling "en" |
Items are atomic values or nodes.
“项”是指原子值或节点。
Each element and attribute has one parent.
每个元素和属性都包含一个“父类”。
In the following example; the book element is the parent of the title, author, year, and price:
在下述案例中:book元素是title、author、year 和 price 元素的父类元素:
<book> |
Element nodes may have zero, one or more children.
元素节点可以包含任意个数的子类元素。
In the following example; the title, author, year, and price elements are all children of the book element:
在下述案例中,title、author、year 和 price元素都是book元素的子元素:
<book> |
Nodes that have the same parent.
拥有相同的父类元素的节点称为同类元素。
In the following example; the title, author, year, and price elements are all siblings:
在下述案例中,title、author、year 和 price 元素都是“同类元素”:
<book> |
A node's parent, parent's parent, etc.
一个节点的父类元素,父类元素的父类元素,以此类推,称为该节点的祖类元素。
In the following example; the ancestors of the title element are the book element and the bookstore element:
在下述案例中,title元素的 “祖类元素” 是 book 元素和 bookstore 元素。
<bookstore> <book> </bookstore> |
A node's children, children's children, etc.
一个节点的子类元素,子类元素的子类元素,以此类推,称为孙类元素。
In the following example; descendants of the bookstore element are the book, title, author, year, and price elements:
在下述案例中,bookstore 元素的孙类元素是book、title、author、year 和 price 元素:
<bookstore> <book> </bookstore> |