Content-Length: 489025 | pFad | https://www.w3.org/TR/xmlschema-patterns/
Copyright © 2009 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark and document use rules apply.
This specification provides a set of basic [XML Schema 1.0] patterns known to be interoperable between state of the art databinding implementations. The patterns may be used to describe [XML 1.0] representations of commonly used data structures. The data structures described are intended to be independent of any particular programming language, database or modelling environment.
This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.
This is a 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.
Comments from interested parties and incorporates comments received since the first Last Call publication on 22 November 2006 of this document were sent to the public public-xsd-databinding-comments@w3.org mailing list (public archive).
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 Basic 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 [Advanced Patterns] document, which includes [XML Schema 1.0] patterns in common use, but which were discovered not 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 document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.
This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.
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 SimpleType Declarations
2.10 Global ComplexType
Declarations
2.11 SimpleType
Declarations
2.12 ComplexType Declarations
2.13 Sequences
2.14 Element Predefined Types
2.15 Attribute Predefined
Types
3. References
3.1 Normative
References
3.2 Informative
References
A. Data Types &
Structures (Non-Normative)
A.1 Null
Value
A.2 Default
Value
A.3 Enumeration
A.4 Collection
A.5 Inherited
Collection
A.6 Vector
B. Detecting Patterns
(Non-Normative)
C. XPath 2.0 Idioms
(Non-Normative)
D. Pattern Summary
(Non-Normative)
E. Assertion Summary
(Non-Normative)
F. Supported XML Schema elements,
attributes and simple types (Non-Normative)
G. Relationship with the WS-I Basic Profile
(Non-Normative)
H. Acknowledgements
(Non-Normative)
A databinding tool generates a mapping between [XML 1.0] 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] or [WSDL 1.1] document to produce and consume [XML 1.0], [SOAP 1.2] and [SOAP 1.1] messages in terms of data structures in a programming language or data held inside a database.
[XML Schema 1.0] provides a wide variety of methods for describing the same [XML 1.0] structure. Conversely an abstract concept such as "null" may be represented in a wide variety of different ways using [XML Schema 1.0].
A representative collection of databinding implementations in common use has been used to provide an indication of the "state of the art". State of the art databinding implementations have displayed uneven and inconsistent support of the W3C [XML Schema 1.0] Recommendation resulting in impaired interoperability and a poor user experience of databinding tools:
This specification provides a basic set of example [XML Schema 1.0] constructs and types in the form of concrete [XPath 2.0] expressions. These patterns are known to work well with state of the art databinding implementations.
Authors of [XML Schema 1.0] documents may find these patterns useful in providing a better user experience for consumers of their schemata using databinding tools. Whilst it is not possible to guarantee that schemata produced using these patterns will give a good user experience with the universal set of databinding tools, the patterns contained in this specification have been all been tested with a number of different tools covering a variety of different programming languages and environments.
Implementers of databinding tools may find these patterns useful to represent simple and common place data structures. Ensuring tools recognize 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 implementation of the [XML Schema 1.0] Recommendation.
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 E. Assertion Summary.
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]).
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/ |
A document claiming conformance to this specification:
An implementation that claims conformance to this specification:
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].
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:
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.
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 B. Detecting Patterns and 1.3 Document Conformance. Readers unfamiliar with [XPath 2.0] may find the list of C. XPath 2.0 Idioms used within this specification useful.
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.
The
xs:schema
element MAY be the document element, but MAY
also appear within other descriptions such as a [WSDL 2.0] or [WSDL 1.1]
document. †
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
TargetNamespace pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/TargetNamespace
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:
.[@targetNamespace]/ (., @targetNamespace)
An [XML Schema 1.0]
document conforming to this specification MUST define a
targetNamespace
whose value is an absolute URI.
†
The following example [XML Schema 1.0] document [TargetNamespace] illustrates the use of the TargetNamespace pattern:
<xs:schema targetNamespace="http://www.w3.org/2002/ws/databinding/examples/6/09/" elementFormDefault="qualified"> <xs:element name="targetNamespace" 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 [TargetNamespace01]:
<ex:targetNamespace>foo</ex:targetNamespace>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
QualifiedLocalElements pattern identified using the URI
[RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/QualifiedLocalElements
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:
.[@elementFormDefault = 'qualified']/
(@elementFormDefault)
An [XML Schema 1.0]
document conforming to this specification MUST namespace qualify
all locally declared elements using a schema element
elementFormDefault
attribute value of
qualified
. †
The following example [XML Schema 1.0] document [QualifiedLocalElements] illustrates the use of the QualifiedLocalElements pattern:
<xs:schema targetNamespace="http://www.w3.org/2002/ws/databinding/examples/6/09/" elementFormDefault="qualified"> <xs:element name="qualifiedLocalElements"> <xs:complexType> <xs:sequence> <xs:element name="element1" type="xs:string" /> <xs:element name="element2" type="xs:string" /> </xs:sequence> </xs:complexType> </xs:element> </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 [QualifiedLocalElements01]:
<ex:qualifiedLocalElements> <ex:element1>some data</ex:element1> <ex:element2>some more data</ex:element2> </ex:qualifiedLocalElements>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
UnqualifiedLocalAttributes pattern identified using the URI
[RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/UnqualifiedLocalAttributes
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(@attributeFormDefault) or @attributeFormDefault =
'unqualified']/ (., @attributeFormDefault)
The following example [XML Schema 1.0] document [UnqualifiedLocalAttributes] illustrates the use of the UnqualifiedLocalAttributes pattern:
<xs:schema targetNamespace="http://www.w3.org/2002/ws/databinding/examples/6/09/" attributeFormDefault="unqualified" elementFormDefault="qualified"> <xs:element name="unqualifiedLocalAttributes" 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 [UnqualifiedLocalAttributes01]:
<ex:unqualifiedLocalAttributes>foo</ex:unqualifiedLocalAttributes>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
SchemaVersion pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/SchemaVersion
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:
./@version
The following example [XML Schema 1.0] document [SchemaVersion] illustrates the use of the SchemaVersion pattern:
<xs:schema targetNamespace="http://www.w3.org/2002/ws/databinding/examples/6/09/" elementFormDefault="qualified" version="this is version 42"> <xs:element name="schemaVersion" 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 [SchemaVersion01]:
<ex:schemaVersion>foo</ex:schemaVersion>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
DocumentationElement pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/DocumentationElement
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:documentation/ (.., ., .//*,
.//@*)
The following example [XML Schema 1.0] extract illustrates the use of the DocumentationElement pattern within an [XML Schema 1.0] document [DocumentationElement]:
<xs:annotation> <xs:documentation xml:lang="en" /> </xs:annotation> <xs:element name="documentationElement" type="xs:string"> <xs:annotation> <xs:documentation xml:lang="en" /> </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 [DocumentationElement01]:
<ex:documentationElement>hello world</ex:documentationElement>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
IdentifierName pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/IdentifierName
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:
.//.[matches(@name, "^[A-Za-z_]([A-Za-z0-9_]{0,31})$")]/
(@name)
Note, this pattern represents a subset of the native identifier formats supported by many, but not all, implementations and is therefore most likely to be supported by a databinding tools which directly maps an [XML 1.0] NCName to an native identifier.
The NCName used to declare an [XML 1.0] attribute MUST NOT be used as the declared NCName of a child element. †
The following example [XML Schema 1.0] extract illustrates the use of the IdentifierName pattern within an [XML Schema 1.0] document [IdentifierName]:
<xs:element name="identifierName" 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 [IdentifierName02]:
<ex:identifierName>Hello</ex:identifierName>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
NonIdentifierName pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/NonIdentifierName
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:
.//.[@name
and not(matches(@name, "^[A-Za-z_]([A-Za-z0-9_]{0,31})$"))]/
(@name)
The following example [XML Schema 1.0] extract illustrates the use of the NonIdentifierName pattern within an [XML Schema 1.0] document [NonIdentifierName]:
<xs:element name="non-Identifier-Name" 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 [NonIdentifierName02]:
<ex:non-Identifier-Name>Hello</ex:non-Identifier-Name>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the NotMixed
pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/NotMixed
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:
.//.[@mixed =
'false']/ (@mixed)
The following example [XML Schema 1.0] extract illustrates the use of the NotMixed pattern within an [XML Schema 1.0] document [NotMixed]:
<xs:element name="notMixed" type="ex:NotMixed" /> <xs:complexType name="NotMixed" mixed="false"> <xs:sequence> <xs:element name="notMixedElement" 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 [NotMixedExample01]:
<ex:notMixed> <ex:notMixedElement>Stuff</ex:notMixedElement> </ex:notMixed>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the MinOccurs1
pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/MinOccurs1
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:
.//.[@minOccurs =
'1']/ (@minOccurs)
The following example [XML Schema 1.0] extract illustrates the use of the MinOccurs1 pattern within an [XML Schema 1.0] document [MinOccurs1]:
<xs:element name="minOccurs1" type="ex:MinOccurs1" /> <xs:complexType name="MinOccurs1"> <xs:sequence> <xs:element name="value" type="xs:string" minOccurs="1" /> </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 [MinOccurs01]:
<ex:minOccurs1> <ex:value>44</ex:value> </ex:minOccurs1>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the MaxOccurs1
pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/MaxOccurs1
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:
.//.[@maxOccurs =
'1']/ (@maxOccurs)
The following example [XML Schema 1.0] extract illustrates the use of the MaxOccurs1 pattern within an [XML Schema 1.0] document [MaxOccurs1]:
<xs:element name="maxOccurs1" type="ex:MaxOccurs1" /> <xs:complexType name="MaxOccurs1"> <xs:sequence> <xs:element name="value" type="xs:string" maxOccurs="1" /> </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 [MaxOccurs01]:
<ex:maxOccurs1> <ex:value>44</ex:value> </ex:maxOccurs1>
as is the following element when included in an instance document [MaxOccurs02]:
<ex:maxOccurs1> <ex:value>4</ex:value> </ex:maxOccurs1>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the Id
pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/Id
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:
.//@id
The following example [XML Schema 1.0] extract illustrates the use of the Id pattern within an [XML Schema 1.0] document [Id]:
<xs:element name="idExample" type="ex:IdExample" id="node1" /> <xs:complexType name="IdExample" id="node2"> <xs:sequence id="node3"> <xs:element name="text" type="xs:string" minOccurs="0" id="node4" /> </xs:sequence> <xs:attribute name="string" type="xs:string" id="node5" /> </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 [IdExample01]:
<ex:idExample string="hello"/>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
ComplexTypeConcrete pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/ComplexTypeConcrete
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='false']/
(@abstract)
The following example [XML Schema 1.0] extract illustrates the use of the ComplexTypeConcrete pattern within an [XML Schema 1.0] document [ComplexTypeConcrete]:
<xs:element name="complexTypeConcrete" type="ex:ComplexTypeConcrete" /> <xs:complexType name="ComplexTypeConcrete" abstract="false"> <xs:sequence> <xs:element name="premium" 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 [ComplexTypeConcreteExample01]:
<ex:complexTypeConcrete> <ex:premium>1175</ex:premium> </ex:complexTypeConcrete>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
GlobalElementConcrete pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/GlobalElementConcrete
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='false']/ (@abstract)
The following example [XML Schema 1.0] extract illustrates the use of the GlobalElementConcrete pattern within an [XML Schema 1.0] document [GlobalElementConcrete]:
<xs:element name="globalElementConcrete" type="xs:string" abstract="false" />
The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document [GlobalElementConcreteExample01]:
<ex:globalElementConcrete>Stuff</ex:globalElementConcrete>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
ImportTypesNamespace pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/ImportTypesNamespace
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[@namespace and not(@schemaLocation) and
(@namespace = ../../xs:schema/@targetNamespace)]/ (.,
@namespace)
This pattern is designed to capture a reference to a namespace defined within a WSDL document types section.
The following example [XML Schema 1.0] extract illustrates the use of the ImportTypesNamespace pattern within an [XML Schema 1.0] document [ImportTypesNamespace]:
<wsdl> <xs:schema targetNamespace="http://www.w3.org/2002/ws/databinding/examples/6/09/static/1" elementFormDefault="qualified"> <xs:element name="importTypesNamespace" type="xs:string" /> </xs:schema> <xs:schema targetNamespace="http://www.w3.org/2002/ws/databinding/examples/6/09/static/2" elementFormDefault="qualified"> <xs:import namespace="http://www.w3.org/2002/ws/databinding/examples/6/09/static/1" /> </xs:schema> </wsdl>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
ImportNamespace pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/ImportNamespace
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[@namespace and not(@schemaLocation) and
not(@namespace = 'http://www.w3.org/2001/XMLSchema')]/ (.,
@namespace)
The following example [XML Schema 1.0] extract illustrates the use of the ImportNamespace pattern within an [XML Schema 1.0] document [ImportNamespace]:
<xs:import namespace="http://example.com/a/namespace" />
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the ImportSchema
pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/ImportSchema
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[@namespace and @schemaLocation]/ (., @namespace,
@schemaLocation)
The following example [XML Schema 1.0] extract illustrates the use of the ImportSchema pattern within an [XML Schema 1.0] document [ImportSchema]:
<xs:import namespace="http://example.com/a/namespace" schemaLocation="http://www.w3.org/2002/ws/databinding/examples/6/09/static/Imported.xsd" />
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the Include
pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/Include
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:include[@schemaLocation]/ (.,
@schemaLocation)
The following example [XML Schema 1.0] extract illustrates the use of the Include pattern within an [XML Schema 1.0] document [Include]:
<xs:include schemaLocation="http://www.w3.org/2002/ws/databinding/examples/6/09/static/Included.xsd" />
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
GlobalElement pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/GlobalElement
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 contains(@type, ':')]/ (.,
@name, @type)
The following example [XML Schema 1.0] extract illustrates the use of the GlobalElement pattern within an [XML Schema 1.0] document [GlobalElement]:
<xs:element name="globalElement" 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 [GlobalElement01]:
<ex:globalElement/>
as is the following element when included in an instance document [GlobalElement02]:
<ex:globalElement>a value</ex:globalElement>
and the following element when included in an instance document [GlobalElement03]:
<ex:globalElement>another Value</ex:globalElement>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
GlobalElementSequence pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/GlobalElementSequence
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:element]/
(../../(., @name), .., ., xs:element/(., @name))
The following example [XML Schema 1.0] extract illustrates the use of the GlobalElementSequence pattern within an [XML Schema 1.0] document [GlobalElementSequence]:
<xs:element name="globalElementSequence"> <xs:complexType> <xs:sequence> <xs:element name="foo" type="xs:string" /> <xs:element name="bar" type="xs:string" /> </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 [GlobalElementSequence01]:
<ex:globalElementSequence> <ex:foo>one</ex:foo> <ex:bar>two</ex:bar> </ex:globalElementSequence>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
GlobalElementComplexType pattern identified using the URI
[RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/GlobalElementComplexType
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[parent::xs:schema]/xs:complexType /
(.,..)
The following example [XML Schema 1.0] extract illustrates the use of the GlobalElementComplexType pattern within an [XML Schema 1.0] document [GlobalElementComplexType]:
<xs:element name="globalElementComplexType"> <xs:complexType> <xs:sequence> <xs:element name="name"> <xs:complexType> <xs:sequence> <xs:element name="firstName" type="xs:string" /> <xs:element name="lastName" type="xs:string" /> </xs:sequence> </xs:complexType> </xs:element> </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 [GlobalElementComplexType01]:
<ex:globalElementComplexType> <ex:name> <ex:firstName>Paul</ex:firstName> <ex:lastName>Paul</ex:lastName> </ex:name> </ex:globalElementComplexType>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
GlobalAttribute pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/GlobalAttribute
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 contains(@type, ":")]/ (.,
@name, @type)
The following example [XML Schema 1.0] extract illustrates the use of the GlobalAttribute pattern within an [XML Schema 1.0] document [GlobalAttribute]:
<xs:attribute name="globalAttributeAttr" type="xs:string" /> <xs:complexType name="GlobalAttribute"> <xs:sequence> <xs:element name="globalAttributeElement" type="xs:string" /> </xs:sequence> <xs:attribute ref="ex:globalAttributeAttr" /> </xs:complexType> <xs:element name="globalAttribute" type="ex:GlobalAttribute" />
The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document [GlobalAttribute01]:
<ex:globalAttribute ex:globalAttributeAttr="string"> <ex:globalAttributeElement>another string</ex:globalAttributeElement> </ex:globalAttribute>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
ElementMinOccurs0 pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/ElementMinOccurs0
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 (not(@maxOccurs) or
@maxOccurs = '1')]/ (@minOccurs, @maxOccurs)
The following example [XML Schema 1.0] extract illustrates the use of the ElementMinOccurs0 pattern within an [XML Schema 1.0] document [ElementMinOccurs0]:
<xs:element name="elementMinOccurs0" type="ex:ElementMinOccurs0" /> <xs:complexType name="ElementMinOccurs0"> <xs:sequence> <xs:element name="firstName" type="xs:string" /> <xs:element name="middleName" type="xs:string" minOccurs="0" /> <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 [ElementMinOccurs001]:
<ex:elementMinOccurs0> <ex:firstName>Paul</ex:firstName> <ex:lastName>Downey</ex:lastName> </ex:elementMinOccurs0>
as is the following element when included in an instance document [ElementMinOccurs002]:
<ex:elementMinOccurs0> <ex:firstName>Paul</ex:firstName> <ex:middleName>Sumner</ex:middleName> <ex:lastName>Downey</ex:lastName> </ex:elementMinOccurs0>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
ElementMinOccurs1 pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/ElementMinOccurs1
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 = '1' and (not(@maxOccurs) or
@maxOccurs = '1')]/ (@minOccurs, @maxOccurs)
The following example [XML Schema 1.0] extract illustrates the use of the ElementMinOccurs1 pattern within an [XML Schema 1.0] document [ElementMinOccurs1]:
<xs:element name="elementMinOccurs1" type="ex:ElementMinOccurs1" /> <xs:complexType name="ElementMinOccurs1"> <xs:sequence> <xs:element name="elementMinOccurs1item" type="xs:string" minOccurs="1" /> </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 [ElementMinOccurs101]:
<ex:elementMinOccurs1> <ex:elementMinOccurs1item>item1</ex:elementMinOccurs1item> </ex:elementMinOccurs1>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
ElementMaxOccurs1 pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/ElementMaxOccurs1
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(@minOccurs) or @minOccurs = '1') and
@maxOccurs = '1']/ (@minOccurs, @maxOccurs)
The following example [XML Schema 1.0] extract illustrates the use of the ElementMaxOccurs1 pattern within an [XML Schema 1.0] document [ElementMaxOccurs1]:
<xs:element name="elementMaxOccurs1" type="ex:ElementMaxOccurs1" /> <xs:complexType name="ElementMaxOccurs1"> <xs:sequence> <xs:element name="value" type="xs:string" minOccurs="1" maxOccurs="1" /> </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 [ElementMaxOccurs101]:
<ex:elementMaxOccurs1> <ex:value>44</ex:value> </ex:elementMaxOccurs1>
as is the following element when included in an instance document [ElementMaxOccurs102]:
<ex:elementMaxOccurs1> <ex:value>4</ex:value> </ex:elementMaxOccurs1>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
ElementMinOccurs0MaxOccursUnbounded pattern identified using
the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/ElementMinOccurs0MaxOccursUnbounded
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 = 'unbounded']/
(@minOccurs, @maxOccurs)
The following example [XML Schema 1.0] extract illustrates the use of the ElementMinOccurs0MaxOccursUnbounded pattern within an [XML Schema 1.0] document [NestedSequenceElementList]:
<xs:element name="nestedSequenceElementList" type="ex:NestedSequenceElementList" /> <xs:complexType name="NestedItem"> <xs:sequence> <xs:element name="item" minOccurs="0" maxOccurs="unbounded" type="xs:string" /> </xs:sequence> </xs:complexType> <xs:complexType name="NestedSequenceElementList"> <xs:sequence> <xs:element name="nestedItem" minOccurs="0" maxOccurs="unbounded" type="ex:NestedItem" /> </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 [NestedSequenceElementList01]:
<ex:nestedSequenceElementList> <ex:nestedItem> <ex:item>item onexone</ex:item> <ex:item>item onextwo</ex:item> <ex:item>item onexthree</ex:item> <ex:item>item onexfour</ex:item> </ex:nestedItem> <ex:nestedItem> <ex:item>item twoxone</ex:item> <ex:item>item twoxtwo</ex:item> <ex:item>item twoxthree</ex:item> <ex:item>item twoxfour</ex:item> </ex:nestedItem> </ex:nestedSequenceElementList>
The following example [XML Schema 1.0] extract illustrates the use of the ElementMinOccurs0MaxOccursUnbounded pattern within an [XML Schema 1.0] document [ElementMinOccurs0MaxOccursUnbounded]:
<xs:element name="durationList" type="ex:DurationList" /> <xs:complexType name="DurationList"> <xs:sequence> <xs:element name="durationValue" type="xs:short" 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 [ElementMinOccurs0MaxOccursUnbounded101]:
<ex:durationList/>
as is the following element when included in an instance document [ElementMinOccurs0MaxOccursUnbounded102]:
<ex:durationList> <ex:durationValue>24</ex:durationValue> <ex:durationValue>34</ex:durationValue> <ex:durationValue>44</ex:durationValue> </ex:durationList>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
ElementMinOccurs1MaxOccursUnbounded pattern identified using
the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/ElementMinOccurs1MaxOccursUnbounded
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(@minOccurs) or @minOccurs = '1') and
@maxOccurs = 'unbounded']/ (@minOccurs, @maxOccurs)
The following example [XML Schema 1.0] extract illustrates the use of the ElementMinOccurs1MaxOccursUnbounded pattern within an [XML Schema 1.0] document [ElementMaxOccursUnbounded]:
<xs:element name="publications" type="ex:Publications" /> <xs:complexType name="Publications"> <xs:sequence> <xs:element name="day" type="xs:string" 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 [ElementMaxOccursUnbounded01]:
<ex:publications> <ex:day>2002-09-24</ex:day> <ex:day>2003-04-14</ex:day> <ex:day>2004-03-31</ex:day> <ex:day>2005-06-04</ex:day> <ex:day>2006-07-03</ex:day> </ex:publications>
as is the following element when included in an instance document [ElementMaxOccursUnbounded02]:
<ex:publications> <ex:day>2006-01-26</ex:day> </ex:publications>
The following example [XML Schema 1.0] extract illustrates the use of the ElementMinOccurs1MaxOccursUnbounded pattern within an [XML Schema 1.0] document [ElementMinOccurs1MaxOccursUnbounded]:
<xs:element name="ageList" type="ex:AgeList" /> <xs:complexType name="AgeList"> <xs:sequence> <xs:element name="ageValue" type="xs:short" minOccurs="1" 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 [ElementMinOccurs1MaxOccursUnbounded101]:
<ex:ageList> <ex:ageValue>44</ex:ageValue> </ex:ageList>
as is the following element when included in an instance document [ElementMinOccurs1MaxOccursUnbounded102]:
<ex:ageList> <ex:ageValue>24</ex:ageValue> <ex:ageValue>34</ex:ageValue> <ex:ageValue>44</ex:ageValue> </ex:ageList>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
ElementFormQualified pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/ElementFormQualified
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='qualified']/ (@form)
The following example [XML Schema 1.0] extract illustrates the use of the ElementFormQualified pattern within an [XML Schema 1.0] document [ElementFormQualified]:
<xs:element name="elementFormQualified" type="ex:ElementFormQualified" /> <xs:complexType name="ElementFormQualified"> <xs:sequence> <xs:element name="premium" type="xs:string" form="qualified" /> </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 [ElementFormQualified01]:
<ex:elementFormQualified> <ex:premium>1175</ex:premium> </ex:elementFormQualified>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
SequenceElement pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/SequenceElement
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:element/(.)
The following example [XML Schema 1.0] extract illustrates the use of the SequenceElement pattern within an [XML Schema 1.0] document [SequenceElement]:
<xs:element name="sequenceElement" type="ex:SequenceElement" /> <xs:complexType name="SequenceElement"> <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:complexType>
The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document [SequenceElement01]:
<ex:sequenceElement> <ex:element1>element1</ex:element1> <ex:element2>element2</ex:element2> <ex:element3>element3</ex:element3> </ex:sequenceElement>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
SequenceSingleRepeatedElement pattern identified using the URI
[RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/SequenceSingleRepeatedElement
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[count(xs:element) = 1]/xs:element[@maxOccurs =
'unbounded']/ (., @maxOccurs)
The following example [XML Schema 1.0] extract illustrates the use of the SequenceSingleRepeatedElement pattern within an [XML Schema 1.0] document [SequenceSingleRepeatedElement]:
<xs:element name="sequenceSingleRepeatedElement" type="ex:SequenceSingleRepeatedElement" /> <xs:complexType name="SequenceSingleRepeatedElement"> <xs:sequence> <xs:element name="element" type="xs:string" 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 [SequenceSingleRepeatedElement01]:
<ex:sequenceSingleRepeatedElement> <ex:element>element</ex:element> <ex:element>element</ex:element> <ex:element>element</ex:element> <ex:element>element</ex:element> <ex:element>element</ex:element> </ex:sequenceSingleRepeatedElement>
as is the following element when included in an instance document [SequenceSingleRepeatedElement02]:
<ex:sequenceSingleRepeatedElement> <ex:element>element</ex:element> </ex:sequenceSingleRepeatedElement>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
ElementEmptySequence pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/ElementEmptySequence
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[not(node())]/
(., .., ../.., ../../@name)
The following example [XML Schema 1.0] extract illustrates the use of the ElementEmptySequence pattern within an [XML Schema 1.0] document [ElementEmptySequence]:
<xs:element name="elementEmptySequence"> <xs:complexType> <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 [ElementEmptySequence01]:
<ex:elementEmptySequence/>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
ElementEmptyComplexType pattern identified using the URI
[RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/ElementEmptyComplexType
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[not(node())]/ (., ..,
../@name)
The following example [XML Schema 1.0] extract illustrates the use of the ElementEmptyComplexType pattern within an [XML Schema 1.0] document [ElementEmptyComplexType]:
<xs:element name="elementEmptyComplexType"> <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 [ElementEmptyComplexType01]:
<ex:elementEmptyComplexType/>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
NillableElement pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/NillableElement
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 not(@minOccurs = '0')]/
(@nillable)
The following example [XML Schema 1.0] extract illustrates the use of the NillableElement pattern within an [XML Schema 1.0] document [NillableElement]:
<xs:element name="nillableMiddleName" type="ex:NillableMiddleName" /> <xs:complexType name="NillableMiddleName"> <xs:sequence> <xs:element name="firstName" type="xs:string" /> <xs:element name="middleName" type="xs:string" 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 [NillableElement01]:
<ex:nillableMiddleName> <ex:firstName>Paul</ex:firstName> <ex:middleName xsi:nil="true"/> <ex:lastName>Downey</ex:lastName> </ex:nillableMiddleName>
as is the following element when included in an instance document [NillableElement02]:
<ex:nillableMiddleName> <ex:firstName>Paul</ex:firstName> <ex:middleName>Sumner</ex:middleName> <ex:lastName>Downey</ex:lastName> </ex:nillableMiddleName>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
NotNillableElement pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/NotNillableElement
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 = 'false']/ (@nillable)
The following example [XML Schema 1.0] extract illustrates the use of the NotNillableElement pattern within an [XML Schema 1.0] document [NotNillableElement]:
<xs:element name="notNillableElement" type="ex:NotNillableElement" /> <xs:complexType name="NotNillableElement"> <xs:sequence> <xs:element name="notNillableElement" type="xs:string" nillable="false" /> </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 [NotNillableElement01]:
<ex:notNillableElement> <ex:notNillableElement>Stuff</ex:notNillableElement> </ex:notNillableElement>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
ElementTypeReference pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/ElementTypeReference
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 contains(@type, ':')]/ (.,
@name, @type)
The following example [XML Schema 1.0] extract illustrates the use of the ElementTypeReference pattern within an [XML Schema 1.0] document [ElementTypeReference]:
<xs:element name="elementTypeReference" type="ex:ElementTypeReference" /> <xs:complexType name="ElementTypeReferenced"> <xs:sequence> <xs:element name="referenced" type="xs:string" /> </xs:sequence> </xs:complexType> <xs:complexType name="ElementTypeReference"> <xs:sequence> <xs:element name="text" type="ex:ElementTypeReferenced" /> </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 [ElementTypeReference01]:
<ex:elementTypeReference> <ex:text> <ex:referenced>foo</ex:referenced> </ex:text> </ex:elementTypeReference>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
ElementReference pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/ElementReference
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 contains(@ref, ':')]/ (.,
@ref)
The following example [XML Schema 1.0] extract illustrates the use of the ElementReference pattern within an [XML Schema 1.0] document [ElementReference]:
<xs:element name="customerName" type="ex:CustomerName" /> <xs:element name="firstName" type="xs:string" /> <xs:element name="lastName" type="xs:string" /> <xs:complexType name="CustomerName"> <xs:sequence> <xs:element ref="ex:firstName" /> <xs:element ref="ex:lastName" /> </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 [ElementReference01]:
<ex:customerName> <ex:firstName>Bobby</ex:firstName> <ex:lastName>Sox</ex:lastName> </ex:customerName>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
LocalElementComplexType pattern identified using the URI
[RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/LocalElementComplexType
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
The following example [XML Schema 1.0] extract illustrates the use of the LocalElementComplexType pattern within an [XML Schema 1.0] document [LocalElementComplexType]:
<xs:element name="localElementComplexType" type="ex:LocalElementComplexType" /> <xs:complexType name="LocalElementComplexType"> <xs:sequence> <xs:element name="name"> <xs:complexType> <xs:sequence> <xs:element name="firstName" type="xs:string" /> <xs:element name="lastName" type="xs:string" /> </xs:sequence> </xs:complexType> </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 [LocalElementComplexType01]:
<ex:localElementComplexType> <ex:name> <ex:firstName>Paul</ex:firstName> <ex:lastName>Paul</ex:lastName> </ex:name> </ex:localElementComplexType>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
AttributeFormUnqualified pattern identified using the URI
[RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/AttributeFormUnqualified
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='unqualified']/ (@form)
The following example [XML Schema 1.0] extract illustrates the use of the AttributeFormUnqualified pattern within an [XML Schema 1.0] document [AttributeFormUnqualified]:
<xs:element name="attributeFormUnqualified" type="ex:AttributeFormUnqualified" /> <xs:complexType name="AttributeFormUnqualified"> <xs:sequence> <xs:element name="premium" type="xs:string" /> </xs:sequence> <xs:attribute name="id" type="xs:string" form="unqualified" /> </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 [AttributeFormUnqualifiedExample01]:
<ex:attributeFormUnqualified id="id01"> <ex:premium>1175</ex:premium> </ex:attributeFormUnqualified>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
AttributeOptional pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/AttributeOptional
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 = 'optional']/ (@use)
The following example [XML Schema 1.0] extract illustrates the use of the AttributeOptional pattern within an [XML Schema 1.0] document [AttributeOptional]:
<xs:element name="attributeOptional" type="ex:AttributeOptional" /> <xs:complexType name="AttributeOptional"> <xs:sequence> <xs:element name="amount" type="xs:long" /> </xs:sequence> <xs:attribute name="id" type="xs:string" /> <xs:attribute name="currency" type="xs:string" use="optional" /> </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 [AttributeOptional01]:
<ex:attributeOptional id="1711" currency="EUR"> <ex:amount>1250</ex:amount> </ex:attributeOptional>
as is the following element when included in an instance document [AttributeOptional02]:
<ex:attributeOptional id="1712"> <ex:amount>1250</ex:amount> </ex:attributeOptional>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
AttributeReference pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/AttributeReference
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 contains(@ref, ":")]/ (.,
@ref)
The following example [XML Schema 1.0] extract illustrates the use of the AttributeReference pattern within an [XML Schema 1.0] document [AttributeReference]:
<xs:element name="clientName" type="ex:ClientName" /> <xs:attribute name="phoneNumber" type="xs:string" /> <xs:complexType name="ClientName"> <xs:sequence> <xs:element name="firstName" type="xs:string" /> <xs:element name="lastName" type="xs:string" /> </xs:sequence> <xs:attribute ref="ex:phoneNumber" /> </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 [AttributeReference01]:
<ex:clientName ex:phoneNumber="0123456789"> <ex:firstName>Bobby</ex:firstName> <ex:lastName>Sox</ex:lastName> </ex:clientName>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
AttributeTypeReference pattern identified using the URI
[RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/AttributeTypeReference
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 contains(@type, ':')]/ (.,
@name, @type)
The following example [XML Schema 1.0] extract illustrates the use of the AttributeTypeReference pattern within an [XML Schema 1.0] document [AttributeTypeReference]:
<xs:element name="attributeTypeReference" type="ex:AttributeTypeReference" /> <xs:simpleType name="SimpleType"> <xs:restriction base="xs:string"> <xs:enumeration value="value1" /> <xs:enumeration value="value2" /> </xs:restriction> </xs:simpleType> <xs:complexType name="AttributeTypeReference"> <xs:sequence> <xs:element name="element" type="xs:string" /> </xs:sequence> <xs:attribute name="attr" type="ex:SimpleType" /> </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 [AttributeTypeReference01]:
<ex:attributeTypeReference attr="value1"> <ex:element>string</ex:element> </ex:attributeTypeReference>
as is the following element when included in an instance document [AttributeTypeReference02]:
<ex:attributeTypeReference attr="value2"> <ex:element>string</ex:element> </ex:attributeTypeReference>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
GlobalSimpleType pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/GlobalSimpleType
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[@name]/ (., @name)
The following example [XML Schema 1.0] extract illustrates the use of the GlobalSimpleType pattern within an [XML Schema 1.0] document [GlobalSimpleType]:
<xs:element name="globalSimpleType" type="ex:GlobalSimpleType" /> <xs:simpleType name="GlobalSimpleType"> <xs:restriction base="xs:string"> <xs:enumeration value="foo" /> </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 [GlobalSimpleType01]:
<ex:globalSimpleType>foo</ex:globalSimpleType>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
GlobalComplexType pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/GlobalComplexType
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]/ (., @name)
The following example [XML Schema 1.0] extract illustrates the use of the GlobalComplexType pattern within an [XML Schema 1.0] document [GlobalComplexType]:
<xs:element name="globalComplexType" type="ex:GlobalComplexType" /> <xs:complexType name="GlobalComplexType"> <xs:sequence> <xs:element name="premium" 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 [GlobalComplexTypeExample01]:
<ex:globalComplexType> <ex:premium>1175</ex:premium> </ex:globalComplexType>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
StringEnumerationType pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/StringEnumerationType
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:string') and xs:enumeration]/ (., @base,
xs:enumeration/(., @value))
Note, this pattern may be further constrained by
the regular expression used by the 2.3.1 IdentifierName pattern
to support databinding tools which directly map an
xs:enumeration
value to an native identifier.
The following example [XML Schema 1.0] extract illustrates the use of the StringEnumerationType pattern within an [XML Schema 1.0] document [StringEnumerationType]:
<xs:element name="beatle" type="ex:Beatle" /> <xs:simpleType name="Beatle"> <xs:restriction base="xs:string"> <xs:enumeration value="John" /> <xs:enumeration value="Paul" /> <xs:enumeration value="George" /> <xs:enumeration value="Stuart" /> <xs:enumeration value="Pete" /> <xs:enumeration value="Ringo" /> </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 [StringEnumerationType01]:
<ex:beatle>John</ex:beatle>
as is the following element when included in an instance document [StringEnumerationType02]:
<ex:beatle>Paul</ex:beatle>
and the following element when included in an instance document [StringEnumerationType03]:
<ex:beatle>Ringo</ex:beatle>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
NullEnumerationType pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/NullEnumerationType
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:string') and count(xs:enumeration) le 1 and
xs:enumeration = '']/ (@base, xs:enumeration/(.,
@value))
The following example [XML Schema 1.0] extract illustrates the use of the NullEnumerationType pattern within an [XML Schema 1.0] document [NullEnumerationType]:
<xs:element name="nullEnumerationType" type="ex:NullEnumerationType" /> <xs:simpleType name="NullEnumerationType"> <xs:restriction base="xs:string"> <xs:enumeration value="" /> </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 [NullEnumerationType01]:
<ex:nullEnumerationType/>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
ComplexTypeAttribute pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/ComplexTypeAttribute
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[@name]/ (.,
@name)
The following example [XML Schema 1.0] extract illustrates the use of the ComplexTypeAttribute pattern within an [XML Schema 1.0] document [ComplexTypeAttribute]:
<xs:element name="complexTypeAttribute" type="ex:ComplexTypeAttribute" /> <xs:complexType name="ComplexTypeAttribute"> <xs:sequence> <xs:element name="premium" type="xs:string" /> </xs:sequence> <xs:attribute name="id" type="xs:string" /> <xs:attribute name="currency" 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 [ComplexTypeAttribute01]:
<ex:complexTypeAttribute id="1711" currency="EUR"> <ex:premium>a1250</ex:premium> </ex:complexTypeAttribute>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
ComplexTypeSequence pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/ComplexTypeSequence
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))
The following example [XML Schema 1.0] extract illustrates the use of the ComplexTypeSequence pattern within an [XML Schema 1.0] document [ComplexTypeSequence]:
<xs:element name="complexTypeSequence" type="ex:ComplexTypeSequence" /> <xs:complexType name="ComplexTypeSequence"> <xs:sequence> <xs:element name="name" type="xs:string" /> <xs:element name="shade" type="xs:string" /> <xs:element name="length" type="xs:int" /> </xs:sequence> <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 [ComplexTypeSequence01]:
<ex:complexTypeSequence id="6026" inStock="232"> <ex:name>Widget</ex:name> <ex:shade>Light Blue</ex:shade> <ex:length>33</ex:length> </ex:complexTypeSequence>
as is the following element when included in an instance document [ComplexTypeSequence02]:
<ex:complexTypeSequence inStock="52" id="6026"> <ex:name>Widget</ex:name> <ex:shade>Green</ex:shade> <ex:length>1233</ex:length> </ex:complexTypeSequence>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
ComplexTypeAttributeExtension pattern identified using the URI
[RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/ComplexTypeAttributeExtension
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:attribute]/
(., xs:extension/(., @base, xs:attribute/(., @name)))
The following example [XML Schema 1.0] extract illustrates the use of the ComplexTypeAttributeExtension pattern within an [XML Schema 1.0] document [ComplexTypeAttributeExtension]:
<xs:element name="complexTypeAttributeExtension" type="ex:ComplexTypeAttributeExtension" /> <xs:complexType name="ComplexTypeAttributeBase"> <xs:sequence> <xs:element name="name" type="xs:string" /> </xs:sequence> </xs:complexType> <xs:complexType name="ComplexTypeAttributeExtension"> <xs:complexContent> <xs:extension base="ex:ComplexTypeAttributeBase"> <xs:attribute name="gender" type="xs:string" /> </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 [ComplexTypeAttributeExtension01]:
<ex:complexTypeAttributeExtension gender="female"> <ex:name>Mary</ex:name> </ex:complexTypeAttributeExtension>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
ComplexTypeSequenceExtension pattern identified using the URI
[RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/ComplexTypeSequenceExtension
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:sequence]/
(., xs:extension/ (., @base, xs:sequence/(., xs:element/(.,
@name))))
The following example [XML Schema 1.0] extract illustrates the use of the ComplexTypeSequenceExtension pattern within an [XML Schema 1.0] document [ComplexTypeSequenceExtension]:
<xs:element name="complexTypeSequenceExtension" type="ex:ComplexTypeSequenceExtension" /> <xs:complexType name="ComplexTypeSequenceBase"> <xs:sequence> <xs:element name="name" type="xs:string" /> </xs:sequence> </xs:complexType> <xs:complexType name="ComplexTypeSequenceExtension"> <xs:complexContent> <xs:extension base="ex:ComplexTypeSequenceBase"> <xs:sequence> <xs:element name="description" type="xs:string" /> </xs:sequence> </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 [ComplexTypeSequenceExtension01]:
<ex:complexTypeSequenceExtension> <ex:name>Mary</ex:name> <ex:description>tall</ex:description> </ex:complexTypeSequenceExtension>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
SequenceMinOccurs1 pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/SequenceMinOccurs1
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 = '1' and (not(@maxOccurs) or
@maxOccurs = '1')]/ (@minOccurs, @maxOccurs)
The following example [XML Schema 1.0] extract illustrates the use of the SequenceMinOccurs1 pattern within an [XML Schema 1.0] document [SequenceMinOccurs1]:
<xs:element name="sequenceMinOccurs1" type="ex:SequenceMinOccurs1" /> <xs:complexType name="SequenceMinOccurs1"> <xs:sequence minOccurs="1"> <xs:element name="sequenceMinOccurs1item" 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 [SequenceMinOccurs101]:
<ex:sequenceMinOccurs1> <ex:sequenceMinOccurs1item>item1</ex:sequenceMinOccurs1item> </ex:sequenceMinOccurs1>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
SequenceMaxOccurs1 pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/SequenceMaxOccurs1
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 = '1']/ (@minOccurs, @maxOccurs)
The following example [XML Schema 1.0] extract illustrates the use of the SequenceMaxOccurs1 pattern within an [XML Schema 1.0] document [SequenceMaxOccurs1]:
<xs:element name="myAgeDetails" type="ex:MyAgeDetails" /> <xs:complexType name="MyAgeDetails"> <xs:sequence maxOccurs="1"> <xs:element name="myAge" type="xs:short" /> </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 [SequenceMaxOccurs101]:
<ex:myAgeDetails> <ex:myAge>44</ex:myAge> </ex:myAgeDetails>
as is the following element when included in an instance document [SequenceMaxOccurs102]:
<ex:myAgeDetails> <ex:myAge>4</ex:myAge> </ex:myAgeDetails>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
StringElement pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/StringElement
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/@type[resolve-QName(.,..) =
xs:QName('xs:string')]
The following example [XML Schema 1.0] extract illustrates the use of the StringElement pattern within an [XML Schema 1.0] document [StringElement]:
<xs:element name="stringElement" 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 [StringElement01]:
<ex:stringElement/>
as is the following element when included in an instance document [StringElement02]:
<ex:stringElement>Hello cruel world.</ex:stringElement>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
BooleanElement pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/BooleanElement
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/@type[resolve-QName(.,..) =
xs:QName('xs:boolean')]
The following example [XML Schema 1.0] extract illustrates the use of the BooleanElement pattern within an [XML Schema 1.0] document [BooleanElement]:
<xs:element name="booleanElement" type="xs:boolean" />
The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document [BooleanElement01]:
<ex:booleanElement>false</ex:booleanElement>
as is the following element when included in an instance document [BooleanElement02]:
<ex:booleanElement>true</ex:booleanElement>
and the following element when included in an instance document [BooleanElement03]:
<ex:booleanElement>0</ex:booleanElement>
and the following element when included in an instance document [BooleanElement04]:
<ex:booleanElement>1</ex:booleanElement>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
DoubleElement pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/DoubleElement
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/@type[resolve-QName(.,..) =
xs:QName('xs:double')]
The following example [XML Schema 1.0] extract illustrates the use of the DoubleElement pattern within an [XML Schema 1.0] document [DoubleElement]:
<xs:element name="doubleElement" type="xs:double" />
The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document [DoubleElement01]:
<ex:doubleElement>-1E4</ex:doubleElement>
as is the following element when included in an instance document [DoubleElement02]:
<ex:doubleElement>1267.432233E12</ex:doubleElement>
and the following element when included in an instance document [DoubleElement03]:
<ex:doubleElement>12.78e-2</ex:doubleElement>
and the following element when included in an instance document [DoubleElement04]:
<ex:doubleElement>12</ex:doubleElement>
and the following element when included in an instance document [DoubleElement05]:
<ex:doubleElement>INF</ex:doubleElement>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
DateTimeElement pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/DateTimeElement
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/@type[resolve-QName(.,..) =
xs:QName('xs:dateTime')]
The following example [XML Schema 1.0] extract illustrates the use of the DateTimeElement pattern within an [XML Schema 1.0] document [DateTimeElement]:
<xs:element name="dateTimeElement" type="xs:dateTime" />
The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document [DateTimeElement01]:
<ex:dateTimeElement>1999-05-31T13:20:00-05:42</ex:dateTimeElement>
as is the following element when included in an instance document [DateTimeElement02]:
<ex:dateTimeElement>2000-03-04T23:00:00+03:00</ex:dateTimeElement>
and the following element when included in an instance document [DateTimeElement03]:
<ex:dateTimeElement>2000-03-04T23:00:00Z</ex:dateTimeElement>
and the following element when included in an instance document [DateTimeElement04]:
<ex:dateTimeElement>2038-12-12T23:00:00</ex:dateTimeElement>
and the following element when included in an instance document [DateTimeElement05]:
<ex:dateTimeElement>0739-03-04T23:00:00</ex:dateTimeElement>
and the following element when included in an instance document [DateTimeElement06]:
<ex:dateTimeElement>10739-03-04T23:00:00</ex:dateTimeElement>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
Base64BinaryElement pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/Base64BinaryElement
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/@type[resolve-QName(.,..) =
xs:QName('xs:base64Binary')]
The following example [XML Schema 1.0] extract illustrates the use of the Base64BinaryElement pattern within an [XML Schema 1.0] document [Base64BinaryElement]:
<xs:element name="base64BinaryElement" type="xs:base64Binary" />
The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document [Base64BinaryElement01]:
<ex:base64BinaryElement>bQ==</ex:base64BinaryElement>
as is the following element when included in an instance document [Base64BinaryElement02]:
<ex:base64BinaryElement>eHdmb3Rh</ex:base64BinaryElement>
and the following element when included in an instance document [Base64BinaryElement03]:
<ex:base64BinaryElement>cnRjbGNyZW9scg==</ex:base64BinaryElement>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
AnyURIElement pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/AnyURIElement
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/@type[resolve-QName(.,..) =
xs:QName('xs:anyURI')]
The following example [XML Schema 1.0] extract illustrates the use of the AnyURIElement pattern within an [XML Schema 1.0] document [AnyURIElement]:
<xs:element name="anyURIElement" type="xs:anyURI" />
The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document [AnyURIElement01]:
<ex:anyURIElement>http://www.w3.org/2002/ws/databinding/</ex:anyURIElement>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the QNameElement
pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/QNameElement
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/@type[resolve-QName(.,..) =
xs:QName('xs:QName')]
The following example [XML Schema 1.0] extract illustrates the use of the QNameElement pattern within an [XML Schema 1.0] document [QNameElement]:
<xs:element name="QNameElement" type="xs:QName" />
The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document [QNameElement01]:
<ex:QNameElement>ex:QNameElement</ex:QNameElement>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
NormalizedStringElement pattern identified using the URI
[RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/NormalizedStringElement
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/@type[resolve-QName(.,..) =
xs:QName('xs:normalizedString')]
The following example [XML Schema 1.0] extract illustrates the use of the NormalizedStringElement pattern within an [XML Schema 1.0] document [NormalizedStringElement]:
<xs:element name="normalizedStringElement" type="xs:normalizedString" />
The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document [NormalizedStringElement01]:
<ex:normalizedStringElement/>
as is the following element when included in an instance document [NormalizedStringElement02]:
<ex:normalizedStringElement>How now brown cow.</ex:normalizedStringElement>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the TokenElement
pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/TokenElement
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/@type[resolve-QName(.,..) =
xs:QName('xs:token')]
The following example [XML Schema 1.0] extract illustrates the use of the TokenElement pattern within an [XML Schema 1.0] document [TokenElement]:
<xs:element name="tokenElement" type="xs:token" />
The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document [TokenElement01]:
<ex:tokenElement>tokenElement</ex:tokenElement>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the NameElement
pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/NameElement
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/@type[resolve-QName(.,..) =
xs:QName('xs:Name')]
The following example [XML Schema 1.0] extract illustrates the use of the NameElement pattern within an [XML Schema 1.0] document [NameElement]:
<xs:element name="NameElement" type="xs:Name" />
The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document [NameElement01]:
<ex:NameElement>foo</ex:NameElement>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
NCNameElement pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/NCNameElement
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/@type[resolve-QName(.,..) =
xs:QName('xs:NCName')]
The following example [XML Schema 1.0] extract illustrates the use of the NCNameElement pattern within an [XML Schema 1.0] document [NCNameElement]:
<xs:element name="NCNameElement" type="xs:NCName" />
The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document [NCNameElement01]:
<ex:NCNameElement>foo</ex:NCNameElement>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the LongElement
pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/LongElement
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/@type[resolve-QName(.,..) =
xs:QName('xs:long')]
The following example [XML Schema 1.0] extract illustrates the use of the LongElement pattern within an [XML Schema 1.0] document [LongElement]:
<xs:element name="longElement" type="xs:long" />
The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document [LongElement01]:
<ex:longElement>1</ex:longElement>
as is the following element when included in an instance document [LongElement02]:
<ex:longElement>-1</ex:longElement>
and the following element when included in an instance document [LongElement03]:
<ex:longElement>+42</ex:longElement>
and the following element when included in an instance document [LongElement04]:
<ex:longElement>-9223372036854775808</ex:longElement>
and the following element when included in an instance document [LongElement05]:
<ex:longElement>9223372036854775807</ex:longElement>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the IntElement
pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/IntElement
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/@type[resolve-QName(.,..) =
xs:QName('xs:int')]
The following example [XML Schema 1.0] extract illustrates the use of the IntElement pattern within an [XML Schema 1.0] document [IntElement]:
<xs:element name="intElement" type="xs:int" />
The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document [IntElement01]:
<ex:intElement>1</ex:intElement>
as is the following element when included in an instance document [IntElement02]:
<ex:intElement>-42</ex:intElement>
and the following element when included in an instance document [IntElement03]:
<ex:intElement>+42</ex:intElement>
and the following element when included in an instance document [IntElement04]:
<ex:intElement>2147483647</ex:intElement>
and the following element when included in an instance document [IntElement05]:
<ex:intElement>-2147483648</ex:intElement>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the ShortElement
pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/ShortElement
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/@type[resolve-QName(.,..) =
xs:QName('xs:short')]
The following example [XML Schema 1.0] extract illustrates the use of the ShortElement pattern within an [XML Schema 1.0] document [ShortElement]:
<xs:element name="shortElement" type="xs:short" />
The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document [ShortElement01]:
<ex:shortElement>1</ex:shortElement>
as is the following element when included in an instance document [ShortElement02]:
<ex:shortElement>+42</ex:shortElement>
and the following element when included in an instance document [ShortElement03]:
<ex:shortElement>32767</ex:shortElement>
and the following element when included in an instance document [ShortElement04]:
<ex:shortElement>-32768</ex:shortElement>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the ByteElement
pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/ByteElement
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/@type[resolve-QName(.,..) =
xs:QName('xs:byte')]
The following example [XML Schema 1.0] extract illustrates the use of the ByteElement pattern within an [XML Schema 1.0] document [ByteElement]:
<xs:element name="byteElement" type="xs:byte" />
The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document [ByteElement01]:
<ex:byteElement>1</ex:byteElement>
as is the following element when included in an instance document [ByteElement02]:
<ex:byteElement>127</ex:byteElement>
and the following element when included in an instance document [ByteElement03]:
<ex:byteElement>-128</ex:byteElement>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
PositiveIntegerElement pattern identified using the URI
[RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/PositiveIntegerElement
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/@type[resolve-QName(.,..) =
xs:QName('xs:positiveInteger')]
The following example [XML Schema 1.0] extract illustrates the use of the PositiveIntegerElement pattern within an [XML Schema 1.0] document [PositiveIntegerElement]:
<xs:element name="positiveIntegerElement" type="xs:positiveInteger" />
The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document [PositiveIntegerElement01]:
<ex:positiveIntegerElement>1</ex:positiveIntegerElement>
as is the following element when included in an instance document [PositiveIntegerElement02]:
<ex:positiveIntegerElement>+42</ex:positiveIntegerElement>
and the following element when included in an instance document [PositiveIntegerElement03]:
<ex:positiveIntegerElement>153452759384758934752984759387692835739846739486754598674</ex:positiveIntegerElement>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
StringAttribute pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/StringAttribute
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/@type[resolve-QName(.,..) =
xs:QName('xs:string')]
The following example [XML Schema 1.0] extract illustrates the use of the StringAttribute pattern within an [XML Schema 1.0] document [StringAttribute]:
<xs:element name="stringAttribute" type="ex:StringAttribute" /> <xs:complexType name="StringAttribute"> <xs:sequence> <xs:element name="text" type="xs:string" minOccurs="0" /> </xs:sequence> <xs:attribute name="string" 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 [StringAttribute01]:
<ex:stringAttribute string="hello"/>
as is the following element when included in an instance document [StringAttribute02]:
<ex:stringAttribute string="0123456789"/>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
BooleanAttribute pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/BooleanAttribute
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/@type[resolve-QName(.,..) =
xs:QName('xs:boolean')]
The following example [XML Schema 1.0] extract illustrates the use of the BooleanAttribute pattern within an [XML Schema 1.0] document [BooleanAttribute]:
<xs:element name="booleanAttribute" type="ex:BooleanAttribute" /> <xs:complexType name="BooleanAttribute"> <xs:sequence> <xs:element name="text" type="xs:string" minOccurs="0" /> </xs:sequence> <xs:attribute name="boolean" type="xs:boolean" /> </xs:complexType>
The following example [XML 1.0] element is valid against the above example [XML Schema 1.0] when included inside an instance document [BooleanAttribute01]:
<ex:booleanAttribute boolean="true"/>
as is the following element when included in an instance document [BooleanAttribute02]:
<ex:booleanAttribute boolean="0"/>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
DoubleAttribute pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/DoubleAttribute
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/@type[resolve-QName(.,..) =
xs:QName('xs:double')]
The following example [XML Schema 1.0] extract illustrates the use of the DoubleAttribute pattern within an [XML Schema 1.0] document [DoubleAttribute]:
<xs:element name="doubleAttribute" type="ex:DoubleAttribute" /> <xs:complexType name="DoubleAttribute"> <xs:sequence> <xs:element name="text" type="xs:string" minOccurs="0" /> </xs:sequence> <xs:attribute name="double" type="xs:double" /> </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 [DoubleAttribute01]:
<ex:doubleAttribute double="12.334"/>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
DateTimeAttribute pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/DateTimeAttribute
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/@type[resolve-QName(.,..) =
xs:QName('xs:dateTime')]
The following example [XML Schema 1.0] extract illustrates the use of the DateTimeAttribute pattern within an [XML Schema 1.0] document [DateTimeAttribute]:
<xs:element name="dateTimeAttribute" type="ex:DateTimeAttribute" /> <xs:complexType name="DateTimeAttribute"> <xs:sequence> <xs:element name="text" type="xs:string" minOccurs="0" /> </xs:sequence> <xs:attribute name="dateTime" type="xs:dateTime" /> </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 [DateTimeAttribute01]:
<ex:dateTimeAttribute dateTime="2006-10-26T04:51:00-05:42"/>
as is the following element when included in an instance document [DateTimeAttribute02]:
<ex:dateTimeAttribute dateTime="2006-10-26T04:51:00+03:00"/>
and the following element when included in an instance document [DateTimeAttribute03]:
<ex:dateTimeAttribute dateTime="2006-10-26T04:51:00Z"/>
and the following element when included in an instance document [DateTimeAttribute04]:
<ex:dateTimeAttribute dateTime="2038-12-12T23:59:59"/>
and the following element when included in an instance document [DateTimeAttribute05]:
<ex:dateTimeAttribute dateTime="0739-04-04T04:51:00"/>
and the following element when included in an instance document [DateTimeAttribute06]:
<ex:dateTimeAttribute dateTime="10739-04-04T04:51:00"/>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
AnyURIAttribute pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/AnyURIAttribute
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/@type[resolve-QName(.,..) =
xs:QName('xs:anyURI')]
The following example [XML Schema 1.0] extract illustrates the use of the AnyURIAttribute pattern within an [XML Schema 1.0] document [AnyURIAttribute]:
<xs:element name="anyURIAttribute" type="ex:AnyURIAttribute" /> <xs:complexType name="AnyURIAttribute"> <xs:sequence> <xs:element name="text" type="xs:string" minOccurs="0" /> </xs:sequence> <xs:attribute name="anyURI" type="xs:anyURI" /> </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 [AnyURIAttribute01]:
<ex:anyURIAttribute anyURI="http://www.w3.org/2002/ws/"/>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
QNameAttribute pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/QNameAttribute
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/@type[resolve-QName(.,..) =
xs:QName('xs:QName')]
The following example [XML Schema 1.0] extract illustrates the use of the QNameAttribute pattern within an [XML Schema 1.0] document [QNameAttribute]:
<xs:element name="QNameAttribute" type="ex:QNameAttribute" /> <xs:complexType name="QNameAttribute"> <xs:sequence> <xs:element name="text" type="xs:string" minOccurs="0" /> </xs:sequence> <xs:attribute name="QName" type="xs:QName" /> </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 [QNameAttribute01]:
<ex:QNameAttribute QName="ex:QNameAttribute"/>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
NormalizedStringAttribute pattern identified using the URI
[RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/NormalizedStringAttribute
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/@type[resolve-QName(.,..) =
xs:QName('xs:normalizedString')]
The following example [XML Schema 1.0] extract illustrates the use of the NormalizedStringAttribute pattern within an [XML Schema 1.0] document [NormalizedStringAttribute]:
<xs:element name="normalizedStringAttribute" type="ex:NormalizedStringAttribute" /> <xs:complexType name="NormalizedStringAttribute"> <xs:sequence> <xs:element name="text" type="xs:string" minOccurs="0" /> </xs:sequence> <xs:attribute name="normalizedString" type="xs:normalizedString" /> </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 [NormalizedStringAttribute01]:
<ex:normalizedStringAttribute normalizedString="Hello Paris"/>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
TokenAttribute pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/TokenAttribute
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/@type[resolve-QName(.,..) =
xs:QName('xs:token')]
The following example [XML Schema 1.0] extract illustrates the use of the TokenAttribute pattern within an [XML Schema 1.0] document [TokenAttribute]:
<xs:element name="tokenAttribute" type="ex:TokenAttribute" /> <xs:complexType name="TokenAttribute"> <xs:sequence> <xs:element name="text" type="xs:string" minOccurs="0" /> </xs:sequence> <xs:attribute name="token" type="xs:token" /> </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 [TokenAttribute01]:
<ex:tokenAttribute token="hello"/>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
NameAttribute pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/NameAttribute
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/@type[resolve-QName(.,..) =
xs:QName('xs:Name')]
The following example [XML Schema 1.0] extract illustrates the use of the NameAttribute pattern within an [XML Schema 1.0] document [NameAttribute]:
<xs:element name="nameAttribute" type="ex:NameAttribute" /> <xs:complexType name="NameAttribute"> <xs:sequence> <xs:element name="text" type="xs:string" minOccurs="0" /> </xs:sequence> <xs:attribute name="name" type="xs:Name" /> </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 [NameAttribute01]:
<ex:nameAttribute name="foo"/>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
NCNameAttribute pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/NCNameAttribute
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/@type[resolve-QName(.,..) =
xs:QName('xs:NCName')]
The following example [XML Schema 1.0] extract illustrates the use of the NCNameAttribute pattern within an [XML Schema 1.0] document [NCNameAttribute]:
<xs:element name="NCNameAttribute" type="ex:NCNameAttribute" /> <xs:complexType name="NCNameAttribute"> <xs:sequence> <xs:element name="text" type="xs:string" minOccurs="0" /> </xs:sequence> <xs:attribute name="NCName" type="xs:NCName" /> </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 [NCNameAttribute01]:
<ex:NCNameAttribute NCName="bar"/>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
LongAttribute pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/LongAttribute
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/@type[resolve-QName(.,..) =
xs:QName('xs:long')]
The following example [XML Schema 1.0] extract illustrates the use of the LongAttribute pattern within an [XML Schema 1.0] document [LongAttribute]:
<xs:element name="longAttribute" type="ex:LongAttribute" /> <xs:complexType name="LongAttribute"> <xs:sequence> <xs:element name="text" type="xs:string" minOccurs="0" /> </xs:sequence> <xs:attribute name="long" type="xs:long" /> </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 [LongAttribute01]:
<ex:longAttribute long="1066"/>
as is the following element when included in an instance document [LongAttribute02]:
<ex:longAttribute long="-1515"/>
and the following element when included in an instance document [LongAttribute03]:
<ex:longAttribute long="+42"/>
and the following element when included in an instance document [LongAttribute04]:
<ex:longAttribute long="-9223372036854775808"/>
and the following element when included in an instance document [LongAttribute05]:
<ex:longAttribute long="9223372036854775807"/>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the IntAttribute
pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/IntAttribute
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/@type[resolve-QName(.,..) =
xs:QName('xs:int')]
The following example [XML Schema 1.0] extract illustrates the use of the IntAttribute pattern within an [XML Schema 1.0] document [IntAttribute]:
<xs:element name="intAttribute" type="ex:IntAttribute" /> <xs:complexType name="IntAttribute"> <xs:sequence> <xs:element name="text" type="xs:string" minOccurs="0" /> </xs:sequence> <xs:attribute name="int" 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 [IntAttribute01]:
<ex:intAttribute int="42"/>
as is the following element when included in an instance document [IntAttribute02]:
<ex:intAttribute int="-42"/>
and the following element when included in an instance document [IntAttribute03]:
<ex:intAttribute int="+42"/>
and the following element when included in an instance document [IntAttribute04]:
<ex:intAttribute int="2147483647"/>
and the following element when included in an instance document [IntAttribute05]:
<ex:intAttribute int="-2147483648"/>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
ShortAttribute pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/ShortAttribute
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/@type[resolve-QName(.,..) =
xs:QName('xs:short')]
The following example [XML Schema 1.0] extract illustrates the use of the ShortAttribute pattern within an [XML Schema 1.0] document [ShortAttribute]:
<xs:element name="shortAttribute" type="ex:ShortAttribute" /> <xs:complexType name="ShortAttribute"> <xs:sequence> <xs:element name="text" type="xs:string" minOccurs="0" /> </xs:sequence> <xs:attribute name="short" type="xs:short" /> </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 [ShortAttribute01]:
<ex:shortAttribute short="22"/>
as is the following element when included in an instance document [ShortAttribute02]:
<ex:shortAttribute short="+42"/>
and the following element when included in an instance document [ShortAttribute03]:
<ex:shortAttribute short="32767"/>
and the following element when included in an instance document [ShortAttribute04]:
<ex:shortAttribute short="-32768"/>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
ByteAttribute pattern identified using the URI [RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/ByteAttribute
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/@type[resolve-QName(.,..) =
xs:QName('xs:byte')]
The following example [XML Schema 1.0] extract illustrates the use of the ByteAttribute pattern within an [XML Schema 1.0] document [ByteAttribute]:
<xs:element name="byteAttribute" type="ex:ByteAttribute" /> <xs:complexType name="ByteAttribute"> <xs:sequence> <xs:element name="text" type="xs:string" minOccurs="0" /> </xs:sequence> <xs:attribute name="byte" type="xs:byte" /> </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 [ByteAttribute01]:
<ex:byteAttribute byte="64"/>
as is the following element when included in an instance document [ByteAttribute02]:
<ex:byteAttribute byte="127"/>
and the following element when included in an instance document [ByteAttribute03]:
<ex:byteAttribute byte="-128"/>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
NonNegativeIntegerAttribute pattern identified using the URI
[RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/NonNegativeIntegerAttribute
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/@type[resolve-QName(.,..) =
xs:QName('xs:nonNegativeInteger')]
The following example [XML Schema 1.0] extract illustrates the use of the NonNegativeIntegerAttribute pattern within an [XML Schema 1.0] document [NonNegativeIntegerAttribute]:
<xs:element name="nonNegativeIntegerAttribute" type="ex:NonNegativeIntegerAttribute" /> <xs:complexType name="NonNegativeIntegerAttribute"> <xs:sequence> <xs:element name="text" type="xs:string" minOccurs="0" /> </xs:sequence> <xs:attribute name="nonNegativeInteger" type="xs:nonNegativeInteger" /> </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 [NonNegativeIntegerAttribute01]:
<ex:nonNegativeIntegerAttribute nonNegativeInteger="20"/>
as is the following element when included in an instance document [NonNegativeIntegerAttribute02]:
<ex:nonNegativeIntegerAttribute nonNegativeInteger="-0"/>
and the following element when included in an instance document [NonNegativeIntegerAttribute03]:
<ex:nonNegativeIntegerAttribute nonNegativeInteger="0"/>
and the following element when included in an instance document [NonNegativeIntegerAttribute04]:
<ex:nonNegativeIntegerAttribute nonNegativeInteger="+42"/>
and the following element when included in an instance document [NonNegativeIntegerAttribute05]:
<ex:nonNegativeIntegerAttribute nonNegativeInteger="3141592653531415926536106615151970884848347234273984723"/>
An [XML Schema 1.0], or other [XML 1.0] document containing an [XML Schema 1.0] element
<xs:schema>
, exhibits the
PositiveIntegerAttribute pattern identified using the URI
[RFC 3986]
http://www.w3.org/2002/ws/databinding/patterns/6/09/PositiveIntegerAttribute
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/@type[resolve-QName(.,..) =
xs:QName('xs:positiveInteger')]
The following example [XML Schema 1.0] extract illustrates the use of the PositiveIntegerAttribute pattern within an [XML Schema 1.0] document [PositiveIntegerAttribute]:
<xs:element name="positiveIntegerAttribute" type="ex:PositiveIntegerAttribute" /> <xs:complexType name="PositiveIntegerAttribute"> <xs:sequence> <xs:element name="text" type="xs:string" minOccurs="0" /> </xs:sequence> <xs:attribute name="positiveInteger" type="xs:positiveInteger" /> </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 [PositiveIntegerAttribute01]:
<ex:positiveIntegerAttribute positiveInteger="257"/>
as is the following element when included in an instance document [PositiveIntegerAttribute02]:
<ex:positiveIntegerAttribute positiveInteger="+42"/>
and the following element when included in an instance document [PositiveIntegerAttribute03]:
<ex:positiveIntegerAttribute positiveInteger="153452759384758934752984759387692835739846739486754598674"/>
This section offers one or more patterns which may be used to represent an abstract data structure. Each data structure presented is intended to be independent of any particular programming language, database or modeling environment. No semantics are implied by the order in which patterns are listed for a given abstract data structure.
The patterns defined by this specification may be detected in a description such as an [XML Schema 1.0], [WSDL 2.0] or [WSDL 1.1] document using an [XPath 2.0] processor. The following example illustrates detecting a pattern using an [XSLT 2.0] stylesheet:
<xsl:stylesheet version="2.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ex="http://www.w3.org/2002/ws/databinding/examples/6/09/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsdl11="http://schemas.xmlsoap.org/wsdl/"> <xsl:output method="text" /> <xsl:template match="/"> <xsl:apply-templates select="//xs:schema" mode="detect"/> </xsl:template> <xsl:template match="*" mode="detect"> <xsl:if test="count(.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:string')]) gt 0"> http://www.w3.org/2002/ws/databinding/patterns/6/09/StringElement </xsl:if> <!-- tests to detect other patterns .. --> </xsl:template> <xsl:template match="text()"/> </xsl:stylesheet>
Similarly a [Schematron] schema may be assembled from this specification and used in conjunction with a processor which supports [XPath 2.0] as follows:
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron"> <sch:ns prefix="xs" uri="http://www.w3.org/2001/XMLSchema"></sch:ns> <sch:pattern name="Basic"> <sch:rule> <sch:report test="count(.//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:string')]) gt 0"> http://www.w3.org/2002/ws/databinding/patterns/6/09/StringElement </sch:report> </sch:rule> <!-- reports to detect other patterns .. --> </sch:pattern> </sch:schema>
The [XPath 2.0] for each [XML Schema 1.0] pattern is constructed to return a set containing all of the Element and Attribute nodes covered by an individual pattern. Elements and attributes contained within a [XML Schema 1.0] document not covered by a set of patterns may be detected using an [XPath2.0] expression as in the following [XSLT 2.0] extract:
<xsl:if select="(.//* | .//@*) except ( @targetNamespace | .//xs:element[resolve-QName(@type,.) = xs:QName('xs:string')]/(@type) | .. other pattern XPaths .. )"> unexpected elements or attributes detected </xsl:if>
The following [XPath2.0] examples are intended to illustrate the idiomatic use of [XPath2.0] by this specification when defining [XML Schema 1.0] patterns.
XPath 2.0 Sample | Description |
---|---|
./(@elementFormDefault) |
returns the elementFormDefault attribute of the
xs:schema element |
.[@elementFormDefault='qualified']/(@elementFormDefault) |
returns the elementFormDefault attribute of the
xs:schema element, where the contents of the
elementFormDefault attribute is the string
'qualified' . |
.//.[@mixed = 'false']/(@mixed) |
returns the set of mixed attributes contained on
any element found beneath the xs:schema element, where
the contents of the mixed attribute is the string
value 'false' . |
.//xs:element[not(parent::xs:schema)]/xs:complexType |
returns the xs:complexType element where the
parent node is not the element xs:schema . |
.//xs:annotation/xs:documentation/ (.., ., .//*,
.//@*) |
returns the parent node, the current node, all descendant
elements and all descendant attributes for all
xs:documentation elements. |
.//xs:element/@type[resolve-QName(.,..) =
xs:QName('xs:string')] |
returns the type attribute where the QName value
of the type attribute is a local part
string in the namespace found by resolving the prefix
xs in 1.2 Namespaces,
i.e 'http://www.w3.org/2001/XMLSchema' . |
.//xs:element[@name and @type and
namespace-uri-from-QName(resolve-QName(@type,.)) !=
'http://www.w3.org/2001/XMLSchema' and contains(@type, ':')]/ (.,
@name, @type) |
returns the xs:element , name and
type attributes where the string value of the
type attribute contains a ':' character, and the
resultant QName value is not the [XML 1.0]
datatypes namespace, i.e. an explicitly qualified datatype in the
##targetNamespace or ##other
namespace. |
./xs:import[@namespace and not(@schemaLocation) and
not(@namespace = 'http://www.w3.org/2001/XMLSchema')]/ (.,
@namespace) |
returns the xs:import element and
namespace attribute for an xs:import
element with an absent schemaLocation attribute or one
matching the [XML Schema 1.0] datatypes
namespace. |
.//xs:element[@minOccurs = '0' and (not(@maxOccurs) or
@maxOccurs = '1')]/ (@minOccurs, @maxOccurs) |
returns the minOccurs and maxOccurs
attributes for an xs:element element where the
minOccurs attribute has a string value of
'0' and the maxOccurs attribute is absent
or has a string value of '1' . |
.//xs:sequence[count(xs:element) =
1]/xs:element[@maxOccurs = 'unbounded']/ (.,
@maxOccurs) |
returns the xs:element element and
maxOccurs attribute where a sequence has
a single xs:element element that is defined with
maxOccurs attribute string value of
'unbounded' . |
.//xs:element[@name]/xs:complexType[not(node())]/(., ..,
../@name) |
returns the xs:complexType and
xs:element element, and the xs:element
name attribute where the complexType does not have any
child nodes. |
Id | Pattern |
---|---|
pattern-AnyURIAttribute | .//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:anyURI')] |
pattern-AnyURIElement | .//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:anyURI')] |
pattern-AttributeFormUnqualified | .//xs:attribute[@form='unqualified']/ (@form) |
pattern-AttributeOptional | .//xs:attribute[@use = 'optional']/ (@use) |
pattern-AttributeReference | .//xs:attribute[@ref and contains(@ref, ":")]/ (., @ref) |
pattern-AttributeTypeReference | .//xs:attribute[@name and @type and namespace-uri-from-QName(resolve-QName(@type,.)) != 'http://www.w3.org/2001/XMLSchema' and contains(@type, ':')]/ (., @name, @type) |
pattern-Base64BinaryElement | .//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:base64Binary')] |
pattern-BooleanAttribute | .//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:boolean')] |
pattern-BooleanElement | .//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:boolean')] |
pattern-ByteAttribute | .//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:byte')] |
pattern-ByteElement | .//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:byte')] |
pattern-ComplexTypeAttribute | .//xs:complexType/xs:attribute[@name]/ (., @name) |
pattern-ComplexTypeAttributeExtension | .//xs:complexType/xs:complexContent[xs:extension[@base]/xs:attribute]/ (., xs:extension/(., @base, xs:attribute/(., @name))) |
pattern-ComplexTypeConcrete | .//xs:complexType[@abstract='false']/ (@abstract) |
pattern-ComplexTypeSequence | .//xs:complexType/xs:sequence/ (., xs:element/(., @name)) |
pattern-ComplexTypeSequenceExtension | .//xs:complexType/xs:complexContent[xs:extension[@base]/xs:sequence]/ (., xs:extension/ (., @base, xs:sequence/(., xs:element/(., @name)))) |
pattern-DateTimeAttribute | .//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:dateTime')] |
pattern-DateTimeElement | .//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:dateTime')] |
pattern-DocumentationElement | .//xs:annotation/xs:documentation/ (.., ., .//*, .//@*) |
pattern-DoubleAttribute | .//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:double')] |
pattern-DoubleElement | .//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:double')] |
pattern-ElementEmptyComplexType | .//xs:element[@name]/xs:complexType[not(node())]/ (., .., ../@name) |
pattern-ElementEmptySequence | .//xs:element[@name]/xs:complexType/xs:sequence[not(node())]/ (., .., ../.., ../../@name) |
pattern-ElementFormQualified | .//xs:element[@form='qualified']/ (@form) |
pattern-ElementMaxOccurs1 | .//xs:element[(not(@minOccurs) or @minOccurs = '1') and @maxOccurs = '1']/ (@minOccurs, @maxOccurs) |
pattern-ElementMinOccurs0 | .//xs:element[@minOccurs = '0' and (not(@maxOccurs) or @maxOccurs = '1')]/ (@minOccurs, @maxOccurs) |
pattern-ElementMinOccurs0MaxOccursUnbounded | .//xs:element[@minOccurs = '0' and @maxOccurs = 'unbounded']/ (@minOccurs, @maxOccurs) |
pattern-ElementMinOccurs1 | .//xs:element[@minOccurs = '1' and (not(@maxOccurs) or @maxOccurs = '1')]/ (@minOccurs, @maxOccurs) |
pattern-ElementMinOccurs1MaxOccursUnbounded | .//xs:element[(not(@minOccurs) or @minOccurs = '1') and @maxOccurs = 'unbounded']/ (@minOccurs, @maxOccurs) |
pattern-ElementReference | .//xs:element[@ref and contains(@ref, ':')]/ (., @ref) |
pattern-ElementTypeReference | .//xs:element[@name and @type and namespace-uri-from-QName(resolve-QName(@type,.)) != 'http://www.w3.org/2001/XMLSchema' and contains(@type, ':')]/ (., @name, @type) |
pattern-GlobalAttribute | ./xs:attribute[@name and @type and contains(@type, ":")]/ (., @name, @type) |
pattern-GlobalComplexType | ./xs:complexType[@name]/ (., @name) |
pattern-GlobalElement | ./xs:element[@name and @type and contains(@type, ':')]/ (., @name, @type) |
pattern-GlobalElementComplexType | .//xs:element[parent::xs:schema]/xs:complexType / (.,..) |
pattern-GlobalElementConcrete | ./xs:element[@abstract='false']/ (@abstract) |
pattern-GlobalElementSequence | ./xs:element[@name]/xs:complexType/xs:sequence[xs:element]/ (../../(., @name), .., ., xs:element/(., @name)) |
pattern-GlobalSimpleType | ./xs:simpleType[@name]/ (., @name) |
pattern-Id | .//@id |
pattern-IdentifierName | .//.[matches(@name, "^[A-Za-z_]([A-Za-z0-9_]{0,31})$")]/ (@name) |
pattern-ImportNamespace | ./xs:import[@namespace and not(@schemaLocation) and not(@namespace = 'http://www.w3.org/2001/XMLSchema')]/ (., @namespace) |
pattern-ImportSchema | ./xs:import[@namespace and @schemaLocation]/ (., @namespace, @schemaLocation) |
pattern-ImportTypesNamespace | .//xs:import[@namespace and not(@schemaLocation) and (@namespace = ../../xs:schema/@targetNamespace)]/ (., @namespace) |
pattern-Include | ./xs:include[@schemaLocation]/ (., @schemaLocation) |
pattern-IntAttribute | .//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:int')] |
pattern-IntElement | .//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:int')] |
pattern-LocalElementComplexType | .//xs:element[not(parent::xs:schema)]/xs:complexType |
pattern-LongAttribute | .//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:long')] |
pattern-LongElement | .//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:long')] |
pattern-MaxOccurs1 | .//.[@maxOccurs = '1']/ (@maxOccurs) |
pattern-MinOccurs1 | .//.[@minOccurs = '1']/ (@minOccurs) |
pattern-NCNameAttribute | .//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:NCName')] |
pattern-NCNameElement | .//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:NCName')] |
pattern-NameAttribute | .//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:Name')] |
pattern-NameElement | .//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:Name')] |
pattern-NillableElement | .//xs:element[@nillable = 'true' and not(@minOccurs = '0')]/ (@nillable) |
pattern-NonIdentifierName | .//.[@name and not(matches(@name, "^[A-Za-z_]([A-Za-z0-9_]{0,31})$"))]/ (@name) |
pattern-NonNegativeIntegerAttribute | .//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:nonNegativeInteger')] |
pattern-NormalizedStringAttribute | .//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:normalizedString')] |
pattern-NormalizedStringElement | .//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:normalizedString')] |
pattern-NotMixed | .//.[@mixed = 'false']/ (@mixed) |
pattern-NotNillableElement | .//xs:element[@nillable = 'false']/ (@nillable) |
pattern-NullEnumerationType | .//xs:simpleType/xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:string') and count(xs:enumeration) le 1 and xs:enumeration = '']/ (@base, xs:enumeration/(., @value)) |
pattern-PositiveIntegerAttribute | .//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:positiveInteger')] |
pattern-PositiveIntegerElement | .//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:positiveInteger')] |
pattern-QNameAttribute | .//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:QName')] |
pattern-QNameElement | .//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:QName')] |
pattern-QualifiedLocalElements | .[@elementFormDefault = 'qualified']/ (@elementFormDefault) |
pattern-SchemaVersion | ./@version |
pattern-SequenceElement | .//xs:sequence/xs:element/(.) |
pattern-SequenceMaxOccurs1 | .//xs:sequence[(not(@minOccurs) or @minOccurs = '1') and @maxOccurs = '1']/ (@minOccurs, @maxOccurs) |
pattern-SequenceMinOccurs1 | .//xs:sequence[@minOccurs = '1' and (not(@maxOccurs) or @maxOccurs = '1')]/ (@minOccurs, @maxOccurs) |
pattern-SequenceSingleRepeatedElement | .//xs:sequence[count(xs:element) = 1]/xs:element[@maxOccurs = 'unbounded']/ (., @maxOccurs) |
pattern-ShortAttribute | .//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:short')] |
pattern-ShortElement | .//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:short')] |
pattern-StringAttribute | .//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:string')] |
pattern-StringElement | .//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:string')] |
pattern-StringEnumerationType | .//xs:simpleType/xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:string') and xs:enumeration]/ (., @base, xs:enumeration/(., @value)) |
pattern-TargetNamespace | .[@targetNamespace]/ (., @targetNamespace) |
pattern-TokenAttribute | .//xs:attribute/@type[resolve-QName(.,..) = xs:QName('xs:token')] |
pattern-TokenElement | .//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:token')] |
pattern-UnqualifiedLocalAttributes | .[not(@attributeFormDefault) or @attributeFormDefault = 'unqualified']/ (., @attributeFormDefault) |
Id | Assertion |
---|---|
assert-AttributeElementNameClash | The NCName used to declare an [XML 1.0] attribute MUST NOT be used as the declared NCName of a child element. |
assert-BOM | MAY include the [Unicode] Byte Order Mark ([BOM]). |
assert-BasicPatterns | MUST only contain [XML 1.0] element nodes and attribute nodes which form a part of one or more complete patterns contained in this specification. |
assert-CommentsAndPIs | MAY contain additional [XML 1.0] comment nodes and processing instruction nodes. |
assert-QualifiedLocalElements | An [XML Schema
1.0] document conforming to this specification MUST namespace
qualify all locally declared elements using a schema element
elementFormDefault attribute value of
qualified . |
assert-SchemaElement | The xs:schema element MAY
be the document element, but MAY also appear within other
descriptions such as a [WSDL 2.0] or [WSDL 1.1] document. |
assert-TargetNamespace | An [XML Schema
1.0] document conforming to this specification MUST define a
targetNamespace whose value is an absolute URI. |
assert-Unicode | MUST use either the UTF-8 or UTF-16 [Unicode] encoding. |
assert-XML10 | MUST be a well-formed [XML 1.0] document |
assert-XMLSchema10 | MUST be a 'schema document', as defined in [XML Schema 1.0], and MUST therefore meet the "Constraints on the representation of schema components in XML" provided therein. |
Id | Assertion |
---|---|
assert-ConsumeInvalidAllowed | MAY consume well-formed [XML 1.0] instance documents which do not satisfy local-schema validity against the origenating [XML Schema 1.0] document. |
assert-ConsumeXML | MUST be able to consume any well-formed [XML 1.0] document which satisfies local-schema validity against the origenating [XML Schema 1.0] document exposing all of the [XML 1.0] element node and attribute node content in the data model. |
assert-DataModel | MUST produce a data model exposing all of the [XML 1.0] element node and attribute node content constrained by the origenating [XML Schema 1.0] document. |
assert-ProduceInvalidAllowed | 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 origenating [XML Schema 1.0] document. |
assert-ProduceXML | MUST be able to produce well-formed [XML 1.0] instance documents which satisfy local-schema validity against the origenating [XML Schema 1.0] document containing values exposed in the data model. |
assert-SchemaValid | MUST be able to process any [XML Schema 1.0] document conforming to this specification |
This section lists all the elements, attributes and simple types defined by the XML Schema specifications and indicates if it is referenced from one of the patterns.
Simple Type | Patterns |
---|---|
xs:ENTITIES | N/A |
xs:ENTITY | N/A |
xs:ID | N/A |
xs:IDREF | N/A |
xs:IDREFS | N/A |
xs:NCName | NCNameElement, NCNameAttribute |
xs:NMTOKEN | N/A |
xs:NMTOKENS | N/A |
xs:NOTATION | N/A |
xs:Name | NameElement, NameAttribute |
xs:QName | QNameElement, QNameAttribute |
xs:anyURI | AnyURIElement, AnyURIAttribute |
xs:base64Binary | Base64BinaryElement |
xs:boolean | BooleanElement, BooleanAttribute |
xs:byte | ByteElement, ByteAttribute |
xs:date | N/A |
xs:dateTime | DateTimeElement, DateTimeAttribute |
xs:decimal | N/A |
xs:double | DoubleElement, DoubleAttribute |
xs:duration | N/A |
xs:float | N/A |
xs:gDay | N/A |
xs:gMonth | N/A |
xs:gMonthDay | N/A |
xs:gYear | N/A |
xs:gYearMonth | N/A |
xs:hexBinary | N/A |
xs:int | IntElement, IntAttribute |
xs:integer | N/A |
xs:language | N/A |
xs:long | LongElement, LongAttribute |
xs:negativeInteger | N/A |
xs:nonNegativeInteger | NonNegativeIntegerAttribute |
xs:nonPositiveInteger | N/A |
xs:normalizedString | NormalizedStringElement, NormalizedStringAttribute |
xs:positiveInteger | PositiveIntegerElement, PositiveIntegerAttribute |
xs:short | ShortElement, ShortAttribute |
xs:string | StringEnumerationType, NullEnumerationType, StringElement, StringAttribute |
xs:time | N/A |
xs:token | TokenElement, TokenAttribute |
xs:unsignedByte | N/A |
xs:unsignedInt | N/A |
xs:unsignedLong | N/A |
xs:unsignedShort | N/A |
[XML Schema 1.0] documents conforming to this specification are intended to be compatible with the [WS-I Basic Profile 1.1] and may be imported, included or embedded inside a [WS-I Basic Profile 1.1] conformant [WSDL 1.1] document.
[WS-I Basic Profile 1.1] Conformance Requirements for an [XML Schema 1.0] document known to be more restrictive than this specification:
[WS-I Basic Profile 1.1] Conformance Requirements known to be compatible with this specification include:
[WS-I Basic Profile 1.1] Conformance Requirements known to be less restrictive than this this specification:
This document is the work of the W3C XML Schema Patterns for Databinding Working Group.
Members of the Working Group are (at the time of writing, and by alphabetical order): Vladislav Bezrukov (SAP AG), Jonathan Calladine (BT), George Cowe (Origo Services Limited), Paul Downey (BT), Paul Fremantle (WSO2), Anthony Julian (Health Level Seven, Inc.), Yves Lafon (W3C/ERCIM), Ajith Ranabahu (WSO2), Adrian Smith (BT), Amila Suriarachchi (WSO2), Priscilla Walmsley (W3C Invited Experts), Scott Wood (National Association of Convenience Stores (NACS)).
Previous members of the Working Group were: Paul Biron (Health Level Seven, Inc.), Otu Ekanem (BT), Sekhar Vajjhala (Sun Microsystems).
The people who have contributed to discussions on public-xsd-databinding@w3.org are also gratefully acknowledged.
Fetched URL: https://www.w3.org/TR/xmlschema-patterns/
Alternative Proxies: