W3C

Advanced XML Schema Patterns for Databinding Version 1.0

Editors' Copy $Date: 2009/03/19 21:17:41 $ @@ @@@@ @@@@

This version:
http://www.w3.org/2002/ws/databinding/edcopy/advanced/advanced.html
Editors:
Jonathan Calladine, BT
George Cowe, Origo Services Limited
Paul Downey, BT
Yves Lafon, W3C

This document is also available in these non-normative formats: XML.


Abstract

This specification provides a set of commonly used [XML Schema 1.0] patterns known to cause issues with some state of the art databinding implementations. The patterns in conjunction with the [Basic Patterns] may be used 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 specification at the time of its publication. Other specification may supersede this specification. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.

This is a public Working Group Note produced by the XML Schema Patterns for Databinding Working Group, which is part of the W3C Web Services Activity. This publication as a Working Group Note coincides with the end of the Working Group's charter period, and represents the culmination of the group's work.

This document was built using evidence and experience gained examining the interoperability of a significant number of state of the art databinding implementations using a test suite, see the Advanced Patterns Implementation Report and a collection of implementation reports including the collection of patterns detected from "the wild".

The Working Group also produced an accompanying [Basic Patterns] document, which includes [XML Schema 1.0] patterns in common use, but which were discovered to be well supported by state of the art databinding implementations.

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

This document was produced by a Working Group operating under the 5 February 2004 W3C Patent Policy. The 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 Schema Element
    2.2 Annotations
    2.3 Properties
    2.4 Import and Include
    2.5 Global Element Declarations
    2.6 Global Attribute Declarations
    2.7 Element Declarations
    2.8 Attribute Declarations
    2.9 Global ComplexType Declarations
    2.10 SimpleType Declarations
    2.11 ComplexType Declarations
    2.12 Sequences
    2.13 Choices
    2.14 Unions
    2.15 Lists
    2.16 Element Predefined Types
    2.17 Attribute Predefined Types
    2.18 Restricted Schema Types
    2.19 Numbers
    2.20 Group
    2.21 Redefines
    2.22 Unique
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. Detecting Patterns (Non-Normative)
B. XPath 2.0 Idioms (Non-Normative)
C. Pattern Summary (Non-Normative)
D. Assertion Summary (Non-Normative)
E. Supported XML Schema elements, attributes and simple types (Non-Normative)
F. Relationship with the WS-I Basic Profile (Non-Normative)
G. 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 widespresd 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 D. 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:

  • MUST be able to consume 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 defines the set of concrete [XML Schema 1.0] patterns which may appear inside a conformant document. A pattern definition includes the following information:

URI

A URI [RFC 3986] is provided to identify the pattern. The URI can be dereferenced to return informal documentation for the pattern including a list of examples and public schemas which exhibit the pattern.

XPath

A normative [XPath 2.0] expression, used to detect a pattern in an [XML Schema 1.0] document, returning a set of one or more XML element and attribute nodes. The [XPath 2.0] expression having a context node of an <xs:schema> element node which may be an [XML Schema 1.0] document element, or an <xs:schema> element contained inside an [XML 1.0] document such as [WSDL 2.0] description.

Note, the [XPath 2.0] expressions used to identify individual patterns may be wrapped inside an [XSLT 2.0] stylesheet or [Schematron] schema and used to detect [XML Schema 1.0] patterns contained in a [WSDL 2.0] or other document, see A. Detecting Patterns and 1.3 Document Conformance. Readers unfamiliar with [XPath 2.0] may find the list of B. XPath 2.0 Idioms used within this specification useful.

Examples

Optionally one or more non-normative [XML Schema 1.0] documents or fragments, followed by one or more valid instance document fragments.

A collection of patterns, including patterns beyond the scope of this specification, are available from http://www.w3.org/2002/ws/databinding/patterns/6/09/. This document offers no additional semantics for the schema patterns presented beyond those specified by the [XML Schema 1.0] Recommendation.

2.1 Schema Element

2.1.1 NoTargetNamespace

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

.[not(@targetNamespace)]/ (.)

The following example [XML Schema 1.0] document [NoTargetNamespace] illustrates the use of the NoTargetNamespace pattern:

<xs:schema>
  <xs:element name="noTargetNamespace" type="xs:string" />
</xs:schema>
    

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

  <noTargetNamespace xsi:noNamespaceSchemaLocation="NoTargetNamespace.xsd">some data</noTargetNamespace>

2.1.2 UnqualifiedLocalElements

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

.[not(@elementFormDefault) or @elementFormDefault = 'unqualified']/ (., @elementFormDefault)

The following example [XML Schema 1.0] document [UnqualifiedLocalElements] illustrates the use of the UnqualifiedLocalElements pattern:

<xs:schema targetNamespace="http://www.w3.org/2002/ws/databinding/examples/6/09/"  elementFormDefault="unqualified">
  <xs:element name="unqualifiedLocalElements" type="xs:string" />
</xs:schema>
    

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

  <unqualifiedLocalElements>some data</unqualifiedLocalElements>

2.1.3 QualifiedLocalAttributes

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

.[@attributeFormDefault = 'qualified']/ (@attributeFormDefault)

The following example [XML Schema 1.0] document [QualifiedLocalAttributes] illustrates the use of the QualifiedLocalAttributes pattern:

<xs:schema targetNamespace="http://www.w3.org/2002/ws/databinding/examples/6/09/"  attributeFormDefault="qualified">
  <xs:element name="qualifiedLocalAttributes" type="xs:string" />
</xs:schema>
    

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

  <ex:qualifiedLocalAttributes>string</ex:qualifiedLocalAttributes>

2.1.4 FinalDefault

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

./@finalDefault

The following example [XML Schema 1.0] document [FinalDefault] illustrates the use of the FinalDefault pattern:

<xs:schema targetNamespace="http://www.w3.org/2002/ws/databinding/examples/6/09/" elementFormDefault="qualified"  finalDefault="#all">
  <xs:element name="finalDefault" type="xs:string" />
</xs:schema>
    

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

  <ex:finalDefault>foo</ex:finalDefault>

2.1.5 BlockDefault

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

./@blockDefault

The following example [XML Schema 1.0] document [BlockDefault] illustrates the use of the BlockDefault pattern:

<xs:schema targetNamespace="http://www.w3.org/2002/ws/databinding/examples/6/09/" elementFormDefault="qualified"  blockDefault="#all">
  <xs:element name="blockDefault" type="xs:string" />
</xs:schema>
    

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

  <ex:blockDefault>foo</ex:blockDefault>

2.1.6 XmlLang

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

.[@xml:lang] / (@xml:lang)

The following example [XML Schema 1.0] document [XmlLang] illustrates the use of the XmlLang pattern:

<xs:schema targetNamespace="http://www.w3.org/2002/ws/databinding/examples/6/09/" elementFormDefault="qualified"  xml:lang="en">
  <xs:element name="xmlLang" type="xs:string" />
</xs:schema>
    

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

  <ex:xmlLang>foo</ex:xmlLang>

2.2 Annotations

2.2.1 AppinfoElement

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

.//xs:annotation/xs:appinfo/ (.., ., .//*, .//@*)

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

<xs:element name="appinfoElement" type="xs:string">
  <xs:annotation>
    <xs:appinfo />
  </xs:annotation>
</xs:element>
    

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

  <ex:appinfoElement>some info</ex:appinfoElement>

2.3 Properties

2.3.1 MixedComplexContent

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //xs:schema results in an [XPath 2.0] node-set containing at least one node:

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

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

<xs:element name="mixedComplexContent" type="ex:MixedComplexContent" />
<xs:complexType name="MixedComplexContent">
  <xs:complexContent  mixed="true">
    <xs:restriction base="xs:anyType">
      <xs:sequence>
        <xs:element name="element1" type="xs:string" />
        <xs:element name="element2" type="xs:string" />
        <xs:element name="element3" type="xs:string" />
      </xs:sequence>
    </xs:restriction>
  </xs:complexContent>
</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 [MixedComplexContent01]:

  <ex:mixedComplexContent>
      <ex:element1>string</ex:element1>
  mixed content
  <ex:element2>string</ex:element2>
  mixed content
  <ex:element3>string</ex:element3>
  mixed content
</ex:mixedComplexContent>

2.3.2 MixedContentType

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //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.4 Import and Include

2.4.1 ImportSchemaNamespace

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //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" />
    

2.5 Global Element Declarations

2.5.1 GlobalElementUnqualifiedType

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //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 GlobalElementUnqualifiedType pattern within an [XML Schema 1.0] document [GlobalElementUnqualifiedType]:

<xs:element name="globalElementUnqualifiedType"  type="GlobalElementUnqualifiedType" />
<xs:complexType name="GlobalElementUnqualifiedType">
  <xs:sequence>
    <xs:element name="element1" type="xs:string" />
    <xs:element name="element2" 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 [GlobalElementUnqualifiedType01]:

  <ex:globalElementUnqualifiedType>
      <ex:element1>string1</ex:element1>
      <ex:element2>string2</ex:element2>
   </ex:globalElementUnqualifiedType>

2.5.2 ElementTypeDefaultNamespace

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //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.5.3 GlobalElementAbstract

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //xs:schema results in an [XPath 2.0] node-set containing at least one node:

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

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

<xs:element name="globalElementAbstract" type="ex:GlobalElementAbstract" />
<xs:complexType name="GlobalElementAbstract">
  <xs:sequence>
    <xs:element ref="ex:globalElementAbstractSubHead" />
  </xs:sequence>
</xs:complexType>
<xs:element name="globalElementAbstractSubHead"  abstract="true" />
<xs:element name="globalElementAbstractSub" substitutionGroup="ex:globalElementAbstractSubHead" />
    

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

  <ex:globalElementAbstract>
      <ex:globalElementAbstractSub>String</ex:globalElementAbstractSub>
   </ex:globalElementAbstract>

2.5.4 GlobalElementBlock

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

./xs:element/ (@block)

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

<xs:element name="globalElementBlock" type="xs:string"  block="#all" />
    

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

  <ex:globalElementBlock>Stuff</ex:globalElementBlock>

2.5.5 GlobalElementFinal

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

./xs:element/ (@final)

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

