W3C

Advanced XML Schema Patterns for Databinding Version 1.0

W3C Working Draft 22 November 2006

This version:
http://www.w3.org/TR/2006/WD-xmlschema-patterns-advanced-20061122/
Latest version:
http://www.w3.org/TR/xmlschema-patterns-advanced
Editors:
Jonathan Calladine, BT
George Cowe, Origo Services Limited
Paul Downey, BT
Yves Lafon, W3C

Abstract

This specification provides a set of [XML Schema 1.0] patterns in common use, but which are known to casue issues with state of the art databinding implementations. The patterns may be used in conjunction with the [Basic Patterns] to describe XML representations of commonly used data structures. The data structures described are intended to be independent of any particular programming language, database or modelling environment.

Status of this Document

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

This document has been produced by the XML Schema Patterns for Databinding Working Group, which is part of the W3C Web Services Activity. The Working Group plans to submit a subsequent version of this specification for consideration as a W3C Candidate Recommendation.

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

This document is a W3C First Public Working Draft published to solicit comments from interested parties. Please submit comments on this document to the public public-xsd-databinding-comments@w3.org mailing list (public archive).

The Working Group solicits contributions to the test suite in the form of implementation reports and additional test cases.

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


Table of Contents

1. Introduction
    1.1 Notational Conventions
    1.2 Namespaces
    1.3 Document Conformance
    1.4 Implementation Conformance
2. Schema Patterns
    2.1 Properties
    2.2 Import and Include
    2.3 Global Element Declarations
    2.4 Global Attribute Declarations
    2.5 Element Declarations
    2.6 Attribute Declarations
    2.7 SimpleType Declarations
    2.8 ComplexType Declarations
    2.9 Sequences
    2.10 Unions
    2.11 Lists
    2.12 Element Predefined Types
    2.13 Attribute Predefined Types
    2.14 Restricted Schema Types
3. Data Types & Structures
    3.1 Default Value
    3.2 Map
    3.3 Extensible Enumeration
4. References
    4.1 Normative References
    4.2 Informative References

Appendices

A. Relationship with the WS-I Basic Profile (Non-Normative)
B. Pattern Summary (Non-Normative)
C. Assertion Summary (Non-Normative)
D. Acknowledgements (Non-Normative)


1. Introduction

A databinding tool generates a mapping between XML documents which conform to an [XML Schema 1.0] schema and an internal data representation. For example, a Web services databinding tool may use [XML Schema 1.0] descriptions inside a [WSDL 2.0] document to produce and consume [SOAP 1.2] messages in terms of data structures in a programming language or data held inside a database.

State of the art databinding implementations have displayed uneven and inconsistent support of the W3C [XML Schema 1.0] Recommendation. XML Schema provides a wide variety of methods for describing the same XML structure, conversely a concept such as "null" may be represented in a wide variety of different ways.

The result of these issues is impaired interoperability and a poor user experience of databinding tools:

This specification provides a advanced set of example [XML Schema 1.0] constructs and types in the form of concrete [XPath 2.0] expressions. These patterns are known to be in widespread use and considered to be compatible with databinding implementations.

Implementers of databinding tools may find these patterns useful to represent simple and common place data structures. Ensuring tools recognise at least these simple [XML Schema 1.0] patterns and present them in terms most appropriate to the specific language, database or environment will provide an improved user experience when using databinding tools. It is inappropriate to use this specification to constrain the use of the [XML Schema 1.0] Recommendation.

1.1 Notational Conventions

All parts of this specification are normative, with the EXCEPTION of notes, examples, and sections explicitly marked as Non-Normative.

The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this specification are to be interpreted as described in [RFC 2119].

Each [XML Schema 1.0] pattern is defined using a single [XPath 2.0] expression constraining one or more [XML Schema 1.0] items.

Each [XML Schema 1.0] pattern is identified using a unique and stable URI [RFC 3986].

Assertions about documents and implementations that are not enforced by the normative patterns are marked by a dagger symbol (†) at the end of a sentence. Each assertion has been assigned a unique and stable identifier. The assertion identifiers MAY be used by implementations of this specification for any purpose, such as error reporting. The assertions and their identifiers are summarized in section C. Assertion Summary.

1.2 Namespaces

This specification uses a number of namespace prefixes throughout; they are listed in Table 1-1. Note that the choice of any namespace prefix is arbitrary and not semantically significant (see [XML Namespaces]).

Table 1-1. Prefixes and Namespaces used in this specification
Prefix Namespace
xs http://www.w3.org/2001/XMLSchema
xsi http://www.w3.org/2001/XMLSchema-instance
soap11 http://schemas.xmlsoap.org/soap/envelope/
soap12 http://www.w3.org/2003/05/soap-envelope
wsdl11 http://schemas.xmlsoap.org/wsdl/
wsdl20 http://www.w3.org/2005/08/wsdl
pat http://www.w3.org/2002/ws/databinding/patterns/6/09/
ex http://www.w3.org/2002/ws/databinding/examples/6/09/

1.3 Document Conformance

A Document claiming conformance to this specification:

1.4 Implementation Conformance

An implementation that claims conformance to this specification:

  • SHOULD be able to process any valid [XML Schema 1.0] Document.
  • MUST be able to process any [XML Schema 1.0] Document conforming to this specification
  • MUST produce a data model exposing all of the [XML 1.0] element node and attribute node content described by the originating [XML Schema 1.0] Document.
  • MUST be able to consume any Well-formed [XML 1.0] Document which satisfies local-schema validity against the originating [XML Schema 1.0] Document exposing all of the [XML 1.0] element node and attribute node content in the data model.
  • MUST be able to produce Well-formed [XML 1.0] instance documents which satisfy local-schema validity against the originating [XML Schema 1.0] Document containing values exposed in the data model.
  • MAY consume Well-formed [XML 1.0] instance documents which do not satisfy local-schema validity against the originating [XML Schema 1.0] Document.
  • MAY allow the production of Well-formed [XML 1.0] instance documents containing values exposed in the data model which do not satisfy local-schema validity against the originating [XML Schema 1.0] Document.

