XML Schema Part 1: Structures Second Edition table {text-indent: 0;} code { font-family: monospace; }
div.constraint, div.issue, div.note, div.notice { margin-left: 2em; }
ol.enumar { list-style-type: decimal; } ol.enumla { list-style-type: lower-alpha; } ol.enumlr { list-style-type: lower-roman; } ol.enumua { list-style-type: upper-alpha; } ol.enumur { list-style-type: upper-roman; }
div.exampleInner pre { margin-left: 1em; margin-top: 0em; margin-bottom: 0em} div.exampleOuter {border: 4px double gray; margin: 0em; padding: 0em} div.exampleInner { background-color: #d5dee3; border-top-width: 4px; border-top-style: double; border-top-color: #d3d3d3; border-bottom-width: 4px; border-bottom-style: double; border-bottom-color: #d3d3d3; padding: 4px; margin: 0em } div.exampleWrapper { margin: 4px } div.exampleHeader { font-weight: bold; margin: 4px}
img { color: white; border: none } span.nav { float: right} span.arrow { font-style: normal; font-weight: bold } code { font-family: monospace; font-size: 100%} span.propdef { font-weight: bold; font-family: monospace } span.termdef {color: #850021} a.termref:visited, a.termref:link {font-family: sans-serif; font-style: normal; color: black; text-decoration: none } a.eltref:visited, a.eltref:link { font-family: sans-serif; color: black; text-decoration: none } a.propref:visited, a.xpropref:visited, a.propref:link, a.xpropref:link { color: black; text-decoration: none; font-family: sans-serif } dl.props, dl.psvi {margin-bottom: .5em; margin-top: 0em} div.toc1 {margin-left: 5ex} div.toc2 {margin-left: 2ex} div.tocLine{margin: 0em; text-indent: -6ex} h3.withToc {margin-bottom: 0em} div.constraintnote { margin-top: 1em } div.constraint { margin-left: 1em; } div.constraintlist { margin-left: 1em; margin-bottom: 0em } div.clnumber { text-indent: -1em; margin-top: 0em; margin-bottom: 0em } div.schemaComp { border: 4px double gray; margin: 0em 1em; padding: 0em } div.compHeader { margin: 4px; font-weight: bold } span.schemaComp { color: #A52A2A } div.compBody { border-top-width: 4px; border-top-style: double; border-top-color: #d3d3d3; padding: 4px ; margin: 0em} div.psviDef { border: 4px double gray; margin: 1em 1em; padding: 0em } div.psviHeader { margin: 4px; font-weight: bold } span.psviDef { color: #A52A2A } div.psviBody { border-top-width: 4px; border-top-style: double; border-top-color: #d3d3d3; padding: 4px ; margin: 0em} div.reprdef { border: 4px double gray; margin: 0em 1em; padding: 0em } div.reprHeader { margin: 4px; font-weight: bold } span.reprdef { color: #A52A2A } div.reprBody, div.reprcomp, div.reprdep { border-top-width: 4px; border-top-style: double; border-top-color: #d3d3d3; padding: 4px ; margin: 0em} table.reprcomp { margin-bottom: -.5em} p.element-syntax-1 { font-family: monospace; margin-top: 0em; margin-bottom: .5em } p.element-syntax { font-family: monospace; border-top-width: 1px; border-top-style: solid; border-top-color: #d3d3d3; padding: 4px ; margin: 0em} div.exampleInner pre { margin-left: 1em; margin-top: 0em; margin-bottom: 0em} div.exampleOuter {border: 4px double gray; margin: 0em; padding: 0em} div.exampleInner { background-color: #d5dee3; border-top-width: 4px; border-top-style: double; border-top-color: #d3d3d3; border-bottom-width: 4px; border-bottom-style: double; border-bottom-color: #d3d3d3; padding: 4px; margin: 0em } div.exampleWrapper { margin: 4px } div.exampleHeader { font-weight: bold; margin: 4px} span.edtext { color: red } table.restricts { margin-top: 1em; margin-bottom: 1em; margin-left: -2em} table.restricts th { margin-left: 0em } table.ubc td, table.ubc th { font-size: smaller } table.dtdemo th { text-align: center; background-color: #d5dee3} table.dtdemo pre { margin-left: 0em; margin-bottom: 0em} table.dtdemo td {background-color: #bedce6} table.scrap {background-color: #f5dcb3} img { color: white; border: none } span.nav { float: right} span.arrow { font-style: normal; font-weight: bold } This version: http://www.w3.org/TR/2004/REC-xmlschema-1-20041028/ Latest version: http://www.w3.org/TR/xmlschema-1/ Previous version: http://www.w3.org/TR/2004/PER-xmlschema-1-20040318/ Editors: Henry S. Thompson, University of Edinburgh <[email protected]> David Beech, Oracle Corporation <[email protected]> Murray Maloney, for Commerce One <[email protected]> Noah Mendelsohn, Lotus Development Corporation <[email protected]> Please refer to the errata This document is also available in these non-normative formats: XML XHTML with visible change markup Independent copy of the schema for schema documents Independent copy of the DTD for schema documents translations Copyright W3C ® MIT ERCIM Keio liability trademark document use XML Schema: Structures XML Schema Part 2: Datatypes 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 This is a W3C Recommendation This document has been produced by the W3C XML Schema Working Group XML Activity XML Schema Requirements This document was produced under the 24 January 2002 Current Patent Practice (CPP) W3C Patent Policy Transition Procedure public list of patent disclosures 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/2001/05/xmlschema-translations This second edition is not first edition http://www.w3.org/2001/05/xmlschema-errata The errata list for this second edition is available at http://www.w3.org/2004/03/xmlschema-errata Please report errors in this document to [email protected] archive Note: [email protected] [email protected] 1 Introduction Purpose Dependencies on Other Specifications Documentation Conventions and Terminology Conceptual Framework Overview of XML Schema XML Schema Abstract Data Model Constraints and Validation Rules Conformance Names and Symbol Spaces Schema-Related Markup in Documents Being Validated Representation of Schemas on the World Wide Web Schema Component Details Introduction Attribute Declarations Element Declarations Complex Type Definitions AttributeUses Attribute Group Definitions Model Group Definitions Model Groups Particles Wildcards Identity-constraint Definitions Notation Declarations Annotations Simple Type Definitions Schemas as a Whole Schemas and Namespaces: Access and Composition Layer 1: Summary of the Schema-validity Assessment Core Layer 2: Schema Documents, Namespaces and Composition Layer 3: Schema Document Access and Web-interoperability Schemas and Schema-validity Assessment Errors in Schema Construction and Structure Assessing Schema-Validity Missing Sub-components Responsibilities of Schema-aware Processors A Schema for Schemas (normative) References (normative) Outcome Tabulations (normative) Validation Rules Contributions to the post-schema-validation infoset Schema Representation Constraints Schema Component Constraints Required Information Set Items and Properties (normative) Schema Components Diagram (non-normative) Glossary (non-normative) DTD for Schemas (non-normative) Analysis of the Unique Particle Attribution Constraint (non-normative) References (non-normative) Acknowledgements (non-normative) This document sets out the structural part ( XML Schema: Structures Chapter 2 presents a Conceptual Framework (§2) Chapter 3, Schema Component Details (§3) Chapter 4 presents Schemas and Namespaces: Access and Composition (§4) Chapter 5 discusses Schemas and Schema-validity Assessment (§5) The normative appendices include a Schema for Schemas (normative) (§A) References (normative) (§B) The non-normative appendices include the DTD for Schemas (non-normative) (§G) Glossary (non-normative) (§F) This document is primarily intended as a language definition reference. As such, although it contains a few examples, it is not [XML Schema: Primer] The purpose of XML Schema: Structures The purpose of an XML Schema: Structures XML Schema: Structures Any application that consumes well-formed XML can use the XML Schema: Structures XML Schema: Structures all any The definition of XML Schema: Structures [XML-Infoset] [XML-Namespaces] [XPath] [XML Schemas: Datatypes] See Required Information Set Items and Properties (normative) (§D) [XML-Infoset] The section introduces the highlighting and typography as used in this document to present technical material. Special terms are defined at their point of introduction in the text. For example [Definition:] term · · Non-normative examples are set off in boxes and accompanied by a brief explanation: Example <schema targetNamespace="http://www.example.com/XMLSchema/1.0/mySchema"> And an explanation of the example. The definition of each kind of schema component consists of a list of its properties and their contents, followed by descriptions of the semantics of the properties: Schema Component Example {example property} Definition of the property. References to properties of schema components are links to the relevant definition as exemplified above, set off with curly braces, for instance {example property} The correspondence between an element information item which is part of the XML representation of a schema and one or more schema components is presented in a tableau which illustrates the element information item(s) involved. This is followed by a tabulation of the correspondence between properties of the component and properties of the information item. Where context may determine which of several different components may arise, several tabulations, one per context, are given. The property correspondences are normative, as are the illustrations of the XML representation element information items. In the XML representation, bold-face attribute names (e.g. count size [XML Schemas: Datatypes] The allowed content of the information item is shown as a grammar fragment, using the Kleene operators ? * + Note: Schema for Schemas (normative) (§A) Schema for Schemas (normative) (§A) · · XML Representation Summary example <example count integer large medium small Content: all any Example Schema Component Property Representation {example property} Description of what the property corresponds to, e.g. the value of the size [attribute] References to elements in the text are links to the relevant illustration as exemplified above, set off with angle brackets, for instance <example> References to properties of information items as defined in [XML-Infoset] [children] Properties which this specification defines for information items are introduced as follows: PSVI Contributions for [new property] The value the property gets. References to properties of information items defined in this specification are notated as links to their introduction as exemplified above, set off with square brackets, for example [new property] The following highlighting is used for non-normative commentary in this document: Note: Following [XML 1.0 (Second Edition)] may must may Conforming documents and XML Schema-aware processors are permitted to but need not behave as described. must Conforming documents and XML Schema-aware processors are required to behave as described; otherwise they are in error. Note however that this specification provides a definition of error and of conformant processors' responsibilities with respect to errors (see Schemas and Schema-validity Assessment (§5) [XML 1.0 (Second Edition)] This chapter gives an overview of XML Schema: Structures Schema Component Details (§3) [XML Schema: Primer] Schema Component Details (§3) XML Representation of ... An XML Schema consists of components such as type definitions and element declarations. These can be used to assess the validity of well-formed element and attribute information items (as defined in [XML-Infoset] [Definition:] post-schema-validation infoset Schema-validity assessment has two aspects: 1 2 Synthesizing an overall validation outcome for the item, combining local schema-validity with the results of schema-validity assessments of its descendants, if any, and adding appropriate augmentations to the infoset to record this outcome. Throughout this specification, [Definition:] valid 1 Throughout this specification, [Definition:] assessment 2.2.1 Type Definition Components Declaration Components Model Group Components Identity-constraint Definition Components Group Definition Components Annotation Components This specification builds on [XML 1.0 (Second Edition)] [XML-Namespaces] information items [XML-Infoset] a priori well-formedness [XML 1.0 (Second Edition)] namespace conformance [XML-Namespaces] · · · · Just as [XML 1.0 (Second Edition)] [XML-Namespaces] [Definition:] Schema component [Definition:] XML Schema · · Simple type definitions Complex type definitions Attribute declarations Element declarations The secondary components, which must have names, are as follows: Attribute group definitions Identity-constraint definitions Model group definitions Notation declarations Finally, the "helper" components provide small parts of other components; they are not independent of their context: Annotations Model groups Particles Wildcards Attribute Uses During · · [Definition:] declaration · · On the other hand, [Definition:] definition [Definition:] name [XML-Namespaces] [Definition:] target namespace · · [XML-Namespaces] · · · · Note: · · · · · · · · Schema Component Details (§3) · · · · · · The abstract model provides two kinds of type definition component: simple and complex. [Definition:] type definition Type definitions form a hierarchy with a single root. The subsections below first describe characteristics of that hierarchy, then provide an introduction to simple and complex type definitions themselves. [Definition:] · · · · · · · · Type Definition Hierarchy [Definition:] restriction · · [Definition:] extension [Definition:] ur-type definition anyType · · [Definition:] · · · · base type definition A simple type definition is a set of constraints on strings and information about the values they encode, applicable to the · · Each simple type definition, whether built-in (that is, defined in [XML Schemas: Datatypes] · · · · [Definition:] simple ur-type definition · · anySimpleType · · The mapping from lexical space to value space is unspecified for items whose type definition is the · · · · Note: Simple types may also be defined whose members are lists of items themselves constrained by some other simple type definition, or whose membership is the union of the memberships of some other simple type definitions. Such list and union simple type definitions are also restrictions of the · · For detailed information on simple type definitions, see Simple Type Definitions (§3.14) [XML Schemas: Datatypes] A complex type definition is a set of attribute declarations and a content type, applicable to the [attributes] [children] [children] Each complex type definition other than the · · a restriction of a complex · · or an · · · · A complex type which extends another does so by having additional content model particles at the end of the other definition's content model, or by having additional attribute declarations, or both. Note: For detailed information on complex type definitions, see Complex Type Definitions (§3.4) There are three kinds of declaration component: element, attribute, and notation. Each is described in a section below. Also included is a discussion of element substitution groups, which is a feature provided in conjunction with element declarations. An element declaration is an association of a name with a type definition, either simple or complex, an (optional) default value and a (possibly empty) set of identity-constraint definitions. The association is either global or scoped to a containing complex type definition. A top-level element declaration with name 'A' is broadly comparable to a pair of DTD declarations as follows, where the associated type definition fills in the ellipses: <!ELEMENT A . . .> <!ATTLIST A . . .> Element declarations contribute to · · · · · · For detailed information on element declarations, see Element Declarations (§3.3) In XML 1.0, the name and content of an element must correspond exactly to the element type referenced in the corresponding content model. [Definition:] element substitution groups · · All such members must have type definitions which are either the same as the head's type definition or restrictions or extensions of it. Therefore, although the names of elements can vary widely as new namespaces and members of the substitution group are defined, the content of member elements is strictly limited according to the type definition of the substitution group head. Note that element substitution groups are not represented as separate components. They are specified in the property values for element declarations (see Element Declarations (§3.3) An attribute declaration is an association between a name and a simple type definition, together with occurrence information and (optionally) a default value. The association is either global, or local to its containing complex type definition. Attribute declarations contribute to · · · · For detailed information on attribute declarations, see Attribute Declarations (§3.2) A notation declaration is an association between a name and an identifier for a notation. For an attribute information item to be · · NOTATION For detailed information on notation declarations, see Notation Declarations (§3.12) The model group, particle, and wildcard components contribute to the portion of a complex type definition that controls an element information item's content. A model group is a constraint in the form of a grammar fragment that applies to lists of element information items. It consists of a list of particles, i.e. element declarations, wildcards and model groups. There are three varieties of model group: Sequence (the element information items match the particles in sequential order); Conjunction (the element information items match the particles, in any order); Disjunction (the element information items match one of the particles). For detailed information on model groups, see Model Groups (§3.8) A particle is a term in the grammar for element content, consisting of either an element declaration, a wildcard or a model group, together with occurrence constraints. Particles contribute to · · · · [Definition:] · · [children] content model Note: XML Schema: Structures · · [XML 1.0 (Second Edition)] [XML 1.0 (Second Edition)] XML Schema: Structures · · · · For detailed information on particles, see Particles (§3.9) An attribute use plays a role similar to that of a particle, but for attribute declarations: an attribute declaration within a complex type definition is embedded within an attribute use, which specifies whether the declaration requires or merely allows its attribute, and whether it has a default or fixed value. A wildcard is a special kind of particle which matches element and attribute information items dependent on their namespace name, independently of their local names. For detailed information on wildcards, see Wildcards (§3.10) An identity-constraint definition is an association between a name and one of several varieties of identity-constraint related to uniqueness and reference. All the varieties use [XPath] · · · · For detailed information on identity-constraint definitions, see Identity-constraint Definitions (§3.11) There are two kinds of convenience definitions provided to enable the re-use of pieces of complex type definitions: model group definitions and attribute group definitions. A model group definition is an association between a name and a model group, enabling re-use of the same model group in several complex type definitions. For detailed information on model group definitions, see Model Group Definitions (§3.7) An attribute group definition is an association between a name and a set of attribute declarations, enabling re-use of the same set in several complex type definitions. For detailed information on attribute group definitions, see Attribute Group Definitions (§3.6) An annotation is information for human and/or mechanical consumers. The interpretation of such information is not defined in this specification. For detailed information on annotations, see Annotations (§3.13) The [XML 1.0 (Second Edition)] well-formedness validity The preceding section focused on · · · · Schema Component Constraint [Definition:] Schema Component Details (§3) Schema Component Constraints (§C.4) Schema Representation Constraint [Definition:] Schema for Schemas (normative) (§A) Schema Component Details (§3) Schema Representation Constraints (§C.3) Validation Rules [Definition:] · · Schema Component Details (§3) Validation Rules (§C.1) Schema Information Set Contribution [Definition:] · · · · · · Schema Component Details (§3) Contributions to the post-schema-validation infoset (§C.2) The last of these, schema information set contributions, are not as new as they might at first seem. XML 1.0 validation augments the XML 1.0 information set in similar ways, for example by providing values for attributes not present in instances, and by implicitly exploiting type information for normalization or access. (As an example of the latter case, consider the effect of NMTOKENS ID IDREF This specification describes three levels of conformance for schema aware processors. The first is required of all processors. Support for the other two will depend on the application environments for which the processor is intended. [Definition:] Minimally conforming · · · · · · [Definition:] · · Layer 2: Schema Documents, Namespaces and Composition (§4.2) conformance to the XML Representation of Schemas · · Schema Component Details (§3) · · · · · · Note: · · · · [Definition:] Fully conforming · · · · Representation of Schemas on the World Wide Web (§2.7) How schema definitions are located on the Web (§4.3.2) Note: See Schemas and Namespaces: Access and Composition (§4) As discussed in XML Schema Abstract Data Model (§2.2) · · · · Therefore [Definition:] symbol space namespace partition [XML-Namespaces] · · XML Schema Abstract Data Model (§2.2) Locally scoped attribute and element declarations are special with regard to symbol spaces. Every complex type definition defines its own local attribute and element declaration symbol spaces, where these symbol spaces are distinct from each other and from any of the other symbol spaces. So, for example, two complex type definitions having the same target namespace can contain a local attribute declaration for the unqualified name "priority", or contain a local element declaration for the name "address", without conflict or necessary relation between the two. 2.6.1 xsi:type xsi:nil xsi:schemaLocation, xsi:noNamespaceSchemaLocation The XML representation of schema components uses a vocabulary identified by the namespace name http://www.w3.org/2001/XMLSchema xs: XML Schema: Structures http://www.w3.org/2001/XMLSchema-instance xsi: Attribute Declaration for the 'type' attribute (§3.2.7) Attribute Declaration for the 'nil' attribute (§3.2.7) Attribute Declaration for the 'schemaLocation' attribute (§3.2.7) Attribute Declaration for the 'noNamespaceSchemaLocation' attribute (§3.2.7) The Simple Type Definition (§2.2.1.2) Complex Type Definition (§2.2.1.3) · · xsi:type · · QName Interpretation (§3.15.3) · · XML Schema: Structures · · · · xsi:nil true The xsi:schemaLocation xsi:noNamespaceSchemaLocation · · How schema definitions are located on the Web (§4.3.2) On the World Wide Web, schemas are conventionally represented as XML documents (preferably of MIME type application/xml text/xml 1.1 Inclusion Constraints and Semantics (§4.2.1) Layer 2: Schema Documents, Namespaces and Composition (§4.2) Standards for representation of schemas and retrieval of schema documents on the Web (§4.3.1) How schema definitions are located on the Web (§4.3.2) 3.1.1 Components and Properties XML Representations of Components The Mapping between XML Representations and Components White Space Normalization during Validation The following sections provide full details on the composition of all schema components, together with their XML representations and their contributions to · · properties: their values and significance XML representation and the mapping to properties constraints on representation validation rules · · constraints on the components themselves The sub-sections immediately below introduce conventions and terminology used throughout the component sections. Components are defined in terms of their properties, and each property in turn is defined by giving its range, that is the values it may have. This can be understood as defining a schema as a labeled directed graph, where the root is a schema, every other vertex is a schema component or a literal (string, boolean, number) and every labeled edge is a property. The graph is not · · Note: [Definition:] absent Any property not identified as optional is required to be present; optional properties which are not present are taken to have · · not · · legal XML characters [XML 1.0 (Second Edition)] The principal purpose of XML Schema: Structures [Definition:] <schema> schema document Schema for Schemas (normative) (§A) DTD for Schemas (non-normative) (§G) [namespace name] http://www.w3.org/2001/XMLSchema · · [XML-Infoset] Two aspects of the XML representations of components presented in the following sections are constant across them all: All of them allow attributes qualified with namespace names other than the XML Schema namespace itself: these appear as annotations in the corresponding schema component; All of them allow an <annotation> For each kind of schema component there is a corresponding normative XML representation. The sections below describe the correspondences between the properties of each kind of schema component on the one hand and the properties of information items in that XML representation on the other, together with constraints on that representation above and beyond those implicit in the Schema for Schemas (normative) (§A) The language used is as if the correspondences were mappings from XML representation to schema component, but the mapping in the other direction, and therefore the correspondence in the abstract, can always be constructed therefrom. In discussing the mapping from XML representations to schema components below, the value of a component property is often determined by the value of an attribute information item, one of the [attributes] Schema for Schemas (normative) (§A) [Definition:] actual value · · · · Many properties are identified below as having other schema components or sets of components as values. For the purposes of exposition, the definitions in this section assume that (unless the property is explicitly identified as optional) all such values are in fact present. When schema components are constructed from XML representations involving reference by name to other components, this assumption may be violated if one or more references cannot be resolved. This specification addresses the matter of missing components in a uniform manner, described in Missing Sub-components (§5.3) Forward reference to named definitions and declarations is · · · · Schemas and Namespaces: Access and Composition (§4) Throughout this specification, [Definition:] initial value [normalized value] initial value [character code] [children] The above definition means that comments and processing instructions, even in the midst of text, are ignored for all · · [Definition:] normalized value · · whiteSpace facet · · preserve No normalization is done, the value is the · · replace All occurrences of #x9 #xA #xD #x20 collapse Subsequent to the replacements specified above under replace #x20 #x20 #x20 If the simple type definition used in an item's · · · · · · preserve There are three alternative validation rules which may supply the necessary background for the above: Attribute Locally Valid (§3.2.4) 3 Element Locally Valid (Type) (§3.3.4) 3.1.3 Element Locally Valid (Complex Type) (§3.4.4) 2.2 These three levels of normalization correspond to the processing mandated in XML 1.0 for element content, CDATA attribute content and tokenized attributed content, respectively. See Attribute Value Normalization [XML 1.0 (Second Edition)] replace collapse · · [normalized value] Note: has Attribute Value Normalization · · further · · 3.2.1 The Attribute Declaration Schema Component XML Representation of Attribute Declaration Schema Components Constraints on XML Representations of Attribute Declarations Attribute Declaration Validation Rules Attribute Declaration Information Set Contributions Constraints on Attribute Declaration Schema Components Built-in Attribute Declarations Attribute declarations provide for: Local · · Specifying default or fixed values for attribute information items. Example <xs:attribute name="age" type="xs:positiveInteger" use="required"/> The XML representation of an attribute declaration. The attribute declaration schema component has the following properties: Schema Component Attribute Declaration {name} An NCName as defined by [XML-Namespaces] {target namespace} Either · · [XML-Namespaces] {type definition} A simple type definition. {scope} Optional. Either global {value constraint} Optional. A pair consisting of a value and one of default fixed {annotation} Optional. An annotation. The {name} · · The value of the attribute must conform to the supplied {type definition} A non- · · {target namespace} · · · · {target namespace} · · A {scope} global {scope} · · {value constraint} #FIXED default · · fixed default values See Annotations (§3.13) {annotation} Note: {name} {target namespace} {value constraint} · · Element Locally Valid (Complex Type) (§3.4.4) [XML-Infoset] xmlns xmlns:xsl [namespace attributes] xmlns Not Allowed (§3.2.6) The XML representation for an attribute declaration schema component is an <attribute> XML Representation Summary attribute <attribute string string qualified unqualified ID NCName QName QName optional prohibited required {any attributes with non-schema namespace . . .} Content: annotation simpleType If the <attribute> <schema> Attribute Declaration Schema Component Property Representation {name} The · · name [attribute] {target namespace} The · · targetNamespace [attribute] <schema> · · {type definition} The simple type definition corresponding to the <simpleType> [children] · · · · type [attribute] · · {scope} global {value constraint} If there is a default fixed [attribute] · · {type definition} [attribute] default fixed · · {annotation} The annotation corresponding to the <annotation> [children] · · otherwise if the <attribute> <complexType> <attributeGroup> ref [attribute] use='prohibited' Attribute Use Schema Component Property Representation {required} true use [attribute] · · required false {attribute declaration} See the Attribute Declaration mapping immediately below. {value constraint} If there is a default fixed [attribute] · · {type definition} {attribute declaration} [attribute] default fixed · · Attribute Declaration Schema Component Property Representation {name} The · · name [attribute] {target namespace} If form · · qualified form · · attributeFormDefault <schema> qualified · · targetNamespace [attribute] <schema> · · · · {type definition} The simple type definition corresponding to the <simpleType> [children] · · · · type [attribute] · · {scope} If the <attribute> <complexType> <attribute> <attributeGroup> · · {value constraint} · · {annotation} The annotation corresponding to the <annotation> [children] · · otherwise (the <attribute> <complexType> <attributeGroup> ref [attribute] use='prohibited' Attribute Use Schema Component Property Representation {required} true use [attribute] · · required false {attribute declaration} The (top-level) attribute declaration · · · · ref [attribute] {value constraint} If there is a default fixed [attribute] · · {type definition} {attribute declaration} [attribute] default fixed · · Attribute declarations can appear at the top level of a schema document, or within complex type definitions, either as complete (local) declarations, or by reference to top-level declarations, or within attribute group definitions. For complete declarations, top-level or local, the type <simpleType> The default when no simple type definition is referenced or provided is the · · Attribute information items · · {target namespace} · · · · form [attribute] attributeFormDefault [attribute] <schema> {target namespace} The names for top-level attribute declarations are in their own · · Schema Representation Constraint: Attribute Declaration Representation OK In addition to the conditions imposed on <attribute> all 1 default fixed 2 If default use use · · optional 3 If the item's parent is not <schema> all 3.1 One of ref name 3.2 If ref <simpleType> form type 4 type <simpleType> 5 The corresponding attribute declaration must satisfy the conditions set out in Constraints on Attribute Declaration Schema Components (§3.2.6) Validation Rule: Attribute Locally Valid For an attribute information item to be locally · · all 1 · · Missing Sub-components (§5.3) 2 {type definition} 3 · · · · {type definition} String Valid (§3.14.4) 4 The item's · · {value constraint} fixed Validation Rule: Schema-Validity Assessment (Attribute) The schema-validity assessment of an attribute information item depends on its · · [Definition:] · · [children] [attributes] context-determined declarations 3.1 Element Locally Valid (Complex Type) (§3.4.4) 2 Element Sequence Locally Valid (Particle) (§3.9.4) all 1 A non- · · one 1.1 A declaration which has been established as its · · 1.2 [local name] [namespace name] QName resolution (Instance) (§3.15.4) · · skip 2 Its · · Attribute Locally Valid (§3.2.4) 3 Both clause 1 2 Attribute Locally Valid (§3.2.4) [Definition:] strictly assessed Schema Information Set Contribution: Assessment Outcome (Attribute) If the schema-validity of an attribute information item has been assessed as per Schema-Validity Assessment (Attribute) (§3.2.4) · · PSVI Contributions for [validation context] The nearest ancestor element information item with a [schema information] [validity] The appropriate case 1 If · · then case 1.1 If · · Attribute Locally Valid (§3.2.4) then valid 1.2 otherwise invalid 2 otherwise notKnown [validation attempted] The appropriate case 1 If · · then full 2 otherwise none [schema specified] infoset Attribute Default Value (§3.4.5) Schema Information Set Contribution: Validation Failure (Attribute) If the local · · Attribute Locally Valid (§3.2.4) · · PSVI Contributions for [schema error code] The appropriate case 1 If · · then · · Outcome Tabulations (normative) (§C) 2 otherwise · · Schema Information Set Contribution: Attribute Declaration If an attribute information item is · · Attribute Locally Valid (§3.2.4) · · PSVI Contributions for [attribute declaration] An · · Schema Information Set Contribution: Attribute Validated by Type If clause 3 Attribute Locally Valid (§3.2.4) · · PSVI Contributions for [schema normalized value] The · · · · PSVI Contributions for [type definition] An · · {type definition} [member type definition] If and only if that type definition has {variety} union · · {member type definitions} · · [normalized value] PSVI Contributions for [type definition type] simple [type definition namespace] The {target namespace} · · [type definition anonymous] true {name} · · · · false [type definition name] The {name} · · · · · · · · {variety} union [Definition:] {member type definitions} · · · · actual member type definition PSVI Contributions for [member type definition namespace] The {target namespace} · · [member type definition anonymous] true {name} · · · · false [member type definition name] The {name} · · · · · · · · · · {value constraint} PSVI Contributions for [schema default] The canonical lexical representation {value constraint} · · 1 The item's [schema normalized value] · · 2 The [type definition] [member type definition] · · All attribute declarations (see Attribute Declarations (§3.2) Schema Component Constraint: Attribute Declaration Properties Correct All 1 The values of the properties of an attribute declaration must be as described in the property tableau in The Attribute Declaration Schema Component (§3.2.1) Missing Sub-components (§5.3) 2 if there is a {value constraint} canonical lexical representation · · {type definition} String Valid (§3.14.4) 3 If the {type definition} ID {value constraint} Schema Component Constraint: xmlns Not Allowed The {name} xmlns Note: {name} · · xmlns:* Schema Component Constraint: xsi: Not Allowed The {target namespace} http://www.w3.org/2001/XMLSchema-instance Note: need must xsi:type xsi:nil There are four attribute declarations present in every schema by definition: Attribute Declaration for the 'type' attribute Property Value {name} type {target namespace} http://www.w3.org/2001/XMLSchema-instance {type definition} The built-in QName {scope} global {value constraint} · · {annotation} · · Attribute Declaration for the 'nil' attribute Property Value {name} nil {target namespace} http://www.w3.org/2001/XMLSchema-instance {type definition} The built-in boolean {scope} global {value constraint} · · {annotation} · · Attribute Declaration for the 'schemaLocation' attribute Property Value {name} schemaLocation {target namespace} http://www.w3.org/2001/XMLSchema-instance {type definition} An anonymous simple type definition, as follows: Property Value {name} · · {target namespace} http://www.w3.org/2001/XMLSchema-instance {base type definition} The built in · · {facets} · · {variety} list {item type definition} The built-in anyURI {annotation} · · {scope} global {value constraint} · · {annotation} · · Attribute Declaration for the 'noNamespaceSchemaLocation' attribute Property Value {name} noNamespaceSchemaLocation {target namespace} http://www.w3.org/2001/XMLSchema-instance {type definition} The built-in anyURI {scope} global {value constraint} · · {annotation} · · 3.3.1 The Element Declaration Schema Component XML Representation of Element Declaration Schema Components Constraints on XML Representations of Element Declarations Element Declaration Validation Rules Element Declaration Information Set Contributions Constraints on Element Declaration Schema Components Element declarations provide for: Local · · Specifying default or fixed values for an element information items; Establishing uniquenesses and reference constraint relationships among the values of related elements and attributes; Controlling the substitutability of elements through the mechanism of · · Example <xs:element name="PurchaseOrder" type="PurchaseOrderType"/>
<xs:element name="gift"> <xs:complexType> <xs:sequence> <xs:element name="birthday" type="xs:date"/> <xs:element ref="PurchaseOrder"/> </xs:sequence> </xs:complexType> </xs:element> XML representations of several different types of element declaration The element declaration schema component has the following properties: Schema Component Element Declaration {name} An NCName as defined by [XML-Namespaces] {target namespace} Either · · [XML-Namespaces] {type definition} Either a simple type definition or a complex type definition. {scope} Optional. Either global {value constraint} Optional. A pair consisting of a value and one of default fixed {nillable} A boolean. {identity-constraint definitions} A set of constraint definitions. {substitution group affiliation} Optional. A top-level element definition. {substitution group exclusions} A subset of { extension restriction {disallowed substitutions} A subset of { substitution extension restriction {abstract} A boolean. {annotation} Optional. An annotation. The {name} · · A {scope} global {scope} · · A non- · · {target namespace} · · · · {target namespace} · · An element information item is · · {type definition} {type definition} · · If {nillable} true · · [local name] nil http://www.w3.org/2001/XMLSchema-instance true xsi:nil (§2.6.2) {content type} · · Element Locally Valid (Element) (§3.3.4) {value constraint} default · · [schema normalized value] · · · · fixed fixed default Note: {value constraint} {value constraint} {identity-constraint definitions} Identity-constraint Definitions (§3.11) Element declarations are potential members of the substitution group, if any, identified by {substitution group affiliation} {substitution group affiliation} {substitution group exclusions} {disallowed substitutions} An empty {substitution group exclusions} {substitution group affiliation} {type definition} {substitution group exclusions} extension restriction {type definition} {substitution group affiliation} The supplied values for {disallowed substitutions} · · · · xsi:type (§2.6.1) extension restriction · · {disallowed substitutions} Element declarations for which {abstract} true · · See Annotations (§3.13) {annotation} The XML representation for an element declaration schema component is an <element> XML Representation Summary element <element boolean #all extension restriction substitution string #all extension restriction string qualified unqualified ID nonNegativeInteger unbounded nonNegativeInteger NCName boolean QName QName QName {any attributes with non-schema namespace . . .} Content: annotation simpleType complexType unique key keyref If the <element> <schema> Element Declaration Schema Component Property Representation {name} The · · name [attribute] {target namespace} The · · targetNamespace [attribute] <schema> · · {scope} global {type definition} The type definition corresponding to the <simpleType> <complexType> [children] · · · · type [attribute] {type definition} · · · · substitutionGroup [attribute] · · {nillable} The · · nillable [attribute] false {value constraint} If there is a default fixed [attribute] · · {type definition} {type definition} {content type} string [attribute] default fixed · · {identity-constraint definitions} A set consisting of the identity-constraint-definitions corresponding to all the <key> <unique> <keyref> [children] {substitution group affiliation} The element declaration · · · · substitutionGroup [attribute] · · {disallowed substitutions} A set depending on the · · block [attribute] · · blockDefault [attribute] <schema> EBV case 1 If EBV then 2 If EBV #all then { extension restriction substitution } 3 otherwise · · Note: blockDefault [attribute] <schema> extension restriction substitution {disallowed substitutions} are {substitution group exclusions} As for {disallowed substitutions} final finalDefault [attributes] block blockDefault [attributes] { extension restriction } {abstract} The · · abstract [attribute] false {annotation} The annotation corresponding to the <annotation> [children] · · otherwise if the <element> <complexType> <group> ref [attribute] minOccurs=maxOccurs=0 Particle Schema Component Property Representation {min occurs} The · · minOccurs [attribute] 1 {max occurs} unbounded maxOccurs [attribute] unbounded · · maxOccurs [attribute] 1 {term} A (local) element declaration as given below. An element declaration as in the first case above, with the exception of its {target namespace} {scope} Element Declaration Schema Component Property Representation {target namespace} If form · · qualified form · · elementFormDefault <schema> qualified · · targetNamespace [attribute] <schema> · · · · {scope} If the <element> <complexType> <element> <group> · · otherwise (the <element> <complexType> <group> ref [attribute] minOccurs=maxOccurs=0 Particle Schema Component Property Representation {min occurs} The · · minOccurs [attribute] 1 {max occurs} unbounded maxOccurs [attribute] unbounded · · maxOccurs [attribute] 1 {term} The (top-level) element declaration · · · · ref [attribute] <element> <element> <schema> global <element> <group> <complexType> global ref type <simpleType> <complexType> Element information items · · {target namespace} · · · · form [attribute] elementFormDefault [attribute] <schema> {target namespace} As noted above the names for top-level element declarations are in a separate · · {target namespace} Note that the above allows for two levels of defaulting for unspecified type definitions. An <element> · · name See below at XML Representation of Identity-constraint Definition Schema Components (§3.11.2) <key> <unique> <keyref> Example <xs:element name="unconstrained"/>
<xs:element name="emptyElt"> <xs:complexType> <xs:attribute ...>. . .</xs:attribute> </xs:complexType> </xs:element>
<xs:element name="contextOne"> <xs:complexType> <xs:sequence> <xs:element name="myLocalElement" type="myFirstType"/> <xs:element ref="globalElement"/> </xs:sequence> </xs:complexType> </xs:element>
<xs:element name="contextTwo"> <xs:complexType> <xs:sequence> <xs:element name="myLocalElement" type="mySecondType"/> <xs:element ref="globalElement"/> </xs:sequence> </xs:complexType> </xs:element> The first example above declares an element whose type, by default, is the · · myLocalElement contextOne myFirstType contextTwo mySecondType Note: Example <xs:complexType name="facet"> <xs:complexContent> <xs:extension base="xs:annotated"> <xs:attribute name="value" use="required"/> </xs:extension> </xs:complexContent> </xs:complexType>
<xs:element name="facet" type="xs:facet" abstract="true"/>
<xs:element name="encoding" substitutionGroup="xs:facet"> <xs:complexType> <xs:complexContent> <xs:restriction base="xs:facet"> <xs:sequence> <xs:element ref="annotation" minOccurs="0"/> </xs:sequence> <xs:attribute name="value" type="xs:encodings"/> </xs:restriction> </xs:complexContent> </xs:complexType> </xs:element>
<xs:element name="period" substitutionGroup="xs:facet"> <xs:complexType> <xs:complexContent> <xs:restriction base="xs:facet"> <xs:sequence> <xs:element ref="annotation" minOccurs="0"/> </xs:sequence> <xs:attribute name="value" type="xs:duration"/> </xs:restriction> </xs:complexContent> </xs:complexType> </xs:element>
<xs:complexType name="datatype"> <xs:sequence> <xs:element ref="facet" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="name" type="xs:NCName" use="optional"/> . . . </xs:complexType> An example from a previous version of the schema for datatypes. The facet facet facet only facet facet either period encoding Schema Representation Constraint: Element Declaration Representation OK In addition to the conditions imposed on <element> all 1 default fixed 2 If the item's parent is not <schema> all 2.1 One of ref name 2.2 If ref <complexType> <simpleType> <key> <keyref> <unique> nillable default fixed form block type minOccurs maxOccurs id ref <annotation> 3 type <simpleType> <complexType> 4 The corresponding particle and/or element declarations must satisfy the conditions set out in Constraints on Element Declaration Schema Components (§3.3.6) Constraints on Particle Schema Components (§3.9.6) Validation Rule: Element Locally Valid (Element) For an element information item to be locally · · all 1 · · 2 Its {abstract} false 3 The appropriate case 3.1 If {nillable} false then [attributes] [namespace name] http://www.w3.org/2001/XMLSchema-instance [local name] nil 3.2 If {nillable} true · · true then all 3.2.1 The element information item must have no character or element information item [children] 3.2.2 There must be no fixed {value constraint} 4 If there is an attribute information item among the element information item's [attributes] [namespace name] http://www.w3.org/2001/XMLSchema-instance [local name] type all 4.1 The · · · · QName String Valid (§3.14.4) 4.2 The · · · · QName Interpretation (§3.15.3) · · QName resolution (Instance) (§3.15.4) [Definition:] local type definition 4.3 The · · {type definition} {disallowed substitutions} {type definition} {prohibited substitutions} Type Derivation OK (Complex) (§3.4.6) {disallowed substitutions} Type Derivation OK (Simple) (§3.14.6) [Definition:] actual type definition · · {type definition} 5 The appropriate case 5.1 If {value constraint} [children] 3.2 then all 5.1.1 If the · · · · canonical lexical representation {value constraint} · · Element Default Valid (Immediate) (§3.3.6) 5.1.2 The element information item with the canonical lexical representation {value constraint} · · · · · · Element Locally Valid (Type) (§3.3.4) 5.2 If {value constraint} [children] 3.2 then all 5.2.1 The element information item must be · · · · Element Locally Valid (Type) (§3.3.4) 5.2.2 If there is a fixed {value constraint} 3.2 all 5.2.2.1 The element information item must have no element information item [children] 5.2.2.2 The appropriate case 5.2.2.2.1 If {content type} · · mixed then · · canonical lexical representation {value constraint} 5.2.2.2.2 If {content type} · · then · · canonical lexical representation {value constraint} 6 The element information item must be · · {identity-constraint definitions} Identity-constraint Satisfied (§3.11.4) 7 If the element information item is the · · · · Validation Root Valid (ID/IDREF) (§3.3.4) Validation Rule: Element Locally Valid (Type) For an element information item to be locally · · all 1 · · 2 It must not have {abstract} true 3 The appropriate case 3.1 If then all 3.1.1 The element information item's [attributes] [namespace name] http://www.w3.org/2001/XMLSchema-instance [local name] type nil schemaLocation noNamespaceSchemaLocation 3.1.2 The element information item must have no element information item [children] 3.1.3 3.2 Element Locally Valid (Element) (§3.3.4) · · · · String Valid (§3.14.4) 3.2 If then · · Element Locally Valid (Complex Type) (§3.4.4) Validation Rule: Validation Root Valid (ID/IDREF) For an element information item which is the · · · · all 1 There must be no ID/IDREF binding [ID/IDREF table] [binding] 2 ID/IDREF binding [ID/IDREF table] [binding] ID/IDREF Table (§3.15.5) ID/IDREF binding Note: Outcome Tabulations (normative) (§C) Note: · · 2 Note: [XML 1.0 (Second Edition)] ID/IDREF · · Validation Rule: Schema-Validity Assessment (Element) The schema-validity assessment of an element information item depends on its · · · · all 1 One 1.1 All 1.1.1 A non- · · one 1.1.1.1 A declaration was stipulated by the processor (see Assessing Schema-Validity (§5.2) 1.1.1.2 A declaration has been established as its · · 1.1.1.3 All 1.1.1.3.1 Its · · skip 1.1.1.3.2 Its [local name] [namespace name] QName resolution (Instance) (§3.15.4) 1.1.2 Its · · Element Locally Valid (Element) (§3.3.4) 1.1.3 If that evaluation involved the evaluation of Element Locally Valid (Type) (§3.3.4) 1 1.2 All 1.2.1 A non- · · one 1.2.1.1 A type definition was stipulated by the processor (see Assessing Schema-Validity (§5.2) 1.2.1.2 All 1.2.1.2.1 There is an attribute information item among the element information item's [attributes] [namespace name] http://www.w3.org/2001/XMLSchema-instance [local name] type 1.2.1.2.2 The · · · · QName String Valid (§3.14.4) 1.2.1.2.3 The · · · · QName Interpretation (§3.15.3) · · QName resolution (Instance) (§3.15.4) [Definition:] local type definition 1.2.1.2.4 If there is also a processor-stipulated type definition, the · · {prohibited substitutions} Type Derivation OK (Complex) (§3.4.6) Type Derivation OK (Simple) (§3.14.6) 1.2.2 The element information item's · · · · · · Element Locally Valid (Type) (§3.3.4) 2 The schema-validity of all the element information items among its [children] Schema-Validity Assessment (Element) (§3.3.4) [attributes] Schema-Validity Assessment (Attribute) (§3.2.4) [Definition:] 1 strictly assessed · · 1.1 1.2 [Definition:] laxly assessed · · skip · · · · Element Locally Valid (Type) (§3.3.4) Note: 1.1 1.2 xsi:type [attribute] 1.2 Element Locally Valid (Element) (§3.3.4) Note: {name} {target namespace} · · Element Sequence Locally Valid (Particle) (§3.9.4) Schema Information Set Contribution: Assessment Outcome (Element) If the schema-validity of an element information item has been assessed as per Schema-Validity Assessment (Element) (§3.3.4) · · PSVI Contributions for [validation context] The nearest ancestor element information item with a [schema information] [validity] The appropriate case 1 If · · then case 1.1 If all 1.1.1 1.1.1.1 clause 1.1 Schema-Validity Assessment (Element) (§3.3.4) · · Element Locally Valid (Element) (§3.3.4) 1.1.1.2 clause 1.2 Schema-Validity Assessment (Element) (§3.3.4) · · Element Locally Valid (Type) (§3.3.4) 1.1.2 Neither its [children] [attributes] [validity] invalid 1.1.3 Neither its [children] [attributes] · · mustFind [validity] notKnown then valid 1.2 otherwise invalid. 2 otherwise notKnown [validation attempted] The appropriate case 1 If · · [children] [attributes] [validation attempted] full then full 2 If · · [children] [attributes] [validation attempted] none then none 3 otherwise partial Schema Information Set Contribution: Validation Failure (Element) If the local · · Element Locally Valid (Element) (§3.3.4) Element Locally Valid (Type) (§3.3.4) · · PSVI Contributions for [schema error code] The appropriate case 1 If · · then · · Outcome Tabulations (normative) (§C) 2 otherwise · · Schema Information Set Contribution: Element Declaration If an element information item is · · Element Locally Valid (Element) (§3.3.4) · · PSVI Contributions for [element declaration] an · · PSVI Contributions for [nil] true 3.2 Element Locally Valid (Element) (§3.3.4) false Schema Information Set Contribution: Element Validated by Type If an element information item is · · · · Element Locally Valid (Type) (§3.3.4) · · PSVI Contributions for [schema normalized value] The appropriate case 1 If 3.2 Element Locally Valid (Element) (§3.3.4) Element Default Value (§3.3.5) not · · {content type} then · · · · 2 otherwise · · PSVI Contributions for [type definition] An · · · · [member type definition] If and only if that type definition is a simple type definition with {variety} union {content type} {variety} union · · {member type definitions} · · · · PSVI Contributions for [type definition type] simple complex · · [type definition namespace] The {target namespace} · · [type definition anonymous] true {name} · · · · false [type definition name] The {name} · · · · · · · · {content type} {variety} union [Definition:] {member type definitions} · · · · actual member type definition PSVI Contributions for [member type definition namespace] The {target namespace} · · [member type definition anonymous] true {name} · · · · false [member type definition name] The {name} · · · · · · · · · · {value constraint} PSVI Contributions for [schema default] The canonical lexical representation {value constraint} · · [type definition] [member type definition] · · Schema Information Set Contribution: Element Default Value If the local · · Element Locally Valid (Element) (§3.3.4) · · PSVI Contributions for [schema specified] The appropriate case 1 If · · Element Locally Valid (Element) (§3.3.4) {value constraint} 3.2 Element Locally Valid (Element) (§3.3.4) [children] then schema · · canonical lexical representation {value constraint} [schema normalized value] 2 otherwise infoset All element declarations (see Element Declarations (§3.3) Schema Component Constraint: Element Declaration Properties Correct All 1 The values of the properties of an element declaration must be as described in the property tableau in The Element Declaration Schema Component (§3.3.1) Missing Sub-components (§5.3) 2 If there is a {value constraint} canonical lexical representation · · {type definition} Element Default Valid (Immediate) (§3.3.6) 3 If there is a non- · · {substitution group affiliation} {scope} global 4 If there is a {substitution group affiliation} {type definition} {type definition} {substitution group affiliation} {substitution group exclusions} {substitution group affiliation} Type Derivation OK (Complex) (§3.4.6) {type definition} Type Derivation OK (Simple) (§3.14.6) {type definition} 5 If the {type definition} {type definition} {content type} ID {value constraint} Note: ID 6 Circular substitution groups are disallowed. That is, it must not be possible to return to an element declaration by repeatedly following the {substitution group affiliation} The following constraints define relations appealed to elsewhere in this specification. Schema Component Constraint: Element Default Valid (Immediate) For a string to be a valid default with respect to a type definition the appropriate case 1 If then · · String Valid (§3.14.4) 2 If then all 2.1 its {content type} mixed 2.2 The appropriate case 2.2.1 If {content type} then · · String Valid (§3.14.4) 2.2.2 If {content type} mixed then {content type} · · Particle Emptiable (§3.9.6) Schema Component Constraint: Substitution Group OK (Transitive) For an element declaration (call it D C substitution extension restriction {disallowed substitutions} one 1 D C 2 All 2.1 The blocking constraint does not contain substitution 2.2 There is a chain of {substitution group affiliation} D C D {substitution group affiliation} C D {substitution group affiliation} {substitution group affiliation} C 2.3 The set of all {derivation method} D {type definition} C {type definition} C {prohibited substitutions} C {prohibited substitutions} {type definition} D {type definition} C {type definition} Schema Component Constraint: Substitution Group [Definition:] HEAD {element declarations} substitution group {element declarations} P HEAD 1 The element declaration itself is in P 2 P {substitution group affiliation} {element declarations} {substitution group affiliation} P P HEAD · · P all 1 Its {abstract} false 2 It is validly substitutable for HEAD HEAD {disallowed substitutions} Substitution Group OK (Transitive) (§3.3.6) 3.4.1 The Complex Type Definition Schema Component XML Representation of Complex Type Definitions Constraints on XML Representations of Complex Type Definitions Complex Type Definition Validation Rules Complex Type Definition Information Set Contributions Constraints on Complex Type Definition Schema Components Built-in Complex Type Definition Complex Type Definitions provide for: Constraining element information items by providing Attribute Declaration (§2.2.2.3) [attributes] Constraining element information item [children] [children] Using the mechanisms of Type Definition Hierarchy (§2.2.1.1) Specifying · · Limiting the ability to derive additional types from a given complex type. Controlling the permission to substitute, in an instance, elements of a derived type for elements declared in a content model to be of a given complex type. Example <xs:complexType name="PurchaseOrderType"> <xs:sequence> <xs:element name="shipTo" type="USAddress"/> <xs:element name="billTo" type="USAddress"/> <xs:element ref="comment" minOccurs="0"/> <xs:element name="items" type="Items"/> </xs:sequence> <xs:attribute name="orderDate" type="xs:date"/> </xs:complexType> The XML representation of a complex type definition. A complex type definition schema component has the following properties: Schema Component Complex Type Definition {name} Optional. An NCName as defined by [XML-Namespaces] {target namespace} Either · · [XML-Namespaces] {base type definition} Either a simple type definition or a complex type definition. {derivation method} Either extension restriction {final} A subset of { extension restriction {abstract} A boolean {attribute uses} A set of attribute uses. {attribute wildcard} Optional. A wildcard. {content type} One of empty · · Particle (§2.2.3.2) mixed element-only {prohibited substitutions} A subset of { extension restriction {annotations} A set of annotations. Complex types definitions are identified by their {name} {target namespace} {name} · · {name} {target namespace} xsi:type (§2.6.1) <element> References to schema components across namespaces (§4.2.3) Note: {name} ipso facto [(local) name] · · Element Declarations (§3.3) As described in Type Definition Hierarchy (§2.2.1.1) {base type definition} Simple Type Definition (§2.2.1.2) Complex Type Definition (§2.2.1.3) {derivation method} extension restriction Type Definition Hierarchy (§2.2.1.1) A complex type with an empty specification for {final} {base type definition} extension restriction [Definition:] final not final Complex types for which {abstract} true {type definition} · · xsi:type (§2.6.1) {base type definition} {type definition} · · xsi:type (§2.6.1) {attribute uses} Element Locally Valid (Complex Type) (§3.4.4) Attribute Locally Valid (§3.2.4) · · {attribute wildcard} · · {attribute uses} {attribute wildcard} any [attributes] a set whose members are either namespace names or · · [attributes] · · 'not' [attributes] 'not' · · [attributes] See Element Locally Valid (Complex Type) (§3.4.4) Wildcard allows Namespace Name (§3.10.4) · · {content type} · · [children] A {content type} empty · · [children] A {content type} Simple Type Definition (§2.2.1.2) · · [children] An element-only {content type} · · [children] · · A mixed {content type} · · [children] [children] · · {prohibited substitutions} · · · · xsi:type (§2.6.1) extension restriction {prohibited substitutions} See Annotations (§3.13) {annotations} The XML representation for a complex type definition schema component is a <complexType> The XML representation for complex type definitions with a simple type definition {content type} {content type} XML Representation Summary complexType <complexType boolean #all extension restriction #all extension restriction ID boolean NCName {any attributes with non-schema namespace . . .} Content: annotation simpleContent complexContent group all choice sequence attribute attributeGroup anyAttribute Whichever alternative for the content of <complexType> Complex Type Definition Schema Component Property Representation {name} The · · name [attribute] · · {target namespace} The · · targetNamespace [attribute] <schema> · · {abstract} The · · abstract [attribute] false {prohibited substitutions} A set corresponding to the · · block [attribute] · · blockDefault [attribute] <schema> EBV case 1 If EBV then 2 If EBV #all then { extension restriction } 3 otherwise · · Note: blockDefault [attribute] <schema> restriction extension {prohibited substitutions} are {final} As for {prohibited substitutions} final finalDefault [attributes] block blockDefault [attributes] {annotations} The annotations corresponding to the <annotation> [children] <simpleContent> <complexContent> [children] <restriction> <extension> [children] · · When the <simpleContent> <restriction> <extension> <simpleContent> <simpleContent ID {any attributes with non-schema namespace . . .} Content: annotation restriction extension <restriction base QName ID {any attributes with non-schema namespace . . .} Content: annotation simpleType minExclusive minInclusive maxExclusive maxInclusive totalDigits fractionDigits length minLength maxLength enumeration whiteSpace pattern attribute attributeGroup anyAttribute <extension base QName ID {any attributes with non-schema namespace . . .} Content: annotation attribute attributeGroup anyAttribute <attributeGroup ID ref QName {any attributes with non-schema namespace . . .} Content: annotation <anyAttribute ID ##any ##other anyURI ##targetNamespace ##local lax skip strict {any attributes with non-schema namespace . . .} Content: annotation Complex Type Definition with simple content Schema Component Property Representation {base type definition} The type definition · · · · base [attribute] {derivation method} If the <restriction> restriction <extension> extension {attribute uses} A union of sets of attribute uses as follows 1 <attribute> [children] 2 {attribute uses} · · · · ref [attribute] <attributeGroup> [children] 3 if the type definition · · · · base [attribute] {attribute uses} <restriction> {attribute uses} {attribute declaration} {name} {target namespace} one 3.1 the {name} {target namespace} {attribute declaration} 1 2 3.2 what would have been the {name} {target namespace} {attribute declaration} 1 · · use [attribute] <attribute> [children] <restriction> prohibited {attribute wildcard} 1 [Definition:] local wildcard case 1.1 If <anyAttribute> then · · namespace processContents [attributes] <annotation> [children] <any> XML Representation of Wildcard Schema Components (§3.10.2) 1.2 otherwise · · 2 [Definition:] complete wildcard case 2.1 If <attributeGroup> [children] · · {attribute wildcard} then · · 2.2 If <attributeGroup> [children] · · {attribute wildcard} then case 2.2.1 If <anyAttribute> then {process contents} {annotation} · · {namespace constraint} {namespace constraint} · · {namespace constraint} · · {attribute wildcard} <attributeGroup> [children] Attribute Wildcard Intersection (§3.10.6) 2.2.2 If <anyAttribute> then {process contents} The {process contents} · · {attribute wildcard} <attributeGroup> [children] {namespace constraint} The intensional intersection of the {namespace constraint} · · {attribute wildcard} <attributeGroup> [children] Attribute Wildcard Intersection (§3.10.6) {annotation} · · 3 The value is then determined by the appropriate case 3.1 If <restriction> then · · 3.2 If <extension> then 3.2.1 [Definition:] base wildcard case 3.2.1.1 If · · · · base [attribute] {attribute wildcard} then {attribute wildcard} 3.2.1.2 otherwise · · 3.2.2 The value is then determined by the appropriate case 3.2.2.1 If · · · · then case 3.2.2.1.1 If · · · · then · · 3.2.2.1.2 otherwise {process contents} {annotation} · · {namespace constraint} {namespace constraint} · · · · Attribute Wildcard Union (§3.10.6) 3.2.2.2 otherwise · · · · · · {content type} the appropriate case 1 If · · · · base [attribute] {content type} <restriction> then 1.1 <simpleType> [children] <restriction> 1.2 <restriction> <simpleType> [children] {content type} · · · · base [attribute] 1.1 1.2 <restriction> [children] Simple Type Restriction (Facets) (§3.14.6) 2 If · · · · base [attribute] {content type} mixed · · Particle Emptiable (§3.9.6) <restriction> then <simpleType> [children] <restriction> <restriction> [children] Simple Type Restriction (Facets) (§3.14.6) 3 If · · · · base [attribute] {content type} <extension> then {content type} 4 otherwise · · · · base [attribute] <extension> When the <complexContent> <attributeGroup> <anyAttribute> <restriction> <extension> <complexContent> <simpleContent> The property mappings below are also <simpleContent> <complexContent> · · <complexContent ID boolean {any attributes with non-schema namespace . . .} Content: annotation restriction extension <restriction base QName ID {any attributes with non-schema namespace . . .} Content: annotation group all choice sequence attribute attributeGroup anyAttribute <extension base QName ID {any attributes with non-schema namespace . . .} Content: annotation group all choice sequence attribute attributeGroup anyAttribute Complex Type Definition with complex content Schema Component Property Representation {base type definition} The type definition · · · · base [attribute] {derivation method} If the <restriction> restriction <extension> extension {attribute uses} A union of sets of attribute uses as follows: 1 <attribute> [children] 2 {attribute uses} · · · · ref [attribute] <attributeGroup> [children] 3 The {attribute uses} · · · · base [attribute] <restriction> {attribute uses} {attribute declaration} {name} {target namespace} one 3.1 The {name} {target namespace} {attribute declaration} 1 2 3.2 what would have been the {name} {target namespace} {attribute declaration} 1 · · use [attribute] <attribute> [children] <restriction> prohibited {attribute wildcard} As above for the <simpleContent> {content type} 1 [Definition:] effective mixed case 1.1 If mixed [attribute] <complexContent> then · · 1.2 If mixed [attribute] <complexType> then · · 1.3 otherwise false 2 [Definition:] effective content case 2.1 If one 2.1.1 There is no <group> <all> <choice> <sequence> [children] 2.1.2 There is an <all> <sequence> [children] [children] <annotation> 2.1.3 There is a <choice> [children] [children] <annotation> minOccurs [attribute] · · 0 then case 2.1.4 If · · true then {min occurs} 1 {max occurs} 1 {term} A model group whose {compositor} sequence {particles} 2.1.5 otherwise empty 2.2 otherwise <all> <choice> <group> <sequence> [children] 3 Then the value of the property is the appropriate case 3.1 If <restriction> then case 3.1.1 If · · empty then empty 3.1.2 otherwise 3.1.2.1 mixed · · true elementOnly 3.1.2.2 The · · 3.2 If <extension> then case 3.2.1 If · · empty then {content type} · · · · base [attribute] 3.2.2 If · · · · base [attribute] {content type} empty then 3.1.2 3.2.3 otherwise mixed elementOnly 3.1.2.1 {min occurs} 1 {max occurs} 1 {term} A model group whose {compositor} sequence {particles} {content type} · · · · base [attribute] · · Note: be · · · · Constraints on Complex Type Definition Schema Components (§3.4.6) Note: only prohibited use <attribute> {base type definition} <attribute> Complex Type Definition Validation Rules (§3.4.4) Constraints on Complex Type Definition Schema Components (§3.4.6) Careful consideration of the above concrete syntax reveals that a type definition need consist of no more than a name, i.e. that <complexType name="anyThing"/> Example <xs:complexType name="length1"> <xs:simpleContent> <xs:extension base="xs:nonNegativeInteger"> <xs:attribute name="unit" type="xs:NMTOKEN"/> </xs:extension> </xs:simpleContent> </xs:complexType>
<xs:element name="width" type="length1"/>
<width unit="cm">25</width>
<xs:complexType name="length2"> <xs:complexContent> <xs:restriction base="xs:anyType"> <xs:sequence> <xs:element name="size" type="xs:nonNegativeInteger"/> <xs:element name="unit" type="xs:NMTOKEN"/> </xs:sequence> </xs:restriction> </xs:complexContent> </xs:complexType>
<xs:element name="depth" type="length2"/>
<depth> <size>25</size><unit>cm</unit> </depth>
<xs:complexType name="length3"> <xs:sequence> <xs:element name="size" type="xs:nonNegativeInteger"/> <xs:element name="unit" type="xs:NMTOKEN"/> </xs:sequence> </xs:complexType> Three approaches to defining a type for length: one with character data content constrained by reference to a built-in datatype, and one attribute, the other two using two elements. length3 length2 Example <xs:complexType name="personName"> <xs:sequence> <xs:element name="title" minOccurs="0"/> <xs:element name="forename" minOccurs="0" maxOccurs="unbounded"/> <xs:element name="surname"/> </xs:sequence> </xs:complexType>
<xs:complexType name="extendedName"> <xs:complexContent> <xs:extension base="personName"> <xs:sequence> <xs:element name="generation" minOccurs="0"/> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType>
<xs:element name="addressee" type="extendedName"/>
<addressee> <forename>Albert</forename> <forename>Arnold</forename> <surname>Gore</surname> <generation>Jr</generation> </addressee> A type definition for personal names, and a definition derived by extension which adds a single element; an element declaration referencing the derived definition, and a · · Example <xs:complexType name="simpleName"> <xs:complexContent> <xs:restriction base="personName"> <xs:sequence> <xs:element name="forename" minOccurs="1" maxOccurs="1"/> <xs:element name="surname"/> </xs:sequence> </xs:restriction> </xs:complexContent> </xs:complexType>
<xs:element name="who" type="simpleName"/>
<who> <forename>Bill</forename> <surname>Clinton</surname> </who> A simplified type definition derived from the base type from the previous example by restriction, eliminating one optional daughter and fixing another to occur exactly once; an element declared by reference to it, and a · · Example <xs:complexType name="paraType" mixed="true"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element ref="emph"/> <xs:element ref="strong"/> </xs:choice> <xs:attribute name="version" type="xs:number"/> </xs:complexType> A further illustration of the abbreviated form, with the mixed complexType Schema Representation Constraint: Complex Type Definition Representation OK In addition to the conditions imposed on <complexType> all 1 If the <complexContent> · · · · base [attribute] 2 If the <simpleContent> all 2.1 The type definition · · · · base [attribute] one 2.1.1 a complex type definition whose {content type} 2.1.2 <restriction> {content type} mixed · · Particle Emptiable (§3.9.6) 2.1.3 only if the <extension> 2.2 If clause 2.1.2 <simpleType> [children] <restriction> Note: Schema for Schemas (normative) (§A) <xs:complexType . . .mixed='true' <simpleContent> 3 The corresponding complex type definition component must satisfy the conditions set out in Constraints on Complex Type Definition Schema Components (§3.4.6) 4 If clause 2.2.1 2.2.2 {attribute wildcard} Attribute Wildcard Intersection (§3.10.6) Validation Rule: Element Locally Valid (Complex Type) For an element information item to be locally · · all 1 {abstract} false 2 If clause 3.2 Element Locally Valid (Element) (§3.3.4) case 2.1 If {content type} empty then [children] 2.2 If {content type} then [children] · · · · String Valid (§3.14.4) 2.3 If {content type} element-only then [children] [character code] white space [XML 1.0 (Second Edition)] 2.4 If {content type} element-only mixed then [children] · · {content type} Element Sequence Locally Valid (Particle) (§3.9.4) 3 [attributes] [namespace name] http://www.w3.org/2001/XMLSchema-instance [local name] type nil schemaLocation noNamespaceSchemaLocation case 3.1 If {attribute uses} {attribute declaration} {name} [local name] {target namespace} [namespace name] · · {target namespace} [namespace name] then · · Attribute Locally Valid (Use) (§3.5.4) {attribute declaration} · · Schema-Validity Assessment (Attribute) (§3.2.4) Assessment Outcome (Attribute) (§3.2.5) 3.2 otherwise all 3.2.1 There must be an {attribute wildcard} 3.2.2 The attribute information item must be · · Item Valid (Wildcard) (§3.10.4) 4 The {attribute declaration} {attribute uses} {required} true [attributes] 3.1 5 Let [Definition:] wild IDs 3.2 · · · · mustFind · · [local name] [namespace name] QName resolution (Instance) (§3.15.4) {type definition} ID all 5.1 There must be no more than one item in · · 5.2 If · · {attribute uses} {attribute declaration} {type definition} ID Note: Note: {attribute wildcard} not {attribute uses} · · always · · {attribute declaration} 3 Schema Information Set Contribution: Attribute Default Value For each attribute use in the {attribute uses} {required} false {value constraint} · · {attribute declaration} [attributes] 3.1 Element Locally Valid (Complex Type) (§3.4.4) · · [attributes] [local name] The {attribute declaration} {name} [namespace name] The {attribute declaration} {target namespace} [schema normalized value] The canonical lexical representation · · [schema default] The canonical lexical representation · · [validation context] The nearest ancestor element information item with a [schema information] [validity] valid [validation attempted] full [schema specified] schema [type definition] [member type definition] Attribute Validated by Type (§3.2.5) All complex type definitions (see Complex Type Definitions (§3.4) Schema Component Constraint: Complex Type Definition Properties Correct All 1 The values of the properties of a complex type definition must be as described in the property tableau in The Complex Type Definition Schema Component (§3.4.1) Missing Sub-components (§5.3) 2 If the {base type definition} {derivation method} extension 3 Circular definitions are disallowed, except for the · · · · {base type definition} 4 Two distinct attribute declarations in the {attribute uses} {name} {target namespace} 5 Two distinct attribute declarations in the {attribute uses} {type definition} ID Schema Component Constraint: Derivation Valid (Extension) If the {derivation method} extension case 1 If {base type definition} then all 1.1 The {final} {base type definition} extension 1.2 {attribute uses} {attribute uses} {attribute uses} {base type definition} {attribute uses} {attribute declaration} {name} {target namespace} {type definition} 1.3 If it has an {attribute wildcard} {attribute wildcard} {namespace constraint} {attribute wildcard} {namespace constraint} Wildcard Subset (§3.10.6) 1.4 One 1.4.1 The {content type} {base type definition} {content type} 1.4.2 The {content type} {base type definition} empty 1.4.3 All 1.4.3.1 The {content type} 1.4.3.2 One 1.4.3.2.1 The {content type} {base type definition} empty 1.4.3.2.2 All 1.4.3.2.2.1 Both {content type} mixed element-only 1.4.3.2.2.2 The particle of the complex type definition must be a · · {base type definition} Particle Valid (Extension) (§3.9.6) 1.5 It must in principle be possible to derive the complex type definition in two steps, the first an extension and the second a restriction (possibly vacuous), from that type definition among its ancestors whose {base type definition} · · Note: · · 2 If {base type definition} then all 2.1 The {content type} 2.2 The {final} {base type definition} extension [Definition:] Derivation Valid (Extension) (§3.4.6) valid extension {base type definition} Schema Component Constraint: Derivation Valid (Restriction, Complex) If the {derivation method} restriction all 1 The {base type definition} {final} restriction 2 R {attribute uses} case 2.1 If {attribute uses} {base type definition} B {attribute declaration} {name} {target namespace} then all 2.1.1 one 2.1.1.1 B {required} false 2.1.1.2 R {required} true 2.1.2 R {attribute declaration} {type definition} B {type definition} Type Derivation OK (Simple) (§3.14.6) 2.1.3 [Definition:] effective value constraint {value constraint} {attribute declaration} {value constraint} one 2.1.3.1 B · · · · default 2.1.3.2 R · · fixed B 2.2 otherwise {base type definition} {attribute wildcard} {target namespace} R {attribute declaration} · · Wildcard allows Namespace Name (§3.10.4) 3 {attribute uses} {base type definition} {required} true {attribute declaration} {name} {target namespace} {attribute declaration} {attribute uses} {required} true 4 {attribute wildcard} all 4.1 The {base type definition} 4.2 The complex type definition's {attribute wildcard} {namespace constraint} {base type definition} {attribute wildcard} {namespace constraint} Wildcard Subset (§3.10.6) 4.3 Unless the {base type definition} · · {attribute wildcard} {process contents} {base type definition} {attribute wildcard} {process contents} strict lax skip 5 One 5.1 The {base type definition} · · 5.2 All 5.2.1 The {content type} 5.2.2 One 5.2.2.1 The {content type} {base type definition} {content type} Type Derivation OK (Simple) (§3.14.6) 5.2.2.2 The {base type definition} mixed · · Particle Emptiable (§3.9.6) 5.3 All 5.3.1 The {content type} empty 5.3.2 One 5.3.2.1 The {content type} {base type definition} empty 5.3.2.2 The {content type} {base type definition} elementOnly mixed · · Particle Emptiable (§3.9.6) 5.4 All 5.4.1 One 5.4.1.1 The {content type} element-only 5.4.1.2 The {content type} {base type definition} mixed 5.4.2 The particle of the complex type definition itself must be a · · {content type} {base type definition} Particle Valid (Restriction) (§3.9.6) Note: {content type} element-only {base type definition} {content type} empty Particle Valid (Restriction) (§3.9.6) element-only <sequence> Particle Valid (Restriction) (§3.9.6) empty {base type definition} [Definition:] Derivation Valid (Restriction, Complex) (§3.4.6) valid restriction {base type definition} Note: empty fixed The following constraint defines a relation appealed to elsewhere in this specification. Schema Component Constraint: Type Derivation OK (Complex) For a complex type definition (call it D B extension restriction all 1 If B D {derivation method} D 2 One 2.1 B D 2.2 B D {base type definition} 2.3 All 2.3.1 D {base type definition} · · 2.3.2 The appropriate case 2.3.2.1 If D {base type definition} then B 2.3.2.2 If D {base type definition} then B Type Derivation OK (Simple) (§3.14.6) Note: xsi:type Note: 2.1 When they are both top-level components with the same component type, namespace name, and local name; When they are necessarily the same type definition (for example, when the two types definitions in question are the type definitions associated with two attribute or element declarations, which are discovered to be the same declaration); When they are the same by construction (for example, when an element's type definition defaults to being the same type definition as that of its substitution-group head or when a complex type definition inherits an attribute declaration from its base type definition). There is a complex type definition nearly equivalent to the · · Complex Type Definition of the Ur-Type Property Value {name} anyType {target namespace} http://www.w3.org/2001/XMLSchema {base type definition} Itself {derivation method} restriction {content type} A pair consisting of mixed Property Value {min occurs} 1 {max occurs} 1 {term} a model group with the following properties: Property Value {compositor} sequence {particles} a list containing one particle with the following properties: Property Value {min occurs} 0 {max occurs} unbounded {term} a wildcard with the following properties: Property Value {namespace constraint} any {process contents} lax {attribute uses} The empty set {attribute wildcard} a wildcard with the following properties:: Property Value {namespace constraint} any {process contents} lax {final} The empty set {prohibited substitutions} The empty set {abstract} false The mixed lax · · every · · Note: rational array text http://www.w3.org/2001/03/XMLSchema/TypeLibrary.xsd 3.5.1 The Attribute Use Schema Component XML Representation of Attribute Use Components Constraints on XML Representations of Attribute Uses Attribute Use Validation Rules Attribute Use Information Set Contributions Constraints on Attribute Use Schema Components An attribute use is a utility component which controls the occurrence and defaulting behavior of attribute declarations. It plays the same role for attribute declarations in complex types that particles play for element declarations. Example <xs:complexType> . . . <xs:attribute ref="xml:lang" use="required"/> <xs:attribute ref="xml:space" default="preserve"/> <xs:attribute name="version" type="xs:number" fixed="1.0"/> </xs:complexType> XML representations which all involve attribute uses, illustrating some of the possibilities for controlling occurrence. The attribute use schema component has the following properties: Schema Component Attribute Use {required} A boolean. {attribute declaration} An attribute declaration. {value constraint} Optional. A pair consisting of a value and one of default fixed {required} {attribute declaration} {value constraint} {attribute declaration} {attribute declaration} {value constraint} Attribute uses correspond to all uses of <attribute> use two {attribute declaration} XML Representation of Attribute Declaration Schema Components (§3.2.2) None as such. Validation Rule: Attribute Locally Valid (Use) For an attribute information item to be · · · · canonical lexical representation {value constraint} fixed None as such. All attribute uses (see AttributeUses (§3.5) Schema Component Constraint: Attribute Use Correct All 1 The values of the properties of an attribute use must be as described in the property tableau in The Attribute Use Schema Component (§3.5.1) Missing Sub-components (§5.3) 2 If the {attribute declaration} fixed {value constraint} {value constraint} fixed {attribute declaration} {value constraint} 3.6.1 The Attribute Group Definition Schema Component XML Representation of Attribute Group Definition Schema Components Constraints on XML Representations of Attribute Group Definitions Attribute Group Definition Validation Rules Attribute Group Definition Information Set Contributions Constraints on Attribute Group Definition Schema Components A schema can name a group of attribute declarations so that they may be incorporated as a group into complex type definitions. Attribute group definitions do not participate in · · {attribute uses} {attribute wildcard} parameter entity <complexType> <attributeGroup> Example <xs:attributeGroup name="myAttrGroup"> <xs:attribute . . ./> . . . </xs:attributeGroup>
<xs:complexType name="myelement"> . . . <xs:attributeGroup ref="myAttrGroup"/> </xs:complexType> XML representations for attribute group definitions. The effect is as if the attribute declarations in the group were present in the type definition. The attribute group definition schema component has the following properties: Schema Component Attribute Group Definition {name} An NCName as defined by [XML-Namespaces] {target namespace} Either · · [XML-Namespaces] {attribute uses} A set of attribute uses. {attribute wildcard} Optional. A wildcard. {annotation} Optional. An annotation. Attribute groups are identified by their {name} {target namespace} · · References to schema components across namespaces (§4.2.3) {attribute uses} {attribute wildcard} Complex Type Definitions (§3.4) · · See Annotations (§3.13) {annotation} The XML representation for an attribute group definition schema component is an <attributeGroup> XML Representation Summary attributeGroup <attributeGroup ID NCName QName {any attributes with non-schema namespace . . .} Content: annotation attribute attributeGroup anyAttribute When an <attributeGroup> <schema> <redefine> <complexType> <attributeGroup> Attribute Group Definition Schema Component Property Representation {name} The · · name [attribute] {target namespace} The · · targetNamespace [attribute] schema {attribute uses} The union of the set of attribute uses corresponding to the <attribute> [children] {attribute uses} · · · · ref [attribute] <attributeGroup> [children] {attribute wildcard} As for the · · XML Representation of Complex Type Definitions (§3.4.2) {annotation} The annotation corresponding to the <annotation> [children] · · The example above illustrates a pattern which recurs in the XML representation of schemas: The same element, in this case attributeGroup name ref name ref Schema Representation Constraint: Attribute Group Definition Representation OK In addition to the conditions imposed on <attributeGroup> all 1 The corresponding attribute group definition, if any, must satisfy the conditions set out in Constraints on Attribute Group Definition Schema Components (§3.6.6) 2 If clause 2.2.1 2.2.2 XML Representation of Complex Type Definitions (§3.4.2) {attribute wildcard} Attribute Wildcard Intersection (§3.10.6) 3 Circular group reference is disallowed outside <redefine> <redefine> [children] <attributeGroup> ref [attribute] <attributeGroup> QName resolution (Schema Document) (§3.15.3) · · <attributeGroup> ref [attribute] [children] · · <attributeGroup> None as such. None as such. All attribute group definitions (see Attribute Group Definitions (§3.6) Schema Component Constraint: Attribute Group Definition Properties Correct All 1 The values of the properties of an attribute group definition must be as described in the property tableau in The Attribute Group Definition Schema Component (§3.6.1) Missing Sub-components (§5.3) 2 Two distinct members of the {attribute uses} {attribute declaration} {name} {target namespace} 3 Two distinct members of the {attribute uses} {attribute declaration} {type definition} ID 3.7.1 The Model Group Definition Schema Component XML Representation of Model Group Definition Schema Components Constraints on XML Representations of Model Group Definitions Model Group Definition Validation Rules Model Group Definition Information Set Contributions Constraints on Model Group Definition Schema Components A model group definition associates a name and optional annotations with a Model Group (§2.2.3.1) {term} Model group definitions are provided primarily for reference from the XML Representation of Complex Type Definitions (§3.4.2) <complexType> <group> parameter entity Example <xs:group name="myModelGroup"> <xs:sequence> <xs:element ref="someThing"/> . . . </xs:sequence> </xs:group>
<xs:complexType name="trivial"> <xs:group ref="myModelGroup"/> <xs:attribute .../> </xs:complexType>
<xs:complexType name="moreSo"> <xs:choice> <xs:element ref="anotherThing"/> <xs:group ref="myModelGroup"/> </xs:choice> <xs:attribute .../> </xs:complexType> A minimal model group is defined and used by reference, first as the whole content model, then as one alternative in a choice. The model group definition schema component has the following properties: Schema Component Model Group Definition {name} An NCName as defined by [XML-Namespaces] {target namespace} Either · · [XML-Namespaces] {model group} A model group. {annotation} Optional. An annotation. Model group definitions are identified by their {name} {target namespace} · · References to schema components across namespaces (§4.2.3) Model group definitions per se · · {term} {model group} Model Group (§2.2.3.1) See Annotations (§3.13) {annotation} The XML representation for a model group definition schema component is a <group> XML Representation Summary group <group ID nonNegativeInteger unbounded nonNegativeInteger NCName QName {any attributes with non-schema namespace . . .} Content: annotation all choice sequence If there is a name [attribute] <schema> <redefine> Model Group Definition Schema Component Property Representation {name} The · · name [attribute] {target namespace} The · · targetNamespace [attribute] schema {model group} A model group which is the {term} <all> <choice> <sequence> [children] {annotation} The annotation corresponding to the <annotation> [children] · · Otherwise, the item will have a ref [attribute] minOccurs=maxOccurs=0 Particle Schema Component Property Representation {min occurs} The · · minOccurs [attribute] 1 {max occurs} unbounded maxOccurs [attribute] unbounded · · maxOccurs [attribute] 1 {term} The {model group} · · · · ref [attribute] The name of this section is slightly misleading, in that the second, un-named, case above (with a ref name minOccurs maxOccurs <group> {min occurs} {max occurs} refer Given the constraints on its appearance in content models, an <all> [children] Constraints on Model Group Schema Components (§3.8.6) Schema Representation Constraint: Model Group Definition Representation OK In addition to the conditions imposed on <group> Constraints on Model Group Schema Components (§3.8.6) None as such. None as such. All model group definitions (see Model Group Definitions (§3.7) Schema Component Constraint: Model Group Definition Properties Correct The values of the properties of a model group definition must be as described in the property tableau in The Model Group Definition Schema Component (§3.7.1) Missing Sub-components (§5.3) 3.8.1 The Model Group Schema Component XML Representation of Model Group Schema Components Constraints on XML Representations of Model Groups Model Group Validation Rules Model Group Information Set Contributions Constraints on Model Group Schema Components When the [children] empty Simple Type Definitions (§3.14) [children] {term} Example <xs:all> <xs:element ref="cats"/> <xs:element ref="dogs"/> </xs:all>
<xs:sequence> <xs:choice> <xs:element ref="left"/> <xs:element ref="right"/> </xs:choice> <xs:element ref="landmark"/> </xs:sequence> XML representations for the three kinds of model group, the third nested inside the second. The model group schema component has the following properties: Schema Component Model Group {compositor} One of all choice sequence {particles} A list of particles {annotation} Optional. An annotation. specifies a sequential ( sequence choice all {particles} [children] · · ( sequence {particles} ( choice {particles} ( all {particles} {particles} {min occurs} =0 1 {max occurs} =1 When two or more particles contained directly or indirectly in the {particles} {term} {particles} {term} See Annotations (§3.13) {annotation} The XML representation for a model group schema component is either an <all> <choice> <sequence> XML Representation Summary all <all ID 1 0 1 {any attributes with non-schema namespace . . .} Content: annotation element <choice ID nonNegativeInteger unbounded nonNegativeInteger {any attributes with non-schema namespace . . .} Content: annotation element group choice sequence any <sequence ID nonNegativeInteger unbounded nonNegativeInteger {any attributes with non-schema namespace . . .} Content: annotation element group choice sequence any Each of the above items corresponds to a particle containing a model group, with properties as follows (unless minOccurs=maxOccurs=0 Particle Schema Component Property Representation {min occurs} The · · minOccurs [attribute] 1 {max occurs} unbounded maxOccurs [attribute] unbounded · · maxOccurs [attribute] 1 {term} A model group as given below: Model Group Schema Component Property Representation {compositor} One of all choice sequence {particles} A sequence of particles corresponding to all the <all> <choice> <sequence> <any> <group> <element> [children] {annotation} The annotation corresponding to the <annotation> [children] · · Schema Representation Constraint: Model Group Representation OK In addition to the conditions imposed on <all> <choice> <sequence> Constraints on Model Group Schema Components (§3.8.6) Constraints on Particle Schema Components (§3.9.6) Validation Rule: Element Sequence Valid [Definition:] partition · · case 1 If {compositor} sequence then · · n n {particles} · · {particles} Element Sequence Locally Valid (Particle) (§3.9.4) 2 If {compositor} choice then {particles} · · Element Sequence Locally Valid (Particle) (§3.9.4) 3 If {compositor} all then · · n n {particles} {particles} · · Element Sequence Locally Valid (Particle) (§3.9.4) {particles} · · {compositor} choice is · · {compositor} sequence all Note: {compositor} all Constraints on Model Group Schema Components (§3.8.6) · · {min occurs} 0 · · None as such. All model groups (see Model Groups (§3.8) Schema Component Constraint: Model Group Correct All 1 The values of the properties of a model group must be as described in the property tableau in The Model Group Schema Component (§3.8.1) Missing Sub-components (§5.3) 2 Circular groups are disallowed. That is, within the {particles} {term} Schema Component Constraint: All Group Limited When a model group has {compositor} all all 1 It appears only as the value of one or both of the following properties: 1.1 the {model group} 1.2 the {term} {max occurs} =1 {content type} 2 The {max occurs} {particles} 0 1 Schema Component Constraint: Element Declarations Consistent If the {particles} {particles} · · {name} {target namespace} all 1 all their {type definition} · · {name} 2 all their {type definition} {name} 3 all their {type definition} {target namespace} [Definition:] implicitly contains · · Schema Component Constraint: Unique Particle Attribution A content model must be formed such that during · · · · · · Note: [XML 1.0 (Second Edition)] Analysis of the Unique Particle Attribution Constraint (non-normative) (§H) Note: {target namespace} not The following constraints define relations appealed to elsewhere in this specification. Schema Component Constraint: Effective Total Range (all and sequence) The effective total range of a particle whose {term} {compositor} all sequence minimum The product of the particle's {min occurs} {min occurs} {particles} {particles} 0 {particles} maximum unbounded {max occurs} {particles} {particles} unbounded {max occurs} unbounded {max occurs} {max occurs} {particles} {particles} 0 {particles} Schema Component Constraint: Effective Total Range (choice) The effective total range of a particle whose {term} {compositor} choice minimum The product of the particle's {min occurs} {min occurs} {particles} {particles} 0 {particles} maximum unbounded {max occurs} {particles} {particles} unbounded {max occurs} unbounded {max occurs} {max occurs} {particles} {particles} 0 {particles} 3.9.1 The Particle Schema Component XML Representation of Particle Components Constraints on XML Representations of Particles Particle Validation Rules Particle Information Set Contributions Constraints on Particle Schema Components As described in Model Groups (§3.8) Example <xs:element ref="egg" minOccurs="12" maxOccurs="12"/>
<xs:group ref="omelette" minOccurs="0"/>
<xs:any maxOccurs="unbounded"/> XML representations which all involve particles, illustrating some of the possibilities for controlling occurrence. The particle schema component has the following properties: Schema Component Particle {min occurs} A non-negative integer. {max occurs} Either a non-negative integer or unbounded {term} One of a model group, a wildcard, or an element declaration. In general, multiple element information item [children] [children] mixed · · {term} {min occurs} [children] {min occurs} {min occurs} 0 Again, when the {term} [children] {max occurs} {max occurs} unbounded When the {term} {min occurs} {max occurs} {term} {particles} Particles correspond to all three elements ( <element> <schema> <group> <schema> <any> minOccurs maxOccurs two {term} XML Representation of Element Declaration Schema Components (§3.3.2) XML Representation of Model Group Schema Components (§3.8.2) XML Representation of Wildcard Schema Components (§3.10.2) None as such. Validation Rule: Element Sequence Locally Valid (Particle) For a sequence (possibly empty) of element information items to be locally · · case 1 If {term} then all 1.1 The length of the sequence must be greater than or equal to the {min occurs} 1.2 If {max occurs} {max occurs} 1.3 Each element information item in the sequence must be · · Item Valid (Wildcard) (§3.10.4) 2 If {term} then all 2.1 The length of the sequence must be greater than or equal to the {min occurs} 2.2 If {max occurs} {max occurs} 2.3 For each element information item in the sequence one 2.3.1 The element declaration is local (i.e. its {scope} global {abstract} false [namespace name] {target namespace} · · {target namespace} [namespace name] [local name] {name} · · Schema-Validity Assessment (Element) (§3.3.4) Assessment Outcome (Element) (§3.3.5) 2.3.2 The element declaration is top-level (i.e. its {scope} global {abstract} false [namespace name] {target namespace} · · {target namespace} [namespace name] [local name] {name} · · Schema-Validity Assessment (Element) (§3.3.4) Assessment Outcome (Element) (§3.3.5) 2.3.3 {scope} global {disallowed substitutions} substitution [local ] [namespace name] QName resolution (Instance) (§3.15.4) [Definition:] substituting declaration · · {disallowed substitutions} Substitution Group OK (Transitive) (§3.3.6) · · · · Schema-Validity Assessment (Element) (§3.3.4) Assessment Outcome (Element) (§3.3.5) 3 If {term} then all 3.1 There is a · · n n {min occurs} 3.2 If {max occurs} n {max occurs} 3.3 Each sub-sequence in the · · · · Element Sequence Valid (§3.8.4) Note: 1 2.3.3 not None as such. All particles (see Particles (§3.9) Schema Component Constraint: Particle Correct All 1 The values of the properties of a particle must be as described in the property tableau in The Particle Schema Component (§3.9.1) Missing Sub-components (§5.3) 2 If {max occurs} unbounded all 2.1 {min occurs} {max occurs} 2.2 {max occurs} The following constraints define relations appealed to elsewhere in this specification. Schema Component Constraint: Particle Valid (Extension) [Definition:] E valid extension B one 1 They are the same particle. 2 E {min occurs} {max occurs} =1 {term} sequence {particles} B {annotation} The approach to defining a type by restricting another type definition set out here is designed to ensure that types defined in this way are guaranteed to be a subset of the type they restrict. This is accomplished by requiring a clear mapping between the components of the base type definition and the restricting type definition. Permissible mappings are set out below via a set of recursive definitions, bottoming out in the obvious cases, e.g. where an (restricted) element declaration corresponds to another (base) element declaration with the same name and type but the same or wider range of occurrence. Note: Schema Component Constraint: Particle Valid (Restriction) [Definition:] R valid restriction B one 1 They are the same particle. 2 depending on the kind of particle, per the table below, with the qualifications that all 2.1 Any top-level element declaration particle (in R B {substitution group affiliation} · · choice {min occurs} {max occurs} {particles} {min occurs} {max occurs} 1 · · 2.2 Any pointless occurrences of <sequence> <choice> <all> <sequence> One 2.2.1 {particles} 2.2.2 All 2.2.2.1 The particle within which this <sequence> {max occurs} {min occurs} 1 2.2.2.2 One 2.2.2.2.1 The <sequence> {particles} 2.2.2.2.2 The particle within which this <sequence> {particles} <sequence> <all> One 2.2.1 {particles} 2.2.2 {particles} <choice> One 2.2.1 {particles} <choice> {min occurs} 0 2.2.2 All 2.2.2.1 The particle within which this <choice> {max occurs} {min occurs} 1 2.2.2.2 One 2.2.2.2.1 The <choice> {particles} 2.2.2.2.2 The particle within which this <choice> {particles} <choice> Base Particle elt any all choice sequence Derived Particle elt NameAnd- TypeOK NSCompat Recurse- AsIfGroup Recurse- AsIfGroup RecurseAs- IfGroup any Forbidden NSSubset Forbidden Forbidden Forbidden all Forbidden NSRecurse- CheckCardinality Recurse Forbidden Forbidden choice Forbidden NSRecurse- CheckCardinality Forbidden RecurseLax Forbidden seq- uence Forbidden NSRecurse- CheckCardinality Recurse- Unordered MapAndSum Recurse Schema Component Constraint: Occurrence Range OK For a particle's occurrence range to be a valid restriction of another's occurrence range all 1 Its {min occurs} {min occurs} 2 one 2.1 The other's {max occurs} unbounded 2.2 Both {max occurs} Schema Component Constraint: Particle Restriction OK (Elt:Elt -- NameAndTypeOK) For an element declaration particle to be a · · all 1 The declarations' {name} {target namespace} 2 R B Occurrence Range OK (§3.9.6) 3 One 3.1 Both B {scope} R {scope} global 3.2 All 3.2.1 Either B {nillable} true R {nillable} false 3.2.2 either B {value constraint} fixed R {value constraint} fixed 3.2.3 R {identity-constraint definitions} B {identity-constraint definitions} 3.2.4 R {disallowed substitutions} B {disallowed substitutions} 3.2.5 R {type definition} extension list union B {type definition} Type Derivation OK (Complex) (§3.4.6) Type Derivation OK (Simple) (§3.14.6) Note: {type definition} Schema Component Constraint: Particle Derivation OK (Elt:Any -- NSCompat) For an element declaration particle to be a · · all 1 The element declaration's {target namespace} · · {namespace constraint} Wildcard allows Namespace Name (§3.10.4) 2 R B Occurrence Range OK (§3.9.6) Schema Component Constraint: Particle Derivation OK (Elt:All/Choice/Sequence -- RecurseAsIfGroup) For an element declaration particle to be a · · all choice sequence B {min occurs} {max occurs} 1 {particles} · · Particle Derivation OK (All:All,Sequence:Sequence -- Recurse) (§3.9.6) Particle Derivation OK (Choice:Choice -- RecurseLax) (§3.9.6) Particle Derivation OK (All:All,Sequence:Sequence -- Recurse) (§3.9.6) all choice sequence Schema Component Constraint: Particle Derivation OK (Any:Any -- NSSubset) For a wildcard particle to be a · · all 1 R B Occurrence Range OK (§3.9.6) 2 R {namespace constraint} B {namespace constraint} Wildcard Subset (§3.10.6) 3 Unless B · · R {process contents} B {process contents} strict lax skip Note: · · {process contents} lax {process contents} skip Schema Component Constraint: Particle Derivation OK (All/Choice/Sequence:Any -- NSRecurseCheckCardinality) For a group particle to be a · · all 1 Every member of the {particles} · · Particle Valid (Restriction) (§3.9.6) 2 The effective total range of the group, as defined by Effective Total Range (all and sequence) (§3.8.6) all sequence Effective Total Range (choice) (§3.8.6) choice B Occurrence Range OK (§3.9.6) Schema Component Constraint: Particle Derivation OK (All:All,Sequence:Sequence -- Recurse) For an all sequence · · {compositor} all 1 R B Occurrence Range OK (§3.9.6) 2 There is a complete · · {particles} R {particles} B all 2.1 Each particle in the {particles} R · · {particles} B Particle Valid (Restriction) (§3.9.6) 2.2 All particles in the {particles} B {particles} R · · Particle Emptiable (§3.9.6) Note: · · all all [Definition:] order-preserving r R b B B r R B Schema Component Constraint: Particle Derivation OK (Choice:Choice -- RecurseLax) For a choice · · choice all 1 R B Occurrence Range OK (§3.9.6) 2 There is a complete · · {particles} R {particles} B {particles} R · · {particles} B Particle Valid (Restriction) (§3.9.6) Note: · · choice choice Schema Component Constraint: Particle Derivation OK (Sequence:All -- RecurseUnordered) For a sequence · · all all 1 R B Occurrence Range OK (§3.9.6) 2 There is a complete functional mapping from the particles in the {particles} R {particles} B all 2.1 No particle in the {particles} B {particles} R 2.2 Each particle in the {particles} R · · {particles} B Particle Valid (Restriction) (§3.9.6) 2.3 All particles in the {particles} B {particles} R · · Particle Emptiable (§3.9.6) Note: all Schema Component Constraint: Particle Derivation OK (Sequence:Choice -- MapAndSum) For a sequence · · choice all 1 There is a complete functional mapping from the particles in the {particles} R {particles} B {particles} R · · {particles} B Particle Valid (Restriction) (§3.9.6) 2 The pair consisting of the product of the {min occurs} R {particles} unbounded {max occurs} unbounded {max occurs} R {particles} B Occurrence Range OK (§3.9.6) Note: Note: Schema Component Constraint: Particle Emptiable [Definition:] emptiable one 1 Its {min occurs} 0 2 Its {term} Effective Total Range (all and sequence) (§3.8.6) all sequence Effective Total Range (choice) (§3.8.6) choice 0 3.10.1 The Wildcard Schema Component XML Representation of Wildcard Schema Components Constraints on XML Representations of Wildcards Wildcard Validation Rules Wildcard Information Set Contributions Constraints on Wildcard Schema Components In order to exploit the full potential for extensibility offered by XML plus namespaces, more provision is needed than DTDs allow for targeted flexibility in content models and attribute declarations. A wildcard provides for · · Example <xs:any processContents="skip"/>
<xs:any namespace="##other" processContents="lax"/>
<xs:any namespace="http://www.w3.org/1999/XSL/Transform"/>
<xs:any namespace="##targetNamespace"/>
<xs:anyAttribute namespace="http://www.w3.org/XML/1998/namespace"/> XML representations of the four basic types of wildcard, plus one attribute wildcard. The wildcard schema component has the following properties: Schema Component Wildcard {namespace constraint} One of any not · · · · {process contents} One of skip lax strict {annotation} Optional. An annotation. {namespace constraint} · · ( any ( not ( not · · (a set whose members are either namespace names or · · · · {process contents} · · strict There must be a top-level declaration for the item available, or the item must have an xsi:type · · skip No constraints at all: the item must simply be well-formed XML. lax If the item has a uniquely determined declaration available, it must be · · · · See Annotations (§3.13) {annotation} The XML representation for a wildcard schema component is an <any> <anyAttribute> <any> <complexType> <attributeGroup> <anyAttribute> XML Representation Summary any <any ID nonNegativeInteger unbounded nonNegativeInteger ##any ##other anyURI ##targetNamespace ##local lax skip strict {any attributes with non-schema namespace . . .} Content: annotation A particle containing a wildcard, with properties as follows (unless minOccurs=maxOccurs=0 Particle Schema Component Property Representation {min occurs} The · · minOccurs [attribute] 1 {max occurs} unbounded maxOccurs [attribute] unbounded · · maxOccurs [attribute] 1 {term} A wildcard as given below: Wildcard Schema Component Property Representation {namespace constraint} Dependent on the · · namespace [attribute] any ##any any ##other a pair of not · · targetNamespace [attribute] <schema> · · otherwise a set whose members are namespace names corresponding to the space-delimited substrings of the string, except 1 if one such substring is ##targetNamespace · · targetNamespace [attribute] <schema> · · 2 if one such substring is ##local · · {process contents} The · · processContents [attribute] strict {annotation} The annotation corresponding to the <annotation> [children] · · Wildcards are subject to the same ambiguity constraints ( Unique Particle Attribution (§3.8.6) Schema Representation Constraint: Wildcard Representation OK In addition to the conditions imposed on <any> Constraints on Model Group Schema Components (§3.8.6) Constraints on Particle Schema Components (§3.9.6) Validation Rule: Item Valid (Wildcard) For an element or attribute information item to be locally · · [namespace name] · · Wildcard allows Namespace Name (§3.10.4) case 1 If {process contents} lax then · · Assessment Outcome (Element) (§3.3.5) Schema-Validity Assessment (Element) (§3.3.4) Schema-Validity Assessment (Attribute) (§3.2.4) 2 If {process contents} strict then · · mustFind 3 If {process contents} skip then · · skip Validation Rule: Wildcard allows Namespace Name For a value which is either a namespace name or · · · · {namespace constraint} one 1 The constraint must be any 2 All 2.1 The constraint is a pair of not · · [Definition:] namespace test 2.2 The value must not be identical to the · · 2.3 The value must not be · · 3 The constraint is a set, and the value is identical to one of the members of the set. None as such. All wildcards (see Wildcards (§3.10) Schema Component Constraint: Wildcard Properties Correct The values of the properties of a wildcard must be as described in the property tableau in The Wildcard Schema Component (§3.10.1) Missing Sub-components (§5.3) The following constraints define a relation appealed to elsewhere in this specification. Schema Component Constraint: Wildcard Subset For a namespace constraint (call it sub super one 1 super any 2 All 2.1 sub not · · 2.2 super not 3 All 3.1 sub · · 3.2 One 3.2.1 super 3.2.2 super not · · · · sub Schema Component Constraint: Attribute Wildcard Union For a wildcard's {namespace constraint} O1 O2 case 1 If O1 O2 then 2 If O1 O2 any then any 3 If O1 O2 · · then 4 If · · then not · · 5 If O1 O2 not · · S then case 5.1 If S · · then any 5.2 If S · · then not · · 5.3 If S · · then 5.4 If S · · then O1 O2 not 6 If O1 O2 not · · · · S then case 6.1 If S · · then any 6.2 If S · · then not · · Schema Component Constraint: Attribute Wildcard Intersection For a wildcard's {namespace constraint} O1 O2 case 1 If O1 O2 then 2 If O1 O2 any then 3 If O1 O2 not · · · · then · · 4 If O1 O2 · · then 5 If then 6 If · · then 3.11.1 The Identity-constraint Definition Schema Component XML Representation of Identity-constraint Definition Schema Components Constraints on XML Representations of Identity-constraint Definitions Identity-constraint Definition Validation Rules Identity-constraint Definition Information Set Contributions Constraints on Identity-constraint Definition Schema Components Identity-constraint definition components provide for uniqueness and reference constraints with respect to the contents of multiple elements and attributes. Example <xs:key name="fullName"> <xs:selector xpath=".//person"/> <xs:field xpath="forename"/> <xs:field xpath="surname"/> </xs:key>
<xs:keyref name="personRef" refer="fullName"> <xs:selector xpath=".//personPointer"/> <xs:field xpath="@first"/> <xs:field xpath="@last"/> </xs:keyref>
<xs:unique name="nearlyID"> <xs:selector xpath=".//*"/> <xs:field xpath="@id"/> </xs:unique> XML representations for the three kinds of identity-constraint definitions. The identity-constraint definition schema component has the following properties: Schema Component Identity-constraint Definition {name} An NCName as defined by [XML-Namespaces] {target namespace} Either · · [XML-Namespaces] {identity-constraint category} One of key keyref unique {selector} A restricted XPath ( [XPath] {fields} A non-empty list of restricted XPath ( [XPath] {referenced key} Required if {identity-constraint category} keyref {identity-constraint category} key unique {annotation} Optional. A set of annotations. Identity-constraint definitions are identified by their {name} {target namespace} · · References to schema components across namespaces (§4.2.3) Informally, {identity-constraint category} ( unique {selector} {fields} ( key unique key ( keyref {selector} {fields} {referenced key} These constraints are specified along side the specification of types for the attributes and elements involved, i.e. something declared as of type integer may also serve as a key. Each constraint declaration has a name, which exists in a single symbol space for constraints. The equality and inequality conditions appealed to in checking these constraints apply to the value 3.0 3 Overall the augmentations to XML's ID/IDREF Functioning as a part of an identity-constraint is in addition to, not instead of, having a type; Not just attribute values, but also element content and combinations of values and content can be declared to be unique; Identity-constraints are specified to hold within the scope of particular elements; (Combinations of) attribute values and/or element content can be declared to be keys, that is, not only unique, but always present and non-nillable; The comparison between keyref {fields} key unique {fields} {selector} [XPath] {fields} {selector} {fields} In order to reduce the burden on implementers, in particular implementers of streaming processors, only restricted subsets of XPath expressions are allowed in {selector} {fields} Constraints on Identity-constraint Definition Schema Components (§3.11.6) Note: xsl:key See Annotations (§3.13) {annotation} The XML representation for an identity-constraint definition schema component is either a <key> <keyref> <unique> XML Representation Summary unique <unique ID name NCName {any attributes with non-schema namespace . . .} Content: annotation selector field <key ID name NCName {any attributes with non-schema namespace . . .} Content: annotation selector field <keyref ID name NCName refer QName {any attributes with non-schema namespace . . .} Content: annotation selector field <selector ID xpath a subset of XPath expression, see below {any attributes with non-schema namespace . . .} Content: annotation <field ID xpath a subset of XPath expression, see below {any attributes with non-schema namespace . . .} Content: annotation Identity-constraint Definition Schema Component Property Representation {name} The · · name [attribute] {target namespace} The · · targetNamespace [attribute] schema {identity-constraint category} One of key keyref unique {selector} A restricted XPath expression corresponding to the · · xpath [attribute] <selector> [children] {fields} A sequence of XPath expressions, corresponding to the · · xpath [attribute] <field> [children] {referenced key} If the item is a <keyref> · · · · refer [attribute] · · {annotation} The annotations corresponding to the <annotation> [children] <selector> <field> [children] · · Example <xs:element name="vehicle"> <xs:complexType> . . . <xs:attribute name="plateNumber" type="xs:integer"/> <xs:attribute name="state" type="twoLetterCode"/> </xs:complexType> </xs:element>
<xs:element name="state"> <xs:complexType> <xs:sequence> <xs:element name="code" type="twoLetterCode"/> <xs:element ref="vehicle" maxOccurs="unbounded"/> <xs:element ref="person" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType>
<xs:key name="reg"> <!-- vehicles are keyed by their plate within states --> <xs:selector xpath=".//vehicle"/> <xs:field xpath="@plateNumber"/> </xs:key> </xs:element>
<xs:element name="root"> <xs:complexType> <xs:sequence> . . . <xs:element ref="state" maxOccurs="unbounded"/> . . . </xs:sequence> </xs:complexType>
<xs:key name="state"> <!-- states are keyed by their code --> <xs:selector xpath=".//state"/> <xs:field xpath="code"/> </xs:key>
<xs:keyref name="vehicleState" refer="state"> <!-- every vehicle refers to its state --> <xs:selector xpath=".//vehicle"/> <xs:field xpath="@state"/> </xs:keyref>
<xs:key name="regKey"> <!-- vehicles are keyed by a pair of state and plate --> <xs:selector xpath=".//vehicle"/> <xs:field xpath="@state"/> <xs:field xpath="@plateNumber"/> </xs:key>
<xs:keyref name="carRef" refer="regKey"> <!-- people's cars are a reference --> <xs:selector xpath=".//car"/> <xs:field xpath="@regState"/> <xs:field xpath="@regPlate"/> </xs:keyref>
</xs:element>
<xs:element name="person"> <xs:complexType> <xs:sequence> . . . <xs:element name="car"> <xs:complexType> <xs:attribute name="regState" type="twoLetterCode"/> <xs:attribute name="regPlate" type="xs:integer"/> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> A state code vehicle person vehicle plateNumber state code plateNumber state plateNumber key vehicle person car regState regPlate vehicle carRef vehicle state state code Schema Representation Constraint: Identity-constraint Definition Representation OK In addition to the conditions imposed on <key> <keyref> <unique> Constraints on Identity-constraint Definition Schema Components (§3.11.6) Validation Rule: Identity-constraint Satisfied For an element information item to be locally · · all 1 The {selector} [XPath] [Definition:] target node set 2 Each node in the · · 3 For each node in the · · {fields} [Definition:] [XML Schemas: Datatypes] [schema normalized value] key-sequence 4 [Definition:] · · {fields} qualified node set case 4.1 If {identity-constraint category} unique then · · · · Equal [XML Schemas: Datatypes] 4.2 If {identity-constraint category} key then all 4.2.1 The · · · · · · · · vice versa 4.2.2 No two members of the · · · · Equal [XML Schemas: Datatypes] 4.2.3 · · · · · · {nillable} true 4.3 If {identity-constraint category} keyref then · · keyref member · · {referenced key} [identity-constraint table] Identity-constraint Table (§3.11.5) · · keyref member's · · Equal [XML Schemas: Datatypes] Note: [schema normalized value] · · default fixed · · Note: keyref 4.3 · · · · · · Note: · · 4.2.3 Element Declaration (§3.3.5) {nillable} Schema Information Set Contribution: Identity-constraint Table [Definition:] eligible identity-constraint 4.1 4.2 Identity-constraint Satisfied (§3.11.4) [children] [identity-constraint table] [Definition:] node table · · · · · · PSVI Contributions for [identity-constraint table] one Identity-constraint Binding · · PSVI Contributions for [definition] The · · [node table] A · · · · k n one 1 · · [definition] Identity-constraint Binding [identity-constraint table] [children] · · k n 2 n · · k · · [definition] · · 1 1 · · Note: keyref · · Identity-constraint Binding Identity-constraint Satisfied (§3.11.4) not [identity-constraint table] · · · · as if All identity-constraint definitions (see Identity-constraint Definitions (§3.11) Schema Component Constraint: Identity-constraint Definition Properties Correct All 1 The values of the properties of an identity-constraint definition must be as described in the property tableau in The Identity-constraint Definition Schema Component (§3.11.1) Missing Sub-components (§5.3) 2 If the {identity-constraint category} keyref {fields} {fields} {referenced key} Schema Component Constraint: Selector Value OK All 1 The {selector} [XPath] 2 One 2.1 It must conform to the following extended BNF: Selector XPath expressions Selector ::= Path Path Path ::= ('.//')? Step Step Step ::= '.' | NameTest NameTest ::= QName NCName 2.2 It must be an XPath expression involving the child whitespace token Lexical productions token ::= '.' | '/' | '//' | '|' | '@' | NameTest whitespace ::= S Schema Component Constraint: Fields Value OK All 1 Each member of the {fields} [XPath] 2 One 2.1 It must conform to the extended BNF given above for Selector Path in Field XPath expressions Path ::= ('.//')? ( Step Step NameTest 2.2 It must be an XPath expression involving the child attribute whitespace token 3.12.1 The Notation Declaration Schema Component XML Representation of Notation Declaration Schema Components Constraints on XML Representations of Notation Declarations Notation Declaration Validation Rules Notation Declaration Information Set Contributions Constraints on Notation Declaration Schema Components Notation declarations reconstruct XML 1.0 NOTATION declarations. Example <xs:notation name="jpeg" public="image/jpeg" system="viewer.exe"> The XML representation of a notation declaration. The notation declaration schema component has the following properties: Schema Component Notation Declaration {name} An NCName as defined by [XML-Namespaces] {target namespace} Either · · [XML-Namespaces] {system identifier} Optional if {public identifier} {public identifier} Optional if {system identifier} [XML 1.0 (Second Edition)] {annotation} Optional. An annotation. Notation declarations do not participate in · · · · NOTATION See Annotations (§3.13) {annotation} The XML representation for a notation declaration schema component is a <notation> XML Representation Summary notation <notation ID name NCName token anyURI {any attributes with non-schema namespace . . .} Content: annotation Notation Declaration Schema Component Property Representation {name} The · · name [attribute] {target namespace} The · · targetNamespace [attribute] schema {system identifier} The · · system [attribute] · · {public identifier} The · · public [attribute] {annotation} The annotation corresponding to the <annotation> [children] · · Example <xs:notation name="jpeg" public="image/jpeg" system="viewer.exe" />
<xs:element name="picture"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:hexBinary"> <xs:attribute name="pictype"> <xs:simpleType> <xs:restriction base="xs:NOTATION"> <xs:enumeration value="jpeg"/> <xs:enumeration value="png"/> . . . </xs:restriction> </xs:simpleType> </xs:attribute> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element>
<picture pictype="jpeg">...</picture> Schema Representation Constraint: Notation Definition Representation OK In addition to the conditions imposed on <notation> Constraints on Notation Declaration Schema Components (§3.12.6) None as such. Schema Information Set Contribution: Validated with Notation Whenever an attribute information item is · · NOTATION · · PSVI Contributions for [notation] An · · {name} {target namespace} · · · · QName Interpretation (§3.15.3) · · PSVI Contributions for [notation system] The value of the {system identifier} [notation public] The value of the {public identifier} Note: does All notation declarations (see Notation Declarations (§3.12) Schema Component Constraint: Notation Declaration Correct The values of the properties of a notation declaration must be as described in the property tableau in The Notation Declaration Schema Component (§3.12.1) Missing Sub-components (§5.3) 3.13.1 The Annotation Schema Component XML Representation of Annotation Schema Components Constraints on XML Representations of Annotations Annotation Validation Rules Annotation Information Set Contributions Constraints on Annotation Schema Components Annotations provide for human- and machine-targeted annotations of schema components. Example <xs:simpleType fn:note="special"> <xs:annotation> <xs:documentation>A type for experts only</xs:documentation> <xs:appinfo> <fn:specialHandling>checkForPrimes</fn:specialHandling> </xs:appinfo> </xs:annotation> XML representations of three kinds of annotation. The annotation schema component has the following properties: Schema Component Annotation {application information} A sequence of element information items. {user information} A sequence of element information items. {attributes} A sequence of attribute information items. {user information} {application information} source · · not {user information} xml:lang {attributes} Annotations do not participate in · · · · cannot · · Annotation of schemas and schema components, with material for human or computer consumption, is provided for by allowing application information and human information at the beginning of most major schema elements, and anywhere at the top level of schemas. The XML representation for an annotation schema component is an <annotation> XML Representation Summary annotation <annotation ID {any attributes with non-schema namespace . . .} Content: appinfo documentation <appinfo anyURI {any attributes with non-schema namespace . . .} Content: {any} <documentation anyURI language {any attributes with non-schema namespace . . .} Content: {any} Annotation Schema Component Property Representation {application information} A sequence of the <appinfo> [children] {user information} A sequence of the <documentation> [children] {attributes} A sequence of attribute information items, namely those allowed by the attribute wildcard in the type definition for the <annotation> The annotation component corresponding to the <annotation> {user information} {application information} {attributes} Schema Representation Constraint: Annotation Definition Representation OK In addition to the conditions imposed on <annotation> Constraints on Annotation Schema Components (§3.13.6) None as such. None as such: the addition of annotations to the · · · · All annotations (see Annotations (§3.13) Schema Component Constraint: Annotation Correct The values of the properties of an annotation must be as described in the property tableau in The Annotation Schema Component (§3.13.1) Missing Sub-components (§5.3) 3.14.1 (non-normative) The Simple Type Definition Schema Component (non-normative) XML Representation of Simple Type Definition Schema Components (non-normative) Constraints on XML Representations of Simple Type Definitions Simple Type Definition Validation Rules Simple Type Definition Information Set Contributions Constraints on Simple Type Definition Schema Components Built-in Simple Type Definition Note: [XML Schemas: Datatypes] Simple type definitions provide for constraining character information item [children] Example <xs:simpleType name="fahrenheitWaterTemp"> <xs:restriction base="xs:number"> <xs:fractionDigits value="2"/> <xs:minExclusive value="0.00"/> <xs:maxExclusive value="100.00"/> </xs:restriction> </xs:simpleType> The XML representation of a simple type definition. The simple type definition schema component has the following properties: Schema Component Simple Type Definition {name} Optional. An NCName as defined by [XML-Namespaces] {target namespace} Either · · [XML-Namespaces] {base type definition} A simple type definition, which may be the · · {facets} A set of constraining facets. {fundamental facets} A set of fundamental facets. {final} A subset of { extension list restriction union {variety} One of { atomic list union {variety} atomic {primitive type definition} A built-in primitive simple type definition. list {item type definition} A simple type definition. union {member type definitions} A non-empty sequence of simple type definitions. {annotation} Optional. An annotation. Simple types are identified by their {name} {target namespace} {name} · · {name} {target namespace} xsi:type (§2.6.1) <element> <attribute> References to schema components across namespaces (§4.2.3) Note: {name} ipso facto [(local) name] · · Element Declarations (§3.3) Attribute Declarations (§3.2) A simple type definition with an empty specification for {final} {base type definition} {item type definition} {member type definitions} extension restriction list union {variety} atomic list union [XML Schemas: Datatypes] As described in Type Definition Hierarchy (§2.2.1.1) · · {base type definition} · · atomic {primitive type definition} {facets} [XML Schemas: Datatypes] atomic {primitive type definition} · · {primitive type definition} {facets} As specified in [XML Schemas: Datatypes] list · · {item type definition} list [XML Schemas: Datatypes] {facets} A union · · {member type definitions} list {facets} The · · not · · See Annotations (§3.13) {annotation} Note: [XML Schemas: Datatypes] XML Representation Summary simpleType <simpleType #all list union restriction ID NCName {any attributes with non-schema namespace . . .} Content: annotation restriction list union <restriction QName ID {any attributes with non-schema namespace . . .} Content: annotation simpleType minExclusive minInclusive maxExclusive maxInclusive totalDigits fractionDigits length minLength maxLength enumeration whiteSpace pattern <list ID QName {any attributes with non-schema namespace . . .} Content: annotation simpleType <union ID QName {any attributes with non-schema namespace . . .} Content: annotation simpleType Simple Type Definition Schema Component Property Representation {name} The · · name [attribute] · · {target namespace} The · · targetNamespace [attribute] <schema> · · {base type definition} The appropriate case 1 If <restriction> then · · · · base [attribute] <restriction> <simpleType> [children] <restriction> 2 If <list> <union> then · · {final} As for the {prohibited substitutions} final finalDefault [attributes] block blockDefault [attributes] { extension restriction list union } {variety} If the <list> list <union> union <restriction> {variety} {base type definition} If the {variety} atomic Atomic Simple Type Definition Schema Component Property Representation {primitive type definition} The built-in primitive type definition from which the {base type definition} {facets} A set of facet components · · {facets} {base type definition} [children] <restriction> Simple Type Restriction (Facets) (§3.14.6) If the {variety} list List Simple Type Definition Schema Component Property Representation {item type definition} The appropriate case 1 If <list> then · · · · itemType [attribute] <list> <simpleType> [children] <list> 2 If <restriction> then {item type definition} {base type definition} {facets} If the <restriction> · · {facets} {base type definition} [children] <restriction> Simple Type Restriction (Facets) (§3.14.6) If the {variety} union Union Simple Type Definition Schema Component Property Representation {member type definitions} The appropriate case 1 If <union> then [Definition:] explicit members · · · · memberTypes [attribute] <simpleType> [children] <union> · · {member type definitions} 2 If <restriction> then {member type definitions} {base type definition} {facets} If the <restriction> · · {facets} {base type definition} [children] <restriction> Simple Type Restriction (Facets) (§3.14.6) Schema Representation Constraint: Simple Type Definition Representation OK In addition to the conditions imposed on <simpleType> all 1 The corresponding simple type definition, if any, must satisfy the conditions set out in Constraints on Simple Type Definition Schema Components (§3.14.6) 2 If the <restriction> base [attribute] <simpleType> [children] 3 If the <list> itemType [attribute] <simpleType> [children] 4 Circular union type definition is disallowed. That is, if the <union> memberTypes [attribute] <simpleType> Validation Rule: String Valid For a string to be locally · · all 1 It is schema-valid with respect to that definition as defined by Datatype Valid [XML Schemas: Datatypes] 2 The appropriate case 2.1 If ENTITY ENTITY Type Derivation OK (Simple) (§3.14.6) then · · 2.2 If ENTITIES ENTITIES Type Derivation OK (Simple) (§3.14.6) then · · 2.3 otherwise [Definition:] declared entity name [name] [unparsedEntities] · · None as such. All simple type definitions other than the · · Simple Type Definitions (§3.14) Schema Component Constraint: Simple Type Definition Properties Correct All 1 The values of the properties of a simple type definition must be as described in the property tableau in Datatype definition Missing Sub-components (§5.3) 2 All simple type definitions must be derived ultimately from the · · · · {base type definition} 3 The {final} {base type definition} restriction Schema Component Constraint: Derivation Valid (Restriction, Simple) The appropriate case 1 If {variety} atomic then all 1.1 The {base type definition} 1.2 The {final} {base type definition} restriction 1.3 For each facet in the {facets} DF all 1.3.1 DF {primitive type definition} 3.2 Primitive datatypes 1.3.2 If there is a facet of the same kind in the {facets} {base type definition} BF DF {value} BF {value} [XML Schemas: Datatypes] 2 If {variety} list then all 2.1 The {item type definition} {variety} atomic union {member type definitions} atomic 2.2 2.3 The appropriate case 2.3.1 If {base type definition} · · then all 2.3.1.1 The {final} {item type definition} list 2.3.1.2 The {facets} whiteSpace 2.3.2 otherwise all 2.3.2.1 The {base type definition} {variety} list 2.3.2.2 The {final} {base type definition} restriction 2.3.2.3 The {item type definition} {base type definition} {item type definition} Type Derivation OK (Simple) (§3.14.6) 2.3.2.4 Only length minLength maxLength whiteSpace pattern enumeration {facets} 2.3.2.5 For each facet in the {facets} DF {facets} {base type definition} BF DF {value} BF {value} [XML Schemas: Datatypes] 3 If {variety} union then all 3.1 The {member type definitions} {variety} atomic list 3.2 3.3 The appropriate case 3.3.1 If {base type definition} · · then all 3.3.1.1 All of the {member type definitions} {final} union 3.3.1.2 The {facets} 3.3.2 otherwise all 3.3.2.1 The {base type definition} {variety} union 3.3.2.2 The {final} {base type definition} restriction 3.3.2.3 The {member type definitions} {base type definition} {member type definitions} Type Derivation OK (Simple) (§3.14.6) 3.3.2.4 Only pattern enumeration {facets} 3.3.2.5 For each facet in the {facets} DF {facets} {base type definition} BF DF {value} BF {value} [XML Schemas: Datatypes] [Definition:] Derivation Valid (Restriction, Simple) (§3.14.6) valid restriction · · The following constraint defines relations appealed to elsewhere in this specification. Schema Component Constraint: Type Derivation OK (Simple) For a simple type definition (call it D B extension restriction list union restriction one 1 2 All 2.1 restriction {final} {base type definition} 2.2 One 2.2.1 D · · B 2.2.2 D · · · · B 2.2.3 D {variety} list union B · · 2.2.4 B {variety} union D B {member type definitions} Note: 1 (§3.4.6) Schema Component Constraint: Simple Type Restriction (Facets) For a simple type definition (call it R B S all 1 The {variety} R B 2 If {variety} atomic {primitive type definition} R B 3 {facets} R S {facets} B S {facets} B {facets} B enumeration pattern 4.3 Constraining Facets [Definition:] 3 {facets} R constitute a restriction {facets} B S There is a simple type definition nearly equivalent to the · · Simple Type Definition of the Ur-Type Property Value {name} anySimpleType {target namespace} http://www.w3.org/2001/XMLSchema {base type definition} · · {final} The empty set {variety} · · The · · {base type definition} · · its {base type definition} · · Simple Type Definition Properties Correct (§3.14.6) {variety} Simple type definitions for all the built-in primitive datatypes, namely string boolean float double number dateTime duration time date gMonth gMonthDay gDay gYear gYearMonth hexBinary base64Binary anyURI Primitive Datatypes [XML Schemas: Datatypes] {target namespace} http://www.w3.org/2001/XMLSchema atomic {variety} {facets} · · · · {primitive type definition} Similarly, simple type definitions for all the built-in derived datatypes (see the Derived Datatypes [XML Schemas: Datatypes] [XML Schemas: Datatypes] Schema for Schemas (normative) (§A) 3.15.1 The Schema Itself XML Representations of Schemas Constraints on XML Representations of Schemas Validation Rules for Schemas as a Whole Schema Information Set Contributions Constraints on Schemas as a Whole A schema consists of a set of schema components. Example <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.com/example"> . . . </xs:schema> The XML representation of the skeleton of a schema. At the abstract level, the schema itself is just a container for its components. Schema Component Schema {type definitions} A set of named simple and complex type definitions. {attribute declarations} A set of named (top-level) attribute declarations. {element declarations} A set of named (top-level) element declarations. {attribute group definitions} A set of named attribute group definitions. {model group definitions} A set of named model group definitions. {notation declarations} A set of notation declarations. {annotations} A set of annotations. A schema is represented in XML by one or more · · <schema> · · {target namespace} · · <import> {target namespace} Import Constraints and Semantics (§4.2.3) XML Representation Summary schema <schema qualified unqualified #all extension restriction substitution qualified unqualified #all extension restriction list union ID anyURI token language {any attributes with non-schema namespace . . .} Content: include import redefine annotation simpleType complexType group attributeGroup element attribute notation annotation Schema Schema Component Property Representation {type definitions} The simple and complex type definitions corresponding to all the <simpleType> <complexType> [children] Assembling a schema for a single target namespace from multiple schema definition documents (§4.2.1) References to schema components across namespaces (§4.2.3) {attribute declarations} The (top-level) attribute declarations corresponding to all the <attribute> [children] Assembling a schema for a single target namespace from multiple schema definition documents (§4.2.1) References to schema components across namespaces (§4.2.3) {element declarations} The (top-level) element declarations corresponding to all the <element> [children] Assembling a schema for a single target namespace from multiple schema definition documents (§4.2.1) References to schema components across namespaces (§4.2.3) {attribute group definitions} The attribute group definitions corresponding to all the <attributeGroup> [children] Assembling a schema for a single target namespace from multiple schema definition documents (§4.2.1) References to schema components across namespaces (§4.2.3) {model group definitions} The model group definitions corresponding to all the <group> [children] Assembling a schema for a single target namespace from multiple schema definition documents (§4.2.1) References to schema components across namespaces (§4.2.3) {notation declarations} The notation declarations corresponding to all the <notation> [children] Assembling a schema for a single target namespace from multiple schema definition documents (§4.2.1) References to schema components across namespaces (§4.2.3) {annotations} The annotations corresponding to all the <annotation> [children] Note that none of the attribute information items displayed above correspond directly to properties of schemas. The blockDefault finalDefault attributeFormDefault elementFormDefault targetNamespace id version The definition of the schema abstract data model in XML Schema Abstract Data Model (§2.2) {target namespace} <schema> {target namespace} targetNamespace Since the empty string is not a legal namespace name, supplying an empty string for targetNamespace not · · {target namespace} targetNamespace Note: {target namespace} Although the example schema at the beginning of this section might be a complete XML document, <schema> Aside from <include> <import> <schema> <annotation> Reference to schema components from a schema document is managed in a uniform way, whether the component corresponds to an element information item from the same schema document or is imported ( References to schema components across namespaces (§4.2.3) · · [Definition:] QName [XML-Namespaces] QName [XML Schemas: Datatypes] [Definition:] NCName [XML-Namespaces] NCName [XML Schemas: Datatypes] In each of the XML representation expositions in the following sections, an attribute is shown as having type QName Example <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns="http://www.example.com" targetNamespace="http://www.example.com"> . . .
<xs:element name="elem1" type="Address"/>
<xs:element name="elem2" type="xhtml:blockquote"/>
<xs:attribute name="attr1" type="xsl:quantity"/> . . . </xs:schema> The first of these is most probably a local reference, i.e. a reference to a type definition corresponding to a <complexType> References to schema components across namespaces (§4.2.3) The names of schema components such as type definitions and element declarations are not of type ID There is currently no provision in the definition of the interpretation of fragment identifiers for the text/xml [XPointer] #xpointer(xs:schema/xs:element[@name="person"]) person Short-form fragment identifiers may also be used in some cases, that is when a DTD or XML Schema is available for the schema in question, and the provision of an id is ID It is a matter for applications to specify whether they interpret document-level references of either of the above varieties as being to the relevant element information item (i.e. without special recognition of the relation of schema documents to schema components) or as being to the corresponding schema component. Schema Representation Constraint: QName Interpretation Where the type of an attribute information item in a document involved in · · · · · · [Definition:] local name [Definition:] namespace name · · · · [in-scope namespaces] [XML-Namespaces] case 1 If · · then all 1.1 There must be a namespace in the [in-scope namespaces] [prefix] 1.2 its · · [namespace name] 1.3 Its · · · · ':' 2 otherwise · · all 2.1 its · · · · 2.2 The appropriate case 2.2.1 If [in-scope namespaces] [prefix] then · · [namespace name] 2.2.2 otherwise · · · · [in-scope namespaces] [ namespace attributes] [Definition:] resolve · · QName resolution (Schema Document) (§3.15.3) Schema Representation Constraint: QName resolution (Schema Document) For a · · all 1 That component is a member of the value of the appropriate property of the schema which corresponds to the schema document within which the · · case 1.1 If then {type definitions} 1.2 If then {attribute declarations} 1.3 If then {element declarations} 1.4 If then {attribute group definitions} 1.5 If then {model group definitions} 1.6 If then {notation declarations} 2 The component's {name} · · · · 3 The component's {target namespace} · · · · 4 The appropriate case 4.1 If · · · · · · then one 4.1.1 The <schema> · · targetNamespace [attribute] 4.1.2 The <schema> <import> namespace [attribute] 4.2 otherwise · · · · one 4.2.1 The · · targetNamespace [attribute] <schema> · · 4.2.2 The · · namespace [attribute] <import> <schema> As the discussion above at Schema Component Details (§3) · · · · Validation Rule: QName resolution (Instance) A pair of a local name and a namespace name (or · · · · · · case 1 If then {type definitions} 2 If then {attribute declarations} 3 If then {element declarations} 4 If then {attribute group definitions} 5 If then {model group definitions} 6 If then {notation declarations} {name} {target namespace} Schema Information Set Contribution: Schema Information Schema components provide a wealth of information about the basis of · · · · [Definition:] item isomorphic · · · · PSVI Contributions for [schema information] A set of namespace schema information {target namespace} · · {target namespace} namespace schema information PSVI Contributions for [schema namespace] A namespace name or · · [schema components] A (possibly empty) set of schema component information items, each one an · · {target namespace} [schema namespace] · · [schema documents] A (possibly empty) set of schema document targetNamespace [schema namespace] targetNamespace · · <include> targetNamespace Assembling a schema for a single target namespace from multiple schema definition documents (§4.2.1) PSVI Contributions for [document location] Either a URI reference, if available, otherwise · · [document] A document information item, if available, otherwise · · {schema components} · · is · · Schema Information Set Contribution: ID/IDREF Table In the · · ID/IDREF binding · · PSVI Contributions for [ID/IDREF table] A (possibly empty) set of ID/IDREF binding [Definition:] eligible item set all 1 its [validation context] · · 2 it was successfully · · Attribute Locally Valid (§3.2.4) Element Locally Valid (Element) (§3.3.4) {type definition} {type definition} ID IDREF IDREFS ID/IDREF binding [ID/IDREF table] one 1 the · · · · ID IDREF 2 one of the items in the · · · · IDREFS ID/IDREF binding PSVI Contributions for [id] The string identified above. [binding] A set consisting of every element information item for which all 1 its [validation context] · · 2 it has an attribute information item in its [attributes] [children] · · ID [schema normalized value] [id] ID/IDREF binding Validation Root Valid (ID/IDREF) (§3.3.4) Note: ID/IDREF binding Validation Root Valid (ID/IDREF) (§3.3.4) not · · · · as if All schemas (see Schemas as a Whole (§3.15) Schema Component Constraint: Schema Properties Correct All 1 The values of the properties of a schema must be as described in the property tableau in The Schema Itself (§3.15.1) Missing Sub-components (§5.3) 2 {type definitions} {element declarations} {attribute group definitions} {model group definitions} {notation declarations} {name} {target namespace} This chapter defines the mechanisms by which this specification establishes the necessary precondition for · · Conformance (§2.4) Schemas and Schema-validity Assessment (§5) · · The · · Schema representation: the connections between XML representations and schema components, including the relationships between namespaces and schema components; XML Schema web-interoperability guidelines: instance->schema and schema->schema connections for the WWW. Layer 1 specifies the manner in which a schema composed of schema components can be applied to in the · · <schema> The fundamental purpose of the · · · · · · · · not · · · · post facto · · As specified above, each schema component is associated directly or indirectly with a target namespace, or explicitly with no namespace. In the case of multi-namespace documents, components for more than one target namespace will co-exist in a schema. Processors have the option to assemble (and perhaps to optimize or pre-compile) the entire schema prior to the start of an · · The processor succeed in locating the · · · · · · no definition or declaration changes once it has been established; if the processor chooses to acquire declarations and definitions dynamically, that there be no side effects of such dynamic acquisition that would cause the results of · · Note: · · <schema> The obligation of a schema-aware processor as far as the · · · · Assessing Schema-Validity (§5.2) · · · · Although · · · · same · · 4.2.1 Assembling a schema for a single target namespace from multiple schema definition documents Including modified component definitions References to schema components across namespaces The sub-sections of Schema Component Details (§3) · · not Note: · · Conformance (§2.4) Note: Schema components for a single target namespace can be assembled from several · · <schema> XML Representation Summary include <include ID schemaLocation anyURI {any attributes with non-schema namespace . . .} Content: annotation A <schema> <include> schemaLocation · · <schema> The · · <schema> [children] · · <include> targetNamespace <include> targetNamespace <include> <include> targetNamespace Schema Representation Constraint: Inclusion Constraints and Semantics In addition to the conditions imposed on <include> all 1 · · schemaLocation [attribute] one 1.1 application/xml text/xml <schema> 1.2 It resolves to a <schema> <include> <schema> SII I <include> <schema> SII’ 2 One 2.1 SII targetNamespace [attribute] · · · · targetNamespace [attribute] SII’ [attribute] 2.2 SII SII’ targetNamespace [attribute] 2.3 SII targetNamespace [attribute] SII’ 3 The appropriate case 3.1 If 2.1 2.2 then SII’ [children] · · I 3.2 If 2.3 then <include> <schema> [children] · · I · · · · targetNamespace [attribute] SII’ · · 3.2.1 The {target namespace} code qualified 3.2.2 The {namespace constraint} not · · schemaLocation [attribute] is · · Missing Sub-components (§5.3) · · · · · · · · · · · · <include> 3.2 Note: <include> 2 Schema Properties Correct (§3.15.6) <include> In order to provide some support for evolution and versioning, it is possible to incorporate components corresponding to a schema document with modifications XML Representation Summary redefine <redefine ID schemaLocation anyURI {any attributes with non-schema namespace . . .} Content: annotation simpleType complexType group attributeGroup A <schema> <redefine> schemaLocation · · <schema> The · · <schema> [children] · · <redefine> targetNamespace <redefine> targetNamespace <redefine> <redefine> targetNamespace The definitions within the <redefine> <redefine> in terms of themselves Type definitions must use themselves as their base type definition; Attribute group definitions and model group definitions must be supersets or subsets of their original definitions, either by including exactly one reference to themselves or by containing only (possibly restricted) components which appear in a corresponding way in their <redefine> Not all the components of the <redefine> This mechanism is intended to provide a declarative and modular approach to schema modification, with functionality no different except in scope from what would be achieved by wholesale text copying and redefinition by editing. In particular redefining a type is not guaranteed to be side-effect free: it may have unexpected impacts on other type definitions which are based on the redefined one, even to the extent that some such definitions become ill-formed. Note: Example v1.xsd: <xs:complexType name="personName"> <xs:sequence> <xs:element name="title" minOccurs="0"/> <xs:element name="forename" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType>
<xs:element name="addressee" type="personName"/>
v2.xsd: <xs:redefine schemaLocation="v1.xsd"> <xs:complexType name="personName"> <xs:complexContent> <xs:extension base="personName"> <xs:sequence> <xs:element name="generation" minOccurs="0"/> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType> </xs:redefine>
<xs:element name="author" type="personName"/> The schema corresponding to v2.xsd v1.xsd personName personName generation author addressee Schema Representation Constraint: Redefinition Constraints and Semantics In addition to the conditions imposed on <redefine> all 1 If there are any element information items among the [children] <annotation> · · schemaLocation [attribute] 2 If the · · schemaLocation [attribute] one 2.1 it resolves to (a fragment of) a resource which is an XML document (see clause 1.1 <schema> 2.2 It resolves to a <schema> <redefine> <schema> SII I <redefine> <schema> SII’ 3 One 3.1 SII targetNamespace [attribute] · · · · targetNamespace [attribute] SII’ [attribute] 3.2 SII SII’ targetNamespace [attribute] 3.3 SII targetNamespace [attribute] SII’ 4 The appropriate case 4.1 If 3.1 3.2 then SII’ [children] · · I Individual Component Redefinition (§4.2.2) 4.2 If 3.3 then SII’ [children] · · I Individual Component Redefinition (§4.2.2) · · · · targetNamespace [attribute] SII’ 3.2 Inclusion Constraints and Semantics (§4.2.1) 5 Within the [children] <simpleType> <restriction> [children] <complexType> restriction extension [children] · · base [attribute] · · name 6 Within the [children] <group> case 6.1 If <group> · · ref [attribute] · · name then all 6.1.1 It must have exactly one such group. 6.1.2 The · · minOccurs maxOccurs [attribute] 1 · · 6.2 If then all 6.2.1 The · · name · · I 6.2.2 The {model group} XML Representation of Model Group Definition Schema Components (§3.7.2) · · {model group} I Particle Valid (Restriction) (§3.9.6) 7 Within the [children] <attributeGroup> case 7.1 If <attributeGroup> · · ref [attribute] · · name then 7.2 If then all 7.2.1 The · · name · · I 7.2.2 The {attribute uses} {attribute wildcard} XML Representation of Attribute Group Definition Schema Components (§3.6.2) · · {attribute uses} {attribute wildcard} I 2 3 4 Derivation Valid (Restriction, Complex) (§3.4.6) I Note: 7.2 {attribute uses} <attribute> [children] <redefine> <attributeGroup> <redefine> {attribute wildcard} <anyAttribute> Schema Representation Constraint: Individual Component Redefinition Corresponding to each non- <annotation> [children] <redefine> <redefine> 1 The <simpleType> <complexType> [children] 1.1 One component which corresponds to the top-level definition item with the same name <redefine> Schema Component Details (§3) {name} · · 1.2 One component which corresponds to the information item itself, as defined in Schema Component Details (§3) {base type definition} <redefine> <redefine> 2 The <group> <attributeGroup> [children] Schema Component Details (§3) ref [attribute] · · name I <redefine> Note: <redefine> 2 Schema Properties Correct (§3.15.6) <redefine> As described in XML Schema Abstract Data Model (§2.2) Two things are required: not only a means of addressing such foreign components but also a signal to schema-aware processors that a schema document contains such references: XML Representation Summary import <import ID anyURI anyURI {any attributes with non-schema namespace . . .} Content: annotation The <import> · · targetNamespace · · namespace [attribute] · · The · · schemaLocation · · schemaLocation [attribute] Layer 3: Schema Document Access and Web-interoperability (§4.3) schemaLocation · · <import> Note: namespace schemaLocation [attribute] <import/> Example The same namespace may be used both for real work, and in the course of defining schema components in terms of foreign components: <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:html="http://www.w3.org/1999/xhtml" targetNamespace="uri:mywork" xmlns:my="uri:mywork">
<import namespace="http://www.w3.org/1999/xhtml"/>
<annotation> <documentation> <html:p>[Some documentation for my schema]</html:p> </documentation> </annotation>
. . .
<complexType name="myType"> <sequence> <element ref="html:p" minOccurs="0"/> </sequence> . . . </complexType>
<element name="myElt" type="my:myType"/> </schema> The treatment of references as · · either or Schema Representation Constraint: Import Constraints and Semantics In addition to the conditions imposed on <import> all 1 The appropriate case 1.1 If namespace [attribute] then · · · · <schema> targetNamespace [attribute] 1.2 If namespace [attribute] then <schema> targetNamespace [attribute] 2 · · schemaLocation namespace [attributes] Schema Document Location Strategy (§4.3.2) one 2.1 The referent is (a fragment of) a resource which is an XML document (see clause 1.1 <schema> 2.2 The referent is a <schema> <schema> SII I 3 The appropriate case 3.1 If namespace [attribute] then · · · · targetNamespace [attribute] SII 3.2 If namespace [attribute] then SII targetNamespace [attribute] not is 2 · · · · {type definitions} {attribute declarations} {element declarations} {attribute group definitions} {model group definitions} {notation declarations} <schema> <import> [children] <import> 2 · · · · I Note: <import> 2 Schema Properties Correct (§3.15.6) <import> schemaLocation [attribute] <import> · · schemaLocation schemaLocation 4.3.1 Standards for representation of schemas and retrieval of schema documents on the Web How schema definitions are located on the Web Layers 1 and 2 provide a framework for · · For interoperability, serialized · · 1.1 <schema> Note: <schema> <schema> Note: · · Accept application/xml, text/xml; q=0.9, */* As described in Layer 1: Summary of the Schema-validity Assessment Core (§4.1) · · Note: Layer 2: Schema Documents, Namespaces and Composition (§4.2) · · Processors on the Web are free to undertake · · Assessing Schema-Validity (§5.2) · · unless directed otherwise by the user, · · unless directed otherwise by the user, the processor is required to construct a schema corresponding to a schema document whose targetNamespace · · The composition of the complete schema for use in · · Layer 2: Schema Documents, Namespaces and Composition (§4.2) Schemas are represented on the Web in the form specified above in Standards for representation of schemas and retrieval of schema documents on the Web (§4.3.1) The author of a document uses namespace declarations to indicate the intended interpretation of names appearing therein; there may or may not be a schema retrievable via the namespace name. Accordingly whether a processor's default behavior is or is not to attempt such dereferencing, it must always provide for user-directed overriding of that default. Note: is On the other hand, in case a document author (human or not) created a document with a particular schema in view, and warrants that some or all of the document conforms to that schema, the schemaLocation noNamespaceSchemaLocation [attributes] http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation xsi:noNamespaceSchemaLocation targetNamespace [attribute] · · xsi:schemaLocation xsi:noNamespaceSchemaLocation [attributes] xsi:schemaLocation xsi:noNamespaceSchemaLocation [attributes] after · · [namespace name] Layer 1: Summary of the Schema-validity Assessment Core (§4.1) · · · · Example Multiple schema bindings can be declared using a single attribute. For example consider a stylesheet: <stylesheet xmlns="http://www.w3.org/1999/XSL/Transform" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/1999/XSL/Transform http://www.w3.org/1999/XSL/Transform.xsd http://www.w3.org/1999/xhtml http://www.w3.org/1999/xhtml.xsd"> The namespace names used in schemaLocation Schema Representation Constraint: Schema Document Location Strategy Given a namespace name (or none) and (optionally) a URI reference from xsi:schemaLocation xsi:noNamespaceSchemaLocation 1 Do nothing, for instance because a schema containing components for the given namespace name is already known to be available, or because it is known in advance that no efforts to locate schema documents will be successful (for example in embedded systems); 2 Based on the location URI, identify an existing schema document, either as a resource which is an XML document or a <schema> 3 Based on the namespace name, identify an existing schema document, either as a resource which is an XML document or a <schema> 4 Attempt to resolve the location URI, to locate a resource on the web which is or contains or references a <schema> 5 Attempt to resolve the namespace name to locate such a resource. Improved or alternative conventions for Web interoperability can be standardized in the future without reopening this specification. For example, the W3C is currently considering initiatives to standardize the packaging of resources relating to particular documents and/or namespaces: this would be an addition to the mechanisms described here for layer 3. This architecture also facilitates innovation at layer 2: for example, it would be possible in the future to define an additional standard for the representation of schema components which allowed e.g. type definitions to be specified piece by piece, rather than all at once. The architecture of schema-aware processing allows for a rich characterization of XML documents: schema validity is not a binary predicate. This specification distinguishes between errors in schema construction and structure, on the one hand, and schema validation outcomes, on the other. Before · · · · Schema Document Location Strategy (§4.3.2) · · · · xsi:schemaLocation xsi:noNamespaceSchemaLocation [attributes] It is an error if a schema and all the components which are the value of any of its properties, recursively, fail to satisfy all the relevant Constraints on Schemas set out in the last section of each of the subsections of Schema Component Details (§3) If a schema is derived from one or more schema documents (that is, one or more <schema> Schema Component Details (§3) Schemas and Namespaces: Access and Composition (§4) It is an error if any such schema document would not be fully valid with respect to a schema corresponding to the Schema for Schemas (normative) (§A) <schema> [validation attempted] full partial [validity] valid It is an error if any such schema document is or contains any element information items which violate any of the relevant Schema Representation Constraints set out in Schema Representation Constraints (§C.3) The three cases described above are the only types of error which this specification defines. With respect to the processes of the checking of schema structure and the construction of schemas corresponding to schema documents, this specification imposes no restrictions on processors after an error is detected. However · · not · · With a schema which satisfies the conditions expressed in Errors in Schema Construction and Structure (§5.1) 1 The user or application identifies a complex type definition from among the {type definitions} Schema-Validity Assessment (Element) (§3.3.4) 1.2 2 {element declarations} {name} {target namespace} [local name] [namespace name] Schema-Validity Assessment (Element) (§3.3.4) 1.1 3 The processor starts from Schema-Validity Assessment (Element) (§3.3.4) · · · · xsi:type The outcome of this effort, in any case, will be manifest in the [validation attempted] [validity] [attributes] [children] Assessment Outcome (Element) (§3.3.5) Assessment Outcome (Attribute) (§3.2.5) Note that every element and attribute information item participating in the · · [validation context] · · [Definition:] · · validation root Note: root · · 2 Note: · · · · · · · · · · [validation attempted] none · · · · [children] [attributes] · · · · skip [children] [attributes] At the beginning of Schema Component Details (§3) QNames · · QNames · · If at any time during · · · · · · · · In the case of attribute information items, the effect is as if clause 1 Attribute Locally Valid (§3.2.4) In the case of element information items, the effect is as if clause 1 Element Locally Valid (Element) (§3.3.4) In the case of element information items, processors may choose to continue · · · · Because of the value specification for [validation attempted] Assessment Outcome (Element) (§3.3.5) [validation attempted] full Schema-aware processors are responsible for processing XML documents, schemas and schema documents, as appropriate given the level of conformance (as defined in Conformance (§2.4) The XML representation of the schema for schema documents is presented here as a normative part of the specification, and as an illustrative example of how the XML Schema language can define itself using its own constructs. The names of XML Schema language types, elements, attributes and groups defined here are evocative of their purpose, but are occasionally verbose. There is some annotation in comments, but a fuller annotation will require the use of embedded documentation facilities or a hyperlinked external annotation for which tools are not yet readily available. Since a schema document is an XML document, it has optional XML and doctype declarations that are provided here for completeness. The root schema XML Schema: Structures targetNamespace <!DOCTYPE xs:schema PUBLIC "-//W3C//DTD XMLSCHEMA 200102//EN" "XMLSchema.dtd" [
<!-- provide ID type information even for parsers which only read the internal subset --> <!ATTLIST xs:schema id ID #IMPLIED> <!ATTLIST xs:complexType id ID #IMPLIED> <!ATTLIST xs:complexContent id ID #IMPLIED> <!ATTLIST xs:simpleContent id ID #IMPLIED> <!ATTLIST xs:extension id ID #IMPLIED> <!ATTLIST xs:element id ID #IMPLIED> <!ATTLIST xs:group id ID #IMPLIED> <!ATTLIST xs:all id ID #IMPLIED> <!ATTLIST xs:choice id ID #IMPLIED> <!ATTLIST xs:sequence id ID #IMPLIED> <!ATTLIST xs:any id ID #IMPLIED> <!ATTLIST xs:anyAttribute id ID #IMPLIED> <!ATTLIST xs:attribute id ID #IMPLIED> <!ATTLIST xs:attributeGroup id ID #IMPLIED> <!ATTLIST xs:unique id ID #IMPLIED> <!ATTLIST xs:key id ID #IMPLIED> <!ATTLIST xs:keyref id ID #IMPLIED> <!ATTLIST xs:selector id ID #IMPLIED> <!ATTLIST xs:field id ID #IMPLIED> <!ATTLIST xs:include id ID #IMPLIED> <!ATTLIST xs:import id ID #IMPLIED> <!ATTLIST xs:redefine id ID #IMPLIED> <!ATTLIST xs:notation id ID #IMPLIED> ]>
<?xml version='1.0'?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" blockDefault="#all" elementFormDefault="qualified" xml:lang="EN" targetNamespace="http://www.w3.org/2001/XMLSchema" version="Id: structures.xsd,v 1.2 2004/01/15 11:34:25 ht Exp "> <xs:annotation> <xs:documentation source="../structures/structures-with-errata.html.html"> The schema corresponding to this document is normative, with respect to the syntactic constraints it expresses in the XML Schema language. The documentation (within <documentation> elements) below, is not normative, but rather highlights important aspects of the W3C Recommendation of which this is a part</xs:documentation> </xs:annotation> <xs:annotation> <xs:documentation> The simpleType element and all of its members are defined in datatypes.xsd</xs:documentation> </xs:annotation> <xs:include schemaLocation="datatypes.xsd"/> <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"> <xs:annotation> <xs:documentation> Get access to the xml: attribute groups for xml:lang as declared on 'schema' and 'documentation' below </xs:documentation> </xs:annotation> </xs:import> <xs:complexType name="openAttrs"> <xs:annotation> <xs:documentation> This type is extended by almost all schema types to allow attributes from other namespaces to be added to user schemas. </xs:documentation> </xs:annotation> <xs:complexContent> <xs:restriction base="xs:anyType"> <xs:anyAttribute namespace="##other" processContents="lax"/> </xs:restriction> </xs:complexContent> </xs:complexType> <xs:complexType name="annotated"> <xs:annotation> <xs:documentation> This type is extended by all types which allow annotation other than <schema> itself </xs:documentation> </xs:annotation> <xs:complexContent> <xs:extension base="xs:openAttrs"> <xs:sequence> <xs:element ref="xs:annotation" minOccurs="0"/> </xs:sequence> <xs:attribute name="id" type="xs:ID"/> </xs:extension> </xs:complexContent> </xs:complexType> <xs:group name="schemaTop"> <xs:annotation> <xs:documentation> This group is for the elements which occur freely at the top level of schemas. All of their types are based on the "annotated" type by extension.</xs:documentation> </xs:annotation> <xs:choice> <xs:group ref="xs:redefinable"/> <xs:element ref="xs:element"/> <xs:element ref="xs:attribute"/> <xs:element ref="xs:notation"/> </xs:choice> </xs:group> <xs:group name="redefinable"> <xs:annotation> <xs:documentation> This group is for the elements which can self-redefine (see <redefine> below).</xs:documentation> </xs:annotation> <xs:choice> <xs:element ref="xs:simpleType"/> <xs:element ref="xs:complexType"/> <xs:element ref="xs:group"/> <xs:element ref="xs:attributeGroup"/> </xs:choice> </xs:group> <xs:simpleType name="formChoice"> <xs:annotation> <xs:documentation> A utility type, not for public use</xs:documentation> </xs:annotation> <xs:restriction base="xs:NMTOKEN"> <xs:enumeration value="qualified"/> <xs:enumeration value="unqualified"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="reducedDerivationControl"> <xs:annotation> <xs:documentation> A utility type, not for public use</xs:documentation> </xs:annotation> <xs:restriction base="xs:derivationControl"> <xs:enumeration value="extension"/> <xs:enumeration value="restriction"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="derivationSet"> <xs:annotation> <xs:documentation> A utility type, not for public use</xs:documentation> <xs:documentation> #all or (possibly empty) subset of {extension, restriction}</xs:documentation> </xs:annotation> <xs:union> <xs:simpleType> <xs:restriction base="xs:token"> <xs:enumeration value="#all"/> </xs:restriction> </xs:simpleType> <xs:simpleType> <xs:list itemType="xs:reducedDerivationControl"/> </xs:simpleType> </xs:union> </xs:simpleType> <xs:simpleType name="typeDerivationControl"> <xs:annotation> <xs:documentation> A utility type, not for public use</xs:documentation> </xs:annotation> <xs:restriction base="xs:derivationControl"> <xs:enumeration value="extension"/> <xs:enumeration value="restriction"/> <xs:enumeration value="list"/> <xs:enumeration value="union"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="fullDerivationSet"> <xs:annotation> <xs:documentation> A utility type, not for public use</xs:documentation> <xs:documentation> #all or (possibly empty) subset of {extension, restriction, list, union}</xs:documentation> </xs:annotation> <xs:union> <xs:simpleType> <xs:restriction base="xs:token"> <xs:enumeration value="#all"/> </xs:restriction> </xs:simpleType> <xs:simpleType> <xs:list itemType="xs:typeDerivationControl"/> </xs:simpleType> </xs:union> </xs:simpleType> <xs:element name="schema" id="schema"> <xs:annotation> <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-schema"/> </xs:annotation> <xs:complexType> <xs:complexContent> <xs:extension base="xs:openAttrs"> <xs:sequence> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element ref="xs:include"/> <xs:element ref="xs:import"/> <xs:element ref="xs:redefine"/> <xs:element ref="xs:annotation"/> </xs:choice> <xs:sequence minOccurs="0" maxOccurs="unbounded"> <xs:group ref="xs:schemaTop"/> <xs:element ref="xs:annotation" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:sequence> <xs:attribute name="targetNamespace" type="xs:anyURI"/> <xs:attribute name="version" type="xs:token"/> <xs:attribute name="finalDefault" type="xs:fullDerivationSet" default="" use="optional"/> <xs:attribute name="blockDefault" type="xs:blockSet" default="" use="optional"/> <xs:attribute name="attributeFormDefault" type="xs:formChoice" default="unqualified" use="optional"/> <xs:attribute name="elementFormDefault" type="xs:formChoice" default="unqualified" use="optional"/> <xs:attribute name="id" type="xs:ID"/> <xs:attribute ref="xml:lang"/> </xs:extension> </xs:complexContent> </xs:complexType> <xs:key name="element"> <xs:selector xpath="xs:element"/> <xs:field xpath="@name"/> </xs:key> <xs:key name="attribute"> <xs:selector xpath="xs:attribute"/> <xs:field xpath="@name"/> </xs:key> <xs:key name="type"> <xs:selector xpath="xs:complexType|xs:simpleType"/> <xs:field xpath="@name"/> </xs:key> <xs:key name="group"> <xs:selector xpath="xs:group"/> <xs:field xpath="@name"/> </xs:key> <xs:key name="attributeGroup"> <xs:selector xpath="xs:attributeGroup"/> <xs:field xpath="@name"/> </xs:key> <xs:key name="notation"> <xs:selector xpath="xs:notation"/> <xs:field xpath="@name"/> </xs:key> <xs:key name="identityConstraint"> <xs:selector xpath=".//xs:key|.//xs:unique|.//xs:keyref"/> <xs:field xpath="@name"/> </xs:key> </xs:element> <xs:simpleType name="allNNI"> <xs:annotation> <xs:documentation> for maxOccurs</xs:documentation> </xs:annotation> <xs:union memberTypes="xs:nonNegativeInteger"> <xs:simpleType> <xs:restriction base="xs:NMTOKEN"> <xs:enumeration value="unbounded"/> </xs:restriction> </xs:simpleType> </xs:union> </xs:simpleType> <xs:attributeGroup name="occurs"> <xs:annotation> <xs:documentation> for all particles</xs:documentation> </xs:annotation> <xs:attribute name="minOccurs" type="xs:nonNegativeInteger" default="1" use="optional"/> <xs:attribute name="maxOccurs" type="xs:allNNI" default="1" use="optional"/> </xs:attributeGroup> <xs:attributeGroup name="defRef"> <xs:annotation> <xs:documentation> for element, group and attributeGroup, which both define and reference</xs:documentation> </xs:annotation> <xs:attribute name="name" type="xs:NCName"/> <xs:attribute name="ref" type="xs:QName"/> </xs:attributeGroup> <xs:group name="typeDefParticle"> <xs:annotation> <xs:documentation> 'complexType' uses this</xs:documentation> </xs:annotation> <xs:choice> <xs:element name="group" type="xs:groupRef"/> <xs:element ref="xs:all"/> <xs:element ref="xs:choice"/> <xs:element ref="xs:sequence"/> </xs:choice> </xs:group> <xs:group name="nestedParticle"> <xs:choice> <xs:element name="element" type="xs:localElement"/> <xs:element name="group" type="xs:groupRef"/> <xs:element ref="xs:choice"/> <xs:element ref="xs:sequence"/> <xs:element ref="xs:any"/> </xs:choice> </xs:group> <xs:group name="particle"> <xs:choice> <xs:element name="element" type="xs:localElement"/> <xs:element name="group" type="xs:groupRef"/> <xs:element ref="xs:all"/> <xs:element ref="xs:choice"/> <xs:element ref="xs:sequence"/> <xs:element ref="xs:any"/> </xs:choice> </xs:group> <xs:complexType name="attribute"> <xs:complexContent> <xs:extension base="xs:annotated"> <xs:sequence> <xs:element name="simpleType" type="xs:localSimpleType" minOccurs="0"/> </xs:sequence> <xs:attributeGroup ref="xs:defRef"/> <xs:attribute name="type" type="xs:QName"/> <xs:attribute name="use" default="optional" use="optional"> <xs:simpleType> <xs:restriction base="xs:NMTOKEN"> <xs:enumeration value="prohibited"/> <xs:enumeration value="optional"/> <xs:enumeration value="required"/> </xs:restriction> </xs:simpleType> </xs:attribute> <xs:attribute name="default" type="xs:string"/> <xs:attribute name="fixed" type="xs:string"/> <xs:attribute name="form" type="xs:formChoice"/> </xs:extension> </xs:complexContent> </xs:complexType> <xs:complexType name="topLevelAttribute"> <xs:complexContent> <xs:restriction base="xs:attribute"> <xs:sequence> <xs:element ref="xs:annotation" minOccurs="0"/> <xs:element name="simpleType" type="xs:localSimpleType" minOccurs="0"/> </xs:sequence> <xs:attribute name="ref" use="prohibited"/> <xs:attribute name="form" use="prohibited"/> <xs:attribute name="use" use="prohibited"/> <xs:attribute name="name" type="xs:NCName" use="required"/> <xs:anyAttribute namespace="##other" processContents="lax"/> </xs:restriction> </xs:complexContent> </xs:complexType> <xs:group name="attrDecls"> <xs:sequence> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="attribute" type="xs:attribute"/> <xs:element name="attributeGroup" type="xs:attributeGroupRef"/> </xs:choice> <xs:element ref="xs:anyAttribute" minOccurs="0"/> </xs:sequence> </xs:group> <xs:element name="anyAttribute" type="xs:wildcard" id="anyAttribute"> <xs:annotation> <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-anyAttribute"/> </xs:annotation> </xs:element> <xs:group name="complexTypeModel"> <xs:choice> <xs:element ref="xs:simpleContent"/> <xs:element ref="xs:complexContent"/> <xs:sequence> <xs:annotation> <xs:documentation> This branch is short for <complexContent> <restriction base="xs:anyType"> ... </restriction> </complexContent></xs:documentation> </xs:annotation> <xs:group ref="xs:typeDefParticle" minOccurs="0"/> <xs:group ref="xs:attrDecls"/> </xs:sequence> </xs:choice> </xs:group> <xs:complexType name="complexType" abstract="true"> <xs:complexContent> <xs:extension base="xs:annotated"> <xs:group ref="xs:complexTypeModel"/> <xs:attribute name="name" type="xs:NCName"> <xs:annotation> <xs:documentation> Will be restricted to required or forbidden</xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="mixed" type="xs:boolean" default="false" use="optional"> <xs:annotation> <xs:documentation> Not allowed if simpleContent child is chosen. May be overriden by setting on complexContent child.</xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="abstract" type="xs:boolean" default="false" use="optional"/> <xs:attribute name="final" type="xs:derivationSet"/> <xs:attribute name="block" type="xs:derivationSet"/> </xs:extension> </xs:complexContent> </xs:complexType> <xs:complexType name="topLevelComplexType"> <xs:complexContent> <xs:restriction base="xs:complexType"> <xs:sequence> <xs:element ref="xs:annotation" minOccurs="0"/> <xs:group ref="xs:complexTypeModel"/> </xs:sequence> <xs:attribute name="name" type="xs:NCName" use="required"/> <xs:anyAttribute namespace="##other" processContents="lax"/> </xs:restriction> </xs:complexContent> </xs:complexType> <xs:complexType name="localComplexType"> <xs:complexContent> <xs:restriction base="xs:complexType"> <xs:sequence> <xs:element ref="xs:annotation" minOccurs="0"/> <xs:group ref="xs:complexTypeModel"/> </xs:sequence> <xs:attribute name="name" use="prohibited"/> <xs:attribute name="abstract" use="prohibited"/> <xs:attribute name="final" use="prohibited"/> <xs:attribute name="block" use="prohibited"/> <xs:anyAttribute namespace="##other" processContents="lax"/> </xs:restriction> </xs:complexContent> </xs:complexType> <xs:complexType name="restrictionType"> <xs:complexContent> <xs:extension base="xs:annotated"> <xs:sequence> <xs:choice minOccurs="0"> <xs:group ref="xs:typeDefParticle"/> <xs:group ref="xs:simpleRestrictionModel"/> </xs:choice> <xs:group ref="xs:attrDecls"/> </xs:sequence> <xs:attribute name="base" type="xs:QName" use="required"/> </xs:extension> </xs:complexContent> </xs:complexType> <xs:complexType name="complexRestrictionType"> <xs:complexContent> <xs:restriction base="xs:restrictionType"> <xs:sequence> <xs:element ref="xs:annotation" minOccurs="0"/> <xs:choice minOccurs="0"> <xs:annotation> <xs:documentation>This choice is added simply to make this a valid restriction per the REC</xs:documentation> </xs:annotation> <xs:group ref="xs:typeDefParticle"/> </xs:choice> <xs:group ref="xs:attrDecls"/> </xs:sequence> <xs:anyAttribute namespace="##other" processContents="lax"/> </xs:restriction> </xs:complexContent> </xs:complexType> <xs:complexType name="extensionType"> <xs:complexContent> <xs:extension base="xs:annotated"> <xs:sequence> <xs:group ref="xs:typeDefParticle" minOccurs="0"/> <xs:group ref="xs:attrDecls"/> </xs:sequence> <xs:attribute name="base" type="xs:QName" use="required"/> </xs:extension> </xs:complexContent> </xs:complexType> <xs:element name="complexContent" id="complexContent"> <xs:annotation> <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-complexContent"/> </xs:annotation> <xs:complexType> <xs:complexContent> <xs:extension base="xs:annotated"> <xs:choice> <xs:element name="restriction" type="xs:complexRestrictionType"/> <xs:element name="extension" type="xs:extensionType"/> </xs:choice> <xs:attribute name="mixed" type="xs:boolean"> <xs:annotation> <xs:documentation> Overrides any setting on complexType parent.</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> </xs:element> <xs:complexType name="simpleRestrictionType"> <xs:complexContent> <xs:restriction base="xs:restrictionType"> <xs:sequence> <xs:element ref="xs:annotation" minOccurs="0"/> <xs:choice minOccurs="0"> <xs:annotation> <xs:documentation>This choice is added simply to make this a valid restriction per the REC</xs:documentation> </xs:annotation> <xs:group ref="xs:simpleRestrictionModel"/> </xs:choice> <xs:group ref="xs:attrDecls"/> </xs:sequence> <xs:anyAttribute namespace="##other" processContents="lax"/> </xs:restriction> </xs:complexContent> </xs:complexType> <xs:complexType name="simpleExtensionType"> <xs:complexContent> <xs:restriction base="xs:extensionType"> <xs:sequence> <xs:annotation> <xs:documentation> No typeDefParticle group reference</xs:documentation> </xs:annotation> <xs:element ref="xs:annotation" minOccurs="0"/> <xs:group ref="xs:attrDecls"/> </xs:sequence> <xs:anyAttribute namespace="##other" processContents="lax"/> </xs:restriction> </xs:complexContent> </xs:complexType> <xs:element name="simpleContent" id="simpleContent"> <xs:annotation> <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-simpleContent"/> </xs:annotation> <xs:complexType> <xs:complexContent> <xs:extension base="xs:annotated"> <xs:choice> <xs:element name="restriction" type="xs:simpleRestrictionType"/> <xs:element name="extension" type="xs:simpleExtensionType"/> </xs:choice> </xs:extension> </xs:complexContent> </xs:complexType> </xs:element> <xs:element name="complexType" type="xs:topLevelComplexType" id="complexType"> <xs:annotation> <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-complexType"/> </xs:annotation> </xs:element> <xs:simpleType name="blockSet"> <xs:annotation> <xs:documentation> A utility type, not for public use</xs:documentation> <xs:documentation> #all or (possibly empty) subset of {substitution, extension, restriction}</xs:documentation> </xs:annotation> <xs:union> <xs:simpleType> <xs:restriction base="xs:token"> <xs:enumeration value="#all"/> </xs:restriction> </xs:simpleType> <xs:simpleType> <xs:list> <xs:simpleType> <xs:restriction base="xs:derivationControl"> <xs:enumeration value="extension"/> <xs:enumeration value="restriction"/> <xs:enumeration value="substitution"/> </xs:restriction> </xs:simpleType> </xs:list> </xs:simpleType> </xs:union> </xs:simpleType> <xs:complexType name="element" abstract="true"> <xs:annotation> <xs:documentation> The element element can be used either at the top level to define an element-type binding globally, or within a content model to either reference a globally-defined element or type or declare an element-type binding locally. The ref form is not allowed at the top level.</xs:documentation> </xs:annotation> <xs:complexContent> <xs:extension base="xs:annotated"> <xs:sequence> <xs:choice minOccurs="0"> <xs:element name="simpleType" type="xs:localSimpleType"/> <xs:element name="complexType" type="xs:localComplexType"/> </xs:choice> <xs:group ref="xs:identityConstraint" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> <xs:attributeGroup ref="xs:defRef"/> <xs:attribute name="type" type="xs:QName"/> <xs:attribute name="substitutionGroup" type="xs:QName"/> <xs:attributeGroup ref="xs:occurs"/> <xs:attribute name="default" type="xs:string"/> <xs:attribute name="fixed" type="xs:string"/> <xs:attribute name="nillable" type="xs:boolean" default="false" use="optional"/> <xs:attribute name="abstract" type="xs:boolean" default="false" use="optional"/> <xs:attribute name="final" type="xs:derivationSet"/> <xs:attribute name="block" type="xs:blockSet"/> <xs:attribute name="form" type="xs:formChoice"/> </xs:extension> </xs:complexContent> </xs:complexType> <xs:complexType name="topLevelElement"> <xs:complexContent> <xs:restriction base="xs:element"> <xs:sequence> <xs:element ref="xs:annotation" minOccurs="0"/> <xs:choice minOccurs="0"> <xs:element name="simpleType" type="xs:localSimpleType"/> <xs:element name="complexType" type="xs:localComplexType"/> </xs:choice> <xs:group ref="xs:identityConstraint" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="ref" use="prohibited"/> <xs:attribute name="form" use="prohibited"/> <xs:attribute name="minOccurs" use="prohibited"/> <xs:attribute name="maxOccurs" use="prohibited"/> <xs:attribute name="name" type="xs:NCName" use="required"/> <xs:anyAttribute namespace="##other" processContents="lax"/> </xs:restriction> </xs:complexContent> </xs:complexType> <xs:complexType name="localElement"> <xs:complexContent> <xs:restriction base="xs:element"> <xs:sequence> <xs:element ref="xs:annotation" minOccurs="0"/> <xs:choice minOccurs="0"> <xs:element name="simpleType" type="xs:localSimpleType"/> <xs:element name="complexType" type="xs:localComplexType"/> </xs:choice> <xs:group ref="xs:identityConstraint" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="substitutionGroup" use="prohibited"/> <xs:attribute name="final" use="prohibited"/> <xs:attribute name="abstract" use="prohibited"/> <xs:anyAttribute namespace="##other" processContents="lax"/> </xs:restriction> </xs:complexContent> </xs:complexType> <xs:element name="element" type="xs:topLevelElement" id="element"> <xs:annotation> <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-element"/> </xs:annotation> </xs:element> <xs:complexType name="group" abstract="true"> <xs:annotation> <xs:documentation> group type for explicit groups, named top-level groups and group references</xs:documentation> </xs:annotation> <xs:complexContent> <xs:extension base="xs:annotated"> <xs:group ref="xs:particle" minOccurs="0" maxOccurs="unbounded"/> <xs:attributeGroup ref="xs:defRef"/> <xs:attributeGroup ref="xs:occurs"/> </xs:extension> </xs:complexContent> </xs:complexType> <xs:complexType name="realGroup"> <xs:complexContent> <xs:restriction base="xs:group"> <xs:sequence> <xs:element ref="xs:annotation" minOccurs="0"/> <xs:choice minOccurs="0" maxOccurs="1"> <xs:element ref="xs:all"/> <xs:element ref="xs:choice"/> <xs:element ref="xs:sequence"/> </xs:choice> </xs:sequence> <xs:anyAttribute namespace="##other" processContents="lax"/> </xs:restriction> </xs:complexContent> </xs:complexType> <xs:complexType name="namedGroup"> <xs:complexContent> <xs:restriction base="xs:realGroup"> <xs:sequence> <xs:element ref="xs:annotation" minOccurs="0"/> <xs:choice minOccurs="1" maxOccurs="1"> <xs:element name="all"> <xs:complexType> <xs:complexContent> <xs:restriction base="xs:all"> <xs:group ref="xs:allModel"/> <xs:attribute name="minOccurs" use="prohibited"/> <xs:attribute name="maxOccurs" use="prohibited"/> <xs:anyAttribute namespace="##other" processContents="lax"/> </xs:restriction> </xs:complexContent> </xs:complexType> </xs:element> <xs:element name="choice" type="xs:simpleExplicitGroup"/> <xs:element name="sequence" type="xs:simpleExplicitGroup"/> </xs:choice> </xs:sequence> <xs:attribute name="name" type="xs:NCName" use="required"/> <xs:attribute name="ref" use="prohibited"/> <xs:attribute name="minOccurs" use="prohibited"/> <xs:attribute name="maxOccurs" use="prohibited"/> <xs:anyAttribute namespace="##other" processContents="lax"/> </xs:restriction> </xs:complexContent> </xs:complexType> <xs:complexType name="groupRef"> <xs:complexContent> <xs:restriction base="xs:realGroup"> <xs:sequence> <xs:element ref="xs:annotation" minOccurs="0"/> </xs:sequence> <xs:attribute name="ref" type="xs:QName" use="required"/> <xs:attribute name="name" use="prohibited"/> <xs:anyAttribute namespace="##other" processContents="lax"/> </xs:restriction> </xs:complexContent> </xs:complexType> <xs:complexType name="explicitGroup"> <xs:annotation> <xs:documentation> group type for the three kinds of group</xs:documentation> </xs:annotation> <xs:complexContent> <xs:restriction base="xs:group"> <xs:sequence> <xs:element ref="xs:annotation" minOccurs="0"/> <xs:group ref="xs:nestedParticle" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="name" type="xs:NCName" use="prohibited"/> <xs:attribute name="ref" type="xs:QName" use="prohibited"/> <xs:anyAttribute namespace="##other" processContents="lax"/> </xs:restriction> </xs:complexContent> </xs:complexType> <xs:complexType name="simpleExplicitGroup"> <xs:complexContent> <xs:restriction base="xs:explicitGroup"> <xs:sequence> <xs:element ref="xs:annotation" minOccurs="0"/> <xs:group ref="xs:nestedParticle" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="minOccurs" use="prohibited"/> <xs:attribute name="maxOccurs" use="prohibited"/> <xs:anyAttribute namespace="##other" processContents="lax"/> </xs:restriction> </xs:complexContent> </xs:complexType> <xs:group name="allModel"> <xs:sequence> <xs:element ref="xs:annotation" minOccurs="0"/> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:annotation> <xs:documentation>This choice with min/max is here to avoid a pblm with the Elt:All/Choice/Seq Particle derivation constraint</xs:documentation> </xs:annotation> <xs:element name="element" type="xs:narrowMaxMin"/> </xs:choice> </xs:sequence> </xs:group> <xs:complexType name="narrowMaxMin"> <xs:annotation> <xs:documentation>restricted max/min</xs:documentation> </xs:annotation> <xs:complexContent> <xs:restriction base="xs:localElement"> <xs:sequence> <xs:element ref="xs:annotation" minOccurs="0"/> <xs:choice minOccurs="0"> <xs:element name="simpleType" type="xs:localSimpleType"/> <xs:element name="complexType" type="xs:localComplexType"/> </xs:choice> <xs:group ref="xs:identityConstraint" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="minOccurs" default="1" use="optional"> <xs:simpleType> <xs:restriction base="xs:nonNegativeInteger"> <xs:enumeration value="0"/> <xs:enumeration value="1"/> </xs:restriction> </xs:simpleType> </xs:attribute> <xs:attribute name="maxOccurs" default="1" use="optional"> <xs:simpleType> <xs:restriction base="xs:allNNI"> <xs:enumeration value="0"/> <xs:enumeration value="1"/> </xs:restriction> </xs:simpleType> </xs:attribute> <xs:anyAttribute namespace="##other" processContents="lax"/> </xs:restriction> </xs:complexContent> </xs:complexType> <xs:complexType name="all"> <xs:annotation> <xs:documentation> Only elements allowed inside</xs:documentation> </xs:annotation> <xs:complexContent> <xs:restriction base="xs:explicitGroup"> <xs:group ref="xs:allModel"/> <xs:attribute name="minOccurs" default="1" use="optional"> <xs:simpleType> <xs:restriction base="xs:nonNegativeInteger"> <xs:enumeration value="0"/> <xs:enumeration value="1"/> </xs:restriction> </xs:simpleType> </xs:attribute> <xs:attribute name="maxOccurs" default="1" use="optional"> <xs:simpleType> <xs:restriction base="xs:allNNI"> <xs:enumeration value="1"/> </xs:restriction> </xs:simpleType> </xs:attribute> <xs:anyAttribute namespace="##other" processContents="lax"/> </xs:restriction> </xs:complexContent> </xs:complexType> <xs:element name="all" type="xs:all" id="all"> <xs:annotation> <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-all"/> </xs:annotation> </xs:element> <xs:element name="choice" type="xs:explicitGroup" id="choice"> <xs:annotation> <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-choice"/> </xs:annotation> </xs:element> <xs:element name="sequence" type="xs:explicitGroup" id="sequence"> <xs:annotation> <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-sequence"/> </xs:annotation> </xs:element> <xs:element name="group" type="xs:namedGroup" id="group"> <xs:annotation> <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-group"/> </xs:annotation> </xs:element> <xs:complexType name="wildcard"> <xs:complexContent> <xs:extension base="xs:annotated"> <xs:attribute name="namespace" type="xs:namespaceList" default="##any" use="optional"/> <xs:attribute name="processContents" default="strict" use="optional"> <xs:simpleType> <xs:restriction base="xs:NMTOKEN"> <xs:enumeration value="skip"/> <xs:enumeration value="lax"/> <xs:enumeration value="strict"/> </xs:restriction> </xs:simpleType> </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> <xs:element name="any" id="any"> <xs:annotation> <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-any"/> </xs:annotation> <xs:complexType> <xs:complexContent> <xs:extension base="xs:wildcard"> <xs:attributeGroup ref="xs:occurs"/> </xs:extension> </xs:complexContent> </xs:complexType> </xs:element> <xs:annotation> <xs:documentation> simple type for the value of the 'namespace' attr of 'any' and 'anyAttribute'</xs:documentation> </xs:annotation> <xs:annotation> <xs:documentation> Value is ##any - - any non-conflicting WFXML/attribute at all
##other - - any non-conflicting WFXML/attribute from namespace other than targetNS
##local - - any unqualified non-conflicting WFXML/attribute
one or - - any non-conflicting WFXML/attribute from more URI the listed namespaces references (space separated)
##targetNamespace or ##local may appear in the above list, to refer to the targetNamespace of the enclosing schema or an absent targetNamespace respectively</xs:documentation> </xs:annotation> <xs:simpleType name="namespaceList"> <xs:annotation> <xs:documentation> A utility type, not for public use</xs:documentation> </xs:annotation> <xs:union> <xs:simpleType> <xs:restriction base="xs:token"> <xs:enumeration value="##any"/> <xs:enumeration value="##other"/> </xs:restriction> </xs:simpleType> <xs:simpleType> <xs:list> <xs:simpleType> <xs:union memberTypes="xs:anyURI"> <xs:simpleType> <xs:restriction base="xs:token"> <xs:enumeration value="##targetNamespace"/> <xs:enumeration value="##local"/> </xs:restriction> </xs:simpleType> </xs:union> </xs:simpleType> </xs:list> </xs:simpleType> </xs:union> </xs:simpleType> <xs:element name="attribute" type="xs:topLevelAttribute" id="attribute"> <xs:annotation> <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-attribute"/> </xs:annotation> </xs:element> <xs:complexType name="attributeGroup" abstract="true"> <xs:complexContent> <xs:extension base="xs:annotated"> <xs:group ref="xs:attrDecls"/> <xs:attributeGroup ref="xs:defRef"/> </xs:extension> </xs:complexContent> </xs:complexType> <xs:complexType name="namedAttributeGroup"> <xs:complexContent> <xs:restriction base="xs:attributeGroup"> <xs:sequence> <xs:element ref="xs:annotation" minOccurs="0"/> <xs:group ref="xs:attrDecls"/> </xs:sequence> <xs:attribute name="name" type="xs:NCName" use="required"/> <xs:attribute name="ref" use="prohibited"/> <xs:anyAttribute namespace="##other" processContents="lax"/> </xs:restriction> </xs:complexContent> </xs:complexType> <xs:complexType name="attributeGroupRef"> <xs:complexContent> <xs:restriction base="xs:attributeGroup"> <xs:sequence> <xs:element ref="xs:annotation" minOccurs="0"/> </xs:sequence> <xs:attribute name="ref" type="xs:QName" use="required"/> <xs:attribute name="name" use="prohibited"/> <xs:anyAttribute namespace="##other" processContents="lax"/> </xs:restriction> </xs:complexContent> </xs:complexType> <xs:element name="attributeGroup" type="xs:namedAttributeGroup" id="attributeGroup"> <xs:annotation> <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-attributeGroup"/> </xs:annotation> </xs:element> <xs:element name="include" id="include"> <xs:annotation> <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-include"/> </xs:annotation> <xs:complexType> <xs:complexContent> <xs:extension base="xs:annotated"> <xs:attribute name="schemaLocation" type="xs:anyURI" use="required"/> </xs:extension> </xs:complexContent> </xs:complexType> </xs:element> <xs:element name="redefine" id="redefine"> <xs:annotation> <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-redefine"/> </xs:annotation> <xs:complexType> <xs:complexContent> <xs:extension base="xs:openAttrs"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element ref="xs:annotation"/> <xs:group ref="xs:redefinable"/> </xs:choice> <xs:attribute name="schemaLocation" type="xs:anyURI" use="required"/> <xs:attribute name="id" type="xs:ID"/> </xs:extension> </xs:complexContent> </xs:complexType> </xs:element> <xs:element name="import" id="import"> <xs:annotation> <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-import"/> </xs:annotation> <xs:complexType> <xs:complexContent> <xs:extension base="xs:annotated"> <xs:attribute name="namespace" type="xs:anyURI"/> <xs:attribute name="schemaLocation" type="xs:anyURI"/> </xs:extension> </xs:complexContent> </xs:complexType> </xs:element> <xs:element name="selector" id="selector"> <xs:annotation> <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-selector"/> </xs:annotation> <xs:complexType> <xs:complexContent> <xs:extension base="xs:annotated"> <xs:attribute name="xpath" use="required"> <xs:simpleType> <xs:annotation> <xs:documentation>A subset of XPath expressions for use in selectors</xs:documentation> <xs:documentation>A utility type, not for public use</xs:documentation> </xs:annotation> <xs:restriction base="xs:token"> <xs:annotation> <xs:documentation>The following pattern is intended to allow XPath expressions per the following EBNF: Selector ::= Path ( '|' Path )* Path ::= ('.//')? Step ( '/' Step )* Step ::= '.' | NameTest NameTest ::= QName | '*' | NCName ':' '*' child:: is also allowed </xs:documentation> </xs:annotation> <xs:pattern value="(\.//)?(((child::)?((\i\c*:)?(\i\c*|\*)))|\.)(/(((child::)?((\i\c*:)?(\i\c*|\*)))|\.))*(\|(\.//)?(((child::)?((\i\c*:)?(\i\c*|\*)))|\.)(/(((child::)?((\i\c*:)?(\i\c*|\*)))|\.))*)*"/> </xs:restriction> </xs:simpleType> </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> </xs:element> <xs:element name="field" id="field"> <xs:annotation> <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-field"/> </xs:annotation> <xs:complexType> <xs:complexContent> <xs:extension base="xs:annotated"> <xs:attribute name="xpath" use="required"> <xs:simpleType> <xs:annotation> <xs:documentation>A subset of XPath expressions for use in fields</xs:documentation> <xs:documentation>A utility type, not for public use</xs:documentation> </xs:annotation> <xs:restriction base="xs:token"> <xs:annotation> <xs:documentation>The following pattern is intended to allow XPath expressions per the same EBNF as for selector, with the following change: Path ::= ('.//')? ( Step '/' )* ( Step | '@' NameTest ) </xs:documentation> </xs:annotation> <xs:pattern value="(\.//)?((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)/)*((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)|((attribute::|@)((\i\c*:)?(\i\c*|\*))))(\|(\.//)?((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)/)*((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)|((attribute::|@)((\i\c*:)?(\i\c*|\*)))))*"/> </xs:restriction> </xs:simpleType> </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> </xs:element> <xs:complexType name="keybase"> <xs:complexContent> <xs:extension base="xs:annotated"> <xs:sequence> <xs:element ref="xs:selector"/> <xs:element ref="xs:field" minOccurs="1" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="name" type="xs:NCName" use="required"/> </xs:extension> </xs:complexContent> </xs:complexType> <xs:group name="identityConstraint"> <xs:annotation> <xs:documentation>The three kinds of identity constraints, all with type of or derived from 'keybase'. </xs:documentation> </xs:annotation> <xs:choice> <xs:element ref="xs:unique"/> <xs:element ref="xs:key"/> <xs:element ref="xs:keyref"/> </xs:choice> </xs:group> <xs:element name="unique" type="xs:keybase" id="unique"> <xs:annotation> <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-unique"/> </xs:annotation> </xs:element> <xs:element name="key" type="xs:keybase" id="key"> <xs:annotation> <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-key"/> </xs:annotation> </xs:element> <xs:element name="keyref" id="keyref"> <xs:annotation> <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-keyref"/> </xs:annotation> <xs:complexType> <xs:complexContent> <xs:extension base="xs:keybase"> <xs:attribute name="refer" type="xs:QName" use="required"/> </xs:extension> </xs:complexContent> </xs:complexType> </xs:element> <xs:element name="notation" id="notation"> <xs:annotation> <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-notation"/> </xs:annotation> <xs:complexType> <xs:complexContent> <xs:extension base="xs:annotated"> <xs:attribute name="name" type="xs:NCName" use="required"/> <xs:attribute name="public" type="xs:public"/> <xs:attribute name="system" type="xs:anyURI"/> </xs:extension> </xs:complexContent> </xs:complexType> </xs:element> <xs:simpleType name="public"> <xs:annotation> <xs:documentation> A utility type, not for public use</xs:documentation> <xs:documentation> A public identifier, per ISO 8879</xs:documentation> </xs:annotation> <xs:restriction base="xs:token"/> </xs:simpleType> <xs:element name="appinfo" id="appinfo"> <xs:annotation> <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-appinfo"/> </xs:annotation> <xs:complexType mixed="true"> <xs:sequence minOccurs="0" maxOccurs="unbounded"> <xs:any processContents="lax"/> </xs:sequence> <xs:attribute name="source" type="xs:anyURI"/> <xs:anyAttribute namespace="##other" processContents="lax"/> </xs:complexType> </xs:element> <xs:element name="documentation" id="documentation"> <xs:annotation> <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-documentation"/> </xs:annotation> <xs:complexType mixed="true"> <xs:sequence minOccurs="0" maxOccurs="unbounded"> <xs:any processContents="lax"/> </xs:sequence> <xs:attribute name="source" type="xs:anyURI"/> <xs:attribute ref="xml:lang"/> <xs:anyAttribute namespace="##other" processContents="lax"/> </xs:complexType> </xs:element> <xs:element name="annotation" id="annotation"> <xs:annotation> <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-annotation"/> </xs:annotation> <xs:complexType> <xs:complexContent> <xs:extension base="xs:openAttrs"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element ref="xs:appinfo"/> <xs:element ref="xs:documentation"/> </xs:choice> <xs:attribute name="id" type="xs:ID"/> </xs:extension> </xs:complexContent> </xs:complexType> </xs:element> <xs:annotation> <xs:documentation> notations for use within XML Schema schemas</xs:documentation> </xs:annotation> <xs:notation name="XMLSchemaStructures" public="structures" system="http://www.w3.org/2000/08/XMLSchema.xsd"/> <xs:notation name="XML" public="REC-xml-19980210" system="http://www.w3.org/TR/1998/REC-xml-19980210"/> <xs:complexType name="anyType" mixed="true"> <xs:annotation> <xs:documentation> Not the real urType, but as close an approximation as we can get in the XML representation</xs:documentation> </xs:annotation> <xs:sequence> <xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/> </xs:sequence> <xs:anyAttribute processContents="lax"/> </xs:complexType> </xs:schema> Note: Extensible Markup Language (XML) 1.0, Second Edition http://www.w3.org/TR/2000/REC-xml-20001006 XML Schema Requirements http://www.w3.org/TR/1999/NOTE-xml-schema-req-19990215 XML Schema Part 2: Datatypes http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/datatypes.html XML Information Set http://www.w3.org/TR/2001/WD-xml-infoset-20010316/ Namespaces in XML http://www.w3.org/TR/1999/REC-xml-names-19990114/ XML Path Language http://www.w3.org/TR/1999/REC-xpath-19991116 XML Pointer Language (XPointer) http://www.w3.org/TR/2001/WD-xptr-20010108/ To facilitate consistent reporting of schema errors and · · cos-ct-extends.1.2 1.2 Derivation Valid (Extension) (§3.4.6) cvc-assess-attr Schema-Validity Assessment (Attribute) cvc-assess-elt Schema-Validity Assessment (Element) cvc-attribute Attribute Locally Valid cvc-au Attribute Locally Valid (Use) cvc-complex-type Element Locally Valid (Complex Type) cvc-datatype-valid Datatype Valid cvc-elt Element Locally Valid (Element) cvc-enumeration-valid enumeration valid cvc-facet-valid Facet Valid cvc-fractionDigits-valid fractionDigits Valid cvc-id Validation Root Valid (ID/IDREF) cvc-identity-constraint Identity-constraint Satisfied cvc-length-valid Length Valid cvc-maxExclusive-valid maxExclusive Valid cvc-maxInclusive-valid maxInclusive Valid cvc-maxLength-valid maxLength Valid cvc-minExclusive-valid minExclusive Valid cvc-minInclusive-valid minInclusive Valid cvc-minLength-valid minLength Valid cvc-model-group Element Sequence Valid cvc-particle Element Sequence Locally Valid (Particle) cvc-pattern-valid pattern valid cvc-resolve-instance QName resolution (Instance) cvc-simple-type String Valid cvc-totalDigits-valid totalDigits Valid cvc-type Element Locally Valid (Type) cvc-wildcard Item Valid (Wildcard) cvc-wildcard-namespace Wildcard allows Namespace Name attribute information item properties [attribute declaration] Attribute Declaration [member type definition] Attribute Validated by Type [member type definition anonymous] Attribute Validated by Type [member type definition name] Attribute Validated by Type [member type definition namespace] Attribute Validated by Type [schema default] Attribute Validated by Type [schema error code] Validation Failure (Attribute) [schema normalized value] Attribute Validated by Type [schema specified] Assessment Outcome (Attribute) [type definition] Attribute Validated by Type [type definition anonymous] Attribute Validated by Type [type definition name] Attribute Validated by Type [type definition namespace] Attribute Validated by Type [type definition type] Attribute Validated by Type [validation attempted] Assessment Outcome (Attribute) [validation context] Assessment Outcome (Attribute) [validity] Assessment Outcome (Attribute) element information item properties [element declaration] Element Declaration [ID/IDREF table] ID/IDREF Table [identity-constraint table] Identity-constraint Table [member type definition] Element Validated by Type [member type definition anonymous] Element Validated by Type [member type definition name] Element Validated by Type [member type definition namespace] Element Validated by Type [nil] Element Declaration [notation] Validated with Notation [notation public] Validated with Notation [notation system] Validated with Notation [schema default] Element Validated by Type [schema error code] Validation Failure (Element) [schema information] Schema Information [schema normalized value] Element Validated by Type [schema specified] Element Default Value [type definition] Element Validated by Type [type definition anonymous] Element Validated by Type [type definition name] Element Validated by Type [type definition namespace] Element Validated by Type [type definition type] Element Validated by Type [validation attempted] Assessment Outcome (Element) [validation context] Assessment Outcome (Element) [validity] Assessment Outcome (Element) ID/IDREF binding information item properties [binding] ID/IDREF Table [id] ID/IDREF Table Identity-constraint Binding information item properties [definition] Identity-constraint Table [node table] Identity-constraint Table namespace schema information information item properties [schema components] Schema Information [schema documents] Schema Information [schema namespace] Schema Information schema document information item properties [document] Schema Information [document location] Schema Information schema_reference Schema Document Location Strategy src-annotation Annotation Definition Representation OK src-attribute Attribute Declaration Representation OK src-attribute_group Attribute Group Definition Representation OK src-ct Complex Type Definition Representation OK src-element Element Declaration Representation OK src-expredef Individual Component Redefinition src-identity-constraint Identity-constraint Definition Representation OK src-import Import Constraints and Semantics src-include Inclusion Constraints and Semantics src-list-itemType-or-simpleType itemType attribute or simpleType child src-model_group Model Group Representation OK src-model_group_defn Model Group Definition Representation OK src-multiple-enumerations Multiple enumerations src-multiple-patterns Multiple patterns src-notation Notation Definition Representation OK src-qname QName Interpretation src-redefine Redefinition Constraints and Semantics src-resolve QName resolution (Schema Document) src-restriction-base-or-simpleType base attribute or simpleType child src-simple-type Simple Type Definition Representation OK src-single-facet-value Single Facet Value src-union-memberTypes-or-simpleTypes memberTypes attribute or simpleType children src-wildcard Wildcard Representation OK a-props-correct Attribute Declaration Properties Correct ag-props-correct Attribute Group Definition Properties Correct an-props-correct Annotation Correct au-props-correct Attribute Use Correct c-fields-xpaths Fields Value OK c-props-correct Identity-constraint Definition Properties Correct c-selector-xpath Selector Value OK cos-all-limited All Group Limited cos-applicable-facets applicable facets cos-aw-intersect Attribute Wildcard Intersection cos-aw-union Attribute Wildcard Union cos-choice-range Effective Total Range (choice) cos-ct-derived-ok Type Derivation OK (Complex) cos-ct-extends Derivation Valid (Extension) cos-element-consistent Element Declarations Consistent cos-equiv-class Substitution Group cos-equiv-derived-ok-rec Substitution Group OK (Transitive) cos-group-emptiable Particle Emptiable cos-list-of-atomic list of atomic cos-no-circular-unions no circular unions cos-nonambig Unique Particle Attribution cos-ns-subset Wildcard Subset cos-particle-extend Particle Valid (Extension) cos-particle-restrict Particle Valid (Restriction) cos-seq-range Effective Total Range (all and sequence) cos-st-derived-ok Type Derivation OK (Simple) cos-st-restricts Derivation Valid (Restriction, Simple) cos-valid-default Element Default Valid (Immediate) ct-props-correct Complex Type Definition Properties Correct derivation-ok-restriction Derivation Valid (Restriction, Complex) e-props-correct Element Declaration Properties Correct enumeration-required-notation enumeration facet value required for NOTATION enumeration-valid-restriction enumeration valid restriction fractionDigits-totalDigits fractionDigits less than or equal to totalDigits fractionDigits-valid-restriction fractionDigits valid restriction length-minLength-maxLength length and minLength or maxLength length-valid-restriction length valid restriction maxExclusive-valid-restriction maxExclusive valid restriction maxInclusive-maxExclusive maxInclusive and maxExclusive maxInclusive-valid-restriction maxInclusive valid restriction maxLength-valid-restriction maxLength valid restriction mg-props-correct Model Group Correct mgd-props-correct Model Group Definition Properties Correct minExclusive-less-than-equal-to-maxExclusive minExclusive <= maxExclusive minExclusive-less-than-maxInclusive minExclusive < maxInclusive minExclusive-valid-restriction minExclusive valid restriction minInclusive-less-than-equal-to-maxInclusive minInclusive <= maxInclusive minInclusive-less-than-maxExclusive minInclusive < maxExclusive minInclusive-minExclusive minInclusive and minExclusive minInclusive-valid-restriction minInclusive valid restriction minLength-less-than-equal-to-maxLength minLength <= maxLength minLength-valid-restriction minLength valid restriction n-props-correct Notation Declaration Correct no-xmlns xmlns Not Allowed no-xsi xsi: Not Allowed p-props-correct Particle Correct range-ok Occurrence Range OK rcase-MapAndSum Particle Derivation OK (Sequence:Choice -- MapAndSum) rcase-NameAndTypeOK Particle Restriction OK (Elt:Elt -- NameAndTypeOK) rcase-NSCompat Particle Derivation OK (Elt:Any -- NSCompat) rcase-NSRecurseCheckCardinality Particle Derivation OK (All/Choice/Sequence:Any -- NSRecurseCheckCardinality) rcase-NSSubset Particle Derivation OK (Any:Any -- NSSubset) rcase-Recurse Particle Derivation OK (All:All,Sequence:Sequence -- Recurse) rcase-RecurseAsIfGroup Particle Derivation OK (Elt:All/Choice/Sequence -- RecurseAsIfGroup) rcase-RecurseLax Particle Derivation OK (Choice:Choice -- RecurseLax) rcase-RecurseUnordered Particle Derivation OK (Sequence:All -- RecurseUnordered) sch-props-correct Schema Properties Correct st-props-correct Simple Type Definition Properties Correct st-restrict-facets Simple Type Restriction (Facets) totalDigits-valid-restriction totalDigits valid restriction w-props-correct Wildcard Properties Correct whiteSpace-valid-restriction whiteSpace valid restriction This specification requires as a precondition for · · [XML-Infoset] Attribute Information Item [local name] [namespace name] [normalized value] Character Information Item [character code] Element Information Item [local name] [namespace name] [children] [attributes] [in-scope namespaces] [namespace attributes] Namespace Information Item [prefix] [namespace name] In addition, infosets should support the [unparsedEntities] ENTITY ENTITIES · · This specification does not require any destructive alterations to the input information set: all the information set contributions specified herein are additive. This appendix is intended to satisfy the requirements for Conformance [XML-Infoset] The listing below is for the benefit of readers of a printed version of this document: it collects together all the definitions which appear in the document above. absent Throughout this specification, the term absent actual value The phrase actual value · · assessment the word assessment base type definition A type definition used as the basis for an · · · · base type definition component name Declarations and definitions may have and be identified by name [XML-Namespaces] conformance to the XML Representation of Schemas · · Layer 2: Schema Documents, Namespaces and Composition (§4.2) conformance to the XML Representation of Schemas content model A particle can be used in a complex type definition to constrain the · · [children] content model context-determined declaration During · · [children] [attributes] context-determined declarations declaration declaration · · declared entity name A string is a declared entity name [name] [unparsedEntities] · · definition definition element substitution group Through the new mechanism of element substitution groups extension A complex type definition which allows element or attribute content in addition to that allowed by another specified type definition is said to be an extension final the complex type is said to be final fully conforming Fully conforming · · · · Representation of Schemas on the World Wide Web (§2.7) How schema definitions are located on the Web (§4.3.2) implicitly contains A list of particles implicitly contains · · initial value the initial value [normalized value] initial value [character code] [children] item isomorphic to a component by an item isomorphic laxly assessed an element information item's schema validity may be laxly assessed · · skip · · · · Element Locally Valid (Type) (§3.3.4) minimally conforming Minimally conforming · · · · · · NCName An NCName [XML-Namespaces] NCName [XML Schemas: Datatypes] normalized value The normalized value · · whiteSpace facet · · partition Define a partition post-schema-validation infoset We refer to the augmented infoset which results from conformant processing as defined in this specification as the post-schema-validation infoset QName A QName [XML-Namespaces] QName [XML Schemas: Datatypes] resolve Whenever the word resolve · · QName resolution (Schema Document) (§3.15.3) restriction A type definition whose declarations or facets are in a one-to-one relation with those of another specified type definition, with each in turn restricting the possibilities of the one it corresponds to, is said to be a restriction schema component Schema component Schema Component Constraint Constraints on the schema components themselves, i.e. conditions components must satisfy to be components at all. Located in the sixth sub-section of the per-component sections of Schema Component Details (§3) Schema Component Constraints (§C.4) schema document A document in this form (i.e. a <schema> schema document Schema Information Set Contribution Augmentations to · · · · · · Schema Component Details (§3) Contributions to the post-schema-validation infoset (§C.2) Schema Representation Constraint Constraints on the representation of schema components in XML beyond those which are expressed in Schema for Schemas (normative) (§A) Schema Component Details (§3) Schema Representation Constraints (§C.3) simple ur-type definition the simple ur-type definition · · anySimpleType substitution group Every element declaration (call this HEAD {element declarations} substitution group {element declarations} symbol space this specification introduces the term symbol space target namespace Several kinds of component have a target namespace · · [XML-Namespaces] type definition This specification uses the phrase type definition Type Definition Hierarchy Except for a distinguished · · · · · · · · Type Definition Hierarchy ur-type definition A distinguished complex type definition, the ur-type definition anyType · · valid the word valid 1 valid extension If this constraint Derivation Valid (Extension) (§3.4.6) valid extension {base type definition} valid restriction If this constraint Derivation Valid (Restriction, Complex) (§3.4.6) valid restriction {base type definition} valid restriction If this constraint Derivation Valid (Restriction, Simple) (§3.14.6) valid restriction · · validation root This item, that is the element information item at which · · validation root Validation Rules Contributions to · · Schema Component Details (§3) Validation Rules (§C.1) XML Schema An XML Schema · · The DTD for schema documents is given below. Note there is no schema Although this DTD is non-normative, any XML document which is not valid per this DTD, given redefinitions in its internal subset of the 'p' and 's' parameter entities below appropriate to its namespace declaration of the XML Schema namespace, is almost certainly not a valid schema document, with the exception of documents with multiple namespace prefixes for the XML Schema namespace itself. Accordingly authoring XML Schema documents using this DTD and DTD-based authoring tools, and specifying it as the DOCTYPE of documents intended to be XML Schema documents and validating them with a validating XML parser, are sensible development strategies which users are encouraged to adopt until XML Schema-based authoring tools and validators are more widely available. <!-- DTD for XML Schemas: Part 1: Structures Public Identifier: "-//W3C//DTD XMLSCHEMA 200102//EN" Official Location: http://www.w3.org/2001/XMLSchema.dtd --> <!-- Id: structures.dtd,v 1.1 2003/08/28 13:30:52 ht Exp --> <!-- With the exception of cases with multiple namespace prefixes for the XML Schema namespace, any XML document which is not valid per this DTD given redefinitions in its internal subset of the 'p' and 's' parameter entities below appropriate to its namespace declaration of the XML Schema namespace is almost certainly not a valid schema. -->
<!-- The simpleType element and its constituent parts are defined in XML Schema: Part 2: Datatypes --> <!ENTITY % xs-datatypes PUBLIC 'datatypes' 'datatypes.dtd' >
<!ENTITY % p 'xs:'> <!-- can be overriden in the internal subset of a schema document to establish a different namespace prefix --> <!ENTITY % s ':xs'> <!-- if %p is defined (e.g. as foo:) then you must also define %s as the suffix for the appropriate namespace declaration (e.g. :foo) --> <!ENTITY % nds 'xmlns%s;'>
<!-- Define all the element names, with optional prefix --> <!ENTITY % schema "%p;schema"> <!ENTITY % complexType "%p;complexType"> <!ENTITY % complexContent "%p;complexContent"> <!ENTITY % simpleContent "%p;simpleContent"> <!ENTITY % extension "%p;extension"> <!ENTITY % element "%p;element"> <!ENTITY % unique "%p;unique"> <!ENTITY % key "%p;key"> <!ENTITY % keyref "%p;keyref"> <!ENTITY % selector "%p;selector"> <!ENTITY % field "%p;field"> <!ENTITY % group "%p;group"> <!ENTITY % all "%p;all"> <!ENTITY % choice "%p;choice"> <!ENTITY % sequence "%p;sequence"> <!ENTITY % any "%p;any"> <!ENTITY % anyAttribute "%p;anyAttribute"> <!ENTITY % attribute "%p;attribute"> <!ENTITY % attributeGroup "%p;attributeGroup"> <!ENTITY % include "%p;include"> <!ENTITY % import "%p;import"> <!ENTITY % redefine "%p;redefine"> <!ENTITY % notation "%p;notation">
<!-- annotation elements --> <!ENTITY % annotation "%p;annotation"> <!ENTITY % appinfo "%p;appinfo"> <!ENTITY % documentation "%p;documentation">
<!-- Customisation entities for the ATTLIST of each element type. Define one of these if your schema takes advantage of the anyAttribute='##other' in the schema for schemas -->
<!ENTITY % schemaAttrs ''> <!ENTITY % complexTypeAttrs ''> <!ENTITY % complexContentAttrs ''> <!ENTITY % simpleContentAttrs ''> <!ENTITY % extensionAttrs ''> <!ENTITY % elementAttrs ''> <!ENTITY % groupAttrs ''> <!ENTITY % allAttrs ''> <!ENTITY % choiceAttrs ''> <!ENTITY % sequenceAttrs ''> <!ENTITY % anyAttrs ''> <!ENTITY % anyAttributeAttrs ''> <!ENTITY % attributeAttrs ''> <!ENTITY % attributeGroupAttrs ''> <!ENTITY % uniqueAttrs ''> <!ENTITY % keyAttrs ''> <!ENTITY % keyrefAttrs ''> <!ENTITY % selectorAttrs ''> <!ENTITY % fieldAttrs ''> <!ENTITY % includeAttrs ''> <!ENTITY % importAttrs ''> <!ENTITY % redefineAttrs ''> <!ENTITY % notationAttrs ''> <!ENTITY % annotationAttrs ''> <!ENTITY % appinfoAttrs ''> <!ENTITY % documentationAttrs ''>
<!ENTITY % complexDerivationSet "CDATA"> <!-- #all or space-separated list drawn from derivationChoice --> <!ENTITY % blockSet "CDATA"> <!-- #all or space-separated list drawn from derivationChoice + 'substitution' -->
<!ENTITY % mgs '%all; | %choice; | %sequence;'> <!ENTITY % cs '%choice; | %sequence;'> <!ENTITY % formValues '(qualified|unqualified)'>
<!ENTITY % attrDecls '((%attribute;| %attributeGroup;)*,(%anyAttribute;)?)'>
<!ENTITY % particleAndAttrs '((%mgs; | %group;)?, %attrDecls;)'>
<!-- This is used in part2 --> <!ENTITY % restriction1 '((%mgs; | %group;)?)'>
%xs-datatypes;
<!-- the duplication below is to produce an unambiguous content model which allows annotation everywhere --> <!ELEMENT %schema; ((%include; | %import; | %redefine; | %annotation;)*, ((%simpleType; | %complexType; | %element; | %attribute; | %attributeGroup; | %group; | %notation; ), (%annotation;)*)* )> <!ATTLIST %schema; targetNamespace %URIref; #IMPLIED version CDATA #IMPLIED %nds; %URIref; #FIXED 'http://www.w3.org/2001/XMLSchema' xmlns CDATA #IMPLIED finalDefault %complexDerivationSet; '' blockDefault %blockSet; '' id ID #IMPLIED elementFormDefault %formValues; 'unqualified' attributeFormDefault %formValues; 'unqualified' xml:lang CDATA #IMPLIED %schemaAttrs;> <!-- Note the xmlns declaration is NOT in the Schema for Schemas, because at the Infoset level where schemas operate, xmlns(:prefix) is NOT an attribute! --> <!-- The declaration of xmlns is a convenience for schema authors --> <!-- The id attribute here and below is for use in external references from non-schemas using simple fragment identifiers. It is NOT used for schema-to-schema reference, internal or external. -->
<!-- a type is a named content type specification which allows attribute declarations--> <!-- -->
<!ELEMENT %complexType; ((%annotation;)?, (%simpleContent;|%complexContent;| %particleAndAttrs;))>
<!ATTLIST %complexType; name %NCName; #IMPLIED id ID #IMPLIED abstract %boolean; #IMPLIED final %complexDerivationSet; #IMPLIED block %complexDerivationSet; #IMPLIED mixed (true|false) 'false' %complexTypeAttrs;>
<!-- particleAndAttrs is shorthand for a root type --> <!-- mixed is disallowed if simpleContent, overriden if complexContent has one too. -->
<!-- If anyAttribute appears in one or more referenced attributeGroups and/or explicitly, the intersection of the permissions is used -->
<!ELEMENT %complexContent; ((%annotation;)?, (%restriction;|%extension;))> <!ATTLIST %complexContent; mixed (true|false) #IMPLIED id ID #IMPLIED %complexContentAttrs;>
<!-- restriction should use the branch defined above, not the simple one from part2; extension should use the full model -->
<!ELEMENT %simpleContent; ((%annotation;)?, (%restriction;|%extension;))> <!ATTLIST %simpleContent; id ID #IMPLIED %simpleContentAttrs;>
<!-- restriction should use the simple branch from part2, not the one defined above; extension should have no particle -->
<!ELEMENT %extension; ((%annotation;)?, (%particleAndAttrs;))> <!ATTLIST %extension; base %QName; #REQUIRED id ID #IMPLIED %extensionAttrs;>
<!-- an element is declared by either: a name and a type (either nested or referenced via the type attribute) or a ref to an existing element declaration -->
<!ELEMENT %element; ((%annotation;)?, (%complexType;| %simpleType;)?, (%unique; | %key; | %keyref;)*)> <!-- simpleType or complexType only if no type|ref attribute --> <!-- ref not allowed at top level --> <!ATTLIST %element; name %NCName; #IMPLIED id ID #IMPLIED ref %QName; #IMPLIED type %QName; #IMPLIED minOccurs %nonNegativeInteger; #IMPLIED maxOccurs CDATA #IMPLIED nillable %boolean; #IMPLIED substitutionGroup %QName; #IMPLIED abstract %boolean; #IMPLIED final %complexDerivationSet; #IMPLIED block %blockSet; #IMPLIED default CDATA #IMPLIED fixed CDATA #IMPLIED form %formValues; #IMPLIED %elementAttrs;> <!-- type and ref are mutually exclusive. name and ref are mutually exclusive, one is required --> <!-- In the absence of type AND ref, type defaults to type of substitutionGroup, if any, else the ur-type, i.e. unconstrained --> <!-- default and fixed are mutually exclusive -->
<!ELEMENT %group; ((%annotation;)?,(%mgs;)?)> <!ATTLIST %group; name %NCName; #IMPLIED ref %QName; #IMPLIED minOccurs %nonNegativeInteger; #IMPLIED maxOccurs CDATA #IMPLIED id ID #IMPLIED %groupAttrs;>
<!ELEMENT %all; ((%annotation;)?, (%element;)*)> <!ATTLIST %all; minOccurs (1) #IMPLIED maxOccurs (1) #IMPLIED id ID #IMPLIED %allAttrs;>
<!ELEMENT %choice; ((%annotation;)?, (%element;| %group;| %cs; | %any;)*)> <!ATTLIST %choice; minOccurs %nonNegativeInteger; #IMPLIED maxOccurs CDATA #IMPLIED id ID #IMPLIED %choiceAttrs;>
<!ELEMENT %sequence; ((%annotation;)?, (%element;| %group;| %cs; | %any;)*)> <!ATTLIST %sequence; minOccurs %nonNegativeInteger; #IMPLIED maxOccurs CDATA #IMPLIED id ID #IMPLIED %sequenceAttrs;>
<!-- an anonymous grouping in a model, or a top-level named group definition, or a reference to same -->
<!-- Note that if order is 'all', group is not allowed inside. If order is 'all' THIS group must be alone (or referenced alone) at the top level of a content model --> <!-- If order is 'all', minOccurs==maxOccurs==1 on element/any inside --> <!-- Should allow minOccurs=0 inside order='all' . . . -->
<!ELEMENT %any; (%annotation;)?> <!ATTLIST %any; namespace CDATA '##any' processContents (skip|lax|strict) 'strict' minOccurs %nonNegativeInteger; '1' maxOccurs CDATA '1' id ID #IMPLIED %anyAttrs;>
<!-- namespace is interpreted as follows: ##any - - any non-conflicting WFXML at all
##other - - any non-conflicting WFXML from namespace other than targetNamespace
##local - - any unqualified non-conflicting WFXML/attribute one or - - any non-conflicting WFXML from more URI the listed namespaces references
##targetNamespace ##local may appear in the above list, with the obvious meaning -->
<!ELEMENT %anyAttribute; (%annotation;)?> <!ATTLIST %anyAttribute; namespace CDATA '##any' processContents (skip|lax|strict) 'strict' id ID #IMPLIED %anyAttributeAttrs;> <!-- namespace is interpreted as for 'any' above -->
<!-- simpleType only if no type|ref attribute --> <!-- ref not allowed at top level, name iff at top level --> <!ELEMENT %attribute; ((%annotation;)?, (%simpleType;)?)> <!ATTLIST %attribute; name %NCName; #IMPLIED id ID #IMPLIED ref %QName; #IMPLIED type %QName; #IMPLIED use (prohibited|optional|required) #IMPLIED default CDATA #IMPLIED fixed CDATA #IMPLIED form %formValues; #IMPLIED %attributeAttrs;> <!-- type and ref are mutually exclusive. name and ref are mutually exclusive, one is required --> <!-- default for use is optional when nested, none otherwise --> <!-- default and fixed are mutually exclusive --> <!-- type attr and simpleType content are mutually exclusive -->
<!-- an attributeGroup is a named collection of attribute decls, or a reference thereto --> <!ELEMENT %attributeGroup; ((%annotation;)?, (%attribute; | %attributeGroup;)*, (%anyAttribute;)?) > <!ATTLIST %attributeGroup; name %NCName; #IMPLIED id ID #IMPLIED ref %QName; #IMPLIED %attributeGroupAttrs;>
<!-- ref iff no content, no name. ref iff not top level -->
<!-- better reference mechanisms --> <!ELEMENT %unique; ((%annotation;)?, %selector;, (%field;)+)> <!ATTLIST %unique; name %NCName; #REQUIRED id ID #IMPLIED %uniqueAttrs;>
<!ELEMENT %key; ((%annotation;)?, %selector;, (%field;)+)> <!ATTLIST %key; name %NCName; #REQUIRED id ID #IMPLIED %keyAttrs;>
<!ELEMENT %keyref; ((%annotation;)?, %selector;, (%field;)+)> <!ATTLIST %keyref; name %NCName; #REQUIRED refer %QName; #REQUIRED id ID #IMPLIED %keyrefAttrs;>
<!ELEMENT %selector; ((%annotation;)?)> <!ATTLIST %selector; xpath %XPathExpr; #REQUIRED id ID #IMPLIED %selectorAttrs;> <!ELEMENT %field; ((%annotation;)?)> <!ATTLIST %field; xpath %XPathExpr; #REQUIRED id ID #IMPLIED %fieldAttrs;>
<!-- Schema combination mechanisms --> <!ELEMENT %include; (%annotation;)?> <!ATTLIST %include; schemaLocation %URIref; #REQUIRED id ID #IMPLIED %includeAttrs;>
<!ELEMENT %import; (%annotation;)?> <!ATTLIST %import; namespace %URIref; #IMPLIED schemaLocation %URIref; #IMPLIED id ID #IMPLIED %importAttrs;>
<!ELEMENT %redefine; (%annotation; | %simpleType; | %complexType; | %attributeGroup; | %group;)*> <!ATTLIST %redefine; schemaLocation %URIref; #REQUIRED id ID #IMPLIED %redefineAttrs;>
<!ELEMENT %notation; (%annotation;)?> <!ATTLIST %notation; name %NCName; #REQUIRED id ID #IMPLIED public CDATA #REQUIRED system %URIref; #IMPLIED %notationAttrs;>
<!-- Annotation is either application information or documentation --> <!-- By having these here they are available for datatypes as well as all the structures elements -->
<!ELEMENT %annotation; (%appinfo; | %documentation;)*> <!ATTLIST %annotation; %annotationAttrs;>
<!-- User must define annotation elements in internal subset for this to work --> <!ELEMENT %appinfo; ANY> <!-- too restrictive --> <!ATTLIST %appinfo; source %URIref; #IMPLIED id ID #IMPLIED %appinfoAttrs;> <!ELEMENT %documentation; ANY> <!-- too restrictive --> <!ATTLIST %documentation; source %URIref; #IMPLIED id ID #IMPLIED xml:lang CDATA #IMPLIED %documentationAttrs;>
<!NOTATION XMLSchemaStructures PUBLIC 'structures' 'http://www.w3.org/2001/XMLSchema.xsd' > <!NOTATION XML PUBLIC 'REC-xml-1998-0210' 'http://www.w3.org/TR/1998/REC-xml-19980210' > A specification of the import of Unique Particle Attribution (§3.8.6) [Definition:] overlap They are both element declaration particles whose declarations have the same {name} {target namespace} or They are both element declaration particles one of whose {name} {target namespace} · · or They are both wildcards, and the intensional intersection of their {namespace constraint} Attribute Wildcard Intersection (§3.10.6) or One is a wildcard and the other an element declaration, and the {target namespace} · · · · {namespace constraint} A content model will violate the unique attribution constraint if it contains two particles which · · are both in the {particles} choice all or may · · {min occurs} {max occurs} Two particles may · · A precise formulation of this constraint can also be offered in terms of operations on finite-state automaton: transcribe the content model into an automaton in the usual way using epsilon transitions for optionality and unbounded maxOccurs, unfolding other numeric occurrence ranges and treating the heads of substitution groups as if they were choices over all elements in the group, but Document Content Description for XML (DCD) http://www.w3.org/TR/1998/NOTE-dcd-19980731 Document Definition Markup Language http://www.w3.org/TR/1999/NOTE-ddml-19990119 Schema for Object-oriented XML http://www.w3.org/1999/07/NOTE-SOX-19990730/ Schema for Object-oriented XML http://www.w3.org/TR/NOTE-SOX/ XML-Data Reduced http://www.ltg.ed.ac.uk/~ht/XMLData-Reduced.htm XML Schema Part 0: Primer http://www.w3.org/TR/2004/REC-xmlschema-0-20041028/primer.html XML-Data http://www.w3.org/TR/1998/NOTE-XML-data-0105/ The following contributed material to the first edition of this specification: David Fallside, IBM The editors acknowledge the members of the XML Schema Working Group, the members of other W3C Working Groups, and industry experts in other forums who have contributed directly or indirectly to the process or content of creating this document. The Working Group is particularly grateful to Lotus Development Corp. and IBM for providing teleconferencing facilities. At the time the first edition of this specification was published, the members of the XML Schema Working Group
were: Jim Barnette, Defense Information Systems Agency (DISA) Paul V. Biron, Health Level Seven Don Box, DevelopMentor Allen Brown, Microsoft Lee Buck, TIBCO Extensibility Charles E. Campbell, Informix Wayne Carr, Intel Peter Chen, Bootstrap Alliance and LSU David Cleary, Progress Software Dan Connolly, W3C ( staff contact Ugo Corda, Xerox Roger L. Costello, MITRE Haavard Danielson, Progress Software Josef Dietl, Mozquito Technologies David Ezell, Hewlett-Packard Company Alexander Falk, Altova GmbH David Fallside, IBM Dan Fox, Defense Logistics Information Service (DLIS) Matthew Fuchs, Commerce One Andrew Goodchild, Distributed Systems Technology Centre (DSTC Pty Ltd) Paul Grosso, Arbortext, Inc Martin Gudgin, DevelopMentor Dave Hollander, Contivo, Inc ( co-chair Mary Holstege, Invited Expert Jane Hunter, Distributed Systems Technology Centre (DSTC Pty Ltd) Rick Jelliffe, Academia Sinica Simon Johnston, Rational Software Bob Lojek, Mozquito Technologies Ashok Malhotra, Microsoft Lisa Martin, IBM Noah Mendelsohn, Lotus Development Corporation Adrian Michel, Commerce One Alex Milowski, Invited Expert Don Mullen, TIBCO Extensibility Dave Peterson, Graphic Communications Association Jonathan Robie, Software AG Eric Sedlar, Oracle Corp. C. M. Sperberg-McQueen, W3C ( co-chair Bob Streich, Calico Commerce William K. Stumbo, Xerox Henry S. Thompson, University of Edinburgh Mark Tucker, Health Level Seven Asir S. Vedamuthu, webMethods, Inc Priscilla Walmsley, XMLSolutions Norm Walsh, Sun Microsystems Aki Yoshida, SAP AG Kongyi Zhou, Oracle Corp. The XML Schema Working Group has benefited in its work from the participation and contributions of a number of people not currently members of the Working Group, including in particular those named below. Affiliations given are those current at the time of their work with the WG. Paula Angerstein, Vignette Corporation David Beech, Oracle Corp. Gabe Beged-Dov, Rogue Wave Software Greg Bumgardner, Rogue Wave Software Dean Burson, Lotus Development Corporation Mike Cokus, MITRE Andrew Eisenberg, Progress Software Rob Ellman, Calico Commerce George Feinberg, Object Design Charles Frankston, Microsoft Ernesto Guerrieri, Inso Michael Hyman, Microsoft Renato Iannella, Distributed Systems Technology Centre (DSTC Pty Ltd) Dianne Kennedy, Graphic Communications Association Janet Koenig, Sun Microsystems Setrag Khoshafian, Technology Deployment International (TDI) Ara Kullukian, Technology Deployment International (TDI) Andrew Layman, Microsoft Dmitry Lenkov, Hewlett-Packard Company John McCarthy, Lawrence Berkeley National Laboratory Murata Makoto, Xerox Eve Maler, Sun Microsystems Murray Maloney, Muzmo Communication, acting for Commerce One Chris Olds, Wall Data Frank Olken, Lawrence Berkeley National Laboratory Shriram Revankar, Xerox Mark Reinhold, Sun Microsystems John C. Schneider, MITRE Lew Shannon, NCR William Shea, Merrill Lynch Ralph Swick, W3C Tony Stewart, Rivcom Matt Timmermans, Microstar Jim Trezzo, Oracle Corp. Steph Tryphonas, Microstar The lists given above pertain to the first edition. At the time work on this second edition was completed, the membership of the Working Group was: Leonid Arbouzov, Sun Microsystems Jim Barnette, Defense Information Systems Agency (DISA) Paul V. Biron, Health Level Seven Allen Brown, Microsoft Charles E. Campbell, Invited expert Peter Chen, Invited expert Tony Cincotta, NIST David Ezell, National Association of Convenience Stores Matthew Fuchs, Invited expert Sandy Gao, IBM Andrew Goodchild, Distributed Systems Technology Centre (DSTC Pty Ltd) Xan Gregg, Invited expert Mary Holstege, Mark Logic Mario Jeckle, DaimlerChrysler Marcel Jemio, Data Interchange Standards Association Kohsuke Kawaguchi, Sun Microsystems Ashok Malhotra, Invited expert Lisa Martin, IBM Jim Melton, Oracle Corp Noah Mendelsohn, IBM Dave Peterson, Invited expert Anli Shundi, TIBCO Extensibility C. M. Sperberg-McQueen, W3C ( co-chair Hoylen Sue, Distributed Systems Technology Centre (DSTC Pty Ltd) Henry S. Thompson, University of Edinburgh Asir S. Vedamuthu, webMethods, Inc Priscilla Walmsley, Invited expert Kongyi Zhou, Oracle Corp. We note with sadness the accidental death of Mario Jeckle shortly after the completion of work on this document. In addition to those named above, several people served on the Working Group during the development of this second edition: Oriol Carbo, University of Edinburgh Tyng-Ruey Chuang, Academia Sinica Joey Coyle, Health Level 7 Tim Ewald, DevelopMentor Nelson Hung, Corel Melanie Kudela, Uniform Code Council Matthew MacKenzie, XML Global Cliff Schmidt, Microsoft John Stanton, Defense Information Systems Agency John Tebbutt, NIST Ross Thompson, Contivo Scott Vorthmann, TIBCO Extensibility