<xs:element name="globalElementFinal" type="xs:string"  final="#all" />
    

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

  <ex:globalElementFinal>Stuff</ex:globalElementFinal>

2.5.6 GlobalElementAll

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //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))

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

<xs:element name="globalElementAll">
  <xs:complexType>
    <xs:all>
      <xs:element name="globalElementAllA" type="xs:string" />
      <xs:element name="globalElementAllB" type="xs:string" />
    </xs:all>
  </xs:complexType>
</xs:element>
    

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

  <ex:globalElementAll>
      <ex:globalElementAllA>one</ex:globalElementAllA>
      <ex:globalElementAllB>42</ex:globalElementAllB>
   </ex:globalElementAll>

as is the following element when included in an instance document [GlobalElementAll02]:

  <ex:globalElementAll>
      <ex:globalElementAllB>42</ex:globalElementAllB>
      <ex:globalElementAllA>douze</ex:globalElementAllA>
   </ex:globalElementAll>

2.5.7 GlobalElementChoice

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //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))

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

<xs:element name="globalElementChoice">
  <xs:complexType>
    <xs:choice>
      <xs:element name="globalElementChoiceA" type="xs:string" />
      <xs:element name="globalElementChoiceB" type="xs:string" />
    </xs:choice>
  </xs:complexType>
</xs:element>
    

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

  <ex:globalElementChoice>
      <ex:globalElementChoiceA>one</ex:globalElementChoiceA>
   </ex:globalElementChoice>

as is the following element when included in an instance document [GlobalElementChoice02]:

  <ex:globalElementChoice>
      <ex:globalElementChoiceB>two</ex:globalElementChoiceB>
   </ex:globalElementChoice>

2.5.8 GlobalElementSimpleType

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

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

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

<xs:element name="globalElementSimpleType">
  <xs:simpleType>
    <xs:restriction base="xs:string">
      <xs:enumeration value="value1" />
      <xs:enumeration value="value2" />
      <xs:enumeration value="value3" />
    </xs:restriction>
  </xs:simpleType>
</xs:element>
    

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

  <ex:globalElementSimpleType>value1</ex:globalElementSimpleType>

as is the following element when included in an instance document [GlobalElementSimpleType02]:

  <ex:globalElementSimpleType>value2</ex:globalElementSimpleType>

2.5.9 GlobalElementComplexTypeSequenceExtension

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //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))))

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

<xs:element name="globalElementComplexTypeSequenceExtension">
  <xs:complexType>
    <xs:complexContent>
      <xs:extension base="xs:anyType">
        <xs:sequence />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
</xs:element>
    

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

  <ex:globalElementComplexTypeSequenceExtension>
      <ex:data> some data </ex:data>
   </ex:globalElementComplexTypeSequenceExtension>

2.5.10 GlobalElementComplexTypeEmptyExtension

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, exhibits the GlobalElementComplexTypeEmptyExtension pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/GlobalElementComplexTypeEmptyExtension when the following [XPath 2.0] expression applied to a document or element node with a context node of //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]/not(*)]/ (../../(., @name), .., ., xs:extension/(., @base))

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

<xs:element name="globalElementComplexTypeEmptyExtension">
  <xs:complexType>
    <xs:complexContent>
      <xs:extension base="xs:anyType" />
    </xs:complexContent>
  </xs:complexType>
</xs:element>
    

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

  <ex:globalElementComplexTypeEmptyExtension/>

2.6 Global Attribute Declarations

2.6.1 GlobalAttributeUnqualifiedType

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //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)

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

<xs:attribute name="globalAttributeUnqualifiedTypeAttr"  type="GlobalAttributeUnqualifiedTypeSimpleType" />
<xs:simpleType name="GlobalAttributeUnqualifiedTypeSimpleType">
  <xs:restriction base="xs:string">
    <xs:enumeration value="value1" />
    <xs:enumeration value="value2" />
  </xs:restriction>
</xs:simpleType>
<xs:complexType name="GlobalAttributeUnqualifiedType">
  <xs:sequence>
    <xs:element name="globalAttributeUnqualifiedTypeElement" type="xs:string" />
  </xs:sequence>
  <xs:attribute ref="ex:globalAttributeUnqualifiedTypeAttr" />
</xs:complexType>
<xs:element name="globalAttributeUnqualifiedType" type="ex:GlobalAttributeUnqualifiedType" />
    

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

  <ex:globalAttributeUnqualifiedType ex:globalAttributeUnqualifiedTypeAttr="value1">
      <ex:globalAttributeUnqualifiedTypeElement>another string</ex:globalAttributeUnqualifiedTypeElement>
   </ex:globalAttributeUnqualifiedType>

2.6.2 GlobalAttributeSimpleType

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

./xs:attribute/xs:simpleType/(../(., @name), .., ., descendant::*, descendant::*/@value, descendant::*/@base)

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

<xs:attribute name="globalAttributeSimpleTypeAttr">
  <xs:simpleType>
    <xs:restriction base="xs:string">
      <xs:enumeration value="value1" />
      <xs:enumeration value="value2" />
      <xs:enumeration value="value3" />
    </xs:restriction>
  </xs:simpleType>
</xs:attribute>
<xs:complexType name="globalAttributeSimpleTypeComplexType">
  <xs:sequence>
    <xs:element name="globalAttributeSimpleTypeElement" type="xs:string" />
  </xs:sequence>
  <xs:attribute ref="ex:globalAttributeSimpleTypeAttr" />
</xs:complexType>
<xs:element name="globalAttributeSimpleType" type="ex:globalAttributeSimpleTypeComplexType" />
    

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

  <ex:globalAttributeSimpleType ex:globalAttributeSimpleTypeAttr="value1">
      <ex:globalAttributeSimpleTypeElement>string</ex:globalAttributeSimpleTypeElement>
   </ex:globalAttributeSimpleType>

2.7 Element Declarations

2.7.1 ElementMinOccursFinite

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //xs:schema results in an [XPath 2.0] node-set containing at least one node:

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

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

<xs:element name="elementMinOccursFinite" type="ex:ElementMinOccursFinite" />
<xs:complexType name="ElementMinOccursFinite">
  <xs:sequence>
    <xs:element name="elementMinOccursFiniteitem" type="xs:string"  minOccurs="3"  maxOccurs="3" />
  </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 [ElementMinOccursFinite01]:

  <ex:elementMinOccursFinite>
      <ex:elementMinOccursFiniteitem>item1</ex:elementMinOccursFiniteitem>
      <ex:elementMinOccursFiniteitem>item3</ex:elementMinOccursFiniteitem>
      <ex:elementMinOccursFiniteitem>item2</ex:elementMinOccursFiniteitem>
   </ex:elementMinOccursFinite>

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

<xs:element name="itemColors2" type="ex:ItemColors2" />
<xs:complexType name="ItemColors2">
  <xs:sequence>
    <xs:element name="itemColor" type="xs:string"  minOccurs="2"  maxOccurs="2" />
  </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 [ElementMinOccurs2MaxOccurs201]:

  <ex:itemColors2>
      <ex:itemColor>Red</ex:itemColor>
      <ex:itemColor>Yellow</ex:itemColor>
   </ex:itemColors2>

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.7.2 ElementMinOccurs0MaxOccursFinite

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

.//xs:element[@minOccurs = '0' and @maxOccurs and not(@maxOccurs = '0' or @maxOccurs = '1' or @maxOccurs = 'unbounded')]/ (@minOccurs, @maxOccurs)

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

<xs:element name="colorList" type="ex:ColorList" />
<xs:complexType name="ColorList">
  <xs:sequence>
    <xs:element name="colorValue" type="xs:string"  minOccurs="0"  maxOccurs="2" />
  </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 [ElementMinOccurs0MaxOccursFinite101]:

  <ex:colorList/>

as is the following element when included in an instance document [ElementMinOccurs0MaxOccursFinite102]:

  <ex:colorList>
      <ex:colorValue>red</ex:colorValue>
      <ex:colorValue>green</ex:colorValue>
   </ex:colorList>

2.7.3 ElementMaxOccursFinite

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

.//xs:element[@maxOccurs and not(@maxOccurs = '0' or @maxOccurs = '1' or @maxOccurs = 'unbounded')]/ (@maxOccurs)

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

<xs:element name="summer" type="ex:Summer" />
<xs:complexType name="Summer">
  <xs:sequence>
    <xs:element name="mnth" type="xs:string"  maxOccurs="4" />
  </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 [ElementMaxOccursFinite01]:

  <ex:summer>
      <ex:mnth>May</ex:mnth>
      <ex:mnth>June</ex:mnth>
      <ex:mnth>July</ex:mnth>
      <ex:mnth>August</ex:mnth>
   </ex:summer>

as is the following element when included in an instance document [ElementMaxOccursFinite02]:

  <ex:summer>
      <ex:mnth>August</ex:mnth>
      <ex:mnth>September</ex:mnth>
   </ex:summer>

2.7.4 ElementFormUnqualified

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

.//xs:element[@form='unqualified']/ (@form)

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

<xs:element name="elementFormUnqualified" type="ex:ElementFormUnqualified" />
<xs:complexType name="ElementFormUnqualified">
  <xs:sequence>
    <xs:element name="element" type="xs:string"  form="unqualified" />
  </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 [ElementFormUnqualified01]:

  <ex:elementFormUnqualified>
      <element>string</element>
   </ex:elementFormUnqualified>

2.7.5 ChoiceElement

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

.//xs:choice/xs:element/(.)

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

<xs:element name="choiceElement" type="ex:ChoiceElement" />
<xs:complexType name="ChoiceElement">
  <xs:choice>
    <xs:element name="AChoiceElement" type="xs:string" />
    <xs:element name="BChoiceElement" type="xs:string" />
  </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 [ChoiceElement01]:

  <ex:choiceElement>
      <ex:AChoiceElement>A</ex:AChoiceElement>
   </ex:choiceElement>

as is the following element when included in an instance document [ChoiceElement02]:

  <ex:choiceElement>
      <ex:BChoiceElement>B</ex:BChoiceElement>
   </ex:choiceElement>

2.7.6 AllElement

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

.//xs:all/xs:element/(.)

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

<xs:element name="allElement" type="ex:AllElement" />
<xs:complexType name="AllElement">
  <xs:all>
    <xs:element name="element1" type="xs:string" />
    <xs:element name="element2" type="xs:string" />
    <xs:element name="element3" type="xs:string" />
    <xs:element name="element4" type="xs:string" />
    <xs:element name="element5" type="xs:string" />
  </xs:all>
</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 [AllElement01]:

  <ex:allElement>
      <ex:element1>element1</ex:element1>
      <ex:element2>element2</ex:element2>
      <ex:element3>element3</ex:element3>
      <ex:element4>element4</ex:element4>
      <ex:element5>element5</ex:element5>
   </ex:allElement>

2.7.7 ElementFixed

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

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

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

<xs:element name="elementFixed" type="xs:string"  fixed="yes" />
    

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

  <ex:elementFixed>yes</ex:elementFixed>

2.7.8 AttributeElementNameClash

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //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:string" />
  <xs:attribute name="title" 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 [AttributeElementNameClash01]:

  <ex:clientDetails phone="+15556667788" title="1">
      <ex:forename>Bobby</ex:forename>
      <ex:surname>Sox</ex:surname>
      <ex:title>Mr</ex:title>
   </ex:clientDetails>

2.7.9 NillableOptionalElement

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

.//xs:element[@nillable = 'true' and @minOccurs = '0']/ (@nillable, @minOccurs)

Note, this specification places no particular semantics on the difference between annotating an element with xsi:nil and the absence of an element.

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

<xs:element name="nillableOptionalMiddleName" type="ex:NillableOptionalMiddleName" />
<xs:complexType name="NillableOptionalMiddleName">
  <xs:sequence>
    <xs:element name="firstName" type="xs:string" />
    <xs:element name="middleName" type="xs:string"  minOccurs="0"  nillable="true" />
    <xs:element name="lastName" 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 [NillableOptionalElement01]:

  <ex:nillableOptionalMiddleName>
      <ex:firstName>Paul</ex:firstName>
      <ex:lastName>Downey</ex:lastName>
   </ex:nillableOptionalMiddleName>

as is the following element when included in an instance document [NillableOptionalElement02]:

  <ex:nillableOptionalMiddleName>
      <ex:firstName>Paul</ex:firstName>
      <ex:middleName>Sumner</ex:middleName>
      <ex:lastName>Downey</ex:lastName>
   </ex:nillableOptionalMiddleName>

and the following element when included in an instance document [NillableOptionalElement03]:

  <ex:nillableOptionalMiddleName>
      <ex:firstName>Paul</ex:firstName>
      <ex:middleName xsi:nil="true"/>
      <ex:lastName>Downey</ex:lastName>
   </ex:nillableOptionalMiddleName>

2.7.10 ElementTypeReferenceUnqualified

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //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)

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

<xs:element name="elementTypeReferenceUnqualified" type="ex:ElementTypeReferenceUnqualified" />
<xs:complexType name="ElementTypeReferenceUnqualifiedRef">
  <xs:sequence>
    <xs:element name="referenced" type="xs:string" />
  </xs:sequence>
</xs:complexType>
<xs:complexType name="ElementTypeReferenceUnqualified">
  <xs:sequence>
    <xs:element name="text"  type="ElementTypeReferenceUnqualifiedRef" />
  </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 [ElementTypeReferenceUnqualified01]:

  <ex:elementTypeReferenceUnqualified>
      <ex:text>
         <ex:referenced>String</ex:referenced>
      </ex:text>
   </ex:elementTypeReferenceUnqualified>

2.7.11 ElementReferenceUnqualified

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //xs:schema results in an [XPath 2.0] node-set containing at least one node:

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

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

<xs:element name="elementReferenceUnqualified" type="ex:ElementReferenceUnqualified" />
<xs:element name="elementReferenceUnqualifiedElement1" type="xs:string" />
<xs:element name="elementReferenceUnqualifiedElement2" type="xs:string" />
<xs:complexType name="ElementReferenceUnqualified">
  <xs:sequence>
    <xs:element ref="elementReferenceUnqualifiedElement1" />
    <xs:element ref="elementReferenceUnqualifiedElement2" />
  </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 [ElementReferenceUnqualified01]:

  <ex:elementReferenceUnqualified>
      <ex:elementReferenceUnqualifiedElement1>String</ex:elementReferenceUnqualifiedElement1>
      <ex:elementReferenceUnqualifiedElement2>String</ex:elementReferenceUnqualifiedElement2>
   </ex:elementReferenceUnqualified>

2.7.12 LocalElementSimpleType

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

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

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

<xs:element name="localElementSimpleType" type="ex:LocalElementSimpleType" />
<xs:complexType name="LocalElementSimpleType">
  <xs:sequence>
    <xs:element name="localElement">
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value="First" />
          <xs:enumeration value="Second" />
          <xs:enumeration value="Third" />
        </xs:restriction>
      </xs:simpleType>
    </xs:element>
  </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 [LocalElementSimpleType01]:

  <ex:localElementSimpleType>
      <ex:localElement>First</ex:localElement>
   </ex:localElementSimpleType>

2.7.13 LocalElementComplexTypeEmptyExtension

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

.//xs:element[not(parent::xs:schema)]/xs:complexType[not(@name)]/xs:complexContent[xs:extension[@base]/not(*)]/ (../../(., @name), .., ., xs:extension/(., @base))

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

<xs:element name="localElementComplexTypeEmptyExtension">
  <xs:complexType>
    <xs:sequence>
      <xs:element name="extensionElement">
        <xs:complexType>
          <xs:complexContent>
            <xs:extension base="ex:ExtensionType" />
          </xs:complexContent>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
</xs:element>
<xs:complexType name="ExtensionType">
  <xs:sequence>
    <xs:element name="element1" type="xs:string" />
    <xs:element name="element2" 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 [LocalElementComplexTypeEmptyExtension01]:

  <ex:localElementComplexTypeEmptyExtension>
      <ex:extensionElement>
         <ex:element1>string</ex:element1>
         <ex:element2>string</ex:element2>
      </ex:extensionElement>
   </ex:localElementComplexTypeEmptyExtension>

2.7.14 ElementDefaultAnyType

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

.//xs:element[@name and not(@type) and ./not(xs:simpleType or xs:complexType or xs:unique or xs:key or xs:keyref)]/(.)

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

<xs:element name="elementDefaultAnyType" />
    

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

  <ex:elementDefaultAnyType/>

2.7.15 ElementKey

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

.//xs:element/xs:key[xs:selector and xs:field]/(., xs:selector, xs:selector/(@xpath), xs:field, xs:field/(@xpath))

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

<xs:element name="elementKey" type="ex:ElementKey">
  <xs:key name="key">
    <xs:selector xpath=".//item" />
    <xs:field xpath="number" />
  </xs:key>
</xs:element>
<xs:complexType name="ElementKey">
  <xs:sequence>
    <xs:element name="item" type="ex:itemType" maxOccurs="unbounded" />
  </xs:sequence>
</xs:complexType>
<xs:complexType name="itemType">
  <xs:sequence>
    <xs:element name="number" type="xs:integer" />
  </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 [ElementKey01]:

  <ex:elementKey>
      <ex:item>
         <ex:number>1234</ex:number>
      </ex:item>
   </ex:elementKey>

2.7.16 MaxOccurs0

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

.//xs:element[@maxOccurs='0']/(., @maxOccurs, @minOccurs)

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

<xs:element name="maxOccurs0" type="ex:MaxOccurs0" />
<xs:complexType name="MaxOccurs0">
  <xs:sequence>
    <xs:element name="element1" type="xs:string" />
    <xs:element name="element2" type="xs:string"  maxOccurs="0"  minOccurs="0" />
  </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 [MaxOccurs001]:

  <ex:maxOccurs0>
      <ex:element1>string1</ex:element1>
   </ex:maxOccurs0>

2.8 Attribute Declarations

2.8.1 AttributeFormQualified

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

.//xs:attribute[@form='qualified']/ (@form)

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

<xs:element name="attributeFormQualified" type="ex:AttributeFormQualified" />
<xs:complexType name="AttributeFormQualified">
  <xs:sequence>
    <xs:element name="element1" type="xs:string" />
    <xs:element name="element2" type="xs:string" />
  </xs:sequence>
  <xs:attribute name="attribute"  form="qualified" type="xs:string" />
</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 [AttributeFormQualified01]:

  <ex:attributeFormQualified ex:attribute="string">
      <ex:element1>string</ex:element1>
      <ex:element2>string</ex:element2>
   </ex:attributeFormQualified>

2.8.2 ElementDefault

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:element/ (@default)

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

<xs:element name="globalElementDefault" type="xs:string"  default="theDefaultValue" />
    

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

  <ex:globalElementDefault/>

as is the following element when included in an instance document [GlobalElementDefault02]:

  <ex:globalElementDefault>theDefaultValue</ex:globalElementDefault>

and the following element when included in an instance document [GlobalElementDefault03]:

  <ex:globalElementDefault>anotherValue</ex:globalElementDefault>

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

<xs:element name="elementDefault" type="ex:ElementDefault" />
<xs:complexType name="ElementDefault">
  <xs:sequence>
    <xs:element name="element" type="xs:string"  default="default" />
  </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 [ElementDefault01]:

  <ex:elementDefault>
      <ex:element>default</ex:element>
   </ex:elementDefault>

as is the following element when included in an instance document [ElementDefault02]:

  <ex:elementDefault>
      <ex:element>wrong value</ex:element>
   </ex:elementDefault>

2.8.3 AttributeRequired

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

.//xs:attribute[@use = 'required']/ (@use)

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

<xs:element name="attributeRequired" type="ex:AttributeRequired" />
<xs:complexType name="AttributeRequired">
  <xs:sequence>
    <xs:element name="percentage" type="xs:int" />
  </xs:sequence>
  <xs:attribute name="id" type="xs:string" />
  <xs:attribute name="seasonal" type="xs:string"  use="required" />
</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 [AttributeRequired01]:

  <ex:attributeRequired id="1611" seasonal="yes">
      <ex:percentage>5</ex:percentage>
   </ex:attributeRequired>

