当前位置: 首页 > 网络学院 > XML相关教程 > Xquery > XQuery 介绍
The best way to explain XQuery is to say that XQuery is to XML what SQL is to database tables.
对XQuery最好的解释是:XQuery相当于XML的查询语句;XQuery与XML之间的关系,就如同SQL语句和数据库表。
XQuery is designed to query XML data - not just XML files, but anything that can appear as XML, including databases.
XQuery用于查询XML数据 —— 不仅仅是XML文件,还包括一切以XML形式出现的东西,包括数据库。
Before you continue you should have a basic understanding of the following:
在继续下面的学习之前,你首先应该基本掌握下述知识:
If you want to study these subjects first, find the tutorials on our Home page.
如果你希望先学习上述知识,请看我们的教程主页。
XQuery is a language for finding and extracting elements and attributes from XML documents.
XQuery是用于从XML文档中查找和提取元素和属性的语言。
Here is an example of a question that XQuery could solve:
下面是一个关于XQuery所能解决的问题的案例:
"Select all CD records with a price less than $10 from the CD collection stored in the XML document called cd_catalog.xml".
从存储在名为 “cd_catalog.xml” 的XML文档内的CD集中选择所有价格低于10美元的CD唱片。
XQuery 1.0 and XPath 2.0 share the same data model and support the same functions and operators. If you have already studied XPath you will have no problems with understanding XQuery.
XQuery 1.0 和 XPath 2.0 具有相同的数据模型并支持相同的函数和操作符。如果你已经掌握了XPath的相关知识,那么,理解XQuery就不成问题了。
You can read more about XPath in our XPath Tutorial.
你可以 在我们的XPath 教程中学习更多关于XPath的知识。
XQuery can be used to:
XQuery 可用于下述操作:
XQuery is compatible with several W3C standards, such as XML, Namespaces, XSLT, XPath, and XML Schema.
XQuery和一些W3C的标准是相互吻合的,例如:XML、Namespaces [命名空间]、XSLT、XPath 和 XML Schema。
However, XQuery 1.0 is not yet a W3C Recommendation (XQuery is a Working Draft). Hopefully it will be a recommendation in the near future.
然而,XQuery 1.0 并不是W3C的推荐标准(XQuery 仅是一份工作草案)。相信在不久的将来,它会变成 W3C 推荐的标准吧。