<?xml version="1.0" encoding='utf-8'?>
<!DOCTYPE spec SYSTEM "../schema/xsl-query.dtd" [

<!ENTITY status-section SYSTEM "../etc/status-2edREC.xml">

<!ENTITY Document SYSTEM "document.xml">
<!ENTITY Element  SYSTEM "element.xml">
<!ENTITY Attribute  SYSTEM "attribute.xml">
<!ENTITY Namespace  SYSTEM "namespace.xml">
<!ENTITY ProcessingInstruction  SYSTEM "processing-instruction.xml">
<!ENTITY Comment  SYSTEM "comment.xml">
<!ENTITY Text  SYSTEM "text.xml">
<!ENTITY ChangeLog  SYSTEM "changelog.xml">

<!ENTITY documentNode "Document Node">
<!ENTITY elementNode "Element Node">
<!ENTITY attributeNode "Attribute Node">
<!ENTITY namespaceNode "Namespace Node">
<!ENTITY processingInstructionNode "Processing Instruction Node">
<!ENTITY commentNode "Comment Node">
<!ENTITY textNode "Text Node">

<!ENTITY dm-example.xml SYSTEM "build/dm-example.xml.cdata">
<!ENTITY dm-example.xsd SYSTEM "build/dm-example.xsd.cdata">
<!ENTITY dm-example.tbl SYSTEM "build/dm-example.tbl.xml">
<!ENTITY xdt-schema-app SYSTEM "xdt-schema-app.xml">
<!ENTITY xdt-datatypes  SYSTEM "xdt-datatypes.xml">
<!ENTITY xdt-isoref     '<bibref ref="ISO8601"/>'>

<!ENTITY date.year "2009">
<!ENTITY date.month "April">
<!ENTITY date.MM "04">
<!ENTITY date.day "10">
<!ENTITY date.DD "10">
<!ENTITY doc.date "&date.year;&date.MM;&date.DD;">
<!ENTITY doc.date.presentation "&date.DD; &date.month; &date.year;">
<!ENTITY doc.prefix "PER-xpath-datamodel">
<!ENTITY url.group "http://www.w3.org/XML/Group/">
<!ENTITY url.group.ql "&url.group;xmlquery/">
<!ENTITY url.publoc "&url.group;&date.year;/&date.MM;/&doc.prefix;-&doc.date;.html">
<!ENTITY url.internal "http://www.w3.org/Style/XSL/Group/xpath2-tf/&doc.prefix;-&doc.date;.html">
<!ENTITY url.external "http://www.w3.org/TR/&date.year;/&doc.prefix;-&doc.date;/">
<!ENTITY url.this "&url.external;">

<!ENTITY dm.prop.attributes   "<emph role='dm-node-property'>attributes</emph>">
<!ENTITY dm.prop.base-uri     "<emph role='dm-node-property'>base-uri</emph>">
<!ENTITY dm.prop.node-kind    "<emph role='dm-node-property'>node-kind</emph>">
<!ENTITY dm.prop.children     "<emph role='dm-node-property'>children</emph>">
<!ENTITY dm.prop.content      "<emph role='dm-node-property'>content</emph>">
<!ENTITY dm.prop.namespaces   "<emph role='dm-node-property'>namespaces</emph>">
<!ENTITY dm.prop.nilled	      "<emph role='dm-node-property'>nilled</emph>">
<!ENTITY dm.prop.node-name    "<emph role='dm-node-property'>node-name</emph>">
<!ENTITY dm.prop.parent	      "<emph role='dm-node-property'>parent</emph>">
<!ENTITY dm.prop.prefix	      "<emph role='dm-node-property'>prefix</emph>">
<!ENTITY dm.prop.string-value "<emph role='dm-node-property'>string-value</emph>">
<!ENTITY dm.prop.target	      "<emph role='dm-node-property'>target</emph>">
<!ENTITY dm.prop.type-name    "<emph role='dm-node-property'>type-name</emph>">
<!ENTITY dm.prop.uri          "<emph role='dm-node-property'>uri</emph>">
<!ENTITY dm.prop.typed-value  "<emph role='dm-node-property'>typed-value</emph>">

<!ENTITY % status-entities SYSTEM "../etc/status-entities.dtd">
%status-entities;
<!ENTITY status-section-id "status">
<!ENTITY spec-devby    "&dm-devby;">
<!ENTITY changelog-id  "&dm-changelog-id;">
<!ENTITY changes-para  "&post.REC.changes;">
<!ENTITY implementation-para  "&no-implementation-report-exists;">
<!ENTITY Bugzilla-key "&dm-Bugzilla-key;">
<!ENTITY patent-policy-paragraph "&dm-ppp;">

]>
<spec w3c-doctype="per">
<header>
  <title>XQuery 1.0 and XPath 2.0 Data Model (XDM)</title>
  <version> (Second Edition)</version>
  <w3c-designation>&doc.prefix;-&doc.date;</w3c-designation>
  <w3c-doctype>W3C Proposed Edited Recommendation</w3c-doctype>
  <pubdate>
    <day>&date.day;</day>
    <month>&date.month;</month>
    <year>&date.year;</year>
  </pubdate>
  <publoc>
     <loc href="&url.this;">&url.this;</loc>
  </publoc>
  <altlocs diff="chg" at="Updated for second edition">
    <loc href="&url.this;xpath-datamodel-20090421.xml">XML</loc>
    <loc href="&url.this;xpath-datamodel-diff-from-REC20070123.html">Change markings relative to first edition</loc> 
    <!--* <loc href="&url.this;diff-from-20061121.html">Recent revisions</loc> *-->
  </altlocs>
  <latestloc>
    <loc href="http://www.w3.org/TR/xpath-datamodel/">http://www.w3.org/TR/xpath-datamodel/</loc>
  </latestloc>
  <prevlocs diff="chg" at="Updated for second edition">
    <loc href="http://www.w3.org/TR/2007/REC-xpath-datamodel-20070123/"/>
    <!--*
    <loc href="http://www.w3.org/TR/2006/PR-xpath-datamodel-20061121/"/>
    <loc href="http://www.w3.org/TR/2006/CR-xpath-datamodel-20060711/"/>
    <loc href="http://www.w3.org/TR/2006/CR-xpath-datamodel-20060608/"/>
    <loc href="http://www.w3.org/TR/2005/CR-xpath-datamodel-20051103/"/>
    *-->
  </prevlocs>
  <authlist>
    <author diff="add" at="New editor for second edition" role="2e">
      <name>Anders Berglund (XSL WG)</name>
      <affiliation>BC&amp;TF</affiliation>
      <email href="http://www.albconsults.com">http://www.albconsults.com</email>
    </author>                     
    <author>
      <name>Mary Fernández (XML Query WG)</name>
      <affiliation>AT&amp;T Labs</affiliation>
      <email href="mailto:mff@research.att.com">mff@research.att.com</email>
    </author>
    <author>
      <name>Ashok Malhotra (XML Query and XSL WGs)</name>
      <affiliation>Oracle Corporation</affiliation>
      <email href="mailto:ashok.malhotra@alum.mit.edu">ashok.malhotra@alum.mit.edu</email>
    </author>
    <author>
      <name>Jonathan Marsh (XSL WG)</name>
      <affiliation>Microsoft</affiliation>
      <email href="mailto:jmarsh@microsoft.com">jmarsh@microsoft.com</email>
    </author>
    <author>
      <name>Marton Nagy (XML Query WG)</name>
      <affiliation>Science Applications International Corporation (SAIC)</affiliation>
      <email href="mailto:marton.nagy@saic.com">marton.nagy@saic.com</email>
    </author>
    <author>
      <name>Norman Walsh (XSL WG)</name>
      <affiliation>Mark Logic</affiliation>
      <email href="mailto:Norman.Walsh@marklogic.com">Norman.Walsh@marklogic.com</email>
    </author>
  </authlist>

  <errataloc href="http://www.w3.org/XML/2009/qt-errata/xpath-datamodel-errata2e.html"
    xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink"/>

    <translationloc href="http://www.w3.org/2003/03/Translations/byTechnology?technology=xpath-datamodel"/>


&status-section;

<abstract id="abstract">
<p>This document defines the W3C XQuery 1.0 and XPath 2.0 Data Model (XDM),
which is the data model of <bibref ref="xpath20"/>,
<bibref ref="xslt20"/>, and <bibref ref="xquery"/>, and any other
specifications that reference it. This data model is based on the
<bibref ref="xpath"/> data model and earlier work on an
<bibref ref="XQDM00"/>. This document is the result of joint
work by the <bibref ref="XSLWG"/> and the <bibref ref="XQWG"/>.</p>
</abstract>

<langusage>
<language id="en">English</language>
</langusage>

<revisiondesc>
<p>See the CVS changelog.</p>
</revisiondesc>
</header>

<body>

<div1 id="intro">
<head>Introduction</head>

<p>This document defines the XQuery 1.0 and XPath 2.0 Data Model,
which is the data model of <bibref ref="xpath20"/>, <bibref ref="xslt20"/> and
<bibref ref="xquery"/></p>

<p>The XQuery 1.0 and XPath 2.0 Data Model (henceforth "data model")
serves two purposes.
First, it defines the information contained in the input to an
XSLT or XQuery processor.  Second, it defines all permissible values of
expressions in the XSLT, XQuery, and XPath languages.  A
language is <emph>closed</emph> with respect to a data model if the value
of every expression in the language is guaranteed to be in the data model.
XSLT 2.0, XQuery 1.0, and XPath 2.0 are all closed with respect to
the data model.</p>

