Chapter 6. Iteration

Introduction

Most programming languages adopt one of two styles of expressions: iteration or application. Iterative expressions explicitly loop through sequences one member at a time. Applicative expressions apply operations to entire sequences at once (implicitly iterating through the sequence and applying the operation to each member).

As we saw in Chapter 3, navigation paths have an applicative style—each step implicitly iterates over the nodes selected by the previous step. However, the rest of XQuery has adopted an iterative style of programming. This chapter explores the XQuery expressions that perform iteration.

The FLWOR (pronounced “flower”) expression is the most powerful of these, capable of introducing variables, ...

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.