as is the following element when included in an instance document [AttributeRequired02]:

  <ex:attributeRequired id="1612" seasonal="no">
      <ex:percentage>2</ex:percentage>
   </ex:attributeRequired>

2.8.4 AttributeFixed

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

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

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

<xs:element name="attributeFixed" type="ex:AttributeFixed" />
<xs:complexType name="AttributeFixed">
  <xs:sequence>
    <xs:element name="fee" type="xs:int" />
  </xs:sequence>
  <xs:attribute name="id" type="xs:string" />
  <xs:attribute name="currency" type="xs:string"  fixed="GBP" />
</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 [AttributeFixed01]:

  <ex:attributeFixed id="1511" currency="GBP">
      <ex:fee>500</ex:fee>
   </ex:attributeFixed>

2.8.5 AttributeDefault

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //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.8.6 AttributeReferenceUnqualified

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //xs:schema results in an [XPath 2.0] node-set containing at least one node:

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

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

<xs:element name="attributeReferenceUnqualified" type="ex:AttributeReferenceUnqualified" />
<xs:attribute name="attributeReferenceUnqualifiedAtt" type="xs:string" />
<xs:complexType name="AttributeReferenceUnqualified">
  <xs:sequence>
    <xs:element name="firstElement" type="xs:string" />
    <xs:element name="lastElement" type="xs:string" />
  </xs:sequence>
  <xs:attribute ref="attributeReferenceUnqualifiedAtt" />
</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 [AttributeReferenceUnqualified01]:

  <ex:attributeReferenceUnqualified ex:attributeReferenceUnqualifiedAtt="String">
      <ex:firstElement>String</ex:firstElement>
      <ex:lastElement>String</ex:lastElement>
   </ex:attributeReferenceUnqualified>

2.8.7 AttributeTypeReferenceUnqualified

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //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)

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

<xs:element name="attributeTypeReferenceUnqualified" type="ex:AttributeTypeReferenceUnqualified" />
<xs:simpleType name="AttributeTypeReferenceUnqualifiedType">
  <xs:restriction base="xs:decimal">
    <xs:totalDigits value="3" />
  </xs:restriction>
</xs:simpleType>
<xs:complexType name="AttributeTypeReferenceUnqualified">
  <xs:sequence>
    <xs:element name="firstElement" type="xs:string" />
  </xs:sequence>
  <xs:attribute name="localAttribute"  type="AttributeTypeReferenceUnqualifiedType" />
</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 [AttributeTypeReferenceUnqualified01]:

  <ex:attributeTypeReferenceUnqualified localAttribute="123">
      <ex:firstElement>String</ex:firstElement>
   </ex:attributeTypeReferenceUnqualified>

2.8.8 LocalAttributeSimpleType

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //xs:schema results in an [XPath 2.0] node-set containing at least one node:

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

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

<xs:element name="localAttributeSimpleType" type="ex:LocalAttributeSimpleType" />
<xs:complexType name="LocalAttributeSimpleType">
  <xs:sequence>
    <xs:element name="localElement1" type="xs:string" />
    <xs:element name="localElement2" type="xs:string" />
  </xs:sequence>
  <xs:attribute name="localAttribute">
    <xs:simpleType>
      <xs:restriction base="xs:string">
        <xs:enumeration value="First" />
        <xs:enumeration value="Second" />
        <xs:enumeration value="Third" />
      </xs:restriction>
    </xs:simpleType>
  </xs:attribute>
</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 [LocalAttributeSimpleType01]:

  <ex:localAttributeSimpleType localAttribute="First">
      <ex:localElement1>String</ex:localElement1>
      <ex:localElement2>String</ex:localElement2>
   </ex:localAttributeSimpleType>

2.8.9 AttributeProhibited

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

.//xs:attribute[@use = 'prohibited']/ (@use)

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

<xs:element name="attributeProhibited" type="ex:AttributeProhibited" />
<xs:complexType name="AttributeProhibited">
  <xs:sequence>
    <xs:element name="element1" type="xs:string" />
    <xs:element name="element2" type="xs:string" />
  </xs:sequence>
  <xs:attribute name="prohibitedAttribute"  use="prohibited" type="xs:string" />
</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 [AttributeProhibited01]:

  <ex:attributeProhibited>
      <ex:element1>element1</ex:element1>
      <ex:element2>element2</ex:element2>
   </ex:attributeProhibited>

2.9 Global ComplexType Declarations

2.9.1 GlobalComplexTypeAbstract

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

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

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

<xs:element name="globalComplexTypeAbstract" type="ex:GlobalComplexTypeAbstract" />
<xs:complexType name="GlobalComplexTypeExtra"  abstract="true">
  <xs:sequence>
    <xs:element name="premium" type="xs:string" />
  </xs:sequence>
</xs:complexType>
<xs:complexType name="GlobalComplexTypeAbstract">
  <xs:complexContent>
    <xs:extension base="ex:GlobalComplexTypeExtra" />
  </xs:complexContent>
</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 [GlobalComplexTypeAbstractExample01]:

  <ex:globalComplexTypeAbstract>
      <ex:premium>1175</ex:premium>
   </ex:globalComplexTypeAbstract>

2.9.2 GlobalComplexTypeBlock

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

./xs:complexType/ (@block)

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

<xs:element name="globalComplexTypeBlock" type="ex:BlockAll" />
<xs:complexType name="BlockAll"  block="#all">
  <xs:sequence>
    <xs:element name="amount" 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 [GlobalComplexTypeBlockExample01]:

  <ex:globalComplexTypeBlock>
      <ex:amount>1175</ex:amount>
   </ex:globalComplexTypeBlock>

2.9.3 GlobalComplexTypeEmptyExtension

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

./xs:complexType[@name]/xs:complexContent[xs:extension[@base]/not(*)]/ (../../(., @name), .., ., xs:extension/(., @base))

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

<xs:complexType name="GlobalComplexTypeEmptyExtension">
  <xs:complexContent>
    <xs:extension base="xs:anyType" />
  </xs:complexContent>
</xs:complexType>
<xs:element name="globalComplexTypeEmptyExtension" type="ex:GlobalComplexTypeEmptyExtension" />
    

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

  <ex:globalComplexTypeEmptyExtension/>

2.10 SimpleType Declarations

2.10.1 NMTOKENEnumerationType

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, exhibits the NMTOKENEnumerationType pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/NMTOKENEnumerationType when the following [XPath 2.0] expression applied to a document or element node with a context node of //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:NMTOKEN') and xs:enumeration]/ (., @base, xs:enumeration/(., @value))

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

<xs:element name="nMTOKENEnumerationType" type="ex:NMTOKENEnumerationType" />
<xs:simpleType name="NMTOKENEnumerationType">
  <xs:restriction base="xs:NMTOKEN">
    <xs:enumeration value="token1" />
    <xs:enumeration value="token2" />
    <xs:enumeration value="token3" />
  </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 [NMTOKENEnumerationType01]:

  <ex:nMTOKENEnumerationType>token1</ex:nMTOKENEnumerationType>

2.10.2 IntEnumerationType

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //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.10.3 ShortEnumerationType

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //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.10.4 LongEnumerationType

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //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.10.5 DoubleEnumerationType

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //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.10.6 IntegerEnumerationType

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //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.10.7 DecimalEnumerationType

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //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.10.8 FloatEnumerationType

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //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.10.9 NonNegativeIntegerEnumerationType

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //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.10.10 PositiveIntegerEnumerationType

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //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.10.11 UnsignedIntEnumerationType

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //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.10.12 UnsignedLongEnumerationType

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //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.10.13 UnsignedShortEnumerationType

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //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.10.14 TokenEnumerationType

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, exhibits the TokenEnumerationType pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/TokenEnumerationType when the following [XPath 2.0] expression applied to a document or element node with a context node of //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:token') and xs:enumeration]/ (., @base, xs:enumeration/(., @value))

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

<xs:element name="tokenEnumerationType" type="ex:TokenEnumerationType" />
<xs:simpleType name="TokenEnumerationType">
  <xs:restriction base="xs:token">
    <xs:enumeration value="1" />
    <xs:enumeration value="2" />
    <xs:enumeration value="3" />
  </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 [TokenEnumerationType01]:

  <ex:tokenEnumerationType>1</ex:tokenEnumerationType>

as is the following element when included in an instance document [TokenEnumerationType02]:

  <ex:tokenEnumerationType>2</ex:tokenEnumerationType>

2.10.15 LanguageEnumerationType

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, exhibits the LanguageEnumerationType pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/LanguageEnumerationType when the following [XPath 2.0] expression applied to a document or element node with a context node of //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:language') and xs:enumeration]/ (., @base, xs:enumeration/(., @value))

Note, best current practice for the use of the xs:language type is described in [BCP 47].

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

<xs:element name="languageEnumerationType" type="ex:LanguageEnumerationType" />
<xs:simpleType name="LanguageEnumerationType">
  <xs:restriction base="xs:language">
    <xs:enumeration value="en" />
    <xs:enumeration value="en-US" />
    <xs:enumeration value="fr" />
    <xs:enumeration value="de" />
    <xs:enumeration value="it" />
  </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 [LanguageEnumerationType01]:

  <ex:languageEnumerationType>en</ex:languageEnumerationType>

as is the following element when included in an instance document [LanguageEnumerationType02]:

  <ex:languageEnumerationType>it</ex:languageEnumerationType>

2.10.16 SimpleTypeEnumerationType

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

.//xs:simpleType/xs:restriction[@base and namespace-uri-from-QName(resolve-QName(@base,.)) != 'http://www.w3.org/2001/XMLSchema' ]/ (., @base, xs:enumeration/(., @value))

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

<xs:element name="simpleTypeEnumerationType" type="ex:SimpleTypeEnumerationType" />
<xs:simpleType name="SimpleTypeEnumerationType">
  <xs:restriction base="ex:SimpleTypeEnumerationTypeBase">
    <xs:enumeration value="One" />
    <xs:enumeration value="Two" />
  </xs:restriction>
</xs:simpleType>
<xs:simpleType name="SimpleTypeEnumerationTypeBase">
  <xs:restriction base="xs:string">
    <xs:enumeration value="One" />
    <xs:enumeration value="Two" />
    <xs:enumeration value="Three" />
  </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 [SimpleTypeEnumerationType01]:

  <ex:simpleTypeEnumerationType>One</ex:simpleTypeEnumerationType>

