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

<!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 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 date.year "2003">
<!ENTITY date.month "November">
<!ENTITY date.MM "11">
<!ENTITY date.day "12">
<!ENTITY date.DD "&date.day;">
<!ENTITY doc.date "&date.year;&date.MM;&date.DD;">
<!ENTITY doc.prefix "WD-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 aacute "&#225;">

<!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.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	      "<emph role='dm-node-property'>type</emph>">
<!ENTITY dm.prop.uri          "<emph role='dm-node-property'>uri</emph>">
]>
<spec w3c-doctype="wd">

<header>
  <title>XQuery 1.0 and XPath 2.0 Data Model</title>
  <version/>
  <w3c-designation>&doc.prefix;-&doc.date;</w3c-designation>
  <w3c-doctype>W3C Working Draft</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>
    <loc href="&url.this;data-model.xml">XML</loc>
  </altlocs>
  <latestloc>
    <loc href="http://www.w3.org/TR/xpath-datamodel/">http://www.w3.org/TR/xpath-datamodel/</loc>
  </latestloc>
  <prevlocs>
    <loc href="http://www.w3.org/TR/2003/WD-xpath-datamodel-20030502/">http://www.w3.org/TR/2003/WD-xpath-datamodel-20030502/</loc>
  </prevlocs>
  <authlist>
    <author>
      <name>Mary Fern&aacute;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>Microsoft</affiliation>
      <email href="mailto:ashokma@microsoft.com">ashokma@microsoft.com</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>Sun Microsystems</affiliation>
      <email href="mailto:Norman.Walsh@Sun.COM">Norman.Walsh@Sun.COM</email>
    </author>
  </authlist>

<status>
<p><emph>This section describes the status of this document at the time
of its publication. Other documents may supersede this document. A
list of current W3C publications and the latest revision of this
technical report can be found in the <loc
href="http://www.w3.org/TR/">W3C technical reports index</loc> at
http://www.w3.org/TR/.</emph></p>

<p>This is a Public Working Draft for review by W3C Members and
other interested parties.
Publication as a Working Draft does not imply endorsement by the W3C
Membership. This is a draft document and may be updated, replaced or
obsoleted by other documents at any time. It is inappropriate to cite
this document as other than work in progress.</p>

<p>The XQuery 1.0 and XPath 2.0 Data Model has been defined jointly by
the <loc href="http://www.w3.org/XML/Query">XML Query Working Group</loc>
and the
<loc href="http://www.w3.org/Style/XSL/">XSL Working Group</loc>
(both part of the
<loc href="http://www.w3.org/XML/Activity.html">XML Activity</loc>).
</p>

<p>This is a
<loc href="http://www.w3.org/2003/06/Process-20030618/tr#last-call">Last
Call Working Draft</loc> which 
consolidates changes and editorial improvements
undertaken in response to feedback received during the previous
<loc href="http://www.w3.org/2003/06/Process-20030618/tr#last-call">Last
Call</loc> publication which begin on 2 May 2003.
A list of the
<loc href="http://www.w3.org/XML/2003/05/xpath-datamodel-issues">Last
Call issues</loc>
addressed by the Working Groups is also available.</p>