Describing the form of the data model provided by a databinding implementation is beyond the scope of this specification. For example, the unconstrained built-in numeric primitive types, xs:decimal, xs:integer, xs:negativeInteger, xs:positiveInteger, xs:nonNegativeInteger and xs:nonPositiveInteger, do not map directly to native types in many programming languages and are likely to be presented as a toolkit specific construct or more generalised ways, such as a 'string'.

Note that although the patterns contained in this document are defined using [XPath 2.0], there is no requirement for a conformant implementation to support [XPath 2.0].

2. Schema Patterns

This section enumerates a series of concrete [XML Schema 1.0] patterns. Each pattern is identified by a URI [RFC 3986], defined using an [XPath 2.0] expression and accompanied by an example schema and one or more instance documents. This document offers no additional semantics for the schema patterns presented beyond those specified by the [XML Schema 1.0] Recommendation.

2.1 Properties

2.1.1 MixedContentElement

An [XML 1.0] document exhibits the MixedContentElement pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/MixedContentElement when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:element[@mixed = 'true']/ (@mixed)

2.1.2 MixedComplexContent

An [XML 1.0] document exhibits the MixedComplexContent pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/MixedComplexContent when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:complexContent[@mixed = 'true']/ (@mixed)

2.1.3 MixedContentType

An [XML 1.0] document exhibits the MixedContentType pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/MixedContentType when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:complexType[@mixed = 'true']/ (@mixed)

The following example [XML Schema 1.0] extract illustrates the use of the MixedContentType pattern within an [XML Schema 1.0] document MixedContentType:

<xs:element name="mixedContentType" type="ex:MixedContentType" />
<xs:complexType name="MixedContentType" mixed="true">
  <xs:sequence>
    <xs:element name="elem1" type="xs:string" />
    <xs:element name="elem2" type="xs:string" />
  </xs:sequence>
</xs:complexType>
    

The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document MixedContentType01:

  <ex:mixedContentType>
      <ex:elem1>Tagged Value</ex:elem1>

      mixed value
      
      
      <ex:elem2>Tagged Value</ex:elem2>
   </ex:mixedContentType>

as is the following element when included in an instance document MixedContentType02:

  <ex:mixedContentType>

      some text
      
      
      <ex:elem1>Tagged Value</ex:elem1>

      more text
      
      
      <ex:elem2>Tagged Value</ex:elem2>
   </ex:mixedContentType>

and the following element when included in an instance document MixedContentType03:

  <ex:mixedContentType>
      <ex:elem1>Tagged Value</ex:elem1>

      mixed text value
      
      
      <ex:elem2>Tagged Value</ex:elem2>

      mixed text value
   
   
   </ex:mixedContentType>

and the following element when included in an instance document MixedContentType04:

  <ex:mixedContentType>

      text mixed value
      
      
      <ex:elem1>Tagged Value</ex:elem1>
      <ex:elem2>Tagged Value</ex:elem2>

      some more text in a mixed value
   
   
   </ex:mixedContentType>

2.2 Import and Include

2.2.1 ImportSchemaNamespace

An [XML 1.0] document exhibits the ImportSchemaNamespace pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/ImportSchemaNamespace when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

./xs:import[not(@schemaLocation) and @namespace = 'http://www.w3.org/2001/XMLSchema']/ (., @namespace)

The following example [XML Schema 1.0] extract illustrates the use of the ImportSchemaNamespace pattern within an [XML Schema 1.0] document ImportSchemaNamespace:

<xs:import namespace="http://www.w3.org/2001/XMLSchema" />
<xs:element name="importSchemaNamespace" type="xs:string" />
    

The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document ImportSchemaNamespace01:

  <ex:importSchemaNamespace>hello service</ex:importSchemaNamespace>

2.3 Global Element Declarations

2.3.1 GlobalElementUnqualifiedType

An [XML 1.0] document exhibits the GlobalElementUnqualifiedType pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/GlobalElementUnqualifiedType when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

./xs:element[@name and @type and not(contains(@type, ':'))]/ (., @name, @type)

2.3.2 ElementTypeDefaultNamespace

An [XML 1.0] document exhibits the ElementTypeDefaultNamespace pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/ElementTypeDefaultNamespace when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:element[@name and @type and not(contains(@type, ':'))]/ (@name, @type)

The following example [XML Schema 1.0] extract illustrates the use of the ElementTypeDefaultNamespace pattern within an [XML Schema 1.0] document ElementTypeDefaultNamespace:

<xs:element name="stringElementDefaultNamespace" type="string" />
    

The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document ElementTypeDefaultNamespace01:

  <ex:stringElementDefaultNamespace/>

as is the following element when included in an instance document ElementTypeDefaultNamespace02:

  <ex:stringElementDefaultNamespace>This is a string!</ex:stringElementDefaultNamespace>

2.3.3 GlobalElementAbstract

An [XML 1.0] document exhibits the GlobalElementAbstract pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/GlobalElementAbstract when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

./xs:element[@abstract='true']/ (@abstract)

2.3.4 GlobalElementAll

An [XML 1.0] document exhibits the GlobalElementAll pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/GlobalElementAll when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

./xs:element[@name]/xs:complexType/xs:all[xs:element]/ (../../(., @name), .., ., xs:element/(., @name))

2.3.5 GlobalElementChoice

An [XML 1.0] document exhibits the GlobalElementChoice pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/GlobalElementChoice when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

./xs:element[@name]/xs:complexType/xs:choice[xs:element]/ (../../(., @name), .., ., xs:element/(., @name))

2.3.6 GlobalElementComplexTypeSequenceExtension

An [XML 1.0] document exhibits the GlobalElementComplexTypeSequenceExtension pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/GlobalElementComplexTypeSequenceExtension when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

./xs:element[@name]/xs:complexType/xs:complexContent[xs:extension[@base]/xs:sequence]/ (../../(., @name), .., ., xs:extension/(., @base, xs:sequence/(., xs:element/(., @name), xs:attribute/(., @name))))

2.4 Global Attribute Declarations

2.4.1 GlobalAttributeUnqualifiedType

An [XML 1.0] document exhibits the GlobalAttributeUnqualifiedType pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/GlobalAttributeUnqualifiedType when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

./xs:attribute[@name and @type and not(contains(@type, ':'))]/ (., @name, @type)