<p>The data model is based on the <bibref ref="xml-infoset"/>
(henceforth "Infoset"), but it requires the following new features to
meet the <bibref ref="xpath20req"/> and <bibref ref="xquery-requirements"/>:</p>

<ulist>
  <item>
    <p>Support for XML Schema types. The XML Schema recommendations
    define features, such as structures (<bibref ref="xmlschema-1"/>)
    and simple data types (<bibref ref="xmlschema-2"/>), that extend
    the XML Information Set with precise type information.</p>
  </item>
  <item>
    <p>Representation of collections of documents and of
    complex values. (<bibref ref="xquery-requirements"/>)</p>
  </item>
  <item>
    <p>Support for typed atomic values.</p>
  </item>
  <item>
    <p>Support for ordered, heterogeneous sequences.</p>
  </item>
</ulist>

<p>As with the Infoset, the XQuery 1.0 and XPath 2.0 Data Model
specifies what information in the documents is accessible, but it does
not specify the programming-language interfaces or bindings used to
represent or access the data.</p>

<p>The data model can represent various
values including not only the input and the output of a stylesheet or query, but all
values of expressions used during the intermediate calculations.
Examples include the input document or document repository (represented
as a &documentNode; or a sequence of &documentNode;s), the result of a
path expression (represented as a sequence of nodes), the result of an
arithmetic or a logical expression (represented as an atomic value),
a sequence expression resulting in a sequence of items, etc.
</p>

<p>This document provides a precise definition of the properties of nodes
in the XQuery 1.0 and XPath 2.0 Data Model, how they are accessed, and how
they relate to values in the Infoset and PSVI.</p>

</div1>

<div1 id="concepts">
<head>Concepts</head>

<p>This section outlines a number of general concepts that apply throughout
this specification.</p>

<p diff="add" at="DM.E015">In this document, examples and material labeled as "Note" are provided for
explanatory purposes and are not normative.</p>

<div2 id="terminology">
<head>Terminology</head>

<p>For a full glossary of terms, see <specref ref="glossary"/>.</p>

<p>In this specification the words <rfc2119>must</rfc2119>,
<rfc2119>must not</rfc2119>,
<rfc2119>should</rfc2119>,
<rfc2119>should not</rfc2119>,
<rfc2119>may</rfc2119> and
<rfc2119>recommended</rfc2119>
are to be interpreted as described in <bibref ref="RFC2119"/>.</p>

<p>This specification distinguishes between the data model as a general
concept and specific items (documents, elements, atomic values, etc.)
that are concrete examples of the data model by identifying all concrete
examples as <termref def="dt-instance">instances of the data model</termref>.
</p>

<p><termdef id="dt-instance" term="instance of the data model">Every
<term>instance of the data model</term> is a
<termref def="dt-sequence">sequence</termref>.</termdef>.
</p>

<p><termdef id="dt-sequence" term="sequence">A <term>sequence</term>
is an ordered collection of zero or more <termref
def="dt-item">items</termref>.</termdef> A sequence cannot be a member
of a sequence. A single item appearing on its own is modeled as a
sequence containing one item. Sequences are defined in <specref
ref="sequences"/>.</p>

<p><termdef id="dt-item" term="item">An <term>item</term>
is either a
<termref def="dt-node">node</termref> or an
<termref def="dt-atomic-value">atomic value</termref></termdef>,
</p>

<p diff="add" at="DM.E007"><termdef id="dt-root-node" term="item">The topmost node of a tree
is called the <term>root node</term>.</termdef></p>
<note diff="add" at="DM.E007"><p>Thus the root node is merely a designator, based on position,
for one of the nodes in the tree without implying what kind
of a node it is.
In the XPath 1.0 datamodel the root node was a kind of node.</p>
</note>         

<p>Every node is one of the seven kinds of nodes defined in <specref
ref="Node"/>. Nodes form a tree that consists of a root node plus
all the nodes that are reachable directly or indirectly from the root node
via the <function>children</function>,
<function>attributes</function>, and <function>namespace-nodes</function>
accessors. Every node belongs to exactly one tree, and every tree has
exactly one root node.</p>

<p><termdef id="dt-document" term="document">A
tree whose root node is a &documentNode; is referred to as a
<term>document</term>.</termdef></p>

<p><termdef id="dt-fragment"
term="fragment">A tree whose root node is not a &documentNode; is
referred to as a <term>fragment</term>.</termdef></p>

<p><termdef id="dt-atomic-value" term="atomic value">An
<term>atomic value</term> is a value in the value space
of an <termref def="dt-atomic-type">atomic type</termref> and is labeled with
the name of that atomic type.</termdef></p>

<p><termdef id="dt-atomic-type" term="atomic type">An <term>atomic type</term>
is a <termref def="dt-primitive-simple-type">primitive simple type</termref>
or a type derived by restriction from
another atomic type.</termdef>
(Types derived by list or union are not atomic.)
</p>

<p><termdef id="dt-primitive-simple-type" term="primitive simple type" diff="chg" at="DM.E006 DM.E009">There
are 21
<term>primitive simple types</term>: the 19 defined in
<xspecref spec="XS2" ref="built-in-primitive-datatypes"/>
of <bibref ref="xmlschema-2"/> and
<code>xs:untypedAtomic</code> and
<code>xs:anyAtomicType</code></termdef>,
defined in <specref ref="types"/>.</p>   
<!-- old text
<p><termdef id="dt-primitive-simple-type" term="primitive simple type">There
are 23
<term>primitive simple types</term>: the 19 defined in
<xspecref spec="XS2" ref="built-in-primitive-datatypes"/>
of <bibref ref="xmlschema-2"/> and
<code>xs:untyped</code>,
<code>xs:untypedAtomic</code>,
<code>xs:anyAtomicType</code>,
<code>xs:dayTimeDuration</code>,
and <code>xs:yearMonthDuration</code></termdef>,
defined in <specref ref="types"/>.</p>
-->

<p>A type is represented in the data model by an
<termref def="dt-expanded-qname">expanded-QName</termref>.
</p>

<p><termdef id="dt-expanded-qname" term="expanded-QName">An
<term>expanded-QName</term> is a set of three values consisting of a
possibly empty prefix, a possibly empty namespace URI, and a local
name.</termdef> See <specref ref="qnames-and-notations"/>.</p>

<p><termdef id="dt-implementation-defined" term="implementation
defined"><term>Implementation-defined</term> indicates an aspect that
may differ between implementations, but must be specified by the
implementor for each particular implementation.</termdef></p>

<p><termdef id="dt-implementation-dependent" term="implementation
dependent"><term>Implementation-dependent</term> indicates an aspect
that may differ between implementations, is not specified by this or
any W3C specification, and is not required to be specified by the
implementor for any particular implementation.</termdef></p>

<p diff="add" at="DM.E016"><termdef id="dt-undefined" term="undefined">In certain situations
a value is said to be <term>undefined</term> (for example,
the typed value of an element node).
This term indicates that the property in question has no value and that any
attempt to use its value results in an error.</termdef></p>

<p>Within this specification, the term URI refers to a Universal
Resource Identifier as defined in
<bibref ref="RFC3986"/> and extended in <bibref ref="RFC3987"/>
with the new name IRI. The term URI has been retained in preference to
IRI to avoid introducing new names for concepts such as “Base URI”
that are defined or referenced across the whole family of XML
specifications.</p>

<p>In all cases where this specification leaves the behavior
implementation-defined or implementation-dependent, the implementation
has the option of providing mechanisms that allow the user to
influence the behavior.</p>

</div2>

<div2 id="notation">
<head>Notation</head>

<p>In addition to prose, this specification defines a set of accessor
functions to explain the data model. The accessors are shown with the
prefix <emph>dm:</emph>. This prefix is always shown in italics to
emphasize that these functions are abstract; they exist to explain the
interface between the data model and specifications that rely on the
data model: they are not accessible directly from the host
language.</p>

<p>Several prefixes are used throughout this document for notational
convenience. The following bindings are assumed.</p>

<olist>
<item><p><code>xs:</code> bound to
<code>http://www.w3.org/2001/XMLSchema</code>
</p></item>
<item><p><code>xsi:</code> bound to
<code>http://www.w3.org/2001/XMLSchema-instance</code>
</p></item>
<item><p><code>fn:</code> bound to
<code>http://www.w3.org/2005/xpath-functions</code>
</p></item>
</olist>

<p>In practice, any prefix that is bound to the appropriate URI may be used.</p>

<p>The signature of accessor functions is shown using the same style as
<bibref ref="xpath-functions"/>, described in
<xspecref spec="FO" ref="func-signatures"/>.</p>

<p>This document relies on the <bibref ref="xml-infoset"/> and
<loc href="http://www.w3.org/TR/xmlschema-1/#key-psvi">Post-Schema-Validation
Infoset</loc> (PSVI). Information items
and properties are indicated by the styles <emph role="info-item">information
item</emph> and <emph role="infoset-property">infoset property</emph>, respectively.</p>

<p>Some aspects of type assignment rely on the ability to access properties of
the schema components. Such properties are indicated by the style
{component property}. Note that this does not mean a lightweight schema processor
cannot be used, it only means that the application must have some mechanism to
access the necessary properties.</p>

</div2>

<div2 id="node-identity">
<head>Node Identity</head>

<p>Each node has a unique identity. Every <termref
def="dt-node">node</termref> in an instance of the data model is unique: identical to
itself, and not identical to any other node. (<termref
def="dt-atomic-value">Atomic values</termref> do not have identity;
every instance of the value “5” as an integer is identical to every
other instance of the value “5” as an integer.)
</p>

<note>
<p>The concept of node identity should not be confused with the
concept of a unique ID, which is a unique name assigned to an element
by the author to represent references using ID/IDREF correlation.</p>
</note>
</div2>

