XQuery Data Query Language [1] XQuery Overview
Last updated: March 28, 2004
Disclaimer: This article translated from HoWard Katz and SQL language and Mr. Don Chamberlin, developers, XQuery language, XQuery from the experts: a guide to the w3c xml query language. Used for learners.
This article is started in computer science and technology network http://www.cstc.net.cn/
More articles about the translator can be obtained through the translator's homepage: http://www.zengyiHome.net
Translation list:
l xQuery Data Query Language Guide [1] - Overview
l xQuery Data Query Language Guide [2] - Path Expression
l xQuery Data Query Language Guide [3] - Data Model, Text Notes and Input Functions
l xQuery Data Query Language [4] - Creating Number: Elements, Attributes, and Document Configuration
About the Author:
Howard Katz lived in Roberts Creek in British Columbia, Canada, who is Fatdog Software, which is a company specializing in the development of software to search for XML documents. He is the author of XQENGINE, which is a Java-based open source XQuery engine. In the past 35 years, he has always been an active programmer (always has good performance), and has a long-term writing of a technical article for the computer industry. He wrote an online Java column for Microsoft, and writes a column articles on object-oriented programming. He is one of the common hosts of the Vancouver XML Developer Association. He and his wife went to the sea boating at sea, and winter went to the far away.
XML (extended tag language) is an extremely universal data format that can be used to describe a number of different types of data, including web, web messages, books, business and accounting information, XML representations of relational database tables, program design interface , Object, property matters, chess games, vector diagrams, multimedia images, credit applications, system logs, and text variables written with ancient Greek manuscript.
In addition, some systems provide non-XML data sources XML format browsing, such as relational databases, allowing physical unrecognizable XML-based data processing based on XML format. XML documents can represent almost all things, and users who want to be able to store any data in XML in XML in XML. An example of an XML document and a data query on it can be found in the document [XQ-UC].
Regardless of whether the data stored in XML is more complicated, the structure of the XML itself is simple. The XML document is in essence is a contour of the main structural unit in order and level. XQuery is based on this structure of XML, which uses this structure to provide query capabilities for data within the same range. More precisely, XQuery is [XQ-DM] defined in the form of XQuery 1.0 and XPath 2.0 data model, and describes the analysis structure of the XML document as an orderly, Maken the tagged tree, each of the trees. Nodes have a different identity and may have a simple or complex type. XQuery can be used to query the XML data without any mode (Schema), or you can query the data managed by the World Wide Web Consortium (W3C) XML mode or by the file type definition (DTD). It should be noted that the data model used by XQuery is very different from the classical relationship model. There is no layer of XQuery, and the order is not very important here, and the identity is not supported. XQuery is a functional language - performs commands with the programming language, and each query is an expression of to be evaluated, and the expression can be a very flexible combination to create a new expression. formula. This chapter combines a series of examples a high level of introduction to the XQuery language, each of which describes an important feature of this language and shows how to use this feature in practice. Some examples are from [XQ-UC]. We covered most of the language characteristics of XQuery in this book, and focused on professor using XQuery to solve special types of special types. In the discussion of XML document structure as an input and output query, we will introduce some basic operations on XML - use path expression (Path Expression) to find node, using Element Constructors. Build an XML structure, use the Flowor expression, lookup, conditional expressions, quantitative expressions (Quantified Expression) to combine and reconstruct information from the XML document. After that, we start working on operators and functions, discuss arithmetic operators, compare, some common functions in the xQuery library, and how to write a user-defined function. Finally, we discuss how to import and use the XML schema type in the data query.
If you have the opportunity to implement XQuery, many readers will understand very well. Some good implementations can be downloaded from the Internet; you can find a resource list in the homepage of the W3C XML Qurey Workgroup, can be the following address http://www.w3.org/xml/Query.html .
This chapter is based on the Work draft of XQuery language in May 2003. XQuery is still in the R & D stage, discussing some of this language in this chapter may change.
Sample data: Reference book
This chapter describes the basic characteristics of XQuery with reference bookmark data. The data used is extracted from the XML Query use case, which is the use case "XMP", which appears in [ExemPlars]. We have made some modifications to describe some content to be discussed. The data you want is in the program list 1.1.