2.5 Element Declarations

2.5.1 ElementMinOccursFinite

An [XML 1.0] document exhibits the ElementMinOccursFinite pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/ElementMinOccursFinite when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:element[xs:integer(@minOccurs) gt 1]/ (@minOccurs)

The following example [XML Schema 1.0] extract illustrates the use of the ElementMinOccursFinite pattern within an [XML Schema 1.0] document ElementMinOccurs2orMore:

<xs:element name="itemColors" type="ex:ItemColors" />
<xs:complexType name="ItemColors">
  <xs:sequence>
    <xs:element name="itemColor" type="xs:string" minOccurs="2" maxOccurs="unbounded" />
  </xs:sequence>
</xs:complexType>
    

The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document ElementMinOccurs2orMore01:

  <ex:itemColors>
      <ex:itemColor>Red</ex:itemColor>
      <ex:itemColor>Black</ex:itemColor>
      <ex:itemColor>White</ex:itemColor>
      <ex:itemColor>Yellow</ex:itemColor>
   </ex:itemColors>

as is the following element when included in an instance document ElementMinOccurs2orMore02:

  <ex:itemColors>
      <ex:itemColor>Black</ex:itemColor>
      <ex:itemColor>White</ex:itemColor>
   </ex:itemColors>

2.5.2 AttributeElementNameClash

An [XML 1.0] document exhibits the AttributeElementNameClash pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/AttributeElementNameClash when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:complexType/xs:sequence/xs:element[@name = ../../xs:attribute/@name]/ (@name)

The following example [XML Schema 1.0] extract illustrates the use of the AttributeElementNameClash pattern within an [XML Schema 1.0] document AttributeElementNameClash:

<xs:element name="clientDetails" type="ex:ClientDetails" />
<xs:complexType name="ClientDetails">
  <xs:sequence>
    <xs:element name="forename" type="xs:string" />
    <xs:element name="surname" type="xs:string" />
    <xs:element name="title" type="xs:string" />
  </xs:sequence>
  <xs:attribute name="phone" type="xs:long" />
  <xs:attribute name="title" type="xs:boolean" />
</xs:complexType>
    

The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document AttributeElementNameClash01:

  <ex:clientDetails phone="01211345678" title="true">
      <ex:forename>Bobby</ex:forename>
      <ex:surname>Sox</ex:surname>
      <ex:title>Mr</ex:title>
   </ex:clientDetails>

2.5.3 ElementTypeReferenceUnqualified

An [XML 1.0] document exhibits the ElementTypeReferenceUnqualified pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/ElementTypeReferenceUnqualified when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:element[@name and @type and namespace-uri-from-QName(resolve-QName(@type,.)) != 'http://www.w3.org/2001/XMLSchema' and not(contains(@type, ':'))]/ (., @name, @type)

2.5.4 ElementReferenceUnqualified

An [XML 1.0] document exhibits the ElementReferenceUnqualified pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/ElementReferenceUnqualified when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:element[@ref and not(contains(@ref, ':'))]/ (., @ref)

2.6 Attribute Declarations

2.6.1 ElementDefault

An [XML 1.0] document exhibits the ElementDefault pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/ElementDefault when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:element[@default]/ (@default)

2.6.2 AttributeDefault

An [XML 1.0] document exhibits the AttributeDefault pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/AttributeDefault when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:attribute[@default] / (@default)

The following example [XML Schema 1.0] extract illustrates the use of the AttributeDefault pattern within an [XML Schema 1.0] document AttributeDefault:

<xs:element name="attributeDefault" type="ex:AttributeDefault" />
<xs:complexType name="AttributeDefault">
  <xs:sequence>
    <xs:element name="text" type="xs:string" minOccurs="0" />
  </xs:sequence>
  <xs:attribute name="defaultedValue" type="xs:string" default="theDefaultValue" />
</xs:complexType>
    

The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document AttributeDefault01:

  <ex:attributeDefault/>

as is the following element when included in an instance document AttributeDefault02:

  <ex:attributeDefault defaultedValue="theDefaultValue"/>

and the following element when included in an instance document AttributeDefault03:

  <ex:attributeDefault defaultedValue=""/>

and the following element when included in an instance document AttributeDefault04:

  <ex:attributeDefault defaultedValue="anotherValue"/>

2.6.3 AttributeReferenceUnqualified

An [XML 1.0] document exhibits the AttributeReferenceUnqualified pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/AttributeReferenceUnqualified when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:attribute[@ref and not(contains(@ref, ':'))]/ (., @ref)

2.6.4 AttributeTypeReferenceUnqualified

An [XML 1.0] document exhibits the AttributeTypeReferenceUnqualified pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/AttributeTypeReferenceUnqualified when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:attribute[@name and @type and namespace-uri-from-QName(resolve-QName(@type,.)) != 'http://www.w3.org/2001/XMLSchema' and not(contains(@type, ':'))]/ (., @name, @type)

2.6.5 LocalAttributeSimpleType

An [XML 1.0] document exhibits the LocalAttributeSimpleType pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/LocalAttributeSimpleType when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:attribute[not(parent::xs:schema)]/xs:simpleType

2.7 SimpleType Declarations

2.7.1 IntEnumerationType

An [XML 1.0] document exhibits the IntEnumerationType pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/IntEnumerationType when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:simpleType/xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:int') and xs:enumeration]/ (., @base, xs:enumeration/(., @value))

The following example [XML Schema 1.0] extract illustrates the use of the IntEnumerationType pattern within an [XML Schema 1.0] document IntEnumerationType:

<xs:element name="intEnumerationType" type="ex:IntEnumerationType" />
<xs:simpleType name="IntEnumerationType">
  <xs:restriction base="xs:int">
    <xs:enumeration value="2" />
    <xs:enumeration value="3" />
    <xs:enumeration value="5" />
    <xs:enumeration value="7" />
  </xs:restriction>
</xs:simpleType>
    

The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document IntEnumerationType01:

  <ex:intEnumerationType>2</ex:intEnumerationType>

2.7.2 ShortEnumerationType

An [XML 1.0] document exhibits the ShortEnumerationType pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/ShortEnumerationType when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:simpleType/xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:short') and xs:enumeration]/ (., @base, xs:enumeration/(., @value))