<p>Comments on this document are
due on 15 February 2004.
Comments should be sent to the W3C mailing list
<loc href="mailto:public-qt-comments@w3.org">public-qt-comments@w3.org</loc>.
(archived at
<loc href="http://lists.w3.org/Archives/Public/public-qt-comments/">http://lists.w3.org/Archives/Public/public-qt-comments/</loc>) with “[DM]”
at the beginning of the subject field.</p>

<p>
Patent disclosures relevant to this specification may be found on the
XML Query Working Group's patent disclosure page at
<loc href="http://www.w3.org/2002/08/xmlquery-IPR-statements">http://www.w3.org/2002/08/xmlquery-IPR-statements</loc>
and the XSL Working Group's patent disclosure page at
<loc href="http://www.w3.org/Style/XSL/Disclosures.html">http://www.w3.org/Style/XSL/Disclosures.html</loc>.
</p>
</status>

<abstract>
<p>This document defines the W3C XQuery 1.0 and XPath 2.0 Data Model,
which is the data model of at least <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 precisely 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>
</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>Every value in the data model is a
<termref def="dt-sequence">sequence</termref> of zero or more
<termref def="dt-item">items</termref>.</p>

<p>Every node is one of the seven kinds defined in <specref
ref="Node"/>. Connected 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>namespaces</function>
accessors. Every node belongs to exactly one tree, and every tree has
exactly one root node.
<termdef id="dt-document" term="document">A
tree whose root node is a document node is referred to as a
<term>document</term>.</termdef> <termdef id="dt-fragment"
term="fragment">A tree whose root node is some other kind of node is
referred to as a <term>fragment</term>.</termdef></p>

<p>An atomic value encapsulates an XML Schema atomic type
and a corresponding value of that type. They are defined in
<specref ref="AtomicValue"/>.
A sequence is an ordered collection of nodes, atomic values, or any
mixture of nodes and atomic values.  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>

  <note>
    <p>In XPath 1.0, the data model only
    defines nodes.  The primitive data types (number, boolean, string,
    node-set) are part of the expression language, not
    the data model.</p>
  </note>

  <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 document node or a sequence of document nodes), 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>In this document, we provide 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.  We note wherever the XQuery 1.0 and
  XPath 2.0 Data Model differs from that of XPath 1.0.</p>

</div1>

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

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

<div2>
<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><termdef id="dt-implementation-defined"
term="implementation-defined">In this specification, the term
<term>implementation-defined</term> refers to a feature where the
implementation is allowed some flexibility, and where the choices made
by the implementation <rfc2119>should</rfc2119> be described in the vendor's
documentation.</termdef></p>

<p><termdef id="dt-implementation-dependent"
term="implementation-dependent">The term
<term>implementation-dependent</term> refers to a feature where the
behavior <rfc2119>may</rfc2119> vary from one implementation to
another, and where the vendor is not expected to provide a full
specification of the behavior.</termdef> (This might apply, for
example, to limits on the size of data models that can be
constructed.)</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>

<p>Paragraphs labeled as <term>Note</term>s or described as
<term>examples</term> are non-normative.</p>

</div2>

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

<p>In addition to prose, we define a set of accessor functions to
explain the data model. The accessors defined by the data model are
shown with the prefix <emph>dm:</emph>. The 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 and cannot be made accessible
directly from the host language.</p>

<p>The signature of accessors is shown using the same
style as <bibref ref="xpath-functions"/>. For example:</p>

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

<p>Some accessors can accept or return sequences.
The following notation is used to denote sequence values:</p>

<ulist>
<item><p><emph>V*</emph> denotes a sequence of zero or more items of type
<emph>V</emph>.
</p></item>
<item><p><emph>V?</emph> denotes a sequence of exactly zero or one items of type
<emph>V</emph>.
</p></item>
<item><p><emph>V+</emph> denotes a sequence of one or more items of type
<emph>V</emph>.
</p></item>
</ulist>

<p>In a sequence, <emph>V</emph> may be a <termref
def="dt-node">node</termref> or an <termref
def="dt-atomic-value">atomic value</termref>.</p>

<p>There are some functions in the data model that are <emph>partial
functions</emph>. We use the occurrence indicators <emph>?</emph> or
<emph>*</emph> when specifying the return type of such functions.
For example, a node may have one parent node or no parent.
If the node argument has a parent, the
<function>parent</function> accessor returns a singleton sequence.  If the node
argument does not have a parent, it returns the empty sequence.
The signature of <function>parent</function> specifies that it returns
an empty sequence or a sequence containing one node:</p>

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

<p>This document relies on the <bibref ref="xml-infoset"/>. Information items
and properties are indicated by the styles <emph role="info-item">information
item</emph> and <emph role="infoset-property">property</emph>, respectively.</p>

  <p>This document frequently uses the term <emph>expanded-QName</emph>.
  <termdef id="dt-expanded-qname" term="expanded-QName">An <term>expanded-QName</term>
  is a pair of values consisting of a namespace URI and
  a local name. They belong to the value space of the XML Schema type
  <code>xs:QName</code>. When this document refers to <code>xs:QName</code> we always
  mean the value space, i.e. a namespace URI, local name pair (and not
  the lexical space referring to constructs of the form prefix:local-name).</termdef>
  </p>