<div2 id="document-order">
<head>Document Order</head>

<p><termdef id="dt-document-order" term="document order">A
<term>document order</term> is defined among all the nodes
accessible during a given query or transformation. Document order is a
total ordering, although the relative order of some nodes is
implementation-dependent. Informally, document order is the order in
which nodes appear in the XML serialization of a document.</termdef>
<termdef id="dt-stable" term="stable">Document order is
<term>stable</term>, which means that the relative order of two
nodes will not change during the processing of a given query or
transformation, even if this order is implementation-dependent.</termdef></p>

<p>Within a tree, document order satisfies the following constraints:</p>

<olist>
<item>
<p>The root node is the first node.
</p>
</item>

<item>
<p>Every node occurs before all of its children and descendants.</p>
</item>

<item>
<p>&namespaceNode;s immediately follow the &elementNode; with which
they are associated. The relative order of &namespaceNode;s is
stable but implementation-dependent.</p>
<imp-dep-feature>The relative order of &namespaceNode;s nodes is
stable but implementation-dependent.</imp-dep-feature>
</item>

<item>
<p>&attributeNode;s immediately follow the &namespaceNode;s of the
element with which they are associated. If there are no
&namespaceNode;s associated with a given element, then the
&attributeNode;s associated with that element immediately
follow the element. The relative order of &attributeNode;s is
stable but implementation-dependent.</p>
<imp-dep-feature>The relative order of &attributeNode;s nodes is
stable but implementation-dependent.</imp-dep-feature>
</item>

<item>
<p>The relative order of siblings is the order in which they occur in
the &dm.prop.children; property of their parent node.</p>
</item>

<item>
<p>Children and descendants occur before following siblings.</p>
</item>
</olist>

<p>The relative order of nodes in distinct trees is stable but
implementation-dependent, subject to the following constraint: If
any node in a given tree, <code>T1</code>, occurs before any node in a different
tree, <code>T2</code>, then all nodes in <code>T1</code> are before all nodes in
<code>T2</code>.</p>
<imp-dep-feature>The relative order of distinct trees is
stable but implementation-dependent.</imp-dep-feature>
</div2>

<div2 id="sequences">
<head>Sequences</head>

<p>An important characteristic of the data model is that there is no
distinction between an item (a node or an atomic value) and a
singleton sequence containing that item. An item is
equivalent to a singleton sequence containing that item and vice
versa.</p>

<p>A sequence may contain nodes, atomic values, or any mixture of
nodes and atomic values. When a node is added to a sequence its
identity remains the same. Consequently a node may occur in more than
one sequence and a sequence may contain duplicate items.</p>

<p>Sequences never contain other sequences; if sequences are combined,
the result is always a “flattened” sequence. In other words, appending
“(d e)” to “(a b c)” produces a sequence of length 5: “(a b c d e)”.
It <emph>does not</emph> produce a sequence of length 4: “(a b c (d e))”,
such a nested sequence never occurs.</p>

<note>
<p>Sequences replace node-sets from XPath 1.0. In XPath 1.0, node-sets
do not contain duplicates. In generalizing node-sets to sequences in
XPath 2.0, duplicate removal is provided by functions on node
sequences.</p>
</note>
</div2>

<div2 id="types">
<head>Types</head>

<p>The data model supports strongly typed languages such as
<bibref ref="xpath20"/> and <bibref ref="xquery"/>
that have a type system based on <bibref ref="xmlschema-1"/>. The 
type system is formally defined in <bibref ref="xquery-semantics"/>.</p>

<p>Every <termref def="dt-item">item</termref> in the data model has both
a value and a type.
In addition to nodes, the data model can represent atomic values like
the number 5 or the string “Hello World.” For each of these
atomic values, the data model contains both the value of the item
(such as 5 or “Hello World”) and its type name (such as
<code>xs:integer</code> or <code>xs:string</code>).</p>

<div3 id="types-representation">
<head>Representation of Types</head>

<p>The data model uses
<termref def="dt-expanded-qname">expanded-QNames</termref> to
represent the names of schema types, which include the built-in
types defined by <bibref ref="xmlschema-2"/>, five additional types
defined by this specification, and may include other user- or
implementation-defined types.</p>

<imp-def-feature>Support for additional user-defined or
implementation-defined types is implementation-defined.</imp-def-feature>

<p>For XML Schema types, the namespace name of the expanded-QName is
the {target namespace} property of the type definition, and its local
name is the {name} property of the type definition.</p>

<p>The data model relies on the fact that an expanded-QName uniquely
identifies every named type. Although it is possible for different
schemas to define different types with the same expanded-QName, at
most one of them can be used in any given validation episode. The data model
cannot support environments where different types with the same expanded-QName
are available.
</p>

<p>For anonymous types, the processor <rfc2119>must</rfc2119> construct an
<termref def="dt-anonymous-type-name">anonymous type name</termref>
that is distinct from the name of every named type and the name of
every other anonymous type.
<termdef id="dt-anonymous-type-name" term="anonymous type name">An
<term>anonymous type name</term> is an implementation dependent,
unique type name provided by the processor for every anonymous
type declared in the schemas available.</termdef>
Anonymous type names
<rfc2119>must</rfc2119>
be globally unique across all anonymous types that are accessible to
the processor. In the formalism of this specification, the anonymous
type names are assumed to be <code>xs:QNames</code>, but in practice
implementations are not required to use <code>xs:QNames</code> to
represent the implementation-dependent names of anonymous types.</p>

<imp-dep-feature>The names of anonymous types are implementation-dependent.
</imp-dep-feature>

<p>The scope over which the names of anonymous types must be
meaningful and distinct is depends on the processing context.
It is the responsibility of the host language to define the
size and scope of the processing context.</p>

<p>The data model does not represent element or attribute declaration
schema components, but it supports various type-related operations.
The semantics of other operations, for example, checking if a particular
instance of an &elementNode; has a given schema type is defined in
<bibref ref="xquery-semantics"/>.
</p>
</div3>

<div3 id="types-predefined">
<head>Predefined Types</head>

<p>In addition to the 19 types defined in
<xspecref spec="XS2" ref="built-in-primitive-datatypes"/>
of <bibref ref="xmlschema-2"/>, the data model defines five
additional types: <code>xs:anyAtomicType</code>,
<code>xs:untyped</code>, <code>xs:untypedAtomic</code>,
<code>xs:dayTimeDuration</code>, and
<code>xs:yearMonthDuration</code>.
These types are defined in the XML Schema namespace with permission
of the XML Schema Working Group, which is expected to add them to
some future version of XML Schema.</p>

&xdt-datatypes;

<p>A schema for these types is provided in
<specref ref="xdtschema"/>.</p>
</div3>

<div3 id="types-hierarchy">
<head>Type Hierarchy</head>

<p>The diagram below shows how the nodes,
<termref def="dt-primitive-simple-type">primitive
simple types</termref>, and user defined types fit together into
a hierarchy.</p>

<p>The <code>xs:IDREFS</code>, <code>xs:NMTOKENS</code>,
<code>xs:ENTITIES</code> and <code>user-defined list and union
types</code> are special types in that these types are lists or unions
rather than true subtypes.</p>

<graphic source="type-hierarchy.png" alt="Type hierarchy graphic"/>
</div3>

<div3 id="AtomicValue">
<head>Atomic Values</head>

<p>An atomic value can be constructed from a lexical
representation. Given a string and an atomic type, the atomic value is
constructed in such a way as to be
<loc href="#typed-string-relationships">consistent with schema validation</loc>.
If the
string does not represent a valid value of the type, an error is
raised. When <code>xs:untypedAtomic</code> is specified as the type,
no validation takes place. The details of the construction are
described in <xspecref spec="FO" ref="constructor-functions"/>
and the related <xspecref spec="FO" ref="casting"/>
section of <bibref ref="xpath-functions"/>.
</p>
</div3>

<div3 id="StringValue">
<head>String Values</head>

<p>A string value can be constructed from an atomic value.
Such a value is constructed by
converting the atomic value to its string representation as described
in <xspecref spec="FO" ref="casting"/>.
Using the canonical lexical representation for atomic values
is not always compatible with XPath 1.0. These and other backwards
incompatibilities are described in
<xspecref spec="XP" ref="id-backwards-compatibility"/>.</p>
</div3>

</div2>
</div1>

<div1 id="construction">
<head>Data Model Construction</head>

<p>This section describes the constraints on instances of the data model.</p>

<p>The data model supports well-formed XML documents conforming to
<bibref ref="xml-names"/> or <bibref ref="xml-names11"/>.
Documents that are not well-formed are,
by definition, not XML. XML documents that do not conform to
<bibref ref="xml-names"/> or <bibref ref="xml-names11"/>
are not supported (nor are they supported by
<bibref ref="xml-infoset"/>).</p>

<p>In other words, the data model supports the following classes
of XML documents:</p>

<ulist>
  <item>
    <p>Well-formed documents conforming to <bibref ref="xml-names"/> or
<bibref ref="xml-names11"/>.</p>
  </item>
  <item>
    <p>DTD-valid documents conforming to <bibref ref="xml-names"/> or
<bibref ref="xml-names11"/>, and</p>
  </item>
  <item>
    <p>W3C XML Schema-validated documents.</p>
  </item>
</ulist>

<p>This document describes how to construct an instance of the data
model from an infoset (<bibref ref="xml-infoset"/>) or a Post Schema Validation
Infoset (PSVI), the augmented infoset produced by an XML Schema
validation episode.</p>

<p>An instance of the data model can also be constructed directly
through application APIs, or from non-XML sources such as relational
tables in a database. Regardless of how an instance of the data model
is constructed, every node and atomic value in the data model must
have a typed-value that is consistent with its type.</p>

