Learn XQuery |
Home:Learn XQuery:XQuery Tutorial:XQuery Introduction XQUERY: A GUIDED TOUR*Note: This book excerpt is from XQuery from the Experts: A Guide to the W3C XML Query Language by Howard Katz, Don Chamberlin, Denise Draper, Mary Fernandez, Michael Kay, Jonathan Robie, Michael Rys, Jerome Simeon, Jim Tivy, and Philip Wadler, (ISBN 0-321-18060-7), copyright 2004. All rights reserved. Material posted with permission from Addison-Wesley. Table of Contents:A Brief Introduction to XQueryXML (Extensible Markup Language) is an extremely versatile data format that has been used to represent many different kinds of data. Getting Started with XQuery - Sample Data: A BibliographyThis chapter uses bibliography data to illustrate the basic features of XQuery. The XQuery Data ModelXQuery is defined in terms of a formal data model, not in terms of XML text. Literals and Comments in XQueryXQuery uses "smiley faces" to begin and end comments. This cheerful notation was originally suggested by Jeni Tennison. Input Functions in XQueryXQuery uses input functions to identify the data to be queried. Locating Nodes with Path Expressions in XQueryIn XQuery, path expressions are used to locate nodes in XML data. XQuery's path expressions are derived from XPath 1.0 and are identical to the path expressions of XPath 2.0. Creating Nodes with Elements, Attribute and Document Constructors in XQueryNow we will learn how to create nodes. Elements, attributes, text nodes, processing instructions, and comments can all be created using the same syntax as XML. Combining and Restructuring Nodes in XQueryQueries in XQuery often combine information from one or more sources and restructure it to create a new result. This section focuses on the expressions and functions most commonly used for combining and restructuring XML data. XQuery OperatorsLike most languages, XQuery has arithmetic operators and comparison operators, and because sequences of nodes are a fundamental datatype in XQuery, it is not surprising that XQuery also has node sequence operators. XQuery Built-in FunctionsXQuery has a set of built-in functions and operators, including many that are familiar from other languages, and some that are used for customized XML processing. User-Defined Functions in XQueryWhen a query becomes large and complex, it is often much easier to understand if it is divided into functions, and these functions can be reused in other parts of the query. Variable Definitions in XQueryA query can define a variable in the prolog. Such a variable is available at any point after it is declared. Library Modules in XQueryFunctions can be put in library modules, which can be imported by any query. Every module in XQuery is either a main module, which contains a query body to be evaluated, or a library module, which has a module declaration but no query body. External Functions and Variables in XQueryXQuery implementations are often embedded in an environment such as a Java or C# program or a relational database. The environment can provide external functions and variables to XQuery. Types in XQueryXML documents contain a wide range of type information, from very loosely typed information without even a DTD, to rigidly structured data corresponding to relational data or objects. XQuery in a NutshellXQuery is not only a query language, but also a language that can do fairly general processing of XML. It is a strongly typed language that works well with data that may be strongly or weakly typed. |
Free XQuery Development ResourcesBack to School with DataDirect XQuery®Getting your mind around the possibilities of a data integration technology as promising as XQuery can be difficult, but our XML developers Webinars will help you understand the power and versatility of XQuery, and our favorite XQuery processor, DataDirect XQuery®. From information about how to leverage relational data to real-world use cases, our Webinars will help you see why DataDirect XQuery® is the best choice for today's tough data integration and aggregation challenges. Use DataDirect XQuery® to Mine Relational Data!This informative XQuery webinar shows you how scalable, flexible, and reliable DataDirect XQuery® is for building XML applications that access data from relational databases, XML, Web services and legacy formats; and how it uses document projection and data streaming technologies to efficiently query large (Gigabytes) XML documents. Check our XQuery Webinars page for more information on this and other Webinar topics. |