<div3>
<head>Prefix Bindings</head>

<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>xdt:</code> bound to
<code>http://www.w3.org/&date.year;/&date.MM;/xpath-datatypes</code>
</p></item>
<item><p><code>fn:</code> bound to
<code>http://www.w3.org/2003/05/xpath-functions</code>
</p></item>
</olist>

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

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

<p>Because XML documents are tree-structured, we define the data model
using conventional terminology for trees. The data model is a
node-labeled, directed graph, in which each node has a unique
identity. Every <termref def="dt-node">node</termref> in the data
model is unique: identical to itself, and not identical to any other
node.
</p>

<p>This concept 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>
</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 used
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
returned by an in-order, depth-first traversal of the data model.</termdef>
Document order is stable, 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.</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>The relative order of siblings is determined by their order in 
the XML representation of the tree. A node N1 occurs before a node N2 in 
document order if and only if the start of N1 occurs before the start of 
N2 in the XML representation.</p></item>

<item><p>Namespace nodes immediately follow the element node with which 
they are associated. The relative order of namespace nodes is stable but 
implementation-dependent.</p></item>

<item><p>Attribute nodes immediately follow the namespace nodes of the 
element with which they are associated. The relative order of attribute 
nodes is stable but implementation-dependent.</p></item>

<item><p>Element nodes occur before their children; children 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 tree T1 is before any node in tree T2, then all nodes in tree T1 are 
before all nodes in tree T2.</p>

</div2>

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

<p>The data model uses
<termref def="dt-expanded-qname">expanded-QNames</termref> to
represent the names of named types, which includes both the built-in
types defined by <bibref ref="xmlschema-2"/> and named user-defined
types declared in a schema and imported by a stylesheet or query.
Since named types in XML Schema are global, an expanded-QName
uniquely identifies such a type. The namespace name of the
expanded-QName is the <emph role="infoset-property">target namespace</emph>
property of the type definition, and its local name is the
<emph role="infoset-property">name</emph> property of the type
definition.</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 defined,
unique type name provided by the processor for every anonymous
type declared in an imported schema.</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, we assume that
the anonymous type names are <code>xs:QNames</code>, but in practice
implementations are not required to use <code>xs:QNames</code> to
represent the implementation-defined names of anonymous types.</p>

<p>The data model associates type information with element nodes,
attribute nodes and atomic values. The item is guaranteed to be a
valid instance of that type.
</p>

<p>When no type information exists for an element or an attribute node
we frequently use the terminology <quote>element with unknown type</quote>
or <quote>attribute with unknown simple type</quote>.
</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 element node has a given type is defined in
<bibref ref="xquery-semantics"/>.
</p>

</div2>
</div1>

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

<p>In this section, we describe the constraints on data model
construction.</p>

<p>The data model supports well-formed XML documents conforming to
<bibref ref="REC-xml-names"/>. Documents that are not well-formed are,
by definition, not XML. XML documents that do not conform to <bibref
ref="REC-xml-names"/> 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="REC-xml-names"/>,</p>
  </item>
  <item>
    <p>DTD-valid documents conforming to <bibref ref="REC-xml-names"/>, 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 <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.</p>

<p>The data model supports some kinds of values that are not supported
by <bibref ref="xml-infoset"/>. Examples of these are well-formed
document fragments and sequences of documents nodes.
The data model also supports values that are not nodes. Examples of
these are <termref def="dt-atomic-value">atomic values</termref>,
sequences of atomic values, 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 a data model in
terms of infoset properties, an infoset is not an absolutely 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 data model 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 <bibref ref="xml-infoset"/>.
A data model can only be constructed from infosets that satisfy 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>Constructing and instance of the data model from an information set
<rfc2119>must</rfc2119> be consistent with the description provided
for each node type.</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 that has been
strictly, laxly, or skip validated or validated using any combination
assessment modes. 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 type.</p>