<p>The data model supports some kinds of values that are not supported
by <bibref ref="xml-infoset"/>. Examples of these are
<termref def="dt-fragment">document fragments</termref>
and sequences of &documentNode;s.
The data model also supports values that are not nodes. Examples of
these are sequences of <termref def="dt-atomic-value">atomic values</termref>,
or sequences mixing nodes and atomic
values. These are necessary to be able to represent the results of
intermediate expressions in the data model during expression
processing.
</p>

<div2 id="const-other">
<head>Direct Construction</head>

<p>Although this document describes construction of an instance of the
data model in terms of infoset properties, an infoset is not a
necessary precondition for building an instance of the data model.</p>

<p>There are no constraints on how an instance of the data model may be
constructed directly, save that the resulting instance
<rfc2119>must</rfc2119> satisfy all of the constraints described in
this document.</p>

</div2>

<div2 id="const-infoset">
<head>Construction from an Infoset</head>

<p>An instance of the data model can be constructed from an infoset
that satisfies the
following general constraints:</p>

<ulist>
<item><p>All general and external parsed entities must be fully expanded. The
Infoset must not contain any <emph role="info-item">unexpanded entity
reference information items</emph>.</p>
</item>
<item><p>The infoset <rfc2119>must</rfc2119> provide all of the properties identified as
<quote>required</quote> in this document.
The properties identified as <quote>optional</quote>
may be used, if they are present. All other properties are ignored.</p>
</item>
</ulist>

<p>An instance of the data model constructed from an information set
<rfc2119>must</rfc2119> be consistent with the description provided
for each node kind.</p>
</div2>

<div2 id="const-psvi">
<head>Construction from a PSVI</head>

<p>An instance of the data model can be constructed from a PSVI, whose
element and attribute information items have been strictly assessed,
laxly assessed, or have not been assessed. Constructing an instance of
the data model from a PSVI <rfc2119>must</rfc2119> be consistent with
the description provided in this section and with the description
provided for each node kind.</p>

<p>Data model construction requires that the PSVI provide unique names
for all anonymous schema types.</p>

<note>
<p><bibref ref="xmlschema-1"/> does not require all schema processors to
provide unique names for anonymous schema types. In order to build an
instance of the data model
from a PSVI produced by a processor that does not provide the names,
some post-processing will be required in order to assure that they are
all uniquely identified before construction begins.</p>
</note>

<p><termdef id="dt-incompletely-validated" term="incompletely validated">An
<term>incompletely validated</term> document is an XML document that has a
corresponding schema but whose schema-validity assessment has resulted
in one or more element or attribute information items being assigned
values other than 'valid' for the <emph role="infoset-property">validity</emph>
property in the PSVI.</termdef></p>

<p>The data model supports incompletely validated documents. Elements
and attributes that are not valid are treated as having unknown types.</p>

<p>The most significant difference between Infoset construction and PSVI
construction occurs in the area of schema type assignment. Other differences
can also arise from schema processing: default attribute and element values
may be provided, white space normalization of element content may occur, and the
user-supplied lexical form of elements and attributes with atomic schema types
may be lost.</p>

<div3 id="PSVI2Types">
<head>Mapping PSVI Additions to Node Properties</head>

<p>A PSVI element or attribute information item may have a
<emph role="infoset-property">validity</emph> property.
The <emph role="infoset-property">validity</emph> property may be
<quote><emph>valid</emph></quote>, <quote><emph>invalid</emph></quote>,
or <quote><emph>notKnown</emph></quote>
and reflects the outcome of schema-validity assessment. In the data
model, precise schema type information is exposed for Element and
&attributeNode;s that are <quote><emph>valid</emph></quote>. Nodes
that are not <quote><emph>valid</emph></quote> are treated as if they
were simply well-formed XML and only very general schema type
information is associated with them.
</p>

<div4 id="PSVI2NodeTypes">
<head>Element and Attribute Node Type Names</head>

<p>The precise definition of the schema type of an element or attribute
information item depends on the properties of the PSVI.
In the PSVI, <bibref ref='xmlschema-1'/>
defines a
<emph role="infoset-property">type definition</emph> property
as well as the
<emph role="infoset-property">type definition namespace</emph>,
<emph role="infoset-property">type definition name</emph> and
<emph role="infoset-property">type definition anonymous</emph>
properties, which are effectively short-cut terms for properties of
the type definition.
Further, the <emph role="infoset-property">element declaration</emph> and
<emph role="infoset-property">attribute declaration</emph>
properties are defined for elements and attributes, respectively.
These declarations in turn will identify the
<emph role="infoset-property">type definition</emph>
declared for the element or attribute. To distinguish the 
<emph role="infoset-property">type definition</emph>
given in the PSVI for the element or attribute instance
from the <emph role="infoset-property">type definition</emph> associated
with the declaration, the former is referred to below as the actual
type and the latter as the declared type of the element or attribute
instance in question.
</p>

<p>The type depends on the declared type, the actual type, and the
<emph role="infoset-property">validity</emph> and
<emph role="infoset-property">validation attempted</emph> properties in
the PSVI. If:</p>

<ulist>
<item>
<p>The <emph role="infoset-property">validity</emph> and
<emph role="infoset-property">validation attempted</emph> properties exist
and have the values <quote><emph>valid</emph></quote> and
<quote><emph>full</emph></quote>, respectively, the
schema type of an element or attribute information item is
represented by an <termref def="dt-expanded-qname">expanded-QName</termref>
whose namespace and local name correspond
to the first applicable items in the following list:
</p>

<ulist>
<item>
<p>If the declared type exists and is a union and the actual type is (not the
same as the declared type, and not a type derived from the declared
type, but) one of the member types of the union, or derived from one
of its member types:
</p>
  <ulist>
  <item>
  <p>If the {name} property of the declared type is present: the
  {target namespace} and {name} properties of the declared type.
  </p>
  </item>
  <item>
  <p>If the {name} property of the declared type is absent: the
  namespace and local name of the anonymous type name supplied for the
  declared type.
  </p>
  </item>
  </ulist>
</item>

<item>
<p>If there is no declared type, and the actual type is a union, then:</p>
  <ulist>
  <item>
  <p>If the {name} property of the actual type is present: the {target
  namespace} and {name} properties of the actual type.
  </p>
  </item>
  <item>
  <p>If the {name} property of the actual type is absent: the
  namespace and local name of the anonymous type name supplied for the
  actual type.</p>
  </item>
  </ulist>
</item>

<item>
<p>Otherwise:</p>
  <ulist>
  <item>
  <p>If <emph role="infoset-property">type definition anonymous</emph>
  is false: the {target namespace} and {name} properties of the actual type.
  </p>
  </item>
  <item>
  <p>If <emph role="infoset-property">type definition anonymous</emph> is true:
  the namespace and local name of the anonymous type name supplied for
  the actual type.</p>
  </item>
  </ulist>
</item>
</ulist>

</item>
<item>
<p>The <emph role="infoset-property">validity</emph> property exists
and is <quote><emph>invalid</emph></quote>, or the 
<emph role="infoset-property">validation attempted</emph> property exists
and is <quote><emph>partial</emph></quote>, the schema type of an element
is <code>xs:anyType</code> and the type of an attribute is
<code>xs:anySimpleType</code>.</p>
</item>
<item>
<p>The <emph role="infoset-property">validity</emph> property exists and is
<quote><emph>notKnown</emph></quote>, and the
<emph role="infoset-property">validation attempted</emph> property exists
and is <quote><emph>none</emph></quote>, the schema type of an element is
<code>xs:untyped</code> and the type of an attribute is
<code>xs:untypedAtomic</code>.
</p>
</item>
<item>
<p>The <emph role="infoset-property">validity</emph> or
<emph role="infoset-property">validation attempted</emph> properties do not
exist, the schema type of an element is
<code>xs:untyped</code> and the type of an attribute is
<code>xs:untypedAtomic</code>. 
</p>
</item>
</ulist>

<p>The prefix associated with the type names is implementation-dependent.</p>

<imp-dep-feature>The prefix associated with type names is
implementation-dependent.
</imp-dep-feature>

</div4>

<div4 id="TypedValueDetermination">
<head>Typed Value Determination</head>

<p>This section describes how the typed value of an Element or
&attributeNode; is computed from an element or attribute PSVI
information item, where the information item has either a simple type
or a complex type with simple content. For other kinds of
&elementNode;s, see <specref ref="const-psvi-element"/>; for other kinds of
&attributeNode;s, see <specref ref="const-psvi-attribute"/>.</p>

<p>The typed value of &attributeNode;s and some &elementNode;s is a
sequence of atomic values. The
types of the items in the typed value of a node may differ from
the type of the node itself. This section describes how the typed
value of a node is derived from the properties of an information item
in a PSVI.</p>

<p diff="chg" at="DM.E002">The types of the items in the typed value of a node are determined as follows.
The process begins with a type, <code>T</code>. If the schema type of the node itself, as
represented in the PSVI, is a complex type with simple content, then <code>T</code> is the
{content type} of the schema type of the node; otherwise, <code>T</code> is the schema type
of the node itself. For each primitive or ordinary simple type <code>T</code>, the W3C XML
Schema specification defines a function <code>M</code> mapping the lexical representation of
a value onto the value itself.</p>  

