当前位置: 首页 > 网络学院 > 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   浏览: 630 ::
收藏到网摘: n/a

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形式出现的东西,包括数据库。


What You Should Already Know
你应该已经具备的知识

Before you continue you should have a basic understanding of the following:
在继续下面的学习之前,你首先应该基本掌握下述知识:

  • HTML / XHTML
  • XML / XML 命名空间
  • XPath

If you want to study these subjects first, find the tutorials on our Home page.
如果你希望先学习上述知识,请看我们的教程主页


What is XQuery?
什么是XQuery?

  • XQuery is the language for querying XML data
    XQuery是查询XML数据的语言
  • XQuery for XML is like SQL for databases
    XQuery与XML的关系类似于SQL与数据库的关系
  • XQuery is built on XPath expressions
    XQuery 是建立在XPath表达式基础上的
  • XQuery is defined by the W3C
    XQuery是由W3C 定义的
  • XQuery is supported by all the major database engines (IBM, Oracle, Microsoft, etc.)
    所有重要的数据库引擎(如:IBM、Oracle、Microsoft,等等)都支持XQuery
  • XQuery will become a W3C standard - and developers can be sure that the code will work among different products
    XQuery将会成为W3C的标准 —— 开发者都确信代码可以在不同的产品之间运行

XQuery is About Querying XML
XQuery 是用于查询XML的

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 and XPath
XQuery 和 XPath

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 - Examples of Use
XQuery —— 使用案例

XQuery can be used to:
XQuery 可用于下述操作:

  • Extract information to use in a Web Service
    获取在Web服务中使用的信息
  • Generate summary reports
    产生综合报告。
  • Transform XML data to XHTML
    把XML数据转换成XHTML形式
  • Search Web documents for relevant information
    在Web文档中搜索相关信息

XQuery is Not (Yet) a Web Standard
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 推荐的标准吧。

评论 (0) All

登陆 | 还没注册?