<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 type assignment. Other differences
can also arise from schema processing: default attribute and element values
may be provided, whitespace normalization of element content may occur, and the
user-supplied lexical form of elements and attributes with atomic types
may be lost.</p>

<div3 id="PSVI2Types">
<head>Mapping PSVI Additions to Types</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.
The only information that can be inferred from an
invalid or not known validity value is that the information
item is well-formed, therefore, we must associate very general
type information with the element or attribute node if it is not known
to be valid.
</p>

<p>The precise definition of the type of an element or attribute
information item depends on the properties of the Infoset or PSVI.
In a PSVI,
XML Schema only guarantees the existence of either the
<emph role="infoset-property">type definition</emph> property,
or 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.
If the type definition refers to a union type, there
are further properties defined, that refer to the type definition
which actually validated the item's normalized value.
These properties are either the
<emph role="infoset-property">member type definition</emph>,
or the
<emph role="infoset-property">member type definition namespace</emph>,
<emph role="infoset-property">member type definition name</emph> and
<emph role="infoset-property">member type definition anonymous</emph>
properties.
If these are available, the type of an element or attribute will
refer to the member type that actually validated the schema
normalized value.
</p>

<p>If the <emph role="infoset-property">validity</emph> property exists
and is <quote><emph>valid</emph></quote>,
the 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 <emph role="infoset-property">member type definition</emph>
exists and its {name} property is present:</p>
  <ulist>
    <item><p>The {target namespace} and {name} properties of the
<emph role="infoset-property">member type definition</emph> property.</p></item>
   </ulist>
</item>

<item><p>If the <emph role="infoset-property">type definition</emph> property
exists and its {name} property is present:</p>
  <ulist>
    <item><p>The {target namespace} and {name} properties of the
<emph role="infoset-property">type definition</emph> property.</p></item>
   </ulist>
</item>

<item><p>If <emph role="infoset-property">member type definition anonymous</emph>
exists:</p>
  <ulist>
    <item><p>If it is <emph>false</emph>:
the <emph role="infoset-property">member type definition namespace</emph>
and the <emph role="infoset-property">member type definition name</emph>.
</p></item>
    <item><p>Otherwise, the namespace and local name of the appropriate
<termref def="dt-anonymous-type-name">anonymous type name</termref>.</p>
    </item>
  </ulist>
</item>

<item><p>If <emph role="infoset-property">type definition anonymous</emph>
exists:</p>
  <ulist>
    <item><p>If it is <emph>false</emph>:
the <emph role="infoset-property">type definition namespace</emph>
and the <emph role="infoset-property">type definition name</emph>
</p></item>
    <item><p>Otherwise, the namespace and local name of the appropriate
<termref def="dt-anonymous-type-name">anonymous type name</termref>.</p>
    </item>
  </ulist>
</item>
</ulist>

<p>If the <emph role="infoset-property">validity</emph> property does
not exist or is not <quote><emph>valid</emph></quote>,
the type of an element is <code>xdt:untypedAny</code> and the type
of an attribute is <code>xdt:untypedAtomic</code>.</p>

</div3>

<div3 id="nillable">
<head>Mapping <att>xsi:nil</att> on Element Nodes</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.
</p>

<p>If the <emph role="infoset-property">validity</emph> property exists on
an element node and is <quote><emph>valid</emph></quote> then if
the <emph role="infoset-property">nil</emph> property exists and is true,
then &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="storing-timezones">
<head>Storing <code>xs:dateTime</code>, <code>xs:date</code>, and <code>xs:time</code> Values in the Data Model</head>

<p><bibref ref="xmlschema-2"/> permits <code>xs:dateTime</code>,
<code>xs:date</code>, and <code>xs:time</code>
values both with and without timezones and therefore only specifies
a partial ordering between date and time values. In the data model,
it is necessary to preserve timezone information.</p>

<p>In order to achieve this goal, <code>xs:dateTime</code>,
<code>xs:date</code>, and <code>xs:time</code> values must be stored
with care. If the lexical representation of the value includes a timezone,
it is converted to UTC
as defined by <bibref ref="xmlschema-2"/> and the timezone in the
lexical representation is converted to a
<code>xdt:dayTimeDuration</code> value. Implementations <rfc2119>must</rfc2119> keep
track of both these values for each <code>xs:dateTime</code>,
<code>xs:date</code>, and <code>xs:time</code> stored.</p>

