Chapter 5. Basic Expressions

Introduction

XQuery is a large language, with many different kinds of expressions. Some of these expressions are so basic that they will appear in almost every query you will write.

This chapter focuses on the most fundamental XQuery operators and functions, beginning with comparisons and sequence manipulation, proceeding to arithmetic, logic, and finally touching on the details of the query prolog not already described in previous chapters.

Even if the XML data you are working with is untyped, the XQuery expressions you write are typed. To illustrate the interactions of types and expressions, we'll use the typed XML fragment shown in Listing 5.1 as the input sequence in the examples throughout this chapter.

Each element ...

Get XQuery: The XML Query Language now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.