as is the following element when included in an instance document [SimpleTypeEnumerationType02]:

  <ex:simpleTypeEnumerationType>Two</ex:simpleTypeEnumerationType>

2.10.17 DecimalSimpleTypeTotalDigits

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, exhibits the DecimalSimpleTypeTotalDigits pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/DecimalSimpleTypeTotalDigits when the following [XPath 2.0] expression applied to a document or element node with a context node of //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:totalDigits/@value]/ (., @base, xs:totalDigits/(., @value))

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

<xs:element name="decimalSimpleTypeTotalDigits" type="ex:DecimalSimpleTypeTotalDigits" />
<xs:simpleType name="DecimalSimpleTypeTotalDigits">
  <xs:restriction base="xs:decimal">
    <xs:totalDigits value="5" />
  </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 [DecimalSimpleTypeTotalDigits01]:

  <ex:decimalSimpleTypeTotalDigits>1234</ex:decimalSimpleTypeTotalDigits>

as is the following element when included in an instance document [DecimalSimpleTypeTotalDigits02]:

  <ex:decimalSimpleTypeTotalDigits>12345</ex:decimalSimpleTypeTotalDigits>

2.10.18 DecimalSimpleTypeFractionDigits

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, exhibits the DecimalSimpleTypeFractionDigits pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/DecimalSimpleTypeFractionDigits when the following [XPath 2.0] expression applied to a document or element node with a context node of //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:fractionDigits/@value]/ (., @base, xs:fractionDigits/(., @value))

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

<xs:element name="decimalSimpleTypeFractionDigits" type="ex:DecimalSimpleTypeFractionDigits" />
<xs:simpleType name="DecimalSimpleTypeFractionDigits">
  <xs:restriction base="xs:decimal">
    <xs:fractionDigits value="2" />
  </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 [DecimalSimpleTypeFractionDigits01]:

  <ex:decimalSimpleTypeFractionDigits>1234.00</ex:decimalSimpleTypeFractionDigits>

as is the following element when included in an instance document [DecimalSimpleTypeFractionDigits02]:

  <ex:decimalSimpleTypeFractionDigits>1234</ex:decimalSimpleTypeFractionDigits>

2.10.19 QNameEnumerationType

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, exhibits the QNameEnumerationType pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/QNameEnumerationType when the following [XPath 2.0] expression applied to a document or element node with a context node of //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:QName') and xs:enumeration]/ (., @base, xs:enumeration/(., @value))

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

<xs:element name="qNameEnumerationType" type="ex:QNameSimpleType" />
<xs:simpleType name="QNameSimpleType">
  <xs:restriction base="xs:QName">
    <xs:enumeration value="ex:firstQName" />
    <xs:enumeration value="ex:secondQName" />
  </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 [QNameEnumerationType01]:

  <ex:qNameEnumerationType>ex:firstQName</ex:qNameEnumerationType>

2.10.20 AnyURIEnumerationType

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, exhibits the AnyURIEnumerationType pattern identified using the URI [RFC 3986] http://www.w3.org/2002/ws/databinding/patterns/6/09/AnyURIEnumerationType when the following [XPath 2.0] expression applied to a document or element node with a context node of //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:anyURI') and xs:enumeration]/ (., @base, xs:enumeration/(., @value))

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

<xs:element name="anyURIEnumerationType" type="ex:URISimpleType" />
<xs:simpleType name="URISimpleType">
  <xs:restriction base="xs:anyURI">
    <xs:enumeration value="http://www.w3.org/2005/08/addressing/reply" />
  </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 [AnyURIEnumerationType01]:

  <ex:anyURIEnumerationType>http://www.w3.org/2005/08/addressing/reply</ex:anyURIEnumerationType>

2.11 ComplexType Declarations

2.11.1 ComplexTypeAll

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //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.11.2 ComplexTypeChoice

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //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.11.3 ComplexTypeOnlyAttributes

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

.//xs:complexType/xs:attribute[../not(xs:choice or xs:sequence or xs:all or xs:anyAttribute or xs:group or xs:attributeGroup or xs:simpleContent or xs:complexContent)]/ (., ..,@use)

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

<xs:element name="complexTypeOnlyAttributes" type="ex:ComplexTypeOnlyAttributes" />
<xs:complexType name="ComplexTypeOnlyAttributes">
  <xs:attribute name="a1" type="xs:string" />
  <xs:attribute name="a2" 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 [ComplexTypeOnlyAttributes01]:

  <ex:complexTypeOnlyAttributes a1="11226026" a2="223232"/>

2.11.4 ComplexTypeOnlyAttributeGroup

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

.//xs:complexType/xs:attributeGroup[../not(xs:choice or xs:sequence or xs:all or xs:anyAttribute or xs:group or xs:simpleContent or xs:complexContent)]/(., ..,@ref)

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

<xs:element name="complexTypeOnlyAttributeGroup" type="ex:ComplexTypeOnlyAttributeGroup" />
<xs:complexType name="ComplexTypeOnlyAttributeGroup">
  <xs:attributeGroup ref="ex:CommonOnlyAttributeGroup" />
</xs:complexType>
<xs:attributeGroup name="CommonOnlyAttributeGroup">
  <xs:attribute name="id" type="xs:ID" use="optional" form="unqualified" />
</xs:attributeGroup>
    

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

  <ex:complexTypeOnlyAttributeGroup id="AttributeGroup_contract_001"/>

2.11.5 GlobalElementSequenceAny

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

./xs:element[@name]/xs:complexType/xs:sequence[xs:any and not(xs:element)]/ (../../(., @name))

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

<xs:element name="globalElementSequenceAny">
  <xs:complexType>
    <xs:sequence>
      <xs:any processContents="skip" />
    </xs:sequence>
  </xs:complexType>
</xs:element>
    

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

  <ex:globalElementSequenceAny>
      <ex:data> some data </ex:data>
   </ex:globalElementSequenceAny>

2.11.6 ComplexTypeAnyAttribute

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:complexType/xs:anyAttribute

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

<xs:element name="complexTypeAnyAttribute" type="ex:ComplexTypeAnyAttribute" />
<xs:complexType name="ComplexTypeAnyAttribute">
  <xs:sequence>
    <xs:element name="element1" type="xs:string" />
    <xs:element name="element2" 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 [ComplexTypeAnyAttribute01]:

  <ex:complexTypeAnyAttribute anyattr="string">
      <ex:element1>string</ex:element1>
      <ex:element2>string</ex:element2>
   </ex:complexTypeAnyAttribute>

2.11.7 AnyAttributeStrict

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //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:hairColor="green">
      <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.11.8 AnyAttributeLax

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //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.11.9 AnyAttributeSkip

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //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.11.10 AnyAttributeOtherStrict

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //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)

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

<xs:import namespace="http://www.w3.org/2002/ws/databinding/examples/6/09/strict/" schemaLocation="../strict.xsd" />
<xs:element name="anyAttributeOtherStrict" type="ex:AnyAttributeOtherStrict" />
<xs:complexType name="AnyAttributeOtherStrict">
  <xs:sequence>
    <xs:element name="firstElement" type="xs:string" />
    <xs:element name="lastElement" type="xs:string" />
  </xs:sequence>
  <xs:anyAttribute processContents="strict"  namespace="##other" />
</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 [AnyAttributeOtherStrict01]:

  <ex:anyAttributeOtherStrict ex2:strictAttribute="value1">
      <ex:firstElement>String</ex:firstElement>
      <ex:lastElement>String</ex:lastElement>
   </ex:anyAttributeOtherStrict>

2.11.11 AnyAttributeOtherLax

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //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)

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

<xs:element name="anyAttributeOtherLax" type="ex:AnyAttributeOtherLax" />
<xs:complexType name="AnyAttributeOtherLax">
  <xs:sequence>
    <xs:element name="firstElement" type="xs:string" />
    <xs:element name="lastElement" type="xs:string" />
  </xs:sequence>
  <xs:anyAttribute processContents="lax"  namespace="##other" />
</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 [AnyAttributeOtherLax01]:

  <ex:anyAttributeOtherLax ex2:otherAttribute="text">
      <ex:firstElement>String</ex:firstElement>
      <ex:lastElement>String</ex:lastElement>
   </ex:anyAttributeOtherLax>

2.11.12 AnyAttributeOtherSkip

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //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)

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

<xs:element name="anyAttributeOtherSkip" type="ex:AnyAttributeOtherSkip" />
<xs:complexType name="AnyAttributeOtherSkip">
  <xs:sequence>
    <xs:element name="firstElement" type="xs:string" />
    <xs:element name="lastElement" type="xs:string" />
  </xs:sequence>
  <xs:anyAttribute processContents="skip"  namespace="##other" />
</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 [AnyAttributeOtherSkip01]:

  <ex:anyAttributeOtherSkip ex2:otherAttribute="text">
      <ex:firstElement>String</ex:firstElement>
      <ex:lastElement>String</ex:lastElement>
   </ex:anyAttributeOtherSkip>

2.11.13 ExtendedSimpleContent

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //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))

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

<xs:element name="extendedSimpleContent" type="ex:ExtendedSimpleContent" />
<xs:complexType name="ExtendedSimpleContent">
  <xs:simpleContent>
    <xs:extension base="xs:string">
      <xs:attribute name="attribute" />
    </xs:extension>
  </xs:simpleContent>
</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 [ExtendedSimpleContent01]:

  <ex:extendedSimpleContent attribute="string">string</ex:extendedSimpleContent>

2.11.14 SOAPEncodedArray

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

./xs:complexType[@name]/xs:complexContent/xs:restriction[ @base/resolve-QName(.,..) = xs:QName('soap11enc:Array')]/ xs:attribute[(@ref/resolve-QName(.,..) = xs:QName('soap11enc:arrayType')) and @wsdl11:arrayType]/ (../.., ../(., @base), ., @ref, @wsdl11:arrayType)

The following example [XML Schema 1.0] document [SOAPEncodedArray] illustrates the use of the SOAPEncodedArray pattern:

<xs:schema targetNamespace="http://www.w3.org/2002/ws/databinding/examples/6/09/" elementFormDefault="qualified">
  <xs:import namespace="http://schemas.xmlsoap.org/soap/encoding/" schemaLocation="http://schemas.xmlsoap.org/soap/encoding/" />
  <xs:element name="soapEncodedArray" type="ex:SOAPEncodedArray" />
  <xs:complexType name="SOAPEncodedArray">
    <xs:complexContent>
      <xs:restriction base="soap11enc:Array">
        <xs:attribute ref="soap11enc:arrayType"  wsdl11:arrayType="string[]" />
      </xs:restriction>
    </xs:complexContent>
  </xs:complexType>
</xs:schema>
    

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

  <ex:soapEncodedArray/>

2.11.15 RestrictedSimpleContent

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

.//xs:complexType/xs:simpleContent/xs:restriction[@base]/(.., ., @base, child::*, child::*/@value)

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

<xs:element name="restrictedSimpleContent" type="ex:RestrictedSimpleContent" />
<xs:complexType name="RestrictedSimpleContent">
  <xs:simpleContent>
    <xs:restriction base="ex:SomeSimpleContent">
      <xs:minInclusive value="1" />
      <xs:maxInclusive value="99" />
    </xs:restriction>
  </xs:simpleContent>
</xs:complexType>
<xs:complexType name="SomeSimpleContent">
  <xs:simpleContent>
    <xs:extension base="ex:SimpleType">
      <xs:attribute name="Currency" type="xs:string" />
    </xs:extension>
  </xs:simpleContent>
</xs:complexType>
<xs:simpleType name="SimpleType">
  <xs:restriction base="xs:int">
    <xs:minExclusive value="0" />
    <xs:maxExclusive value="100" />
  </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 [RestrictedSimpleContent01]:

  <ex:restrictedSimpleContent>1</ex:restrictedSimpleContent>

as is the following element when included in an instance document [RestrictedSimpleContent02]:

  <ex:restrictedSimpleContent>99</ex:restrictedSimpleContent>

2.11.16 ComplexTypeChoiceExtension

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

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

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

<xs:element name="complexTypeChoiceExtension" type="ex:ComplexTypeChoiceExtension" />
<xs:complexType name="ComplexTypeChoiceBase">
  <xs:sequence>
    <xs:element name="element1" type="xs:string" />
    <xs:element name="element2" type="xs:string" />
  </xs:sequence>
</xs:complexType>
<xs:complexType name="ComplexTypeChoiceExtension">
  <xs:complexContent>
    <xs:extension base="ex:ComplexTypeChoiceBase">
      <xs:choice>
        <xs:element name="element3" type="xs:string" />
        <xs:element name="element4" type="xs:string" />
      </xs:choice>
    </xs:extension>
  </xs:complexContent>
</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 [ComplexTypeChoiceExtension01]:

  <ex:complexTypeChoiceExtension>
      <ex:element1>element1</ex:element1>
      <ex:element2>element2</ex:element2>
      <ex:element3>element3</ex:element3>
   </ex:complexTypeChoiceExtension>

as is the following element when included in an instance document [ComplexTypeChoiceExtension02]:

  <ex:complexTypeChoiceExtension>
      <ex:element1>element1</ex:element1>
      <ex:element2>element2</ex:element2>
      <ex:element4>element4</ex:element4>
   </ex:complexTypeChoiceExtension>

2.11.17 ComplexTypeAttributeGroupExtension

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

.//xs:complexType/xs:complexContent[xs:extension[@base]/xs:attributeGroup]/ (., xs:extension/ (., @base, xs:attributeGroup))

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

<xs:element name="complexTypeAttributeGroupExtension" type="ex:ComplexTypeAttributeGroupExtension" />
<xs:complexType name="ComplexTypeAttributeGroupBase">
  <xs:sequence>
    <xs:element name="element1" type="xs:string" />
    <xs:element name="element2" type="xs:string" />
  </xs:sequence>
</xs:complexType>
<xs:complexType name="ComplexTypeAttributeGroupExtension">
  <xs:complexContent>
    <xs:extension base="ex:ComplexTypeAttributeGroupBase">
      <xs:attributeGroup ref="ex:CommonAttributes" />
    </xs:extension>
  </xs:complexContent>
</xs:complexType>
<xs:attributeGroup name="CommonAttributes">
  <xs:attribute name="id" type="xs:ID" use="optional" form="unqualified" />
</xs:attributeGroup>
    

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

  <ex:complexTypeAttributeGroupExtension id="ComplexTypeAttributeGroupExtension_01">
      <ex:element1>element1</ex:element1>
      <ex:element2>element2</ex:element2>
   </ex:complexTypeAttributeGroupExtension>

2.11.18 ComplexTypeAttributeRestriction

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

.//xs:complexType/xs:complexContent[xs:restriction[@base]/xs:attribute]/ (., xs:restriction/(., @base, xs:attribute/(., @name)))

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

<xs:element name="complexTypeAttributeRestriction" type="ex:ComplexTypeAttributeRestriction" />
<xs:complexType name="ComplexTypeAttributeRestrictionBase">
  <xs:sequence>
    <xs:element name="element1" type="xs:string" />
  </xs:sequence>
  <xs:attribute name="attrRestriction" type="xs:string" />
</xs:complexType>
<xs:complexType name="ComplexTypeAttributeRestriction">
  <xs:complexContent>
    <xs:restriction base="ex:ComplexTypeAttributeRestrictionBase">
      <xs:sequence>
        <xs:element name="element1" type="xs:string" />
      </xs:sequence>
      <xs:attribute name="attrRestriction" type="xs:string" use="required" />
    </xs:restriction>
  </xs:complexContent>
</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 [ComplexTypeAttributeRestriction01]:

  <ex:complexTypeAttributeRestriction attrRestriction="value">
      <ex:element1>string</ex:element1>
   </ex:complexTypeAttributeRestriction>

2.11.19 ComplexTypeSequenceRestriction

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

.//xs:complexType/xs:complexContent[xs:restriction[@base]/xs:sequence]/ (., xs:restriction/(., @base, xs:sequence))

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

<xs:element name="complexTypeSequenceRestriction" type="ex:ComplexTypeSequenceRestriction" />
<xs:complexType name="ComplexTypeSequenceRestrictionBase">
  <xs:sequence>
    <xs:element name="element1" type="xs:string" minOccurs="0" maxOccurs="unbounded" />
  </xs:sequence>
</xs:complexType>
<xs:complexType name="ComplexTypeSequenceRestriction">
  <xs:complexContent>
    <xs:restriction base="ex:ComplexTypeSequenceRestrictionBase">
      <xs:sequence>
        <xs:element name="element1" type="xs:string" />
      </xs:sequence>
    </xs:restriction>
  </xs:complexContent>
</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 [ComplexTypeSequenceRestriction01]:

  <ex:complexTypeSequenceRestriction>
      <ex:element1>string</ex:element1>
   </ex:complexTypeSequenceRestriction>

2.11.20 ComplexContentRestrictionAnyAttribute

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

.//xs:complexType/xs:complexContent/xs:restriction/xs:anyAttribute/(., @namespace, @processContents)

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

<xs:element name="complexContentRestrictionAnyAttribute" type="ex:ComplexContentRestrictionAnyAttribute" />
<xs:complexType name="ComplexContentRestrictionAnyAttribute">
  <xs:complexContent>
    <xs:restriction base="ex:ComplexTypeToBeRestricted">
      <xs:sequence>
        <xs:element name="element1" type="xs:string" />
        <xs:element name="element2" type="xs:string" />
      </xs:sequence>
      <xs:anyAttribute processContents="skip" />
    </xs:restriction>
  </xs:complexContent>
</xs:complexType>
<xs:complexType name="ComplexTypeToBeRestricted">
  <xs:sequence>
    <xs:element name="element1" type="xs:string" minOccurs="0" />
    <xs:element name="element2" type="xs:string" minOccurs="0" />
  </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 [ComplexContentRestrictionAnyAttribute01]:

  <ex:complexContentRestrictionAnyAttribute>
      <ex:element1>value1</ex:element1>
      <ex:element2>value2</ex:element2>
   </ex:complexContentRestrictionAnyAttribute>

2.11.21 ComplexContentExtensionAnyAttribute

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

.//xs:complexType/xs:complexContent/xs:extension/xs:anyAttribute/(., @namespace, @processContents)

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

<xs:element name="complexContentExtensionAnyAttribute" type="ex:ComplexContentExtensionAnyAttribute" />
<xs:complexType name="ComplexContentExtensionAnyAttribute">
  <xs:complexContent>
    <xs:extension base="ex:ComplexTypeToBeExtended">
      <xs:sequence>
        <xs:element name="element3" type="xs:string" minOccurs="0" />
        <xs:element name="element4" type="xs:string" minOccurs="0" />
      </xs:sequence>
      <xs:anyAttribute processContents="skip" />
    </xs:extension>
  </xs:complexContent>
</xs:complexType>
<xs:complexType name="ComplexTypeToBeExtended">
  <xs:sequence>
    <xs:element name="element1" type="xs:string" />
    <xs:element name="element2" 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 [ComplexContentExtensionAnyAttribute01]:

  <ex:complexContentExtensionAnyAttribute>
      <ex:element1>value1</ex:element1>
      <ex:element2>value2</ex:element2>
   </ex:complexContentExtensionAnyAttribute>

as is the following element when included in an instance document [ComplexContentExtensionAnyAttribute02]:

  <ex:complexContentExtensionAnyAttribute>
      <ex:element1>value1</ex:element1>
      <ex:element2>value2</ex:element2>
      <ex:element3>value3</ex:element3>
      <ex:element4>value4</ex:element4>
   </ex:complexContentExtensionAnyAttribute>

2.11.22 ComplexTypeFinal

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

.//xs:complexType[@final]/(., @final)

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

<xs:element name="complexTypeFinal" type="ex:ComplexTypeFinal" />
<xs:complexType name="ComplexTypeFinal"  final="#all">
  <xs:sequence>
    <xs:element name="element1" type="xs:string" minOccurs="0" 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 [ComplexTypeFinal01]:

  <ex:complexTypeFinal>
      <ex:element1>value1</ex:element1>
      <ex:element1>value2</ex:element1>
      <ex:element1>value3</ex:element1>
   </ex:complexTypeFinal>