<p>Lexical representations that do not have a timezone are assumed to be
in UTC for the purposes of normalization only. An empty sequence is used for their
timezone.</p>

<p>Thus, for the purpose of validation,
<quote>2003-01-02T11:30:00-05:00</quote> is converted to
<quote>2003-01-02T16:30:00Z</quote>, but in the data model it <rfc2119>must</rfc2119> be
stored as as <quote>(2003-01-02T16:30:00Z, -PT5H0M)</quote>. The value
<quote>2003-01-16T16:30:00</quote> is stored as
<quote>(2003-01-02T16:30:00Z, ())</quote> because it has no timezone.
</p>
</div3>

<div3 id="retreiving-timezones">
<head>Retreiving the Typed Value of <code>xs:dateTime</code>, <code>xs:date</code>, and <code>xs:time</code> Values</head>

<p>For <code>xs:dateTime</code>, <code>xs:date</code> and
<code>xs:time</code>, the typed value is the atomic value
that is determined from its stored form as follows:</p>

<ulist>
<item><p>If the timezone component is not the empty sequence, then the value
contains the time component, normalized to the timezone specified by
the timezone component, as well as the timezone component. The stored values
"(2003-01-02T16:30:00Z, -PT5H0M)" produce the value
"2003-01-02T11:30:00-05:00".</p></item>
<item><p>If the timezone component is the empty sequence, then the time
component without any indication of timezone. The stored values
"(2003-01-02T16:30:00Z, ())"  produce the value "2003-01-02T16:30:00".</p>
</item>
</ulist>
</div3>
</div2>
</div1>

<div1 id="data-model-serialization">
<head>Data Model Serialization</head>

<p>Constructing an Infoset from an instance of the data model, for example in
order to perform schema validity assessment, is accomplished by
serializing the document and parsing it. Implementations are not required to
implement this process literally, but they <rfc2119>must</rfc2119> obtain the same result as
if they had.</p>

<p>Serialization of the data model is governed by
<bibref ref="xslt-xquery-serialization"/>.</p>

</div1>

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

<p>A set of accessors is defined on all seven kinds of nodes, see
<specref ref="Node"/>.
Some
accessors return a constant empty sequence on certain node kinds. Some node
kinds have additional accessors that are not summarized here.</p>

<p>In order for applications to be able to operate on instances of the
data model, the model must expose 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 interface 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>

<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 types.</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 “document”, “element”, “attribute”,
“processing-instruction”, “comment”, or “text”.</p>

<p>It is defined on
<loc href="#acc-summ-node-kind">all seven</loc> node types.</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.</p>

<p>It is defined on
<loc href="#acc-summ-node-name">all seven</loc> node types.</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 types.</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 types.</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="xdt: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 types.</p>

</div2>

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

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

<p>The <function>type</function> accessor returns the name of the 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">all seven</loc> node types.</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 types.</p>

</div2>

<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 attribute nodes.</p>

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

</div2>

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

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

<p>The <function>namespaces</function> accessor returns the namespaces
associated with a node as a sequence containing
zero or more namespace nodes.</p>

<p>It is defined on
<loc href="#acc-summ-namespaces">all seven</loc> node types.</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>, see <specref ref="nillable"/>.</p>

<p>It is defined on
<loc href="#acc-summ-nilled">all seven</loc> node types, but always
returns the empty sequence for all nodes except elements.</p>
</div2>
</div1>

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

<p><termdef id="dt-node" term="Node">The category of <term>Node</term>
values contains seven distinct kinds of nodes: <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> The seven kinds of nodes are
defined in the following subsections.</p>

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


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

<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> labeled with that
atomic type.</termdef> 
<termdef id="dt-atomic-type" term="atomic type">An <term>atomic type</term>
is a primitive simple type or a type derived by restriction from
another atomic
simple type. Types derived by list or union are not atomic.</termdef></p>