The following example [XML Schema 1.0] extract illustrates the use of the ShortEnumerationType pattern within an [XML Schema 1.0] document ShortEnumerationType:

<xs:element name="shortEnumerationType" type="ex:ShortEnumerationType" />
<xs:simpleType name="ShortEnumerationType">
  <xs:restriction base="xs:short">
    <xs:enumeration value="7" />
    <xs:enumeration value="11" />
    <xs:enumeration value="13" />
  </xs:restriction>
</xs:simpleType>
    

The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document ShortEnumerationType01:

  <ex:shortEnumerationType>11</ex:shortEnumerationType>

2.7.3 LongEnumerationType

An [XML 1.0] document exhibits the LongEnumerationType pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/LongEnumerationType when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:simpleType/xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:long') and xs:enumeration]/ (., @base, xs:enumeration/(., @value))

The following example [XML Schema 1.0] extract illustrates the use of the LongEnumerationType pattern within an [XML Schema 1.0] document LongEnumerationType:

<xs:element name="longEnumerationType" type="ex:LongEnumerationType" />
<xs:simpleType name="LongEnumerationType">
  <xs:restriction base="xs:long">
    <xs:enumeration value="9152052" />
    <xs:enumeration value="7816230" />
    <xs:enumeration value="7235733" />
  </xs:restriction>
</xs:simpleType>
    

The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document LongEnumerationType01:

  <ex:longEnumerationType>9152052</ex:longEnumerationType>

2.7.4 DoubleEnumerationType

An [XML 1.0] document exhibits the DoubleEnumerationType pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/DoubleEnumerationType when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:simpleType/xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:double') and xs:enumeration]/ (., @base, xs:enumeration/(., @value))

The following example [XML Schema 1.0] extract illustrates the use of the DoubleEnumerationType pattern within an [XML Schema 1.0] document DoubleEnumerationType:

<xs:element name="doubleEnumerationType" type="ex:DoubleEnumerationType" />
<xs:simpleType name="DoubleEnumerationType">
  <xs:restriction base="xs:double">
    <xs:enumeration value="1267.43233E12" />
    <xs:enumeration value="7234.34541E12" />
    <xs:enumeration value="5733.65565E12" />
  </xs:restriction>
</xs:simpleType>
    

The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document DoubleEnumerationType01:

  <ex:doubleEnumerationType>1267.43233E12</ex:doubleEnumerationType>

2.7.5 IntegerEnumerationType

An [XML 1.0] document exhibits the IntegerEnumerationType pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/IntegerEnumerationType when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:simpleType/xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:integer') and xs:enumeration]/ (., @base, xs:enumeration/(., @value))

The following example [XML Schema 1.0] extract illustrates the use of the IntegerEnumerationType pattern within an [XML Schema 1.0] document IntegerEnumerationType:

<xs:element name="integerEnumerationType" type="ex:IntegerEnumerationType" />
<xs:simpleType name="IntegerEnumerationType">
  <xs:restriction base="xs:integer">
    <xs:enumeration value="4000000" />
    <xs:enumeration value="5000000" />
    <xs:enumeration value="6000000" />
  </xs:restriction>
</xs:simpleType>
    

The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document IntegerEnumerationType01:

  <ex:integerEnumerationType>4000000</ex:integerEnumerationType>

2.7.6 DecimalEnumerationType

An [XML 1.0] document exhibits the DecimalEnumerationType pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/DecimalEnumerationType when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:simpleType/xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:decimal') and xs:enumeration]/ (., @base, xs:enumeration/(., @value))

The following example [XML Schema 1.0] extract illustrates the use of the DecimalEnumerationType pattern within an [XML Schema 1.0] document DecimalEnumerationType:

<xs:element name="decimalEnumerationType" type="ex:DecimalEnumerationType" />
<xs:simpleType name="DecimalEnumerationType">
  <xs:restriction base="xs:decimal">
    <xs:enumeration value="+1000.0001" />
    <xs:enumeration value="-1000.0001" />
    <xs:enumeration value="1000.0002" />
  </xs:restriction>
</xs:simpleType>
    

The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document DecimalEnumerationType01:

  <ex:decimalEnumerationType>1000.0002</ex:decimalEnumerationType>

2.7.7 FloatEnumerationType

An [XML 1.0] document exhibits the FloatEnumerationType pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/FloatEnumerationType when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:simpleType/xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:float') and xs:enumeration]/ (., @base, xs:enumeration/(., @value))

The following example [XML Schema 1.0] extract illustrates the use of the FloatEnumerationType pattern within an [XML Schema 1.0] document FloatEnumerationType:

<xs:element name="floatEnumerationType" type="ex:FloatEnumerationType" />
<xs:simpleType name="FloatEnumerationType">
  <xs:restriction base="xs:float">
    <xs:enumeration value="1267.43233E12" />
    <xs:enumeration value="7234.34541E12" />
    <xs:enumeration value="5733.65565E12" />
  </xs:restriction>
</xs:simpleType>
    

The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document FloatEnumerationType01:

  <ex:floatEnumerationType>1267.43233E12</ex:floatEnumerationType>

2.7.8 NonNegativeIntegerEnumerationType

An [XML 1.0] document exhibits the NonNegativeIntegerEnumerationType pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/NonNegativeIntegerEnumerationType when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:simpleType/xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:nonNegativeInteger') and xs:enumeration]/ (., @base, xs:enumeration/(., @value))

The following example [XML Schema 1.0] extract illustrates the use of the NonNegativeIntegerEnumerationType pattern within an [XML Schema 1.0] document NonNegativeIntegerEnumerationType:

<xs:element name="nonNegativeIntegerEnumerationType" type="ex:NonNegativeIntegerEnumerationType" />
<xs:simpleType name="NonNegativeIntegerEnumerationType">
  <xs:restriction base="xs:nonNegativeInteger">
    <xs:enumeration value="12" />
    <xs:enumeration value="24" />
    <xs:enumeration value="33" />
  </xs:restriction>
</xs:simpleType>
    

The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document NonNegativeIntegerEnumerationType01:

  <ex:nonNegativeIntegerEnumerationType>12</ex:nonNegativeIntegerEnumerationType>

