W3C

W3C XML Schema Definition Language (XSD) 1.1 Part 1: Structures

Editor's Draft 4 March 2008

This version:
../structures/
Latest version:
http://www.w3.org/TR/xmlschema11-1/
Previous versions:
http://www.w3.org/TR/2007/WD-xmlschema11-1-20070830/ http://www.w3.org/TR/2006/WD-xmlschema11-1-20060831/ http://www.w3.org/TR/2006/WD-xmlschema11-1-20060330/ http://www.w3.org/TR/2005/WD-xmlschema11-1-20050224/ http://www.w3.org/TR/2004/WD-xmlschema11-1-20040716/
Editors:
Version 1.1:
Shudi (Sandy) Gao 高殊镝, IBM <sandygao@ca.ibm.com>
C. M. Sperberg-McQueen, World Wide Web Consortium <cmsmcq@w3.org>
Henry S. Thompson, University of Edinburgh <ht@inf.ed.ac.uk>
Version 1.0:
Henry S. Thompson, University of Edinburgh <ht@inf.ed.ac.uk>
Noah Mendelsohn, IBM <noah_mendelsohn@us.ibm.com>
David Beech, Oracle Corporation (retired) <davidbeech@earthlink.net>
Murray Maloney, Muzmo Communications <murray@muzmo.com>

This document is also available in these non-normative formats: XML, XHTML with changes since version 1.0 marked, XHTML with changes since previous Working Draft marked, Independent copy of the schema for schema documents, Independent copy of the DTD for schema documents, Independent tabulation of components and microcomponents, and List of translations.


...

Status of this Document

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 W3C technical reports index at http://www.w3.org/TR/.

This is a member-only review version which will in due course become a Last Call Public Working Draft of W3C XML Schema Definition Language (XSD) 1.1. It has no formal standing within W3C; it is here made available for review by W3C members and the public. XSD 1.1 retains all the essential features of XSD 1.0, but adds several new features to support functionality requested by users, fixes some errors in XSD 1.0, and clarifies some wording. This draft was created on 4 March 2008. It reflects (unless otherwise noted elsewhere) all decisions on this document made by the Working Group through 29 February 2008. The document thus incorporates all decisions made by the Working Group to date.

This draft was published on 4 March 2008. The major revisions since the previous draft include:

For those primarily interested in the changes since version 1.0, the appendix Changes since version 1.0 (§G) is the recommended starting point. It summarizes both changes made since XSD 1.0 and some changes which were expected (and predicted in earlier drafts of this specification) but have not been made after all. Accompanying versions of this document display in color all changes to normative text since version 1.0 and since the previous Working Draft.

The Last Call review period for this document extends until 8 November 2007. Comments on this document should be made in W3C's public installation of Bugzilla, specifying "XML Schema" as the product. Instructions can be found at http://www.w3.org/XML/2006/01/public-bugzilla. If access to Bugzilla is not feasible, please send your comments to the W3C XML Schema comments mailing list, www-xml-schema-comments@w3.org (archive) Each Bugzilla entry and email message should contain only one comment.

Although feedback based on any aspect of this specification is welcome, there are certain aspects of the design presented herein for which the Working Group is particularly interested in feedback. These are designated "priority feedback" aspects of the design, and identified as such in editorial notes at appropriate points in this draft. Any feature mentioned in a priority feedback note should be considered a "feature at risk": the feature may be retained as is, modified, or dropped, depending on the feedback received from readers, schema authors, schema users, and implementors.

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.

This document has been produced by the W3C XML Schema Working Group as part of the W3C XML Activity. The goals of XSD 1.1 are discussed in the document Requirements for XML Schema 1.1. The authors of this document are the members of the XML Schema Working Group. Different parts of this specification have different editors.

This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.

The English version of this specification is the only normative version. Information about translations of this document is available at http://www.w3.org/2003/03/Translations/byTechnology?technology=xmlschema.

The presentation of this document has been augmented to identify changes from a previous version, controlled by dg-5160.xml. Three kinds of changes are highlighted: new, added text, changed text, and deleted text.


Table of Contents

1 Introduction
    1.1 Introduction to Version 1.1
    1.2 Purpose
    1.3 Namespaces and Language Identifiers
    1.4 Dependencies on Other Specifications
    1.5 Documentation Conventions and Terminology
2 Conceptual Framework
    2.1 Overview of XSD
    2.2 XSD Abstract Data Model
    2.3 Constraints and Validation Rules
    2.4 Conformance
    2.5 Names and Symbol Spaces
    2.6 Schema-Related Markup in Documents Being Validated
    2.7 Representation of Schemas on the World Wide Web
