• +49-(0)721-402485-12
Ihre Experten für XML, XQuery und XML-Datenbanken

The XQuery data model

The XQuery data model has been introduced in order to be able to specify precisely the semantics of XQuery. The data model is described in the following. An own data model is required because XQuery has not only to deal with single XML fragments, but with a greater diversity of objects, for example with sets of XML documents, with single numerical values or even with a mixture thereof.

Before a XML document can be processed by XQuery, it has to be transformed into an instance of the data model. In doing so, exisiting information is integrated being extracted from the validation of the document against a possibly available DTD or a XML Schema. XQuery is self-contained regarding the data model: Each XQuery expression operates on an instance of the XQuery data model and returns an instance of the XQuery data model.

The basic construct of the XQuery data model is the sequence. All XQuery expressions operate on one or more sequences and return again a sequence. Therefore, in the first section of this chapter sequences are introduced together with the functions defined on them. Sequences may consist of atomic values and nodes which are explained on the following pages.

An important requirement for XQuery is to be able to handle with all kinds of XML documents, irrespective of whether they have no type information at all, little type information (DTD) or a very precise type description (for example by XML Schema). This broad spectrum is surely one of the reasons why the type system of XQuery has turned out very complex and comprehensive. In particular, the diversity of type related operations surprises at first glance. At the end of the chapter, the type notation of XQuery and the type related operations are introduced.

 

Source: "XQuery – Grundlagen und fortgeschrittene Methoden", dpunkt-Verlag, Heidelberg (2004)

<< backnext >>