2.7.9 PositiveIntegerEnumerationType

An [XML 1.0] document exhibits the PositiveIntegerEnumerationType pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/PositiveIntegerEnumerationType when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:simpleType/xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:positiveInteger') and xs:enumeration]/ (., @base, xs:enumeration/(., @value))

The following example [XML Schema 1.0] extract illustrates the use of the PositiveIntegerEnumerationType pattern within an [XML Schema 1.0] document PositiveIntegerEnumerationType:

<xs:element name="positiveIntegerEnumerationType" type="ex:PositiveIntegerEnumerationType" />
<xs:simpleType name="PositiveIntegerEnumerationType">
  <xs:restriction base="xs:positiveInteger">
    <xs:enumeration value="12" />
    <xs:enumeration value="24" />
    <xs:enumeration value="33" />
  </xs:restriction>
</xs:simpleType>
    

The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document PositiveIntegerEnumerationType01:

  <ex:positiveIntegerEnumerationType>12</ex:positiveIntegerEnumerationType>

2.7.10 UnsignedIntEnumerationType

An [XML 1.0] document exhibits the UnsignedIntEnumerationType pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/UnsignedIntEnumerationType when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:simpleType/xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:unsignedInt') and xs:enumeration]/ (., @base, xs:enumeration/(., @value))

The following example [XML Schema 1.0] extract illustrates the use of the UnsignedIntEnumerationType pattern within an [XML Schema 1.0] document UnsignedIntEnumerationType:

<xs:element name="unsignedIntEnumerationType" type="ex:UnsignedIntEnumerationType" />
<xs:simpleType name="UnsignedIntEnumerationType">
  <xs:restriction base="xs:unsignedInt">
    <xs:enumeration value="1111111111" />
    <xs:enumeration value="2222222222" />
    <xs:enumeration value="3333333333" />
  </xs:restriction>
</xs:simpleType>
    

The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document UnsignedIntEnumerationType01:

  <ex:unsignedIntEnumerationType>3333333333</ex:unsignedIntEnumerationType>

2.7.11 UnsignedLongEnumerationType

An [XML 1.0] document exhibits the UnsignedLongEnumerationType pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/UnsignedLongEnumerationType when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:simpleType/xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:unsignedLong') and xs:enumeration]/ (., @base, xs:enumeration/(., @value))

The following example [XML Schema 1.0] extract illustrates the use of the UnsignedLongEnumerationType pattern within an [XML Schema 1.0] document UnsignedLongEnumerationType:

<xs:element name="unsignedLongEnumerationType" type="ex:UnsignedLongEnumerationType" />
<xs:simpleType name="UnsignedLongEnumerationType">
  <xs:restriction base="xs:unsignedLong">
    <xs:enumeration value="11111111111111" />
    <xs:enumeration value="22222222222222" />
    <xs:enumeration value="33333333333333" />
  </xs:restriction>
</xs:simpleType>
    

The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document UnsignedLongEnumerationType01:

  <ex:unsignedLongEnumerationType>33333333333333</ex:unsignedLongEnumerationType>

2.7.12 UnsignedShortEnumerationType

An [XML 1.0] document exhibits the UnsignedShortEnumerationType pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/UnsignedShortEnumerationType when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:simpleType/xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:unsignedShort') and xs:enumeration]/ (., @base, xs:enumeration/(., @value))

The following example [XML Schema 1.0] extract illustrates the use of the UnsignedShortEnumerationType pattern within an [XML Schema 1.0] document UnsignedShortEnumerationType:

<xs:element name="unsignedShortEnumerationType" type="ex:UnsignedShortEnumerationType" />
<xs:simpleType name="UnsignedShortEnumerationType">
  <xs:restriction base="xs:unsignedShort">
    <xs:enumeration value="1111" />
    <xs:enumeration value="2222" />
    <xs:enumeration value="3333" />
  </xs:restriction>
</xs:simpleType>
    

The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document UnsignedShortEnumerationType01:

  <ex:unsignedShortEnumerationType>3333</ex:unsignedShortEnumerationType>

2.8 ComplexType Declarations

2.8.1 ComplexTypeAll

An [XML 1.0] document exhibits the ComplexTypeAll pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/ComplexTypeAll when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:complexType/xs:all/ (., xs:element/(., @name))

The following example [XML Schema 1.0] extract illustrates the use of the ComplexTypeAll pattern within an [XML Schema 1.0] document ComplexTypeAll:

<xs:element name="complexTypeAll" type="ex:ComplexTypeAll" />
<xs:complexType name="ComplexTypeAll">
  <xs:all>
    <xs:element name="name" type="xs:string" />
    <xs:element name="shade" type="xs:string" />
    <xs:element name="length" type="xs:int" />
  </xs:all>
  <xs:attribute name="id" type="xs:string" />
  <xs:attribute name="inStock" type="xs:int" />
</xs:complexType>
    

The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document ComplexTypeAll01:

  <ex:complexTypeAll id="6026" inStock="232">
      <ex:name>Widget</ex:name>
      <ex:length>33</ex:length>
      <ex:shade>Light Blue</ex:shade>
   </ex:complexTypeAll>

as is the following element when included in an instance document ComplexTypeAll02:

  <ex:complexTypeAll inStock="332" id="6026">
      <ex:shade>Green</ex:shade>
      <ex:length>21</ex:length>
      <ex:name>Widget</ex:name>
   </ex:complexTypeAll>

2.8.2 ComplexTypeChoice

An [XML 1.0] document exhibits the ComplexTypeChoice pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/ComplexTypeChoice when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:complexType/xs:choice/ (., xs:element/(., @name))

The following example [XML Schema 1.0] extract illustrates the use of the ComplexTypeChoice pattern within an [XML Schema 1.0] document ComplexTypeChoice:

<xs:element name="fruit" type="ex:Fruit" />
<xs:complexType name="Fruit">
  <xs:choice>
    <xs:element name="apple" type="xs:int" />
    <xs:element name="orange" type="xs:string" />
    <xs:element name="banana" type="xs:int" />
  </xs:choice>
</xs:complexType>
    

