当前位置: 首页 > 网络学院 > XML相关教程 > Xquery > XQuery 术语

Xquery
XQuery 介绍
XQuery 实例
XQuery FLWOR 表达式
XQuery FLWOR + HTML
XQuery 术语
XQuery 语法
XQuery 添加元素和属性
XQuery 选择和过滤
XQuery 函数
XQuery 摘要
XQuery 参考

Xquery 中的 XQuery 术语


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-01   浏览: 587 ::
收藏到网摘: n/a

In XQuery, there are seven kinds of nodes: element, attribute, text, namespace, processing-instruction, comment, and document (root) nodes.
在XQuery中,有7中不同的节点:元素、属性、文本、命名空间、处理指令、注释、文档(根目录)节点。


XQuery 术语

Nodes
节点

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>
<title lang="en">Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>

<price>29.99</price>
</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
“原子值”属性值

Atomic values are nodes with no children or parent.
“原子值”属性值只没有子节点和父节点。

Example of atomic values:
“原子值”属性值案例:

J K. Rowling
"en"

Items

Items are atomic values or nodes.
“项”是指原子值或节点。


Relationship of Nodes
节点间关系

Parent
父类

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>
<title>Harry Potter</title>

<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>

Children
子类元素

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>
<title>Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>

<price>29.99</price>
</book>

Siblings
同类元素

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>
<title>Harry Potter</title>
<author>J K. Rowling</author>

<year>2005</year>
<price>29.99</price>
</book>

Ancestors
祖类元素

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>

<title>Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>

</book>
</bookstore>

Descendants
孙类元素

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>
<title>Harry Potter</title>
<author>J K. Rowling</author>

<year>2005</year>
<price>29.99</price>
</book>
</bookstore>

评论 (0) All

登陆 | 还没注册?