Errata for XQuery 1.0 and XPath 2.0 Data Model (XDM)

31 March 2009

Latest version:
http://www.w3.org/XML/2007/qt-errata/xpath-datamodel-errata.html
Editor:
Anders Berglund, BC&TF http://www.albconsults.com

Abstract

This document addresses errors in the XQuery 1.0 and XPath 2.0 Data Model (XDM) Recommendation published on 23 January 2007. It records all errors that, at the time of this document's publication, have solutions that have been approved by the XSL Working Group and the XML Query Working Group. For updates see the latest version of that document.

The errata are numbered, and are listed in reverse chronological order of their date of origin. Each erratum is classified as Substantive, Editorial, or Markup. These categories are defined as follows:

Each entry contains the following information:

Colored boxes and shading are used to help distinguish new text from old, however these visual clues are not essential to an understanding of the change. The styling of old and new text is an approximation to its appearance in the published Recommendation, but is not normative. Hyperlinks are shown underlined in the erratum text, but the links are not live.

A number of indexes appear at the end of the document.

Substantive corrections are proposed by the XSL Working Group and the XML Query Working Group (part of the XML Activity), where there is consensus that they are appropriate; they are not to be considered normative until approved by a Call for Review of Proposed Corrections or a Call for Review of an Edited Recommendation.

Please report errors in this document using W3C's public Bugzilla system (instructions can be found at http://www.w3.org/XML/2005/04/qt-bugzilla). If access to that system is not feasible, you may send your comments to the W3C XSLT/XPath/XQuery public comments mailing list, public-qt-comments@w3.org. It will be very helpful if you include the string [DMerrata] in the subject line of your report, whether made in Bugzilla or in email. Each Bugzilla entry and email message should contain only one error report. Archives of the comments and responses are available at http://lists.w3.org/Archives/Public/public-qt-comments/.

Status of this Document

This is a public draft. None of the errata reported in this document have been approved by a Call for Review of Proposed Corrections or a Call for Review of an Edited Recommendation. As a consequence, they must not be considered to be normative.

The Working Group does not intend to progress these errata to normative status; instead, it intends to publish a second edition of the Recommendation incorporating these errata, and to progress the second edition to normative status.

Table of Contents

  Errata

     DM.E016   Terminology: "undefined"

     DM.E015   non-normative notes

     DM.E014   Base URI after validation

     DM.E013   reminders re empty Text Nodes

     DM.E012   xs:integer is not primitive

     DM.E011   Accessing undefined static context base URI and XPST0001

     DM.E010   dm:unparsed-entity-system-id absolute or relative URI?

     DM.E009   xs:dayTimeDuration and xs:yearMonthDuration listed as a primitive simple type.

     DM.E008   Obsolete xdt: rather than xs: prefixes used.

     DM.E007   Terminology: root node concept.

     DM.E006   xs:untyped listed as a primitive simple type.

     DM.E005   The rules for is-id property for an element node constructed from a PSVI appear arbitrarily different from the rule for attribute nodes.

     DM.E004   Nowhere does XDM state the constraint that if a namespace URI is present in the node-name of an attribute node then a prefix must also be present.

     DM.E003   The Data Model does not state any constraints on the use of the namespace 'http://www.w3.org/2000/xmlns/'.

     DM.E002   The data model spec doesn't adequately cover the determination of the typed value for an element whose schema type is a complex type with simple content.

     DM.E001   The schema in the examples appendix isn't valid.

  Indexes

    Index by affected section

    Index by Bugzilla entry


DM.E016 - editorial

See Bug 6287

Description

Terminology: "undefined"

History

27 Jan 2009: Proposed

23 Feb 2009: Accepted