The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document ComplexTypeChoice01:

  <ex:fruit>
      <ex:apple>21</ex:apple>
   </ex:fruit>

as is the following element when included in an instance document ComplexTypeChoice02:

  <ex:fruit>
      <ex:orange>Two Hundred</ex:orange>
   </ex:fruit>

and the following element when included in an instance document ComplexTypeChoice03:

  <ex:fruit>
      <ex:banana>329</ex:banana>
   </ex:fruit>

2.8.3 ComplexTypeAnyAttribute

An [XML 1.0] document exhibits the ComplexTypeAnyAttribute pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/ComplexTypeAnyAttribute when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:complexType/xs:anyAttribute

2.8.4 AnyAttributeStrict

An [XML 1.0] document exhibits the AnyAttributeStrict pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/AnyAttributeStrict when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:complexType/xs:anyAttribute[(not(@processContents) or @processContents = 'strict') and (not(@namespace) or @namespace = '##any')]/ (., @processContents, @namespace)

The following example [XML Schema 1.0] extract illustrates the use of the AnyAttributeStrict pattern within an [XML Schema 1.0] document AnyAttributeStrict:

<xs:element name="anyAttributeStrict" type="ex:AnyAttributeStrict" />
<xs:complexType name="AnyAttributeStrict">
  <xs:sequence>
    <xs:element name="firstName" type="xs:string" />
    <xs:element name="lastName" type="xs:string" />
  </xs:sequence>
  <xs:anyAttribute />
</xs:complexType>
<xs:attribute name="eyeColor" type="xs:string" />
<xs:attribute name="hairColor" type="xs:string" />
    

The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document AnyAttributeStrict01:

  <ex:anyAttributeStrict ex:eyeColor="blue">
      <ex:firstName>Bobby</ex:firstName>
      <ex:lastName>Sox</ex:lastName>
   </ex:anyAttributeStrict>

as is the following element when included in an instance document AnyAttributeStrict02:

  <ex:anyAttributeStrict ex:eyeColor="blue">
      <ex:firstName>Bobby</ex:firstName>
      <ex:lastName>Sox</ex:lastName>
   </ex:anyAttributeStrict>

and the following element when included in an instance document AnyAttributeStrict03:

  <ex:anyAttributeStrict ex:eyeColor="blue" ex:hairColor="green">
      <ex:firstName>Bobby</ex:firstName>
      <ex:lastName>Sox</ex:lastName>
   </ex:anyAttributeStrict>

2.8.5 AnyAttributeLax

An [XML 1.0] document exhibits the AnyAttributeLax pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/AnyAttributeLax when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:complexType/xs:anyAttribute[(@processContents = 'lax') and (not(@namespace) or @namespace = '##any')]/ (., @processContents, @namespace)

The following example [XML Schema 1.0] extract illustrates the use of the AnyAttributeLax pattern within an [XML Schema 1.0] document AnyAttributeLax:

<xs:element name="anyAttributeLax" type="ex:AnyAttributeLax" />
<xs:complexType name="AnyAttributeLax">
  <xs:sequence>
    <xs:element name="firstName" type="xs:string" />
    <xs:element name="lastName" type="xs:string" />
  </xs:sequence>
  <xs:anyAttribute processContents="lax" />
</xs:complexType>
    

The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document AnyAttributeLax01:

  <ex:anyAttributeLax eyeColor="blue">
      <ex:firstName>Bobby</ex:firstName>
      <ex:lastName>Sox</ex:lastName>
   </ex:anyAttributeLax>

2.8.6 AnyAttributeSkip

An [XML 1.0] document exhibits the AnyAttributeSkip pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/AnyAttributeSkip when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:complexType/xs:anyAttribute[(@processContents = 'skip') and (not(@namespace) or @namespace = '##any')]/ (., @processContents, @namespace)

The following example [XML Schema 1.0] extract illustrates the use of the AnyAttributeSkip pattern within an [XML Schema 1.0] document AnyAttributeSkip:

<xs:element name="anyAttributeSkip" type="ex:AnyAttributeSkip" />
<xs:complexType name="AnyAttributeSkip">
  <xs:sequence>
    <xs:element name="firstName" type="xs:string" />
    <xs:element name="lastName" type="xs:string" />
  </xs:sequence>
  <xs:anyAttribute processContents="skip" />
</xs:complexType>
    

The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document AnyAttributeSkip01:

  <ex:anyAttributeSkip eyeColor="blue">
      <ex:firstName>Bobby</ex:firstName>
      <ex:lastName>Sox</ex:lastName>
   </ex:anyAttributeSkip>

2.8.7 AnyAttributeOtherStrict

An [XML 1.0] document exhibits the AnyAttributeOtherStrict pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/AnyAttributeOtherStrict when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:complexType/xs:anyAttribute[(not(@processContents) or @processContents = 'strict') and (@namespace = '##other')]/ (., @processContents, @namespace)

2.8.8 AnyAttributeOtherLax

An [XML 1.0] document exhibits the AnyAttributeOtherLax pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/AnyAttributeOtherLax when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:complexType/xs:anyAttribute[(@processContents = 'lax') and (@namespace = '##other')]/ (., @processContents, @namespace)

2.8.9 AnyAttributeOtherSkip

An [XML 1.0] document exhibits the AnyAttributeOtherSkip pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/AnyAttributeOtherSkip when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:complexType/xs:anyAttribute[(@processContents = 'skip') and (@namespace = '##other')]/ (., @processContents, @namespace)

2.8.10 ExtendedSimpleContent

An [XML 1.0] document exhibits the ExtendedSimpleContent pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/ExtendedSimpleContent when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:complexType/xs:simpleContent/xs:extension[@base]/ (.., ., ./@base, xs:attribute/ (., @name))

2.9 Sequences

2.9.1 SequenceMinOccursFinite

An [XML 1.0] document exhibits the SequenceMinOccursFinite pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/SequenceMinOccursFinite when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:sequence[xs:integer(@minOccurs) gt 1]/ (@minOccurs)

The following example [XML Schema 1.0] extract illustrates the use of the SequenceMinOccursFinite pattern within an [XML Schema 1.0] document SequenceMinOccursFinite:

<xs:element name="articleColors" type="ex:ArticleColors" />
<xs:complexType name="ArticleColors">
  <xs:sequence minOccurs="2" maxOccurs="unbounded">
    <xs:element name="articleColor" type="xs:string" />
    <xs:element name="articleContrast" type="xs:string" />
  </xs:sequence>
</xs:complexType>
    

The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document SequenceMinOccursFinite01:

  <ex:articleColors>
      <ex:articleColor>Red</ex:articleColor>
      <ex:articleContrast>Bright</ex:articleContrast>
      <ex:articleColor>Black</ex:articleColor>
      <ex:articleContrast>Bright</ex:articleContrast>
      <ex:articleColor>White</ex:articleColor>
      <ex:articleContrast>Low</ex:articleContrast>
      <ex:articleColor>Yellow</ex:articleColor>
      <ex:articleContrast>Normal</ex:articleContrast>
   </ex:articleColors>

as is the following element when included in an instance document SequenceMinOccursFinite02:

  <ex:articleColors>
      <ex:articleColor>Black</ex:articleColor>
      <ex:articleContrast>Normal</ex:articleContrast>
      <ex:articleColor>White</ex:articleColor>
      <ex:articleContrast>Bright</ex:articleContrast>
   </ex:articleColors>

2.9.2 ExtendedSequenceStrict

An [XML 1.0] document exhibits the ExtendedSequenceStrict pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/ExtendedSequenceStrict when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:sequence/xs:any[(not(@processContents) or @processContents = 'strict') and @minOccurs = '0' and @maxOccurs='unbounded' and @namespace = '##targetNamespace']/ (., @processContents, @minOccurs, @maxOccurs, @namespace)

The following example [XML Schema 1.0] extract illustrates the use of the ExtendedSequenceStrict pattern within an [XML Schema 1.0] document ExtendedSequenceStrict:

<xs:element name="extendedSequenceStrict" type="ex:ExtendedSequenceStrict" />
<xs:complexType name="ExtendedSequenceStrict">
  <xs:sequence>
    <xs:element name="firstName" type="xs:string" />
    <xs:element name="lastName" type="xs:string" />
    <xs:element name="extension" type="ex:StrictExtension" minOccurs="0" />
  </xs:sequence>
</xs:complexType>
<xs:element name="title" type="xs:string" />
<xs:element name="middleName" type="xs:string" />
<xs:complexType name="StrictExtension">
  <xs:sequence>
    <xs:any processContents="strict" minOccurs="0" maxOccurs="unbounded" namespace="##targetNamespace" />
  </xs:sequence>
</xs:complexType>
    

The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document ExtendedSequenceStrict01:

  <ex:extendedSequenceStrict>
      <ex:firstName>Bobby</ex:firstName>
      <ex:lastName>Sox</ex:lastName>
   </ex:extendedSequenceStrict>

as is the following element when included in an instance document ExtendedSequenceStrict02:

  <ex:extendedSequenceStrict>
      <ex:firstName>Bobby</ex:firstName>
      <ex:lastName>Sox</ex:lastName>
      <ex:extension>
         <ex:middleName>William</ex:middleName>
         <ex:title>Mr</ex:title>
      </ex:extension>
   </ex:extendedSequenceStrict>

2.9.3 ExtendedSequenceLax

An [XML 1.0] document exhibits the ExtendedSequenceLax pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/ExtendedSequenceLax when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:sequence/xs:any[@processContents = 'lax' and @minOccurs = '0' and @maxOccurs='unbounded' and @namespace = '##targetNamespace']/ (., @processContents, @minOccurs, @maxOccurs, @namespace)

The following example [XML Schema 1.0] extract illustrates the use of the ExtendedSequenceLax pattern within an [XML Schema 1.0] document ExtendedSequenceLax:

<xs:element name="extendedSequenceLax" type="ex:ExtendedSequenceLax" />
<xs:complexType name="ExtendedSequenceLax">
  <xs:sequence>
    <xs:element name="firstName" type="xs:string" />
    <xs:element name="lastName" type="xs:string" />
    <xs:element name="extension" type="ex:LaxExtension" minOccurs="0" />
  </xs:sequence>
</xs:complexType>
<xs:complexType name="LaxExtension">
  <xs:sequence>
    <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" namespace="##targetNamespace" />
  </xs:sequence>
</xs:complexType>
    

The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document ExtendedSequenceLax01:

  <ex:extendedSequenceLax>
      <ex:firstName>Bobby</ex:firstName>
      <ex:lastName>Sox</ex:lastName>
   </ex:extendedSequenceLax>

as is the following element when included in an instance document ExtendedSequenceLax02:

  <ex:extendedSequenceLax>
      <ex:firstName>Bobby</ex:firstName>
      <ex:lastName>Sox</ex:lastName>
      <ex:extension>
         <ex:middleName>William</ex:middleName>
         <ex:title>Mr</ex:title>
      </ex:extension>
   </ex:extendedSequenceLax>

2.9.4 ExtendedSequenceSkip

An [XML 1.0] document exhibits the ExtendedSequenceSkip pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/ExtendedSequenceSkip when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:sequence/xs:any[@processContents = 'skip' and @minOccurs = '0' and @maxOccurs='unbounded' and @namespace = '##targetNamespace']/ (., @processContents, @minOccurs, @maxOccurs, @namespace)

The following example [XML Schema 1.0] extract illustrates the use of the ExtendedSequenceSkip pattern within an [XML Schema 1.0] document ExtendedSequenceSkip:

<xs:element name="extendedSequenceSkip" type="ex:ExtendedSequenceSkip" />
<xs:complexType name="ExtendedSequenceSkip">
  <xs:sequence>
    <xs:element name="firstName" type="xs:string" />
    <xs:element name="lastName" type="xs:string" />
    <xs:element name="extension" type="ex:SkipExtension" minOccurs="0" />
  </xs:sequence>
</xs:complexType>
<xs:complexType name="SkipExtension">
  <xs:sequence>
    <xs:any processContents="skip" minOccurs="0" maxOccurs="unbounded" namespace="##targetNamespace" />
  </xs:sequence>
</xs:complexType>
    

