Sequences

In the XQuery data model, every expression input and output is defined as a sequence of items. Sequences are flat (never nested) and are ordered collections of heterogeneously-typed values. In general, a sequence of a single item is treated as just the single item.

Sequences are formed using the comma operator. Here is a sequence of integers:

1, 2, 3

Parentheses are a general grouping mechanism in XQuery used to disambiguate or group expressions. If you attempt to nest sequences, they are flattened into a single sequence.

(1, 2, (3, 4, (5), 6), 7)

is resolved to:

(1, 2, 3, 4, 5, 6, 7)

As mentioned, sequences are heterogenous:

(1, ‘abc’, false(), 1.234)


Alex Miller


Categories

Search

Tweets


follow puredanger at http://twitter.com

Hey I wrote some of this


Some early reviews:

  • "Great book, needs more killing and grilling." - Ted Nugent
  • "I was wrong - this is the road ahead." - Bill Gates
  • "I've replaced my roundhouse kick with this book." - Chuck Norris
  • "This book killed me." - George Carlin
  • "Totally replaced my left nut." - Lance Armstrong
  • "I don't get it." - Lindsay Lohan
  • "Is that a poop stain on the cover?" - Quentin Tarantino
  • "Paul insisted I read this." - David Letterman