2.11.23 ComplexTypeExtensionAnnotationOnly

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

.//xs:complexType/xs:complexContent/xs:extension[@base]/xs:annotation[not(preceding-sibling::*) and not(following-sibling::*)]/ (../(., @base), ../../(.))

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

<xs:element name="complexTypeExtensionAnnotationOnly" type="ex:ComplexTypeExtensionAnnotationOnly" />
<xs:complexType name="ComplexTypeExtensionAnnotationOnly">
  <xs:complexContent>
    <xs:extension base="ex:ComplexTypeExtension">
      <xs:annotation>
        <xs:documentation />
      </xs:annotation>
    </xs:extension>
  </xs:complexContent>
</xs:complexType>
<xs:complexType name="ComplexTypeExtension">
  <xs:sequence>
    <xs:element name="element1" type="xs:string" />
    <xs:element name="element2" 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 [ComplexTypeExtensionAnnotationOnly01]:

  <ex:complexTypeExtensionAnnotationOnly>
      <ex:element1>string</ex:element1>
      <ex:element2>string</ex:element2>
   </ex:complexTypeExtensionAnnotationOnly>

2.11.24 SimpleContentAnyAttributeSkip

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

.//xs:complexType/xs:simpleContent/xs:extension/xs:anyAttribute[(@processContents = 'skip')]/ (., @processContents)

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

<xs:element name="simpleContentAnyAttributeSkip" type="ex:SimpleContentAnyAttributeSkip" />
<xs:complexType name="SimpleContentAnyAttributeSkip">
  <xs:simpleContent>
    <xs:extension base="xs:string">
      <xs:anyAttribute processContents="skip" />
    </xs:extension>
  </xs:simpleContent>
</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 [SimpleContentAnyAttributeSkip01]:

  <ex:simpleContentAnyAttributeSkip skipAttribute="string">string</ex:simpleContentAnyAttributeSkip>

2.11.25 SimpleContentAnyAttributeLax

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

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

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

<xs:element name="simpleContentAnyAttributeLax" type="ex:SimpleContentAnyAttributeLax" />
<xs:complexType name="SimpleContentAnyAttributeLax">
  <xs:simpleContent>
    <xs:extension base="xs:string">
      <xs:anyAttribute processContents="lax"  namespace="##other" />
    </xs:extension>
  </xs:simpleContent>
</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 [SimpleContentAnyAttributeLax01]:

  <ex:simpleContentAnyAttributeLax ex2:laxAttribute="string">some data</ex:simpleContentAnyAttributeLax>

2.11.26 SimpleContentAnyAttributeStrict

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

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

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

<xs:import namespace="http://www.w3.org/2002/ws/databinding/examples/6/09/strict/" schemaLocation="../strict.xsd" />
<xs:element name="simpleContentAnyAttributeStrict" type="ex:SimpleContentAnyAttributeStrict" />
<xs:complexType name="SimpleContentAnyAttributeStrict">
  <xs:simpleContent>
    <xs:extension base="xs:string">
      <xs:anyAttribute processContents="strict"  namespace="##other" />
    </xs:extension>
  </xs:simpleContent>
</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 [SimpleContentAnyAttributeStrict01]:

  <ex:simpleContentAnyAttributeStrict ex2:strictAttribute="value1">some data</ex:simpleContentAnyAttributeStrict>

2.11.27 AnyAttributeNamespacedFinite

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

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

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

<xs:element name="anyAttributeNamespacedFinite" type="ex:AnyAttributeNamespacedFinite" />
<xs:complexType name="AnyAttributeNamespacedFinite">
  <xs:sequence>
    <xs:element name="firstElement" type="xs:string" />
    <xs:element name="lastElement" type="xs:string" />
  </xs:sequence>
  <xs:anyAttribute processContents="lax"  namespace="http://www.w3.org/2002/ws/databinding/examples/6/09/" />
</xs:complexType>
<xs:attribute name="otherAttribute">
  <xs:simpleType>
    <xs:restriction base="xs:string">
      <xs:enumeration value="value1" />
      <xs:enumeration value="value2" />
    </xs:restriction>
  </xs:simpleType>
</xs:attribute>
    

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

  <ex:anyAttributeNamespacedFinite ex:otherAttribute="value1">
      <ex:firstElement>element1</ex:firstElement>
      <ex:lastElement>element2</ex:lastElement>
   </ex:anyAttributeNamespacedFinite>

2.12 Sequences

2.12.1 ComplexTypeSequenceChoice

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

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

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

<xs:element name="mortgage" type="ex:Mortgage" />
<xs:complexType name="Mortgage">
  <xs:sequence>
    <xs:element name="amount" type="xs:int" />
    <xs:choice>
      <xs:element name="repayment" type="ex:Repayment" />
      <xs:element name="interestonly" type="ex:InterestOnly" />
    </xs:choice>
  </xs:sequence>
</xs:complexType>
<xs:complexType name="Repayment">
  <xs:sequence>
    <xs:element name="years" type="xs:int" />
    <xs:element name="months" type="xs:int" />
    <xs:element name="rate" type="xs:string" />
  </xs:sequence>
</xs:complexType>
<xs:complexType name="InterestOnly">
  <xs:sequence>
    <xs:element name="years" type="xs:int" />
    <xs:element name="rate" 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 [ComplexTypeSequenceChoice01]:

  <ex:mortgage>
      <ex:amount>225000</ex:amount>
      <ex:repayment>
         <ex:years>20</ex:years>
         <ex:months>6</ex:months>
         <ex:rate>5.25</ex:rate>
      </ex:repayment>
   </ex:mortgage>

as is the following element when included in an instance document [ComplexTypeSequenceChoice02]:

  <ex:mortgage>
      <ex:amount>225000</ex:amount>
      <ex:interestonly>
         <ex:years>25</ex:years>
         <ex:rate>5.50</ex:rate>
      </ex:interestonly>
   </ex:mortgage>

2.12.2 SequenceSequenceElement

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

.//xs:sequence/xs:sequence/xs:element/ (., ..)

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

<xs:element name="sequenceSequenceElement" type="ex:SequenceSequenceElement" />
<xs:complexType name="SequenceSequenceElement">
  <xs:sequence>
    <xs:element name="firstName" type="xs:string" />
    <xs:sequence minOccurs="0">
      <xs:element name="middleName" type="xs:string" />
      <xs:sequence minOccurs="0">
        <xs:element name="lastName" type="xs:string" />
      </xs:sequence>
    </xs:sequence>
  </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 [SequenceSequenceElement01]:

  <ex:sequenceSequenceElement>
      <ex:firstName>Paul</ex:firstName>
   </ex:sequenceSequenceElement>

as is the following element when included in an instance document [SequenceSequenceElement02]:

  <ex:sequenceSequenceElement>
      <ex:firstName>Paul</ex:firstName>
      <ex:middleName>Sumner</ex:middleName>
   </ex:sequenceSequenceElement>

and the following element when included in an instance document [SequenceSequenceElement03]:

  <ex:sequenceSequenceElement>
      <ex:firstName>Paul</ex:firstName>
      <ex:middleName>Sumner</ex:middleName>
      <ex:lastName>Downey</ex:lastName>
   </ex:sequenceSequenceElement>

2.12.3 SequenceMinOccurs0

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

.//xs:sequence[@minOccurs = '0' and (not(@maxOccurs) or @maxOccurs = '1')]/ (@minOccurs, @maxOccurs)

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

<xs:element name="sequenceMinOccurs0" type="ex:SequenceMinOccurs0" />
<xs:complexType name="SequenceMinOccurs0">
  <xs:sequence  minOccurs="0">
    <xs:element name="firstName" type="xs:string" />
    <xs:element name="middleName" type="xs:string" />
    <xs:element name="lastName" 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 [SequenceMinOccurs001]:

  <ex:sequenceMinOccurs0>
      <ex:firstName>Paul</ex:firstName>
      <ex:middleName>Sumner</ex:middleName>
      <ex:lastName>Downey</ex:lastName>
   </ex:sequenceMinOccurs0>

as is the following element when included in an instance document [SequenceMinOccurs002]:

  <ex:sequenceMinOccurs0/>

2.12.4 SequenceMinOccurs0MaxOccursUnbounded

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

.//xs:sequence[@minOccurs = '0' and @maxOccurs = 'unbounded']/ (@minOccurs, @maxOccurs)

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

<xs:element name="durationListSequence" type="ex:DurationListSequence" />
<xs:complexType name="DurationListSequence">
  <xs:sequence  minOccurs="0"  maxOccurs="unbounded">
    <xs:element name="durationVal" type="xs:string" />
    <xs:element name="durationPercentage" 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 [SequenceMinOccurs0MaxOccursUnbounded101]:

  <ex:durationListSequence>
      <ex:durationVal>44</ex:durationVal>
      <ex:durationPercentage>33</ex:durationPercentage>
      <ex:durationVal>24</ex:durationVal>
      <ex:durationPercentage>45</ex:durationPercentage>
      <ex:durationVal>64</ex:durationVal>
      <ex:durationPercentage>22</ex:durationPercentage>
   </ex:durationListSequence>

as is the following element when included in an instance document [SequenceMinOccurs0MaxOccursUnbounded102]:

  <ex:durationListSequence/>

2.12.5 SequenceMinOccurs1MaxOccursUnbounded

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

.//xs:sequence[(not(@minOccurs) or @minOccurs = '1') and @maxOccurs = 'unbounded']/ (@minOccurs, @maxOccurs)

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

<xs:element name="ageListSequence" type="ex:AgeListSequence" />
<xs:complexType name="AgeListSequence">
  <xs:sequence  minOccurs="1"  maxOccurs="unbounded">
    <xs:element name="ageVal" type="xs:string" />
    <xs:element name="agePercentage" 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 [SequenceMinOccurs1MaxOccursUnbounded101]:

  <ex:ageListSequence>
      <ex:ageVal>44</ex:ageVal>
      <ex:agePercentage>33</ex:agePercentage>
      <ex:ageVal>24</ex:ageVal>
      <ex:agePercentage>45</ex:agePercentage>
      <ex:ageVal>64</ex:ageVal>
      <ex:agePercentage>22</ex:agePercentage>
   </ex:ageListSequence>

