February 2004
Intermediate to advanced
544 pages
9h 55m
English
In Chapter 3, you learned how to access XML that exists outside the query and navigate over it. In this chapter, you will learn how to construct XML directly in a query. Constructing XML is useful for several purposes, including creating a new result shape (transformation), representing temporary intermediate data structures (composition), and organizing data into conceptual groups (views).
XQuery has expressions for constructing all seven of the well-known XML node kinds: element, attribute, text, document, comment, processing-instruction, and namespace. For all of these node kinds, XQuery supports two different construction expressions: one with a syntax similar to XML, and an alternate XQuery syntax primarily ...