Changes

  1. In 2.1 Terminology (sixteenth paragraph):

    Insert after the text:

    [Definition] Implementation-dependent 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.

    The following:

    [Definition] In certain situations a value is said to be undefined (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.

  2. In 5 Accessors (third paragraph):

    Replace the text:

    Some typed values in the data model are undefined. 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.

    With:

    Some typed values in the data model are undefined. 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.

DM.E015 - editorial

See Bug 6374

Description

non-normative notes

History

29 Jan 2009: Proposed

16 Feb 2009: Accepted

Change

In 2 Concepts (first paragraph):

Insert after the text:

This section outlines a number of general concepts that apply throughout this specification.

The following:

In this document, examples and material labeled as "Note" are provided for explanatory purposes and are not normative.

DM.E014 - editorial

See Bug 6255

Description

Base URI after validation

History

6 Jan 2009: Proposed

6 Jan 2009: Accepted

Change

In 4 Infoset Mapping (second paragraph):

Delete the text:

An Infoset can also be constructed by serializing an instance of the data model and parsing it. Serialization is governed by [Serialization] .

DM.E013 - editorial

See Bug 6139

Description

reminders re empty Text Nodes

History

6 Jan 2009: Proposed

6 Jan 2009: Accepted

Changes

  1. In 6.7.3 Construction from an Infoset (sixth paragraph):

    Delete the text:

    Text Nodes are only allowed to be empty if they have no parents; an empty Text Node will be discarded when its parent is constructed, if it has a parent.

  2. In 6.7.4 Construction from a PSVI (second paragraph):

    Insert after the text:

    Otherwise, construction from a PSVI is the same as construction from the Infoset except for the content property. When constructing the content property, [element content whitespace] is not used to test if whitespace is collapsed. Instead, if the resulting Text Node consists entirely of whitespace and the character information items used to construct this node have a parent and that parent is an element and its {content type} is not “mixed”, then the content of the Text Node is the zero-length string.

    The following:

    Text Nodes are only allowed to be empty if they have no parents; an empty Text Node will be discarded when its parent is constructed, if it has a parent.

DM.E012 - editorial

See Bug 5983

Description

xs:integer is not primitive

History

16 Sep 2008: Proposed

16 Sep 2008: Accepted

Change

In 2.6.2 (first def):

Replace the text:

The datatype xs:anyAtomicType is an atomic type that includes all atomic values (and no values that are not atomic). Its base type is xs:anySimpleType from which all simple types, including atomic, list, and union types are derived. All primitive atomic types, such as xs:integer and xs:string, have xs:anyAtomicType as their base type.

With:

The datatype xs:anyAtomicType is an atomic type that includes all atomic values (and no values that are not atomic). Its base type is xs:anySimpleType from which all simple types, including atomic, list, and union types are derived. All primitive atomic types, such as xs:decimal and xs:string, have xs:anyAtomicType as their base type.

DM.E011 - substantive

See Bug 5207

Description

Accessing undefined static context base URI and XPST0001

History

22 Feb 2008: Proposed

4 Mar 2008: Accepted

Changes

  1. In 6.1.3 Construction from an Infoset (first list of definitions, first definition, first def):

    Replace the text:

    The value of the [base URI] property. Note that the base URI property is always an absolute URI (if an absolute URI can be computed) though it may contain Unicode characters that are not allowed in URIs. These characters, if they occur, are present in the base-uri property and will have to be encoded and escaped by the application to obtain a URI suitable for retrieval, if retrieval is required.

    With:

    The value of the [base URI] property, if available. Note that the base URI property, if available, is always an absolute URI (if an absolute URI can be computed) though it may contain Unicode characters that are not allowed in URIs. These characters, if they occur, are present in the base-uri property and will have to be encoded and escaped by the application to obtain a URI suitable for retrieval, if retrieval is required.

    In practice a [base URI] is not always known. In this case the value of the base-uri property of the document node will be the empty sequence. This is not intrinsically an error, though it may cause some operations that depend on the base URI to fail.

  2. In 6.2.3 Construction from an Infoset (first list of definitions, first definition, first def):

    Replace the text:

    The value of the [base URI] property. Note that the base URI property is always an absolute URI (if an absolute URI can be computed) though it may contain Unicode characters that are not allowed in URIs. These characters, if they occur, are present in the base-uri property and will have to be encoded and escaped by the application to obtain a URI suitable for retrieval, if retrieval is required.

    With:

    The value of the [base URI] property, if available. Note that the base URI property, if available, is always an absolute URI (if an absolute URI can be computed) though it may contain Unicode characters that are not allowed in URIs. These characters, if they occur, are present in the base-uri property and will have to be encoded and escaped by the application to obtain a URI suitable for retrieval, if retrieval is required.

    In practice a [base URI] is not always known. In this case the value of the base-uri property of the document node will be the empty sequence. This is not intrinsically an error, though it may cause some operations that depend on the base URI to fail.

  3. In 6.5.3 Construction from an Infoset (first list of definitions, third definition, first def):

    Replace the text:

    The value of the [base URI] property. Note that the base URI property is always an absolute URI (if an absolute URI can be computed) though it may contain Unicode characters that are not allowed in URIs. These characters, if they occur, are present in the base-uri property and will have to be encoded and escaped by the application to obtain a URI suitable for retrieval, if retrieval is required.

    With:

    The value of the [base URI] property, if available. Note that the base URI property, if available, is always an absolute URI (if an absolute URI can be computed) though it may contain Unicode characters that are not allowed in URIs. These characters, if they occur, are present in the base-uri property and will have to be encoded and escaped by the application to obtain a URI suitable for retrieval, if retrieval is required.

    In practice a [base URI] is not always known. In this case the value of the base-uri property of the document node will be the empty sequence. This is not intrinsically an error, though it may cause some operations that depend on the base URI to fail.

DM.E010 - substantive

See Bug 4622

Description

dm:unparsed-entity-system-id absolute or relative URI?

History

28 Nov 2007: Proposed

11 Dec 2007: Accepted

Change

In 5.17 unparsed-entity-system-id Accessor (first paragraph):

Replace the text:

The dm:unparsed-entity-system-id accessor returns the system identifier of an unparsed external entity declared in the specified document. If no entity with the name specified in $entityname exists, or if the entity is not an external unparsed entity, the empty sequence is returned.

With:

The dm:unparsed-entity-system-id 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 [system identifier] of the unparsed entity information item against the [declaration base URI] of the same item. If no entity with the name specified in $entityname exists, or if the entity is not an external unparsed entity, the empty sequence is returned.

DM.E009 - editorial

See Bug 5267

Description

xs:dayTimeDuration and xs:yearMonthDuration listed as a primitive simple type.

History

13 Nov 2007: Proposed

13 Nov 2007: Accepted

Change

In 2.1 Terminology (twelfth paragraph):

Replace the text:

[Definition] There are 23 primitive simple types: the 19 defined in Section 3.2 Primitive datatypesXS2 of [Schema Part 2] and xs:untyped, xs:untypedAtomic, xs:anyAtomicType, xs:dayTimeDuration, and xs:yearMonthDuration, defined in 2.6 Types.

With:

[Definition] There are 21 primitive simple types: the 19 defined in Section 3.2 Primitive datatypesXS2 of [Schema Part 2] and xs:untypedAtomic and xs:anyAtomicType, defined in 2.6 Types.

Also: Make the corresponding change to the automatically-generated text in Appendix D Glossary, entry 'primitive simple type'.

DM.E008 - editorial

See Bug 5212

Description

Obsolete xdt: rather than xs: prefixes used.

History

19 Oct 2007: Proposed

13 Nov 2007: Accepted

Changes

  1. In E Example (Non-Normative) (first table, first table body, fifth row, third column):

    Replace the text:

    xdt:untypedAtomic("  Staind:  Been  Awhile  Tee  Black  (1-sided)  \n            Lyrics  from  the  hit  song  'It's  Been  Awhile'\n            are  shown  in  white,  beneath  the  large\n            'Flock  &  Weld'  Staind  logo.\n          25.00    It's  Been  A  While    10.99    Staind  ")

    With:

    xs:untypedAtomic("  Staind:  Been  Awhile  Tee  Black  (1-sided)  \n            Lyrics  from  the  hit  song  'It's  Been  Awhile'\n            are  shown  in  white,  beneath  the  large\n            'Flock  &  Weld'  Staind  logo.\n          25.00    It's  Been  A  While    10.99    Staind  ")
  2. In E Example (Non-Normative) (first table, first table body, one hundred and seventy-second row, third column):

    Replace the text:

    xdt:untypedAtomic("Staind:  Been  Awhile  Tee  Black  (1-sided)")

    With:

    xs:untypedAtomic("Staind:  Been  Awhile  Tee  Black  (1-sided)")
  3. In E Example (Non-Normative) (first table, first table body, one hundred and seventy-third row, third column):

    Replace the text:

    xdt:untypedAtomic

    With:

    xs:untypedAtomic
  4. In E Example (Non-Normative) (first table, first table body, one hundred and eighty-first row, third column):

    Replace the text:

    xdt:untypedAtomic("\n            Lyrics  from  the  hit  song  'It's  Been  Awhile'\n            are  shown  in  white,  beneath  the  large\n            'Flock  &  Weld'  Staind  logo.\n        ")

    With:

    xs:untypedAtomic("\n            Lyrics  from  the  hit  song  'It's  Been  Awhile'\n            are  shown  in  white,  beneath  the  large\n            'Flock  &  Weld'  Staind  logo.\n        ")
  5. In E Example (Non-Normative) (first table, first table body, one hundred and ninety-sixth row, third column):

    Replace the text:

    xdt:untypedAtomic("\n            Lyrics  from  the  hit  song  'It's  Been  Awhile'\n            are  shown  in  white,  beneath  the  large\n            'Flock  &  Weld'  Staind  logo.\n        ")

    With:

    xs:untypedAtomic("\n            Lyrics  from  the  hit  song  'It's  Been  Awhile'\n            are  shown  in  white,  beneath  the  large\n            'Flock  &  Weld'  Staind  logo.\n        ")
  6. In E Example (Non-Normative) (first table, first table body, two hundred and tenth row, third column):

    Replace the text:

    xdt:untypedAtomic("\n            Lyrics  from  the  hit  song  'It's  Been  Awhile'\n            are  shown  in  white,  beneath  the  large\n            'Flock  &  Weld'  Staind  logo.\n        ")

    With:

    xs:untypedAtomic("\n            Lyrics  from  the  hit  song  'It's  Been  Awhile'\n            are  shown  in  white,  beneath  the  large\n            'Flock  &  Weld'  Staind  logo.\n        ")
  7. In E Example (Non-Normative) (first table, first table body, two hundred and eleventh row, third column):

    Replace the text:

    xdt:untypedAtomic

    With:

    xs:untypedAtomic
  8. In E Example (Non-Normative) (first table, first table body, two hundred and thirty-fourth row, third column):

    Replace the text:

    xdt:untypedAtomic("25.00")

    With:

    xs:untypedAtomic("25.00")
  9. In E Example (Non-Normative) (first table, first table body, two hundred and thirty-fifth row, third column):

    Replace the text:

    xdt:untypedAtomic

    With:

    xs:untypedAtomic
  10. In E Example (Non-Normative) (first table, first table body, three hundred and second row, third column):

    Replace the text:

    xdt:untypedAtomic("It's  Been  A  While")

    With:

    xs:untypedAtomic("It's  Been  A  While")
  11. In E Example (Non-Normative) (first table, first table body, three hundred and third row, third column):

    Replace the text:

    xdt:untypedAtomic

    With:

    xs:untypedAtomic
  12. In E Example (Non-Normative) (first table, first table body, three hundred and sixty-first row, third column):

    Replace the text:

    xdt:untypedAtomic("10.99")

    With:

    xs:untypedAtomic("10.99")
  13. In E Example (Non-Normative) (first table, first table body, three hundred and sixty-second row, third column):

    Replace the text:

    xdt:untypedAtomic

    With:

    xs:untypedAtomic
  14. In E Example (Non-Normative) (first table, first table body, three hundred and eighty-fourth row, third column):

    Replace the text:

    xdt:untypedAtomic("  Staind  ")

    With:

    xs:untypedAtomic("  Staind  ")
  15. In E Example (Non-Normative) (first table, first table body, three hundred and eighty-fifth row, third column):

    Replace the text:

    xdt:untypedAtomic

    With:

    xs:untypedAtomic

DM.E007 - editorial

See Bug 5002

Description

Terminology: root node concept.

History

25 Sep 2007: Proposed

25 Sep 2007: Accepted

Change

In 2.1 Terminology (sixth paragraph):

Insert after the text:

[Definition] An item is either a node or an atomic value,

The following:

[Definition] The topmost node of a tree is called the root node.

Note:

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.

DM.E006 - editorial

Superseded by Erratum DM.E009

See Bug 4984

Description

xs:untyped listed as a primitive simple type.

History

26 Jul 2007: Proposed

25 Sep 2007: Accepted

Change

In 2.1 Terminology (twelfth paragraph):

Replace the text:

[Definition] There are 23 primitive simple types: the 19 defined in Section 3.2 Primitive datatypesXS2 of [Schema Part 2] and xs:untyped, xs:untypedAtomic, xs:anyAtomicType, xs:dayTimeDuration, and xs:yearMonthDuration, defined in 2.6 Types.

With:

[Definition] There are 23 primitive simple types: the 19 defined in Section 3.2 Primitive datatypesXS2 of [Schema Part 2] and xs:untypedAtomic, xs:anyAtomicType, xs:dayTimeDuration, and xs:yearMonthDuration, defined in 2.6 Types.

Also: Make the corresponding change to the automatically-generated text in Appendix D Glossary, entry 'primitive simple type'.

DM.E005 - substantive

See Bug 4519

Description

The rules for is-id property for an element node constructed from a PSVI appear arbitrarily different from the rule for attribute nodes.

History

31 Jul 2007: Proposed

18 Sep 2007: Accepted

Changes

  1. In 6.2.4 Construction from a PSVI (first list of definitions, eighth definition):

    Replace the text:

    is-id

    If the element has a complex type with element-only content, the is-id property is false. Otherwise, if the typed-value of the element consists of exactly one atomic value that value is of type xs:ID, or a type derived from xs:ID, the is-id property is true, otherwise it is false.

    With:

    is-id

    If the element has a complex type with element-only content, the is-id property is false. Otherwise, if the typed-value of the element consists of exactly one atomic value and that value is of type xs:ID, or a type derived from xs:ID, the is-id property is true, otherwise it is false.

    Note:

    This means that in the case of a type constructed by list from xs:ID, the ID is recognized provided that the list is of length one. A type constructed as a union involving xs:ID is recognized provided the actual value is of type xs:ID.

    Note:

    The element that is marked with the is-id property, and which will therefore be retrieved by the fn:id function, is the node whose typed value contains the xs:ID value. This node is a child of the element node that, according to XML Schema, is uniquely identified by this ID.

    Also: Make the corresponding change to the automatically-generated text in Appendix J.2 Element Nodes Information Items, entry 'is-id'.

  2. In 6.3.4 Construction from a PSVI (first list of definitions, fourth definition):

    Replace the text:

    is-id

    If the attribute is named xml:id and its [attribute type] property does not have the value xs:ID, then [xml:id] processing is performed. This will assure that the value does have the type xs:ID and that it is properly normalized. If an error is encountered during xml:id processing, an implementation may raise a dynamic error. The is-id property is always true for attributes named xml:id.

    If the type-name is xs:ID or a type derived from xs:ID, true, otherwise false.

    With:

    is-id

    If the attribute is named xml:id and its [attribute type] property does not have the value xs:ID or a type derived from xs:ID, then [xml:id] processing is performed. This will assure that the value does have the type xs:ID and that it is properly normalized. If an error is encountered during xml:id processing, an implementation may raise a dynamic error. The is-id property is always true for attributes named xml:id.

    Otherwise, if the typed-value of the attribute consists of exactly one atomic value and that value is of type xs:ID, or a type derived from xs:ID, the is-id property is true, otherwise it is false.

    Note:

    This means that in the case of a type constructed by list from xs:ID, the ID is recognized provided that the list is of length one. A type constructed as a union involving xs:ID is recognized provided the actual value is of type xs:ID.

    Also: Make the corresponding change to the automatically-generated text in Appendix J.3 Attribute Nodes Information Items, entry 'is-id'.

  3. In 6.3.4 Construction from a PSVI (first list of definitions, fifth definition, first def):

    Insert after the text:

    If any of the atomic values in the typed-value of the attribute is of type xs:IDREF or xs:IDREFS, or a type derived from one of those types, the is-idrefs property is true, otherwise it is false.

    The following:

    Note:

    This rule means that a type constructed by list with an item type of xs:IDREF (or a type derived from xs:IDREF) has the is-idrefs property, whether or not the list type is named xs:IDREFS or is derived from xs:IDREFS. Because union types are allowed, it also means that an element or attribute with the is-idrefs property can contain atomic values of type xs:IDREF alongside values of other types.

    Also: Make the corresponding change to the automatically-generated text in Appendix J.3 Attribute Nodes Information Items, entry 'is-idrefs'.

DM.E004 - substantive

See Bug 4487

Description

Nowhere does XDM state the constraint that if a namespace URI is present in the node-name of an attribute node then a prefix must also be present. This is necessary to ensure that an XDM document can be serialized as namespace-well-formed XML.

History

23 Apr 2007: Proposed

8 May 2007: Accepted

Change

In 6.3.1 Overview (first numbered list, second item):

Insert after the text:

2

If a Attribute Node A has a parent element E, then A must be among the attributes of E.

The data model permits Attribute Nodes without parents (to represent partial results during expression processing, for example). Such attributes must not appear among the attributes of any Element Node.

The following:

3

In the node-name of an attribute node, if a namespace URI is present then a prefix must also be present.

DM.E003 - substantive

See Bug 4486

Description

The Data Model does not state any constraints on the use of the namespace 'http://www.w3.org/2000/xmlns/'. Such constraints are needed to ensure that an XDM document can be serialized as a namespace-well-formed XML document.

History

23 Apr 2007: Proposed

8 May 2007: Accepted

Change

In 6.4.1 Overview (first numbered list, second item):

Insert after the text:

2

If a Namespace Node N has a parent element E, then N must be among the namespaces of E.

The following:

3

A Namespace Node must not have the name xmlns nor the string-value http://www.w3.org/2000/xmlns/.

DM.E002 - substantive

See Bug 4413

Description

The data model spec doesn't adequately cover the determination of the typed value for an element whose schema type is a complex type with simple content.

History

8 May 2007: Proposed

8 May 2007: Accepted

Change

In 3.3.1.2 Typed Value Determination (third paragraph):

Replace the text:

The types of the items in the typed value of a node are determined as follows. The process begins with T, the schema type of the node itself, as represented in the PSVI. For each primitive or ordinary simple type T, the W3C XML Schema specification defines a function M mapping the lexical representation of a value onto the value itself.

With:

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

DM.E001 - editorial

See Bug 4352

Description

The schema in the examples appendix isn't valid.

History

27 Feb 2007: Proposed

27 Mar 2007: Accepted

Change

In E Example (Non-Normative) (second code section):

Replace the text:

<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:cat="http://www.example.com/catalog"
           xmlns:xlink="http://www.w3.org/1999/xlink"
           targetNamespace="http://www.example.com/catalog"
           elementFormDefault="qualified">

<xs:import namespace="http://www.w3.org/XML/1998/namespace"
           schemaLocation="http://www.w3.org/2001/xml.xsd" />

<xs:import namespace="http://www.w3.org/1999/xlink"
           schemaLocation="http://www.cs.rpi.edu/~puninj/XGMML/xlinks-2001.xsd" />

<xs:element name="catalog">
  <xs:complexType>
    <xs:sequence>
      <xs:element ref="cat:_item" maxOccurs="unbounded" />
    </xs:sequence>
    <xs:attribute name="version" type="xs:string" fixed="0.1" use="required" />
    <xs:attribute ref="xml:base" />
    <xs:attribute ref="xml:lang" />
  </xs:complexType>
</xs:element>

<xs:element name="_item" type="cat:itemType" abstract="true" />

<xs:complexType name="itemType">
  <xs:sequence>
    <xs:element name="title" type="xs:token" />
    <xs:element name="description" type="cat:description" nillable="true" />
    <xs:element name="price" type="cat:price" maxOccurs="unbounded" />
  </xs:sequence>
  <xs:attribute name="label" type="xs:token" />
  <xs:attribute name="code" type="xs:ID" use="required" />
  <xs:attributeGroup ref="xlink:simpleLink" />
</xs:complexType>

<xs:element name="tshirt" type="cat:tshirtType" substitutionGroup="cat:_item" />

<xs:complexType name="tshirtType">
  <xs:complexContent>
    <xs:extension base="cat:itemType">
      <xs:attribute name="sizes" type="cat:clothesSizes" use="required" />
      <xs:attribute ref="xml:lang" use="optional"/>
    </xs:extension>
  </xs:complexContent>
</xs:complexType>

<xs:simpleType name="clothesSizes">
  <xs:union memberTypes="cat:sizeList">
    <xs:simpleType>
      <xs:restriction base="xs:token">
        <xs:enumeration value="oneSize" />
      </xs:restriction>
    </xs:simpleType>
  </xs:union>
</xs:simpleType>

<xs:simpleType name="sizeList">
  <xs:restriction>
    <xs:simpleType>
      <xs:list itemType="cat:clothesSize" />
    </xs:simpleType>
    <xs:minLength value="1" />
  </xs:restriction>
</xs:simpleType>

<xs:simpleType name="clothesSize">
  <xs:union memberTypes="cat:numberedSize cat:categorySize" />
</xs:simpleType>

<xs:simpleType name="numberedSize">
  <xs:restriction base="xs:integer">
    <xs:enumeration value="4" />
    <xs:enumeration value="6" />
    <xs:enumeration value="8" />
    <xs:enumeration value="10" />
    <xs:enumeration value="12" />
    <xs:enumeration value="14" />
    <xs:enumeration value="16" />
    <xs:enumeration value="18" />
    <xs:enumeration value="20" />
    <xs:enumeration value="22" />
  </xs:restriction>
</xs:simpleType>

<xs:simpleType name="categorySize">
  <xs:restriction base="xs:token">
    <xs:enumeration value="XS" />
    <xs:enumeration value="S" />
    <xs:enumeration value="M" />
    <xs:enumeration value="L" />
    <xs:enumeration value="XL" />
    <xs:enumeration value="XXL" />
  </xs:restriction>
</xs:simpleType>

<xs:element name="album" type="cat:albumType" substitutionGroup="cat:_item" />

<xs:complexType name="albumType">
  <xs:complexContent>
    <xs:extension base="cat:itemType">
      <xs:sequence>
        <xs:element name="artist" type="xs:string" />
      </xs:sequence>
      <xs:attribute name="formats" type="cat:formatsType" use="required" />
      <xs:attribute ref="xml:lang" use="optional"/>
    </xs:extension>
  </xs:complexContent>
</xs:complexType>

<xs:simpleType name="formatsType">
  <xs:list itemType="cat:formatType" />
</xs:simpleType>

<xs:simpleType name="formatType">
  <xs:restriction base="xs:token">
    <xs:enumeration value="CD" />
    <xs:enumeration value="MiniDisc" />
    <xs:enumeration value="tape" />
    <xs:enumeration value="vinyl" />
  </xs:restriction>
</xs:simpleType>

<xs:complexType name="description" mixed="true">
  <xs:sequence>
    <xs:any namespace="http://www.w3.org/1999/xhtml" processContents="lax"
            minOccurs="0" maxOccurs="unbounded" />
  </xs:sequence>
  <xs:attribute ref="xml:lang" use="optional"/>
</xs:complexType>

<xs:complexType name="price">
  <xs:simpleContent>
    <xs:extension base="cat:monetaryAmount">
      <xs:attribute name="currency" type="cat:currencyType" default="USD" />
    </xs:extension>
  </xs:simpleContent>
</xs:complexType>

<xs:simpleType name="currencyType">
  <xs:restriction base="xs:token">
    <xs:pattern value="[A-Z]{3}" />
  </xs:restriction>
</xs:simpleType>

<xs:simpleType name="monetaryAmount">
  <xs:restriction base="xs:decimal">
    <xs:fractionDigits value="3" />
    <xs:pattern value="\d+(\.\d{2,3})?" />
  </xs:restriction>
</xs:simpleType>

</xs:schema>

With:

<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:cat="http://www.example.com/catalog"
           xmlns:xlink="http://www.w3.org/1999/xlink"
           targetNamespace="http://www.example.com/catalog"
           elementFormDefault="qualified">

<xs:import namespace="http://www.w3.org/XML/1998/namespace"
           schemaLocation="http://www.w3.org/2001/xml.xsd" />

<xs:import namespace="http://www.w3.org/1999/xlink"
           schemaLocation="http://www.cs.rpi.edu/~puninj/XGMML/xlinks-2001.xsd" />

<xs:element name="catalog">
  <xs:complexType>
    <xs:sequence>
      <xs:element ref="cat:_item" maxOccurs="unbounded" />
    </xs:sequence>
    <xs:attribute name="version" type="xs:string" fixed="0.1" use="required" />
    <xs:attribute ref="xml:base" />
    <xs:attribute ref="xml:lang" />
  </xs:complexType>
</xs:element>

<xs:element name="_item" type="cat:itemType" abstract="true" />

<xs:complexType name="itemType">
  <xs:sequence>
    <xs:element name="title" type="xs:token" />
    <xs:element name="description" type="cat:description" nillable="true" />
    <xs:element name="price" type="cat:price" maxOccurs="unbounded" />
  </xs:sequence>
  <xs:attribute name="label" type="xs:token" />
  <xs:attribute name="code" type="xs:ID" use="required" />
  <xs:attributeGroup ref="xlink:simpleLink" />
</xs:complexType>

<xs:element name="tshirt" type="cat:tshirtType" substitutionGroup="cat:_item" />

<xs:complexType name="tshirtType">
  <xs:complexContent>
    <xs:extension base="cat:itemType">
      <xs:attribute name="sizes" type="cat:clothesSizes" use="required" />
      <xs:attribute ref="xml:lang" use="optional"/>
    </xs:extension>
  </xs:complexContent>
</xs:complexType>

<xs:simpleType name="clothesSizes">
  <xs:union memberTypes="cat:sizeList">
    <xs:simpleType>
      <xs:restriction base="xs:token">
        <xs:enumeration value="oneSize" />
      </xs:restriction>
    </xs:simpleType>
  </xs:union>
</xs:simpleType>

<xs:simpleType name="sizeList">
  <xs:restriction>
    <xs:simpleType>
      <xs:list itemType="cat:clothesSize" />
    </xs:simpleType>
    <xs:minLength value="1" />
  </xs:restriction>
</xs:simpleType>

<xs:simpleType name="clothesSize">
  <xs:union memberTypes="cat:numberedSize cat:categorySize" />
</xs:simpleType>

<xs:simpleType name="numberedSize">
  <xs:restriction base="xs:integer">
    <xs:enumeration value="4" />
    <xs:enumeration value="6" />
    <xs:enumeration value="8" />
    <xs:enumeration value="10" />
    <xs:enumeration value="12" />
    <xs:enumeration value="14" />
    <xs:enumeration value="16" />
    <xs:enumeration value="18" />
    <xs:enumeration value="20" />
    <xs:enumeration value="22" />
  </xs:restriction>
</xs:simpleType>

<xs:simpleType name="categorySize">
  <xs:restriction base="xs:token">
    <xs:enumeration value="XS" />
    <xs:enumeration value="S" />
    <xs:enumeration value="M" />
    <xs:enumeration value="L" />
    <xs:enumeration value="XL" />
    <xs:enumeration value="XXL" />
  </xs:restriction>
</xs:simpleType>

<xs:element name="album" type="cat:albumType" substitutionGroup="cat:_item" />

<xs:complexType name="albumType">
  <xs:complexContent>
    <xs:extension base="cat:itemType">
      <xs:sequence>
        <xs:element name="artist" type="xs:string" />
      </xs:sequence>
      <xs:attribute name="formats" type="cat:formatsType" use="required" />
      <xs:attribute ref="xml:lang" use="optional"/>
    </xs:extension>
  </xs:complexContent>
</xs:complexType>

<xs:simpleType name="formatsType">
  <xs:list itemType="cat:formatType" />
</xs:simpleType>

<xs:simpleType name="formatType">
  <xs:restriction base="xs:token">
    <xs:enumeration value="CD" />
    <xs:enumeration value="MiniDisc" />
    <xs:enumeration value="tape" />
    <xs:enumeration value="vinyl" />
  </xs:restriction>
</xs:simpleType>

<xs:complexType name="description" mixed="true">
  <xs:sequence>
    <xs:any namespace="http://www.w3.org/1999/xhtml" processContents="lax"
            minOccurs="0" maxOccurs="unbounded" />
  </xs:sequence>
  <xs:attribute ref="xml:lang" use="optional"/>
</xs:complexType>

<xs:complexType name="price">
  <xs:simpleContent>
    <xs:extension base="cat:monetaryAmount">
      <xs:attribute name="currency" type="cat:currencyType" default="USD" />
    </xs:extension>
  </xs:simpleContent>
</xs:complexType>

<xs:simpleType name="currencyType">
  <xs:restriction base="xs:token">
    <xs:pattern value="[A-Z]{3}" />
  </xs:restriction>
</xs:simpleType>

<xs:simpleType name="monetaryAmount">
  <xs:restriction base="xs:decimal">
    <xs:fractionDigits value="3" />
    <xs:pattern value="\d+(\.\d{2,3})?" />
  </xs:restriction>
</xs:simpleType>

</xs:schema>

Index by affected section

2 Concepts

DM.E015

2.1 Terminology

DM.E006 DM.E007 DM.E009 DM.E016

2.6.2

DM.E012

3.3.1.2 Typed Value Determination

DM.E002

4 Infoset Mapping

DM.E014

5 Accessors

DM.E016

5.17 unparsed-entity-system-id Accessor

DM.E010

6.1.3 Construction from an Infoset

DM.E011

6.2.3 Construction from an Infoset

DM.E011

6.2.4 Construction from a PSVI

DM.E005

6.3.1 Overview

DM.E004

6.3.4 Construction from a PSVI

DM.E005

6.4.1 Overview

DM.E003

6.5.3 Construction from an Infoset

DM.E011

6.7.3 Construction from an Infoset

DM.E013

6.7.4 Construction from a PSVI

DM.E013

E Example (Non-Normative)

DM.E001 DM.E008

Index by Bugzilla entry

Bug #4352: DM.E001

Bug #4413: DM.E002

Bug #4486: DM.E003

Bug #4487: DM.E004

Bug #4519: DM.E005

Bug #4622: DM.E010

Bug #4984: DM.E006

Bug #5002: DM.E007

Bug #5207: DM.E011

Bug #5212: DM.E008

Bug #5267: DM.E009

Bug #5983: DM.E012

Bug #6139: DM.E013

Bug #6255: DM.E014

Bug #6287: DM.E016

Bug #6374: DM.E015