as is the following element when included in an instance document [SequenceMinOccurs1MaxOccursUnbounded102]:

  <ex:ageListSequence>
      <ex:ageVal>44</ex:ageVal>
      <ex:agePercentage>33</ex:agePercentage>
   </ex:ageListSequence>

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

<xs:element name="bookPublications" type="ex:BookPublications" />
<xs:complexType name="BookPublications">
  <xs:sequence  maxOccurs="unbounded">
    <xs:element name="pubDate" type="xs:string" />
    <xs:element name="pubISBN" 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 [SequenceMaxOccursUnbounded01]:

  <ex:bookPublications>
      <ex:pubDate>2002-09-24</ex:pubDate>
      <ex:pubISBN>1-55960-907-6</ex:pubISBN>
      <ex:pubDate>2003-04-14</ex:pubDate>
      <ex:pubISBN>1-25466-908-6</ex:pubISBN>
      <ex:pubDate>2004-03-31</ex:pubDate>
      <ex:pubISBN>1-35460-909-6</ex:pubISBN>
      <ex:pubDate>2005-06-04</ex:pubDate>
      <ex:pubISBN>1-54560-910-6</ex:pubISBN>
      <ex:pubDate>2006-07-03</ex:pubDate>
      <ex:pubISBN>1-74869-911-6</ex:pubISBN>
   </ex:bookPublications>

as is the following element when included in an instance document [SequenceMaxOccursUnbounded02]:

  <ex:bookPublications>
      <ex:pubDate>2006-01-26</ex:pubDate>
      <ex:pubISBN>1-44795-912-6</ex:pubISBN>
   </ex:bookPublications>

2.12.6 SequenceMinOccursFinite

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //xs:schema results in an [XPath 2.0] node-set containing at least one node:

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

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.12.7 SequenceMaxOccursFinite

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

.//xs:sequence[@maxOccurs and not(@maxOccurs = '0' or @maxOccurs = '1' or @maxOccurs = 'unbounded')]/ (@maxOccurs)

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

<xs:element name="winter" type="ex:Winter" />
<xs:complexType name="Winter">
  <xs:sequence  maxOccurs="4">
    <xs:element name="mnth" type="xs:string" />
    <xs:element name="weather" 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 [SequenceMaxOccursFinite01]:

  <ex:winter>
      <ex:mnth>November</ex:mnth>
      <ex:weather>Rain</ex:weather>
      <ex:mnth>December</ex:mnth>
      <ex:weather>Snow</ex:weather>
      <ex:mnth>January</ex:mnth>
      <ex:weather>Snow</ex:weather>
      <ex:mnth>February</ex:mnth>
      <ex:weather>Rain</ex:weather>
   </ex:winter>

as is the following element when included in an instance document [SequenceMaxOccursFinite02]:

  <ex:winter>
      <ex:mnth>December</ex:mnth>
      <ex:weather>Snow</ex:weather>
   </ex:winter>

2.12.8 ExtendedSequenceStrict

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //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 (not (@minOccurs) or @minOccurs = '1' or @minOccurs = '0') and (not (@maxOccurs) or @maxOccurs = '1' or @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.12.9 ExtendedSequenceLax

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:sequence/xs:any[@processContents = 'lax' and (not (@minOccurs) or @minOccurs = '1' or @minOccurs = '0') and (not (@maxOccurs) or @maxOccurs = '1' or @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.12.10 ExtendedSequenceSkip

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //xs:schema results in an [XPath 2.0] node-set containing at least one node:

.//xs:sequence/xs:any[@processContents = 'skip' and (not (@minOccurs) or @minOccurs = '1' or @minOccurs = '0') and (not (@maxOccurs) or @maxOccurs = '1' or @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.12.11 ExtendedSequenceStrictAny

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //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 (not (@minOccurs) or @minOccurs = '1' or @minOccurs = '0') and (not (@maxOccurs) or @maxOccurs = '1' or @maxOccurs='unbounded') and (not(@namespace) or @namespace = '##any')]/ (., @processContents, @minOccurs, @maxOccurs, @namespace)

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

<xs:element name="extendedSequenceStrictAny" type="ex:ExtendedSequenceStrictAny" />
<xs:element name="extendedSequenceStrictAnyElement" type="xs:string" />
<xs:complexType name="ExtendedSequenceStrictAny">
  <xs:sequence>
    <xs:element name="firstElement" type="xs:string" />
    <xs:element name="lastElement" type="xs:string" />
    <xs:element name="extension" type="ex:ExtendedSequenceStrictAnyExtension" minOccurs="0" />
  </xs:sequence>
</xs:complexType>
<xs:complexType name="ExtendedSequenceStrictAnyExtension">
  <xs:sequence>
    <xs:any namespace="##any"  processContents="strict"  minOccurs="0"  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 [ExtendedSequenceStrictAny01]:

  <ex:extendedSequenceStrictAny>
      <ex:firstElement>String</ex:firstElement>
      <ex:lastElement>String</ex:lastElement>
      <ex:extension>
         <ex:extendedSequenceStrictAnyElement>Stuff</ex:extendedSequenceStrictAnyElement>
      </ex:extension>
   </ex:extendedSequenceStrictAny>

2.12.12 ExtendedSequenceLaxAny

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //xs:schema results in an [XPath 2.0] node-set containing at least one node:

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

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

<xs:element name="extendedSequenceLaxAny" type="ex:ExtendedSequenceLaxAny" />
<xs:complexType name="ExtendedSequenceLaxAny">
  <xs:sequence>
    <xs:element name="firstElement" type="xs:string" />
    <xs:element name="lastElement" type="xs:string" />
    <xs:element name="extension" type="ex:ExtendedSequenceLaxAnyExtension" minOccurs="0" />
  </xs:sequence>
</xs:complexType>
<xs:complexType name="ExtendedSequenceLaxAnyExtension">
  <xs:sequence>
    <xs:any namespace="##any"  processContents="lax"  minOccurs="0"  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 [ExtendedSequenceLaxAny01]:

  <ex:extendedSequenceLaxAny>
      <ex:firstElement>String</ex:firstElement>
      <ex:lastElement>String</ex:lastElement>
      <ex:extension>
         <ex2:anyElement>Stuff</ex2:anyElement>
      </ex:extension>
   </ex:extendedSequenceLaxAny>

2.12.13 ExtendedSequenceSkipAny

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //xs:schema results in an [XPath 2.0] node-set containing at least one node:

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

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

<xs:element name="extendedSequenceSkipAny" type="ex:ExtendedSequenceSkipAny" />
<xs:complexType name="ExtendedSequenceSkipAny">
  <xs:sequence>
    <xs:element name="firstElement" type="xs:string" />
    <xs:element name="lastElement" type="xs:string" />
    <xs:element name="extension" type="ex:ExtendedSequenceSkipAnyExtension" minOccurs="0" />
  </xs:sequence>
</xs:complexType>
<xs:complexType name="ExtendedSequenceSkipAnyExtension">
  <xs:sequence>
    <xs:any namespace="##any"  processContents="skip"  minOccurs="0"  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 [ExtendedSequenceSkipAny01]:

  <ex:extendedSequenceSkipAny>
      <ex:firstElement>String</ex:firstElement>
      <ex:lastElement>String</ex:lastElement>
      <ex:extension>
         <ex2:anyElement>Stuff</ex2:anyElement>
      </ex:extension>
   </ex:extendedSequenceSkipAny>

2.12.14 ExtendedSequenceStrictOther

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //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 (not (@minOccurs) or @minOccurs = '1' or @minOccurs = '0') and (not (@maxOccurs) or @maxOccurs = '1' or @maxOccurs='unbounded') and @namespace = '##other']/ (., @processContents, @minOccurs, @maxOccurs, @namespace)

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

<xs:import namespace="http://www.w3.org/2002/ws/databinding/examples/6/09/strict/" schemaLocation="../strict.xsd" />
<xs:element name="extendedSequenceStrictOther" type="ex:ExtendedSequenceStrictOther" />
<xs:complexType name="ExtendedSequenceStrictOther">
  <xs:sequence>
    <xs:element name="element1" type="xs:string" />
    <xs:element name="element2" type="xs:string" />
    <xs:element name="extension" type="ex:ExtendedSequenceStrictOtherExtension" minOccurs="0" />
  </xs:sequence>
</xs:complexType>
<xs:complexType name="ExtendedSequenceStrictOtherExtension">
  <xs:sequence>
    <xs:any namespace="##other"  processContents="strict"  minOccurs="0"  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 [ExtendedSequenceStrictOther01]:

  <ex:extendedSequenceStrictOther>
      <ex:element1>firstElement</ex:element1>
      <ex:element2>lastElement</ex:element2>
      <ex:extension>
         <strictElement>strictElement</strictElement>
      </ex:extension>
   </ex:extendedSequenceStrictOther>

2.12.15 ExtendedSequenceLaxOther

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //xs:schema results in an [XPath 2.0] node-set containing at least one node:

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

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

<xs:element name="extendedSequenceLaxOther" type="ex:ExtendedSequenceLaxOther" />
<xs:complexType name="ExtendedSequenceLaxOther">
  <xs:sequence>
    <xs:element name="firstElement" type="xs:string" />
    <xs:element name="lastElement" type="xs:string" />
    <xs:element name="extension" type="ex:ExtendedSequenceLaxOtherExtension" minOccurs="0" />
  </xs:sequence>
</xs:complexType>
<xs:complexType name="ExtendedSequenceLaxOtherExtension">
  <xs:sequence>
    <xs:any namespace="##other"  processContents="lax"  minOccurs="0"  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 [ExtendedSequenceLaxOther01]:

  <ex:extendedSequenceLaxOther>
      <ex:firstElement>String</ex:firstElement>
      <ex:lastElement>String</ex:lastElement>
      <ex:extension>
         <ex2:anyElement>Stuff</ex2:anyElement>
      </ex:extension>
   </ex:extendedSequenceLaxOther>

2.12.16 ExtendedSequenceSkipOther

An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element <xs:schema>, 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 with a context node of //xs:schema results in an [XPath 2.0] node-set containing at least one node:

<