The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document ExtendedSequenceSkip01:

  <ex:extendedSequenceSkip>
      <ex:firstName>Bobby</ex:firstName>
      <ex:lastName>Sox</ex:lastName>
   </ex:extendedSequenceSkip>

as is the following element when included in an instance document ExtendedSequenceSkip02:

  <ex:extendedSequenceSkip>
      <ex:firstName>Bobby</ex:firstName>
      <ex:lastName>Sox</ex:lastName>
      <ex:extension>
         <ex:middleName>William</ex:middleName>
         <ex:title>Mr</ex:title>
      </ex:extension>
   </ex:extendedSequenceSkip>

2.9.5 ExtendedSequenceStrictAny

An [XML 1.0] document exhibits the ExtendedSequenceStrictAny pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/ExtendedSequenceStrictAny when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:sequence/xs:any[(not(@processContents) or @processContents = 'strict') and @minOccurs = '0' and @maxOccurs='unbounded' and (not(@namespace) or @namespace = '##any')]/ (., @processContents, @minOccurs, @maxOccurs, @namespace)

2.9.6 ExtendedSequenceLaxAny

An [XML 1.0] document exhibits the ExtendedSequenceLaxAny pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/ExtendedSequenceLaxAny when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:sequence/xs:any[@processContents = 'lax' and @minOccurs = '0' and @maxOccurs='unbounded' and (not(@namespace) or @namespace = '##any')]/ (., @processContents, @minOccurs, @maxOccurs, @namespace)

2.9.7 ExtendedSequenceSkipAny

An [XML 1.0] document exhibits the ExtendedSequenceSkipAny pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/ExtendedSequenceSkipAny when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:sequence/xs:any[@processContents = 'skip' and @minOccurs = '0' and @maxOccurs='unbounded' and (not(@namespace) or @namespace = '##any')]/ (., @processContents, @minOccurs, @maxOccurs, @namespace)

2.9.8 ExtendedSequenceStrictOther

An [XML 1.0] document exhibits the ExtendedSequenceStrictOther pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/ExtendedSequenceStrictOther when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:sequence/xs:any[(not(@processContents) or @processContents = 'strict') and @minOccurs = '0' and @maxOccurs='unbounded' and @namespace = '##other']/ (., @processContents, @minOccurs, @maxOccurs, @namespace)

2.9.9 ExtendedSequenceLaxOther

An [XML 1.0] document exhibits the ExtendedSequenceLaxOther pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/ExtendedSequenceLaxOther when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:sequence/xs:any[@processContents = 'lax' and @minOccurs = '0' and @maxOccurs='unbounded' and @namespace = '##other']/ (., @processContents, @minOccurs, @maxOccurs, @namespace)

2.9.10 ExtendedSequenceSkipOther

An [XML 1.0] document exhibits the ExtendedSequenceSkipOther pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/ExtendedSequenceSkipOther when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:sequence/xs:any[@processContents = 'skip' and @minOccurs = '0' and @maxOccurs='unbounded' and @namespace = '##other']/ (., @processContents, @minOccurs, @maxOccurs, @namespace)

2.10 Unions

2.10.1 UnionMemberTypes

An [XML 1.0] document exhibits the UnionMemberTypes pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/UnionMemberTypes when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:simpleType/xs:union[@memberTypes and not(xs:simpleType)]/ (., @memberTypes)

The following example [XML Schema 1.0] extract illustrates the use of the UnionMemberTypes pattern within an [XML Schema 1.0] document UnionDateString:

<xs:simpleType name="UnionDateString">
  <xs:union memberTypes="xs:date xs:string" />
</xs:simpleType>
<xs:element name="unionDateString" type="ex:UnionDateString" />
    

The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document UnionDateString01:

  <ex:unionDateString>Tonight</ex:unionDateString>

as is the following element when included in an instance document UnionDateString02:

  <ex:unionDateString>2006-06-06</ex:unionDateString>

2.10.2 UnionSimpleTypes

An [XML 1.0] document exhibits the UnionSimpleTypes pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/UnionSimpleTypes when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:simpleType/xs:union[not(@memberTypes)]/xs:simpleType/ (.., .)

The following example [XML Schema 1.0] extract illustrates the use of the UnionSimpleTypes pattern within an [XML Schema 1.0] document UnionSimpleDateString:

<xs:simpleType name="UnionSimpleDateString">
  <xs:union>
    <xs:simpleType>
      <xs:restriction base="xs:date" />
    </xs:simpleType>
    <xs:simpleType>
      <xs:restriction base="xs:string" />
    </xs:simpleType>
  </xs:union>
</xs:simpleType>
<xs:element name="unionSimpleDateString" type="ex:UnionSimpleDateString" />
    

The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document UnionSimpleDateString01:

  <ex:unionSimpleDateString>Monday Night</ex:unionSimpleDateString>

as is the following element when included in an instance document UnionSimpleDateString02:

  <ex:unionSimpleDateString>2006-06-06</ex:unionSimpleDateString>

2.10.3 UnionSimpleAndMemberTypes

An [XML 1.0] document exhibits the UnionSimpleAndMemberTypes pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/UnionSimpleAndMemberTypes when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:simpleType/xs:union[@memberTypes and xs:simpleType]/ (., @memberTypes, xs:simpleType)

2.11 Lists

2.11.1 List

An [XML 1.0] document exhibits the List pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/List when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:list[@itemType]/ (., @itemType)

2.12 Element Predefined Types

2.12.1 AnyTypeElement

An [XML 1.0] document exhibits the AnyTypeElement pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/AnyTypeElement when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:anyType')]

The following example [XML Schema 1.0] extract illustrates the use of the AnyTypeElement pattern within an [XML Schema 1.0] document AnyTypeElement:

<xs:element name="anyTypeElement" type="xs:anyType" />
    

The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document AnyTypeElement01:

  <ex:anyTypeElement/>

as is the following element when included in an instance document AnyTypeElement02:

  <ex:anyTypeElement>
      <foo>
         <bar>cheese</bar>
      </foo>
   </ex:anyTypeElement>

2.12.2 DurationElement

An [XML 1.0] document exhibits the DurationElement pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/DurationElement when the following [XPath 2.0] expression applied to a document or element node located by //xs:schema res