>Home>Learn XQuery>XQuery Tutorial
Welcome to DataDirect XQuery® Tutorials! We've created this page so you can learn valuable XQuery skills and pick up important XQuery tips. But don't forget to come back and re-visit this site, because we're always adding new tutorials to help you out.
Follow along with this tutorial on XQueryWebService that shows how to create a web service using DataDirect XQuery®. View as either as an HTML or as a downloadable PDF. This tutorial has been tested using Tomcat 5.x and 6.x.
HL7 versions 2.x and 3.x use different information models. HL7 2.x is EDI-based, 3.x is XML-based, and the concepts are different. This example shows how to go from one to the other, using DataDirect XQuery and DataDirect XML Converters for HL7.
W3C XQuery is a query language for XML. The most common use cases for XQuery involve XML publishing to create XML for Web messages, dynamic web sites, or publishing applications. The original data may be found in XML files, or it may be in a data store such as a relational database.
The XQuery language is designed specifically for XML programming and data integration, and programmers are more productive using XQuery for these tasks. However, many enterprise applications are built on the Java platform, and often require functionality not found in XQuery; for instance, many XML programs need to use the Web Services functionality of J2EE.
This tutorial shows how to use DataDirect XQuery and XQJ in your Java application to perform tasks that allow you to process queries that access XML and relational data sources, and return XML results, including
Configuring connections to relational data sources, Executing queries, querying data in XML sources and DOM trees, joining data from XML and relational data sources, returning results as DOM trees, SAX event streams, and StAX event streams, and
using prepared queries (similar to JDBC prepared statements).
This online video tutorial shows how to insert, modify, and delete data in your relational database from your XQueries. Also, see how easy it is to generate Java code that invokes DataDirect XQuery to execute your XQuery application.
DataDirect XQuery® was designed for performance and scalability, which are critical to our customers. This document describes some of the performance optimizations in our XQuery implementation and provides guidelines that will make most applications perform well.
Increasingly, XML is stored in relational databases as structured XML. Some applications will continue to shred XML into a relational format or store XML as CLOB values. Other applications can now take advantage of relational databases that support a native XML data type to represent an XML document or XML document fragment. This paper shows how you can use DataDirect XQuery® to query XML stored as character data and query XML stored as XML.
A common challenge in XML development is splitting a large XML document in several smaller ones. Learn how to deal with such huge XML documents by leveraging DataDirect XQuery to read and split XML.
Imagine a directory with XML files, each needing to be transformed to a new XML document.
This tutorial covers how to query the complete directory and generate the results, all from a single XQuery, with no need for multiple queries, external scripting, or Java code.
Need to get XML into a Database? Learn how DataDirect XQuery provides an easy and scalable solution for saving or loading XML into any database.
Need to produce HTML and image output from XQuery? The following tutorial explains how to create an HTML document referencing JPEG files through XQuery. The DataDirect XQuery built-in function
ddtek:serialize-to-url is used to save the JPEG images.
XML (Extensible Markup Language) is an extremely versatile data format that has been used to represent many different kinds of data, including web pages, web messages, books, business and accounting data, XML representations of relational database tables, programming interfaces, objects, financial transactions, chess games, vector graphics, multimedia presentations, credit applications, system logs, and textual variants in ancient Greek manuscripts.
This XQuery tutorial written by Dr. Michael Kay is for all those people who really want to know what XQuery is, but don't have the time to find out. It covers what XQuery is, and even how to write and run an example XQuery application, all in just 10 minutes!
FLWOR is acronym made up from the five clauses that make up an XQuery FLWOR expression: for, let, where, order by, and return. This tutorial shows how to write an example XQuery FLWOR expression to join data and format results.
XQuery functions, like any programming language functions are useful as a mechanism for hiding complexity, encouraging code re-use, and for advanced computation. This tutorial shows you how to write your own user-defined functions in XQuery.
XML workflow is all about application design. Rather than starting with a database for storing the data, think in terms of the data as it moves around the system; it's a process-oriented rather than data-centric approach. This tutorial explains how to model and develop an XML-workflow application.
IBM's Developerworks claims "the easiest way to begin with XQJ is to download a free trial from DataDirect." This article is an introduction to XQuery and XQJ, and clarifies its examples throughout by using DataDirect XQuery.