<p>There are 21 primitive atomic types, the 19 defined in <xspecref spec="XS2"
ref="built-in-primitive-datatypes"/> of <bibref ref="xmlschema-2"/> and
<emph>xdt:untypedAtomic</emph> and
<emph>xdt:anyAtomicType</emph>. The “<code>xdt:</code>” types, including
the atomic types <emph>xdt:dayTimeDuration</emph> and
<emph>xdt:yearMonthDuration</emph>, derived by restriction from
<code>xs:duration</code>, are described below.</p>

<p>The value space of the atomic values is the union of the value
spaces of the atomic types. This value space
clearly includes those atomic values whose type is primitive, but it
also includes those whose type is derived by restriction, as derivation by
restriction always limits the value space.</p>

<p>Implementors may extend the set of types available. The value space of
those types, as well as the behavior of those types when used in expressions,
is implementation defined.</p>

<p>An XML Schema simple type definition
has a <emph role="infoset-property">variety</emph> which may be
atomic, union, or list.</p>

<ulist>
<item><p>The value of a node whose type is an atomic type is
represented as an atomic value of that type.</p>
</item>

<item><p>The value of a node whose type is a union type is represented
by the appropriate value for the appropriate member type of the union
type. If the member type is an atomic type, the value is represented
as an atomic value of that type. If the member type is a list type,
the value is represented as a sequence of atomic values whose type is
the item type of the list type. The union type information is lost and
only the specific type of the actual item is retained.
</p></item>
<item><p>The value of a node whose type is a list type whose item type is an
atomic type is represented by a sequence of atomic values whose type
is the item type.
</p></item>
<item><p>The value of a node whose type is a list type whose item type is a
union type is represented by a sequence of atomic values, each of
whose type is one of the member types of the union type.
The union type information is lost
and only the specific types of each individual item is retained.
</p></item>
</ulist>

<p>An atomic value can be constructed from the value's lexical
representation. Given a string and an atomic type, the atomic value is
constructed in such a way as to be consistent with validation. 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>

<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
may not always be compatible with XPath 1.0. These and other backwards
incompatibilities are described in
<xspecref spec="XP" ref="id-backwards-compatibility"/>.</p>

<div2 id="new-datatypes">
<head>New Datatypes</head>

<div3 id="dt-untypedAny">
<head>xdt:untypedAny</head>

<p>The abstract complex type <code>xdt:untypedAny</code> is a subtype of
<code>xs:anyType</code>
and serves as a special type annotation to indicate elements that
have not been validated by a XML Schema or a DTD or that have
received a type annotation of <code>xs:anyType</code> in the PSVI.</p>

<p>This datatype cannot be used in <bibref ref="xmlschema-1"/> element
declarations, nor can it be used as a base for user-defined complex
types. It can be used in the
<bibref ref="xpath20"/> <xnt spec="XP" ref="SequenceType"/>
production (for example in a function signature) to specify the required
type of an element. This datatype resides in the namespace
<code>http://www.w3.org/2003/11/xpath-datatypes</code>.</p>
</div3>

<div3 id="dt-untypedAtomic">
<head>xdt:untypedAtomic</head> 

<p>The abstract atomic type <code>xdt:untypedAtomic</code> is a subtype of
<code>xdt:anyAtomicType</code> and serves as a special type annotation to
indicate elements or attributes that have not been validated by a
XML Schema or DTD, or that have received a type annotation of
<code>xs:anySimpleType</code> in the PSVI. It is also used as the type of the
typed value of such nodes, and of text nodes.</p>

<p>This datatype cannot be used in <bibref ref="xmlschema-1"/>
element or attribute
declarations, nor can it be used as a base for user-defined atomic
types, an item type for user-defined list types, or a member type of
user-defined union types. It can be used in the
<bibref ref="xpath20"/> <xnt spec="XP" ref="SequenceType"/>
production to define a required type (for example in a function
signature), to indicate that only an untyped atomic value is
acceptable. This datatype resides in the namespace
<code>http://www.w3.org/2003/11/xpath-datatypes</code>.</p>
</div3>

<div3 id="dt-anyAtomicType">
<head>xdt:anyAtomicType</head>

