• +49-(0)721-402485-12
Your experts for XML, XQuery and XML Databases

Nodes

In the previous sections we have learned how XQuery integrates the simple data types of XML Schema and on the one hand limits them in the use (because list and union types are excluded) but on the other hand extends them by own types in order to compensate the missing total order on xs:duration and to deal with documents with missing type information.

However, the resulting type system is still not sufficient for the purposes of XQuery. In a XML document you can find parts which cannot be described by XML Schema, as for example comments or processing instructions or also the document as a separate unit. In addition, with XML Schema only the possible structure, but not the acutual structure of a XML document can be described.

For the description of this actual structure there are data models like XML Information Set, the DOM Structure Model or the XPath 1.0 Data Model. Since XQuery wants to create the greatest possible compability to XPath 1.0, it is based on its data model for the depiction of the current document structure. XPath 1.0 knows seven types of nodes: element nodes, document nodes, attribute nodes, namespace nodes, nodes for processing instructions, comment nodes and text nodes. XQuery adopts these node types, but allows a more exact determination of the nodes, as we shall see.

Each node has a textual value and a typed value. Here, again the atomic types come into play which are explained in the previous sections.

 

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

<< backnext >>