3 Schema Component Details
    3.1 Introduction
    3.2 Attribute Declarations
    3.3 Element Declarations
    3.4 Complex Type Definitions
    3.5 Attribute Uses
    3.6 Attribute Group Definitions
    3.7 Model Group Definitions
    3.8 Model Groups
    3.9 Particles
    3.10 Wildcards
    3.11 Identity-constraint Definitions
    3.12 Type Alternatives
    3.13 Assertions
    3.14 Notation Declarations
    3.15 Annotations
    3.16 Simple Type Definitions
    3.17 Schemas as a Whole
4 Schemas and Namespaces: Access and Composition
    4.1 Layer 1: Summary of the Schema-validity Assessment Core
    4.2 Layer 2: Schema Documents, Namespaces and Composition
    4.3 Layer 3: Schema Document Access and Web-interoperability
5 Schemas and Schema-validity Assessment
    5.1 Errors in Schema Construction and Structure
    5.2 Assessing Schema-Validity
    5.3 Missing Sub-components
    5.4 Responsibilities of Schema-aware Processors

Appendices

A Schema for Schema Documents (Structures) (normative)
B References (normative)
C Outcome Tabulations (normative)
    C.1 Validation Rules
    C.2 Contributions to the post-schema-validation infoset
    C.3 Schema Representation Constraints
    C.4 Schema Component Constraints
D Terminology for implementation-defined features
    D.1 Subset of the Post-schema-validation Infoset
    D.2 Terminology of schema construction
E Required Information Set Items and Properties (normative)
F Checklists of implementation-defined and implementation-dependent features
    F.1 Checklist of implementation-defined features
    F.2 Checklist of implementation-dependent features
G Changes since version 1.0
    G.1 Changes made since version 1.0
    G.2 Issues not resolved
H Checking content-type restriction
I Schema Components Diagram (non-normative)
J Glossary (non-normative)
K DTD for Schemas (non-normative)
L Analysis of the Unique Particle Attribution Constraint (non-normative)
M References (non-normative)
N XSD Language Identifiers (non-normative)
O Acknowledgements (non-normative)

...
...

3 Schema Component Details

...
...
...
...
...
...

previous sub-section next sub-section3.7 Model Group Definitions

A model group definition associates a name and optional annotations with a Model Group. By reference to the name, the entire model group can be incorporated by reference into a {term}.

Model group definitions are provided primarily for reference from the XML Representation of Complex Type Definitions (§3.4.2) (see <complexType> and <group>). Thus, model group definitions provide a replacement for some uses of XML's parameter entity facility.

...
...

3.7.2 XML Representation of Model Group Definition Schema Components

The XML representation for a model group definition schema component is a <group> element information item. It provides for naming a model group for use by reference in the XML representation of complex type definitions and model groups. The correspondences between the properties of the information item and properties of the component it corresponds to are as follows:

XML Representation Summary: group Element Information Item

<group
  id = ID
  maxOccurs = (nonNegativeInteger | unbounded)  : 1
  minOccurs = nonNegativeInteger : 1
  name = NCName
  ref = QName
  {any attributes with non-schema namespace . . .}>
  Content: (annotation?, (all | choice | sequence)?)
</group>

If there is a name [attribute] (in which case the item will have <schema> or <redefine> as parent), then the item corresponds to a model group definition component with properties as follows:
Model Group Definition Schema Component
Property
Representation
 
 
The ·actual value· of the targetNamespace [attribute] of the ancestor schema element information item.
 
A model group which is the {term} of a particle corresponding to the <all>, <choice> or <sequence> among the [children] (there must be one).
 
Otherwise, the item will have a ref [attribute], in which case it corresponds to a particle component with properties as follows (unless minOccurs=maxOccurs=0, in which case the item corresponds to no component at all):
Particle Schema Component
Property
Representation
 
The ·actual value· of the minOccurs [attribute], if present, otherwise 1.
 
unbounded, if the maxOccurs [attribute] equals unbounded, otherwise the ·actual value· of the maxOccurs [attribute], if present, otherwise 1.
 
The {model group} of the model group definition ·resolved· to by the ·actual value· of the ref [attribute]
 

The name of this section is slightly misleading, in that the second, un-named, case above (with a ref and no name) is not really a named model group at all, but a reference to one. Also note that in the first (named) case above no reference is made to minOccurs or maxOccurs: this is because the schema for schema documents does not allow them on the child of <group> when it is named. This in turn is because the {min occurs} and {max occurs} of the particles which refer to the definition are what count.

Given the constraints on its appearance in content models, an <all> must only occur as the only item in the [children] of a named model group definition or a content model: see Constraints on Model Group Schema Components (§3.8.6).

...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...