<!-- old text
<p>The types of the items in the typed value of a node are determined
as follows. The process begins with <code>T</code>, the schema type of
the node itself, as represented in the PSVI. For each primitive or
ordinary simple type <code>T</code>, the W3C XML Schema specification
defines a function <code>M</code> mapping the lexical representation
of a value onto the value itself.</p>
-->
<note>
<p>For atomic and list types, the mapping is the “lexical mapping”
defined for <code>T</code> in
<bibref ref="xmlschema-2"/>; for union types, the mapping is the
lexical mapping defined in
<bibref ref="xmlschema-2"/> modified
as appropriate by any applicable rules in
<bibref ref="xmlschema-1"/>. The mapping, so modified, is a function
(in the mathematical sense) which maps to a single value even
in cases where the lexical mapping proper maps to multiple values.
</p>
</note>

<p>The typed value is determined as follows:</p>

<ulist>
<item>
<p>If the &dm.prop.nilled; property of the node in question is
<code>true</code>, then the typed value is the empty sequence.
</p>
</item>
<item>
<p>If <code>T</code> is <code>xs:anySimpleType</code> or
<code>xs:anyAtomicType</code>, the typed value
is the <emph role="infoset-property">schema normalized value</emph> as
an instance of <code>xs:untypedAtomic</code>.
</p>
</item>
<item>
<p>Otherwise, the typed value is the result of applying <code>M</code>
to the string value as an instance of the appropriate value type,
where the appropriate value type is the <emph role="infoset-property">member
type definition</emph> if <code>T</code> is a union type, otherwise it
is simply <code>T</code>.
</p>
</item>
</ulist>

<p>The typed value determination process is guaranteed to result in a 
sequence of atomic values, each having a well-defined atomic type. This 
sequence of atomic values, in turn, determines the
typed-value property of the node in the data model.</p>
</div4>

<div4 id="typed-string-relationships">
<head>Relationship Between Typed-Value and String-Value</head>

<p>Element and attribute nodes have both typed-value and string-value
properties. However, implementations are allowed some flexibility in
how these properties are stored. An implementation may choose to store
the string-value only and derive the typed-value from it, or to store
the typed-value only and derive the string-value from it, or to store
both the string-value and the typed-value.</p>

<p>In order to permit these various implementation strategies, some 
variations in the string value of a node are defined as insignificant. 
Implementations that store only the typed value of a node are permitted to 
return a string value that is different from the original lexical form of 
the node content. For example, consider the following element:</p>

<eg>&lt;offset xsi:type="xs:integer"&gt;0030&lt;/offset&gt;</eg>

<p>Assuming that the node is valid, it has a typed value of 30 as an
<code>xs:integer</code>. An implementation may return either "30" or
"0030" as the string value of the node. Any string that is a valid
lexical representation of the typed value is acceptable. In this
specification, we express this rule by saying that the relationship
between the string value of a node and its typed value must be
"consistent with schema validation."</p>

<p>If an implementation stores only the string-value of a node, the 
following considerations apply:</p>

<ulist>
<item>
<p>Where union types occur, the implementation must be able to deliver
the typed-value as an instance of the appropriate member type. For
example, if the type an element node is my:integer-or-string, which is
defined as a union of xs:integer and xs:string, and the string-value
of the node is "47", the implementation must be able to deliver the
typed-value of the node as either the integer 47 or the string "47",
depending on which member type validated the element.</p>
</item>
<item>
<p>Where types of <code>xs:QName</code>, <code>xs:NOTATION</code>, or
types derived from one of these types occur, the implementation must
be able to deliver the typed-value as a triple including a local name,
a namespace prefix, and a namespace URI, even though the namespace URI
is not part of the string-value (see
<specref ref="qnames-and-notations"/>).</p>
</item>
<item>
<p>Where an element with a complex type and element-only content
occurs, it is an error to attempt to access the typed-value of the
&elementNode;.</p>
</item>
</ulist>

<p>If an implementation stores only the typed-value of a node, it must
be prepared to construct string values from not only the node, but in
some cases also the descendants of that node. For example, an element
with a complex type and element-only content has no typed-value but
does have a string-value that is the concatenation of the
string-values of all its &textNode; descendants in document order.</p>

</div4>

<div4 id="pattern-facets">
<head>Pattern Facets</head>

<p>Creating a subtype by restriction generally reduces the
<emph>value</emph> space of the original schema type. For example,
expressing a hat size as a restriction of decimal with a minimum value
of 6.5 and maximum value of 8.0 creates a schema type whose legal values are
only those in the range 6.5 to 8.0.</p>

<p>The pattern facet is different because it restricts the
<emph>lexical</emph> space of the schema type, not its value space.
Expressing a three-digit number as a restriction of integer with the
pattern facet “[0-9]{3}” creates a schema type whose legal values
are only those with a lexical form consisting of three digits.</p>

<p>The pattern facet is not reversible in practice. A given point in
the value space might have several lexical representations. In
general, there's no practical way to determine which, if any, of these
representations satisfies the pattern facet of the type.</p>

<p>As a consequence, pattern facets are not respected when mapping to
an Infoset or during serialization and values in the data model that
were originally valid with respect to a schema that contains
pattern-based restrictions may be invalid after serialization.</p>
</div4>
</div3>

<!--
<div3 id="nilled">
<head>Mapping <att>xsi:nil</att> on &elementNode;s</head>

<p><bibref ref="xmlschema-2"/> introduced a mechanism for signaling
that an element should be accepted as valid when it has no content
despite a content type which does not require or even necessarily
allow empty content. That mechanism is the <att>xsi:nil</att> attribute.
</p>

<p>The data model exposes this special semantic in the &dm.prop.nilled; property.
(It also exposes the attribute, irrespective of whether or not schema
processing has been performed.)
</p>

<p>If the <emph role="infoset-property">validity</emph> property exists on
an information item and is <quote><emph>valid</emph></quote> then if
the <emph role="infoset-property">nil</emph> property exists and is true,
then the &dm.prop.nilled; property is <quote><emph>true</emph></quote>.
In all other cases, including all cases where schema validity assessment was
not attempted or did not succeed, the
&dm.prop.nilled; property is <quote><emph>false</emph></quote>.</p>

</div3>
-->

<div3 id="dates-and-times">
<head>Dates and Times</head>

<p>The date and time types require special attention. This section
applies to implementations that store the typed value of
<code>xs:dateTime</code>, <code>xs:date</code>, <code>xs:time</code>,
<code>xs:gYearMonth</code>, <code>xs:gYear</code>,
<code>xs:gMonthDay</code>, <code>xs:gMonth</code>,
<code>xs:gDay</code>, and types that are derived from them. These are
known collectively as the date/time types in this specification.</p>

<p>The values of the date/time types are represented in the data model
using seven components:</p>

<glist>
<gitem>
<label>year</label>
<def>
<p>An <code>xs:integer</code>.
</p>
</def>
</gitem>

<gitem>
<label>month</label>
<def>
<p>An <code>xs:integer</code> between 1 and 12, inclusive.
</p>
</def>
</gitem>

<gitem>
<label>day</label>
<def>
<p>An <code>xs:integer</code> between 1 and 31, inclusive, possibly
restricted further depending on the values of month and year.
</p>
</def>
</gitem>

<gitem>
<label>hour</label>
<def>
<p>An <code>xs:integer</code> between 0 and 23, inclusive.
</p>
</def>
</gitem>

<gitem>
<label>minute</label>
<def>
<p>An <code>xs:integer</code> between 0 and 59, inclusive.
</p>
</def>
</gitem>

<gitem id="tuple-timezone">
<label>second</label>
<def>
<p>An <code>xs:decimal</code> greater than or equal to zero and less
than 60. Leap seconds are not supported.
</p>
</def>
</gitem>

<gitem>
<label>timezone</label>
<def>
<p>An <code>xs:dayTimeDuration</code> between -PT14H00M and PT14H00M,
inclusive. All timezone values must be an integral number of minutes.
</p>
</def>
</gitem>
</glist>

<p>Components that are intrinsic to the datatype (for example, day,
month, and year in a <code>xs:date</code>) are required; components
that can never be part of a datatype (for example, years in a
<code>xs:time</code>) must be missing. Missing components are
represented by the empty sequence. When a component is present, it
contains the “local value” that has not been normalized in any way.
The timezone component is optional for all the date/time datatypes.</p>

