O'Reilly logo

XQuery from the Experts: A Guide to the W3C XML Query Language by Philip Wadler, Jim Tivy, Jérôme Siméon, Michael Rys, Jonathan Robie, Michael Kay, Mary Fernández, Denise Draper, Don Chamberlin, Howard Katz - Editor

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Literals and Operators

Now that we know about values and types in XQuery, we describe how the static type system assigns types to expressions. The static type system checks that the type of an expression is compatible with the type required by the context in which the expression is used. If they are not compatible, the static type system raises a type error.

In the remaining sections, the term type refers to the static type associated with an XQuery expression. We use the phrase dynamic type whenever referring to the type associated with a value.

Literals are the simplest XQuery expressions. Every literal expression has one of the types xs:string, xs:integer, xs:decimal, or xs:double. Here are some examples:

"hello" has type xs:string
42 has ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required