<p>The abstract simple type <code>xdt:anyAtomicType</code> is a subtype of
<code>xs:anySimpleType</code> and is the base type for all the primitive atomic
types described in <bibref ref="xmlschema-2"/>, and for
<code>xdt:untypedAtomic</code>.</p>

<p>This datatype cannot be used in <bibref ref="xmlschema-1"/> element
or attribute declarations, nor can it be used as a base for
user-defined atomic types, an item type for user-defined list types,
or a member type of user-defined union types. It can be used in the
<bibref ref="xpath20"/> <xnt spec="XP" ref="SequenceType"/>
production to define a required type (for example
in a function signature), to indicate that any atomic value is
acceptable. This datatype resides in the namespace
<code>http://www.w3.org/2003/11/xpath-datatypes</code>.</p>

</div3>

<div3 id="dt-dayTimeDuration">
<head>xdt:dayTimeDuration</head>

<p>The datatype <term>xdt:dayTimeDuration</term> is a subtype of
<term>xs:duration</term> whose lexical representation contains only
day, hour, minute, and second components.</p>
<p>This datatype resides in the namespace
<code>http://www.w3.org/&date.year;/&date.MM;/xpath-datatypes</code>.</p>
</div3>

<div3 id="dt-yearMonthDuration">
<head>xdt:yearMonthDuration</head>

<p>The datatype <term>xdt:yearMonthDuration</term> is a subtype of
<term>xs:duration</term> whose lexical representation contains only
year and month components.</p>
<p>This datatype resides in the namespace
<code>http://www.w3.org/&date.year;/&date.MM;/xpath-datatypes</code>.</p>
</div3>

</div2>
</div1>

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

<p><termdef id="dt-sequence" term="sequence">A <term>sequence</term>
is an ordered collection of zero or more
items.</termdef>
<termdef id="dt-item" term="item">An <term>item</term>
may be a node or an atomic value</termdef>, i.e.
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>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>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>

<p>A collection of documents is represented in the data model as a
sequence of document nodes.</p>

<p>Equality comparison of sequences is performed by comparing the
items of the sequences. Whereas you can compare the identity of two nodes,
you cannot compare the identity of two sequences; you can only determine
whether or not they contain the same members.</p>

</div1>


</body>

<back>
<div1>
  <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:</p>

  <ulist>
    <item><p>The <emph role="info-item">Document Information Item</emph> with
             <emph role="infoset-property">base URI</emph> and
             <emph role="infoset-property">children</emph> properties.</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">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">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> and
             <emph role="infoset-property">parent</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 properties from the PSV Infoset are required:</p>


  <ulist>
    <item><p><emph role="infoset-property">validity</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">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> properties on
    <emph role="info-item">Element Information Items</emph>.</p></item>

    <item><p><emph role="infoset-property">validity</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">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> properties on
    <emph role="info-item">Attribute Information Items</emph>.</p></item>
  </ulist>

</div1>

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

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

<blist>

<bibl id="xml-infoset"     key="Infoset"/>
<bibl id="REC-xml-names"   key="Namespaces in XML"/>
<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="RFC2119"         key="RFC 2119"/>
<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="xpath20"         key="XPath 2.0"/>
<bibl id="xslt20"          key="XSLT 2.0"/>

<bibl id="xquery-semantics" key="Formal Semantics"/>

<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"/>

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

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

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

  <p>We use the following XML document 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>&dm-example.xsd;</eg>

<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 document node;
the values <emph>E1, E2, etc.</emph> represent element nodes;
the values <emph>A1, A2, etc.</emph> represent attribute nodes;
the values <emph>N1, N2, etc.</emph> represent namespace nodes;
the values <emph>P1, P2, etc.</emph> represent processing-instruction nodes;
the values <emph>T1, T2, etc.</emph> represent text nodes.</p>

<p>For brevity:</p>

<ulist>
<item><p>Text nodes 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:</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>
</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, we can share namespace
nodes 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 in-order, left-to-right,
depth-first traversal; however, because the image has been rotated for
easier presentation, this appears to be in-order, 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>

<!-- removed reference to dm-issues-list.xml -->

</back>
</spec>