<p>Thus, the lexical <code>xs:dateTime</code> representation
“<code>2003-01-02T11:30:00-05:00</code>” is stored as
“<code>{2003,&#160;1,&#160;2,&#160;11,&#160;30,&#160;0.0,&#160;-PT05H00M}</code>”.
The value of the lexical representation “<code>2003-01-16T16:30:00</code>”
is stored as
“<code>{2003,&#160;1,&#160;16,&#160;16,&#160;30,&#160;0,&#160;()}</code>”
because it has no timezone.
The value of the lexical <code>xs:gDay</code> representation
“<code>---30+10:30</code>” is
stored as
“<code>{(),&#160;(),&#160;30,&#160;(),&#160;(),&#160;(),&#160;PT10H30M}</code>”.
</p>

<p>The lexical form “<code>24:00:00</code>” is normalized in the component
model. As a <code>xs:time</code>, it is stored as
“<code>{(),&#160;(),&#160;(),&#160;0,&#160;0,&#160;0.0,&#160;()}</code>”
and the <code>xs:dateTime</code> representation
“<code>1999-12-31T24:00:00</code>” is stored as
“<code>{2000,&#160;1,&#160;1,&#160;0,&#160;0,&#160;0.0,&#160;()}</code>”.
</p>

<p>Note: Implementations are permitted to store date/time values in
any representation that's convenient for them, provided that the
individual properties can be accessed and modified.</p>

</div3>

<div3 id="qnames-and-notations">
<head>QNames and NOTATIONS</head>

<p>The <code>QName</code> and <code>NOTATION</code> data types require
special attention. The following sections apply to
<code>xs:QName</code>, <code>xs:NOTATION</code>, and types derived
from them. These types are referred to collectively as “qualified
names”.</p>

<p>As defined in XML Schema, the lexical space for qualified names
includes a local name and an optional namespace prefix. The value
space for qualified names contains a local name and an optional
namespace URI. Therefore, it is not possible to derive a lexical value
from the typed value, or vice versa, without access to some context
that defines the namespace bindings.</p>

<p>When qualified names exist as values of nodes in a well-formed document,
it is always possible to determine such a namespace context. However,
the data model also allows qualified names to exist as freestanding
atomic values, or as the name or value of a parentless attribute node,
and in these cases no namespace context is available.</p>

<p>In this Data Model, therefore, the value space for qualified names
contains a local-name, an optional namespace URI, and an optional
prefix. The prefix is used only when producing a lexical
representation of the value, that is, when casting the value to a
string. The prefix plays no part in other operations involving
qualified names: in particular, two qualified names are equal if their
local names and namespace URIs match, regardless whether they have the
same prefix.</p>

<p>The following consistency constraints apply:</p>

<ulist>
<item>
<p>If the namespace URI of a qualified name is absent, then the prefix must
also be absent.</p>
</item>

<item>
<p>For every element node whose name has a prefix, the prefix must be one
that has a binding to the namespace URI of the element name in the namespaces
property of the element.</p>
</item>

<item>
<p>For every element node whose name has no prefix, the element must have a
a binding for the empty prefix to the namespace URI of the element name,
or must have no binding for the empty prefix in
the case where the name of the element has no namespace URI.</p>
</item>

<item>
<p>For every attribute node whose name has a prefix, the attribute node must
either be parentless, or the prefix must be one that has a binding to the
namespace URI of the attribute name in the namespaces property of the
parent element.</p>
</item>

<item>
<p>For every qualified name that contains a prefix and that is included in
the typed value of an element node, or of an attribute node that has an
element node as its parent, the prefix must be one that is bound to the
namespace URI of the qualified name in the namespaces property of that
element.</p>
</item>

<item>
<p>For every qualified name that contains a namespace URI and no prefix, and
that is included in the typed value of an element node, or of an attribute
node that has an element node as its parent, that element node must have a
binding for the empty prefix to that namespace URI in its namespace property.
</p>
</item>

<item>
<p>For every qualified name that contains neither a namespace URI nor a
prefix, and that is included in the typed value of an element node, or of an
attribute node that has an element node as its parent, that node
must not have a binding for the empty prefix.</p>
</item>

<item>
<p>No qualified name that contains a prefix may be included in the typed value of
an attribute node that has no parent.</p>
</item>
</ulist>
</div3>
</div2>
</div1>

<div1 id="infoset-mapping">
<head>Infoset Mapping</head>

<p>This specification describes how to map each kind of node to the
corresponding information item. This mapping produces an Infoset; it
does not and cannot produce a PSVI. Validation must be used to obtain
a PSVI for a (portion of a) data model instance.
</p>

<p diff="del" at="DM.E014">An Infoset can also be constructed by serializing an instance of
the data model and parsing it. Serialization is governed by
<bibref ref="xslt-xquery-serialization"/>.</p>

</div1>

<div1 id="accessors">
<head>Accessors</head>

<p>A set of accessors is defined on <loc href="#Node">nodes</loc> in
the data model. For consistency, all the accessors are defined on
every kind of node, although several accessors return a constant empty
sequence on some kinds of nodes.</p>

<p>In order for processors to be able to operate on instances of the
data model, the model must expose the properties of the items it contains.
The data model does this by defining a family of accessor functions.
These are not functions in the literal sense; they are not available
for users or applications to call directly. Rather they are
descriptions of the information that an implementation of the data model
must expose to applications. Functions and operators available to end-users
are described in <bibref ref="xpath-functions"/>.</p>

<p diff="chg" at="DM.E016">Some typed values in the data model
are <termref def="dt-undefined">undefined</termref>.
Attempting to access an undefined property is always an error. Behavior
in these cases is implementation-defined and the host language is responsible
for determining the result.</p>

<imp-def-feature>Some typed values in the data model are <emph>undefined</emph>.
Attempting to access an undefined property is always an error. Behavior
in these cases is implementation-defined and the host language is responsible
for determining the result.</imp-def-feature>

<div2 id="dm-attributes">
<head><code>attributes</code> Accessor</head>

<example role="signature">
  <proto class="dm" name="attributes" return-type="attribute()" returnSeq="yes">
    <arg name="n" type="node()"/>
  </proto>
</example>

<p>The <function>attributes</function> accessor returns the attributes of
a node as a sequence containing zero or more &attributeNode;s.
The order of &attributeNode;s is stable but implementation dependent.</p>


<p>It is defined on
<loc href="#acc-summ-attributes">all seven</loc> node kinds.</p>

</div2>

<div2 id="dm-base-uri">
<head><code>base-uri</code> Accessor</head>

<example role="signature">
  <proto class="dm" name="base-uri" return-type="xs:anyURI" returnEmptyOk="yes">
    <arg name="n" type="node()"/>
  </proto>
</example>

<p>The <function>base-uri</function> accessor returns the base URI of a node
as a sequence containing zero or one URI reference. For more information
about base URIs, see <bibref ref="xmlbase"/>.</p>

<p>It is defined on
<loc href="#acc-summ-base-uri">all seven</loc> node kinds.</p>
</div2>

<div2 id="dm-children">
<head><code>children</code> Accessor</head>

<example role="signature">
  <proto class="dm" name="children" return-type="node()" returnSeq="yes">
    <arg name="n" type="node()"/>
  </proto>
</example>

<p>The <function>children</function> accessor returns the children of a node
as a sequence containing zero or more nodes.</p>

<p>It is defined on
<loc href="#acc-summ-children">all seven</loc> node kinds.</p>

</div2>

<div2 id="dm-document-uri">
<head><code>document-uri</code> Accessor</head>

<example role="signature">
  <proto class="dm" name="document-uri" return-type="xs:anyURI" returnEmptyOk="yes">
    <arg name="node" type="node()"/>
  </proto>
</example>

<p>The <function>document-uri</function> accessor returns the
absolute URI of the resource from which the &documentNode; was constructed, if
the absolute URI is available. If there is no URI available, or if it cannot
be made absolute when the &documentNode; is constructed, or if it is used
on a node other than a &documentNode;,
the empty sequence is returned.
</p>

<p>It is defined on
<loc href="#acc-summ-document-uri">all seven</loc> node kinds.</p>
</div2>

<div2 id="dm-is-id">
<head><code>is-id</code> Accessor</head>

<example role="signature">
  <proto class="dm" name="is-id" return-type="xs:boolean" returnEmptyOk="yes">
    <arg name="node" type="node()"/>
  </proto>
</example>

<p>The <function>is-id</function> accessor returns true if the
node is an XML ID. Exactly what constitutes an ID depends in part on
how the data model was constructed, see
<specref ref="ElementNode"/> and <specref ref="AttributeNode"/>.
</p>

<p>It is defined on <loc href="#acc-summ-is-id">all seven</loc>
node kinds.</p>
</div2>

<div2 id="dm-is-idrefs">
<head><code>is-idrefs</code> Accessor</head>

<example role="signature">
  <proto class="dm" name="is-idrefs" return-type="xs:boolean" returnEmptyOk="yes">
    <arg name="node" type="node()"/>
  </proto>
</example>

<p>The <function>is-idrefs</function> accessor returns true if the
node is an XML IDREF or IDREFS.
Exactly what constitutes an IDREF or IDREFS depends in part on
how the data model was constructed, see
<specref ref="ElementNode"/> and <specref ref="AttributeNode"/>.</p>

<p>It is defined on <loc href="#acc-summ-is-idrefs">all seven</loc>
node kinds.</p>
</div2>

<div2 id="dm-namespace-bindings">
<head><code>namespace-bindings</code> Accessor</head>

<example role="signature">
  <proto class="dm" name="namespace-bindings" return-type="xs:string" returnSeq="yes">
    <arg name="node" type="node()"/>
  </proto>
</example>

<p>The <function>namespace-bindings</function> accessor returns the
dynamic, in-scope namespaces associated with a node as a set of
prefix/URI pairs, using an implementation-dependent
representation.</p>

<imp-dep-feature>The representation of the set of prefix/URI pairs returned
by the <function>namespace-bindings</function> accessor is
implementation-dependent.
</imp-dep-feature>


<p>The prefix for the default namespace is the zero length string.</p>

<p>The <function>namespace-bindings</function> accessor is defined on
<loc href="#acc-summ-namespace-bindings">all seven</loc> node kinds.</p>

<p>Note: this accessor and the <code>namespace-nodes</code> accessor provide
two views of the same information.</p>

</div2>

<div2 id="dm-namespace-nodes">
<head><code>namespace-nodes</code> Accessor</head>

<example role="signature">
  <proto class="dm" name="namespace-nodes" return-type="node()" returnSeq="yes">
    <arg name="n" type="node()"/>
  </proto>
</example>

<p>The <function>namespace-nodes</function> accessor returns the dynamic,
in-scope namespaces associated with a node as a sequence containing
zero or more &namespaceNode;s. The order of &namespaceNode;s is stable
but implementation dependent.</p>

<p>It is defined on
<loc href="#acc-summ-namespace-nodes">all seven</loc> node kinds.</p>

<p>Note: this accessor and the <code>namespace-bindings</code> accessor provide
two views of the same information. Implementations that do not need to expose
&namespaceNode;s might choose not to implement this accessor.</p>

</div2>

<div2 id="dm-nilled">
<head><code>nilled</code> Accessor</head>

<example role="signature">
  <proto class="dm" name="nilled" return-type="xs:boolean" returnSeq="no"
	 returnEmptyOk="yes">
    <arg name="n" type="node()"/>
  </proto>
</example>

<p>The <function>nilled</function> accessor returns true if the
node is <quote>nilled</quote>.
<bibref ref="xmlschema-1"/> introduced the nilled mechanism to
signal that an element should be accepted as valid when it has no
content even when it has a content type which does not require or even
necessarily allow empty content.
</p>

<p>It is defined on
<loc href="#acc-summ-nilled">all seven</loc> node kinds.</p>
</div2>

<div2 id="dm-node-kind">
<head><code>node-kind</code> Accessor</head>

<example role="signature">
  <proto class="dm" name="node-kind" return-type="xs:string" returnEmptyOk="no">
    <arg name="n" type="node()"/>
  </proto>
</example>

<p>The <function>node-kind</function> accessor returns a string identifying the
kind of node. It will be one of the following, depending on the kind of
node:
“attribute”,
“comment”,
“document”,
“element”,
“namespace”
“processing-instruction”, or
“text”.
</p>

<p>It is defined on
<loc href="#acc-summ-node-kind">all seven</loc> node kinds.</p>

</div2>

<div2 id="dm-node-name">
<head><code>node-name</code> Accessor</head>

<example role="signature">
  <proto class="dm" name="node-name" return-type="xs:QName" returnEmptyOk="yes">
    <arg name="n" type="node()"/>
  </proto>
</example>

<p>The <function>node-name</function> accessor returns the name of the node
as a sequence of zero or one <code>xs:QName</code>s. Note that the
QName value includes an optional prefix as described in
<specref ref="qnames-and-notations"/>.</p>

<p>It is defined on
<loc href="#acc-summ-node-name">all seven</loc> node kinds.</p>

</div2>

<div2 id="dm-parent">
<head><code>parent</code> Accessor</head>

<example role="signature">
  <proto class="dm" name="parent" return-type="node()" returnEmptyOk="yes">
    <arg name="n" type="node()"/>
  </proto>
</example>

<p>The <function>parent</function> accessor returns the parent of a node
as a sequence containing zero or one nodes.</p>

<p>It is defined on
<loc href="#acc-summ-parent">all seven</loc> node kinds.</p>

</div2>

<div2 id="dm-string-value">
<head><code>string-value</code> Accessor</head>

<example role="signature">
  <proto class="dm" name="string-value" return-type="xs:string" returnEmptyOk="no">
    <arg name="n" type="node()"/>
  </proto>
</example>

<p>The <function>string-value</function> accessor returns the string value
of a node.</p>

<p>It is defined on
<loc href="#acc-summ-string-value">all seven</loc> node kinds.</p>

</div2>

<div2 id="dm-type-name">
<head><code>type-name</code> Accessor</head>

<example role="signature">
  <proto class="dm" name="type-name" return-type="xs:QName" returnEmptyOk="yes">
    <arg name="n" type="node()"/>
  </proto>
</example>

<p>The <function>type-name</function> accessor returns the name of the schema type
of a node as a sequence of zero or one <code>xs:QName</code>s.</p>

<p>It is defined on
<loc href="#acc-summ-type-name">all seven</loc> node kinds.</p>

</div2>

<div2 id="dm-typed-value">
<head><code>typed-value</code> Accessor</head>

<example role="signature">
  <proto class="dm" name="typed-value" return-type="xs:anyAtomicType" returnSeq="yes">
    <arg name="n" type="node()"/>
  </proto>
</example>

<p>The <function>typed-value</function> accessor returns the
typed-value of the node as a sequence of zero or more atomic
values.</p>

<p>It is defined on
<loc href="#acc-summ-typed-value">all seven</loc> node kinds.</p>

</div2>

<div2 id="dm-unparsed-entity-public-id">
<head><code>unparsed-entity-public-id</code> Accessor</head>

<example role="signature">
  <proto class="dm" name="unparsed-entity-public-id" return-type="xs:string" returnEmptyOk="yes">
    <arg name="node" type="node()"/>
    <arg name="entityname" type="xs:string"/>
  </proto>
</example>

<p>The <function>unparsed-entity-public-id</function> accessor returns
the public identifier of an unparsed external entity declared in the
specified document. If no entity with the name specified in
<code>$entityname</code> exists, or if the entity is not an external
unparsed entity, or if the entity has no public identifier, the empty
sequence is returned.</p>

<p>It is defined on
<loc href="#acc-summ-unparsed-entity-public-id">all seven</loc> node kinds.</p>
</div2>

<div2 id="dm-unparsed-entity-system-id">
<head><code>unparsed-entity-system-id</code> Accessor</head>

<example role="signature">
  <proto class="dm" name="unparsed-entity-system-id" return-type="xs:anyURI" returnEmptyOk="yes">
    <arg name="node" type="node()"/>
    <arg name="entityname" type="xs:string"/>
  </proto>
</example>

<p diff="chg" at="DM.E010">The <function>unparsed-entity-system-id</function> accessor returns the
system identifier of an unparsed external entity declared in the
specified document.
The value is an absolute URI, and is obtained by resolving the
<emph role="infoset-property">system identifier</emph>
of the unparsed entity information item against the
<emph role="infoset-property">declaration base URI</emph>
of the same item.
If no entity with the name specified in <code>$entityname</code>
exists, or if the entity is not an external unparsed entity, the empty sequence
is returned.</p>

<p>It is defined on
<loc href="#acc-summ-unparsed-entity-system-id">all seven</loc> node kinds.</p>
</div2>
</div1>

<div1 id="Node">
<head>Nodes</head>

<p><termdef id="dt-node" term="Node">There are seven kinds of
<term>Nodes</term> in the data model:
<loc href="#DocumentNode">document</loc>,
<loc href="#ElementNode">element</loc>,
<loc href="#AttributeNode">attribute</loc>,
<loc href="#TextNode">text</loc>,
<loc href="#NamespaceNode">namespace</loc>,
<loc href="#ProcessingInstructionNode">processing instruction</loc>, and
<loc href="#CommentNode">comment</loc>.</termdef> Each kind of
node is described in the following sections.</p>

<note>
<p>A host language based on the Data Model may specify that its usage of the 
Data Model does not include namespace nodes. Namespace nodes are used only 
in the "namespaces" property of an element node, which records the 
bindings of namespace prefixes to namespace URIs. These bindings may be 
represented either by means of namespace nodes or by using an alternative, 
implementation-dependent representation.</p>
<imp-dep-feature>The representation of namespaces, i.e. whether or not they
are represented as nodes, is implementation-dependent.</imp-dep-feature>
</note>

<p id="constraints-general">All nodes <rfc2119>must</rfc2119> satisfy
the following general constraints:</p>

<olist>
<item><p>Every node <rfc2119>must</rfc2119> have a unique identity,
distinct from all other nodes.
</p></item>
<item>
<p>The &dm.prop.children; property of a node <rfc2119>must not</rfc2119>
contain two consecutive &textNode;s.</p>
</item>
<item>
<p>The &dm.prop.children; property of a node <rfc2119>must not</rfc2119>
contain any empty &textNode;s.</p>
</item>
<item>
<p>The &dm.prop.children; and &dm.prop.attributes; properties of a node
<rfc2119>must not</rfc2119>
contain two nodes with the same identity.</p>
</item>
</olist>

&Document;
&Element;
&Attribute;
&Namespace;
&ProcessingInstruction;
&Comment;
&Text;
</div1>

<div1 id="conformance">
<head>Conformance</head>

<p>The data model is intended primarily as a component that can be
used by other specifications. Therefore, the data model relies on
specifications that use it (such as <bibref ref="xpath20"/>, <bibref
ref="xslt20"/>, and <bibref ref="xquery"/>) to specify conformance
criteria for the data model in their respective environments.
Specifications that set conformance criteria for their use of the data
model must not relax the constraints expressed in this
specification.</p>

<p>Authors of conformance criteria for the use of the data
model should pay particular attention to the following features of
the data model:</p>

<olist>
<item>
<p>Support for the normative construction from an infoset described in
<specref ref="const-infoset"/>.
</p>
</item>
<item>
<p>Support for the normative construction from a PSVI described in
<specref ref="const-psvi"/>.
</p>
</item>
<item>
<p>Support for XML 1.0 and XML 1.1.
</p>
</item>
<item>
<p>How namespaces are supported, through nodes or through the
alternative, implementation-dependent representation.</p>
</item>
</olist>

</div1>

</body>

<back>
<div1 id="infoset-conformance">
<head>XML Information Set Conformance</head>

<p>This specification conforms to the XML Information Set
<bibref ref="xml-infoset"/>.
The following information items <rfc2119>must</rfc2119> be exposed
by the infoset producer to construct a data model unless they are explicitly
identified as optional:</p>

<ulist>
  <item><p>The <emph role="info-item">Document Information Item</emph> with
           <emph role="infoset-property">base URI</emph>,
           <emph role="infoset-property">children</emph>, and, optionally,
           <emph role="infoset-property">unparsed entities</emph>
           properties. If the
           <emph role="infoset-property">unparsed entities</emph> property
	   is supported, the <emph role="info-item">Unparsed Entity
           Information Items</emph> must also be supported.</p></item>

  <item><p><emph role="info-item">Element Information Items</emph> with
           <emph role="infoset-property">base URI</emph>,
           <emph role="infoset-property">children</emph>,
           <emph role="infoset-property">attributes</emph>,
           <emph role="infoset-property">in-scope namespaces</emph>,
           <emph role="infoset-property">prefix</emph>,
           <emph role="infoset-property">local name</emph>,
           <emph role="infoset-property">namespace name</emph>,
           <emph role="infoset-property">parent</emph> properties.</p></item>

  <item><p><emph role="info-item">Attribute Information Items</emph> with
           <emph role="infoset-property">namespace name</emph>,
           <emph role="infoset-property">prefix</emph>,
           <emph role="infoset-property">local name</emph>,
           <emph role="infoset-property">normalized value</emph>,
           <emph role="infoset-property">attribute type</emph>, and
           <emph role="infoset-property">owner element</emph> properties.</p></item>

  <item><p><emph role="info-item">Character Information Items</emph> with
           <emph role="infoset-property">character code</emph>,
           <emph role="infoset-property">parent</emph>, and, optionally,
           <emph role="infoset-property">element content whitespace</emph>
           properties.</p></item>

  <item><p><emph role="info-item">Processing Instruction Information Items</emph> with
           <emph role="infoset-property">base URI</emph>,
           <emph role="infoset-property">target</emph>,
           <emph role="infoset-property">content</emph> and
           <emph role="infoset-property">parent</emph> properties.</p></item>

  <item><p><emph role="info-item">Comment Information Items</emph> with
           <emph role="infoset-property">content</emph> and
           <emph role="infoset-property">parent</emph> properties.</p></item>

  <item><p><emph role="info-item">Namespace Information Items</emph> with
           <emph role="infoset-property">prefix</emph> and
           <emph role="infoset-property">namespace name</emph> properties.</p></item>
</ulist>

<p>Other information items and properties made available by the
Infoset processor are ignored.  In addition to the properties above,
the following PSVI properties are required
on 
<emph role="info-item">Element Information Items</emph> and
<emph role="info-item">Attribute Information Items</emph>
if the data model is constructed from a PSVI:</p>

<ulist>
  <item><p><emph role="infoset-property">validity</emph>,
  <emph role="infoset-property">validation attempted</emph>,
  <emph role="infoset-property">type definition</emph>,
  <emph role="infoset-property">type definition namespace</emph>,
  <emph role="infoset-property">type definition name</emph>,
  <emph role="infoset-property">type definition anonymous</emph>,
  <emph role="infoset-property">nil</emph>,
  <emph role="infoset-property">member type definition</emph>,
  <emph role="infoset-property">member type definition namespace</emph>,
  <emph role="infoset-property">member type definition name</emph>,
  <emph role="infoset-property">member type definition anonymous</emph> and
  <emph role="infoset-property">schema normalized value</emph>.</p>
  </item>
</ulist>

</div1>

<div1 id="references">
<head>References</head>

<div2 id="normative-references">
<head>Normative References</head>

<blist>

<!--FIXME: update ../etc/tr with the latest TR page info! -->

<bibl id="xml-infoset"     key="Infoset"/>
<bibl id="xml-names"   key="Namespaces in XML"/>
<bibl id="xml-names11"     key="Namespaces in XML 1.1"/>
<bibl id="xml-id"     key="xml:id"/>

<bibl id="xpath20" key="XPath 2.0"/>
<bibl id="xpath-functions" key="Functions and Operators"/>

<bibl id="xmlschema-1"     key="Schema Part 1"/>
<bibl id="xmlschema-2"     key="Schema Part 2"/>

<bibl id="xslt-xquery-serialization" key="Serialization"/>

<bibl id="xquery-semantics" key="Formal Semantics"/>
<bibl id="RFC2119"         key="RFC 2119"/>
<bibl id="RFC3986"         key="RFC 3986"/>
<bibl id="RFC3987"         key="RFC 2987"/>
<bibl id="charmod"         key="Character Model"/>

</blist>
</div2>

<div2 id="informative-references">
<head>Other References</head>

<blist>

<bibl id="XQDM00"          key="XML Query Data Model">
<titleref href="http://www.w3.org/TR/2001/WD-query-datamodel-20010215/"
>XML Query Data Model</titleref>,
Mary Fernández and Jonathan Robie, Editors.
World Wide Web Consortium,
15 Feb 2001.
</bibl>

<bibl id="xmlbase"         key="XML Base"/>
<bibl id="xpath"           key="XPath 1.0"/>
<bibl id="xpath20req"      key="XPath 2.0 Requirements"/>
<bibl id="xslt20"          key="XSLT 2.0"/>

<bibl id="XQWG" key="XML Query Working Group">
<titleref href="http://www.w3.org/XML/Query"
>XML Query Working Group</titleref>,
World Wide Web Consortium.
Home page: http://www.w3.org/XML/Query
</bibl>

<bibl id="XSLWG" key="XSL Working Group">
<titleref href="http://www.w3.org/Style/XSL/"
>XSL Working Group</titleref>,
World Wide Web Consortium.
Home page: http://www.w3.org/Style/XSL/
</bibl>

<bibl id="xquery" key="XQuery"/>

<bibl id="xquery-requirements" key="XML Query Requirements"/>

<bibl id="ISO8601"
      key="ISO 8601">ISO (International Organization for Standardization).
<emph>Representations of dates and times, 2000-08-03.</emph>  
Available from: <loc href="http://www.iso.ch/">http://www.iso.ch/</loc>
</bibl>

</blist>
</div2>
</div1>

<div1 id="xdtschema">
&xdt-schema-app;
</div1>

<inform-div1 id="glossary">
<head>Glossary</head>
<?glossary?>
</inform-div1>

<inform-div1 id="example">
<head>Example</head>

<p>The following XML document is used to illustrate the information
contained in a data model:</p>

<eg>&dm-example.xml;</eg>

<p>The document is associated with the URI
<quote>http://www.example.com/catalog.xml</quote>,
and is valid with respect to the following XML schema:</p>

<eg diff="chg" at="DM.E001">&dm-example.xsd;</eg>

<p>The schema is associated with the URI
<quote>http://www.example.com/dm-example.xsd</quote>.</p>

<p>This example exposes the data model for a document that has an associated
schema and has been validated successfully against it.
In general, an XML Schema is not required,
that is, the data model can represent a schemaless, well-formed XML
document with the rules described in <specref ref="types"/>.</p>

<p>The XML document is represented by the nodes described below.
The value <emph>D1</emph> represents a &documentNode;;
the values <emph>E1, E2, etc.</emph> represent &elementNode;s;
the values <emph>A1, A2, etc.</emph> represent &attributeNode;s;
the values <emph>N1, N2, etc.</emph> represent &namespaceNode;s;
the values <emph>P1, P2, etc.</emph> represent &processingInstructionNode;s;
the values <emph>T1, T2, etc.</emph> represent &textNode;s.</p>

<p>For brevity:</p>

<ulist>
<item><p>&textNode;s in the data model that contain only white space are not shown.</p>
</item>
<item><p>Literal strings are shown in quotes without the <code>xs:string()</code>
constructor
</p></item>
<item><p>Literal decimals are shown without the <code>xs:decimal()</code>
constructor
</p></item>
<item><p>Nodes are referred to using the syntax <code>[nodeID]</code>
</p></item>
<item><p>xs:QNames are used with the following prefixes bindings:</p>

<table border="0" summary="Namespace prefixes">
<tbody>
  <tr>
    <td>xs</td><td>http://www.w3.org/2001/XMLSchema</td>
  </tr>
  <tr>
    <td>xsi</td><td>http://www.w3.org/2001/XMLSchema-instance</td>
  </tr>
  <tr>
    <td>cat</td><td>http://www.example.com/catalog</td>
  </tr>
  <tr>
    <td>xlink</td><td>http://www.w3.org/1999/xlink</td>
  </tr>
  <tr>
    <td>html</td><td>http://www.w3.org/1999/xhtml</td>
  </tr>
  <tr>
    <td>anon</td><td>An implementation-dependent prefix associated with
<termref def="dt-anonymous-type-name">anonymous type names</termref></td>
  </tr>
</tbody>
</table>

</item>
<item><p>The abbreviation <quote><code>\n</code></quote> is used in string literals
to represent a newline character; this isn't supported in XPath, but it makes
this presentation clearer.</p></item>
<item><p>Accessors that return the empty sequence have been omitted.</p>
</item>
<item><p>To simplify the presentation, we’re assuming an implementation
that does not expose the namespace axis. Therefore,
&namespaceNode;s are shared across multiple elements.
See <specref ref="NamespaceNode"/>.</p>
</item>
</ulist>

&dm-example.tbl;

<p>A graphical representation of the data model for the preceding
example is shown below. Document order in this representation can be
found by following the traditional left-to-right,
depth-first traversal; however, because the image has been rotated for
easier presentation, this appears to be bottom-to-top,
depth-first order.</p>

<table border="0" cellspacing="0" summary="Graphic">
  <tbody>
    <tr>
      <td><graphic source="dm-example.png"
                   alt="Graphical depiction of the example data model."/>
      </td>
    </tr>
    <tr>
      <td>Graphic representation of the data model.
[<loc href="dm-example-large.png">large view</loc>,
<loc href="dm-example.svg">SVG</loc>]
      </td>
    </tr>
  </tbody>
</table>

</inform-div1>

<inform-div1 id="impl-summary">
<head>Implementation-Defined and Implementation-Dependent Items</head>

<div2 id="implementation-defined">
<head>Implementation-Defined Items</head>

<p>The following items are
<termref def="dt-implementation-defined">implementation-defined</termref>.
</p>

<?imp-def-feature?>
</div2>

<div2 id="implementation-dependent">
<head>Implementation-Dependent Items</head>

<p>The following items are
<termref def="dt-implementation-dependent">implementation-dependent</termref>.
</p>

<?imp-dep-feature?>
</div2>
</inform-div1>

&ChangeLog; 

</back>
</spec>
