Scott Hinkelman, IBM
IBM hereby grants you permission to copy
and display the W3C XML Schema Constraint Mechanism specification, in any
medium without fee or royalty, provided that you include the following on all
copies of the W3C XML Schema Constraint Mechanism specification, or portions thereof
that you make:
1.
A link or URL to the specification at this location
2.
The copyright notice as shown in the W3C XML Schema Constraint Mechanism
specification.
EXCEPT FOR THE COPYRIGHT LICENSE GRANTED
ABOVE, IBM DOES NOT GRANT, EITHER EXPRESSLY OR IMPLIEDLY, A LICENSE TO ANY
INTELLECTUAL PROPERTY, INCLUDING PATENTS, THEY OWN OR CONTROL. IBM MAY HAVE
PATENTS, PATENT APPLICATIONS, TRADEMARKS, COPYRIGHTS, OR OTHER INTELLECTUAL
PROPERTY RIGHTS COVERING SUBJECT MATTER IN THIS DOCUMENT.
THE INFORMATION CONSTRAINT FRAMEWORK SPECIFICATION
IS PROVIDED "AS IS," AND IBM MAKES NO REPRESENTATIONS OR WARRANTIES,
EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, OR TITLE;
THAT THE CONTENTS OF THE W3C XML SCHEMA CONSTRAINT MECHANISM SPECIFICATION ARE SUITABLE FOR ANY PURPOSE;
NOR THAT THE IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY
PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
IBM WILL NOT BE LIABLE FOR ANY DIRECT,
INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR
RELATING TO ANY USE OR DISTRIBUTION OF THIS SPECIFICATION.
The W3C XML Schema Constraint Mechanism specification
may change before final release and you are cautioned against relying on the
content of this specification.
The name and trademarks of IBM may NOT be
used in any manner, including advertising or publicity pertaining to the
specification or its contents without specific, written prior permission. Title
to copyright in the W3C XML Schema Constraint Mechanism specification will at
all times remain with IBM.
No other rights are granted by
implication, estoppel or otherwise.
The
W3C XML Schema Constraint Mechanism specification (sometimes referred to
as “WXSCM”) provides a W3C XML Schema specific concrete information constraint
mechanism type for the Business Information Conformance Statement
specification.
WXSCM
enables instances of W3C XML Schema to become an information constraint within
the information constraint processing model of a Business Information
Conformance Statement.
This specification is an initial
public draft release and is provided for review and evaluation only. IBM makes
no warrantees or representations regarding the specifications in any manner
whatsoever.
2.1 Single W3C XML Schema Constraint In-line
2.2 Two W3C XML Schema Constraints Using URIs for Default Namespace
Schema Locations
2.3 Two W3C XML Schema Constraints Using URIs for Multiple Namespace
Schema Locations
3.1 complexType
SchemaLocationType
3.2 element SchemaLocationType/Namespace
3.3 element
SchemaLocationType/Location
3.4 complexType
W3CXMLSchemaInformationConstraintMechanismType
3.5 element W3CXMLSchemaInformationConstraintMechanismType/SchemaLocation
3.6 Distinguished TypeName
for Instance Documents
Business information can be declared as adhering to specific constraint mechanisms.
Various constraint mechanisms are utilized in industry.
The Business Information Conformance Statement (BICS) specification [BICS] provides a formal XML vocabulary providing the
ability to declare statements of constraints for business information based in
an information constraint processing model. The BICS specification specifies a
top level Information Conformance Statement as an XML document
structure, several common possible constraint processing models, and an abstract
Information Constraint Mechanism Type.
This specification defines a concrete information constraint
mechanism type to allow instances of W3C XML Schema to exist within a Business
Information Conformance Statement as a constraint mechanism. The constraint
mechanism allows W3C XML Schemas to exist either in-line or referenced using
URIs within a BICS instance document. It also provides support for overriding
schema locations which may appear in XML instance documents in order to facilitate
altered (typically tightened) schemas to be used to process items in specific
namespaces. This also allows a BICS document to be published as to advertise
such constraints, be agreed upon in agreements, etc.
Refer to the Business Information Conformance Statement [BICS] specification for increased details about the BICS
framework.
The keywords [keywords] "MUST", "MUST NOT",
"REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
"SHOULD NOT", "RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in
RFC2119 [RFC2119].
The XML namespace names [XMLNamespace] URIs [URIs] defined by this specification is as follows:
http://ibm.com/xml/namespaces/w3cxmlschemainformationconstraint
In order to use the Business Information Conformance Statement within an
XML instance document, an importing W3C XML Schema must be defined that
provides a concrete subtype of the InformationConstraintMechanismType type from
the Business Information Conformance Statement namespace. Once a concrete
constraint mechanism is defined, an XML instance document is then based on the
BICS schema and makes use of the concrete subtype within a constraint
processing model.
This specification defines such a concrete subtype, and this section
shows fictitious examples of utilizing the subtype in BICS.
The InformationConformanceStatement
element is the single root element for instance documents.
The following BICS states that if the W3C XML Schema constraint mechanism
is applied with no errors to the information under discussion, that the
information is considered conformant.
In this simple example, the W3C XML Schema constraint is the only
constraint within the statement, and it exists in-line within a sequential constraint
processing model.
[1]
<?xml version="1.0" encoding="UTF-8"?>
[2]
<InformationConformanceStatement
xmlns="http://ibm.com/xml/namespaces/businessinformationconformancestatement"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:w3ccm="http://ibm.com/xml/namespaces/w3cxmlschemainformationconstraint"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ibm.com/xml/namespaces/businessinformationconformancestatement
[3]
./businessinformationconformancestatement.xsd
http://ibm.com/xml/namespaces/w3cxmlschemainformationconstraint
[4]
./w3cmechanism.xsd">
[5] <Description>This conformance
statement defines a single W3C XML Schema constraint existing
inline.</Description>
[6] <InformationConstraintProcessingModel
modelType="sequence">
[7] <InformationConstraint
xsi:type="w3ccm:W3CXMLSchemaInformationConstraintMechanismType">
[8]
<Name>member education information</Name>
[9]
<TypeName>W3C XML Schema Constraint Mechanism</TypeName>
[10]
<Description>This constraint mechanism, a W3C XML Schema for
member information, is located in-line with this conformance
statement.</Description>
[11]
<xs:schema
targetNamespace="http://members.org/xml/namspaces/member"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
xmlns="http://ibm.com/xml/namspaces/member" xmlns:xs="http://www.w3.org/2001/XMLSchema">
[12]
<xs:element name="Member" type="MemberType"/>
[13]
<xs:complexType name="MemberType">
[14] <xs:sequence>
[15] <xs:element
name="Name">
[16] <xs:simpleType>
[17]
<xs:restriction
base="xs:string">
[18] <xs:minLength
value="1"/>
[19] </xs:restriction>
[20] </xs:simpleType>
[21] </xs:element>
[22] <xs:element
name="EducationInfo" type="EducationInfoType"
minOccurs="0" maxOccurs="unbounded"/>
[23] </xs:sequence>
[24]
</xs:complexType>
[25]
<xs:complexType name="EducationInfoType">
[26] <xs:sequence>
[27] <xs:element
name="Degree">
[28]
<xs:simpleType>
[29] <xs:restriction
base="xs:string">
[30] <xs:minLength
value="1"/>
[31] </xs:restriction>
[32] </xs:simpleType>
[33] </xs:element>
[34] <xs:element
name="InstitutionInfo">
[35] <xs:simpleType>
[36] <xs:restriction
base="xs:string">
[37] <xs:minLength
value="1"/>
[38] </xs:restriction>
[39] </xs:simpleType>
[40] </xs:element>
[41] </xs:sequence>
[42] </xs:complexType>
[43] </xs:schema>
[44]
</InformationConstraint>
[45]
</InformationConstraintProcessingModel>
[46]
</InformationConformanceStatement>
Lines (002) to (004) define the top-level element,
namespaces, etc.
Line (005) defines a description of the conformance
statement.
Lines (006) to (045) define the constraint processing
model of the statement. The attribute on line (006) defines the constraint
processing model as a sequential model. Both constraints must be processed with
the order they appear.
Lines (007) to (044) define the first, and only in
this example, InformationConstraint within the processing model. This
constraint is of the concrete W3CXMLSchemaInformationConstraintMechanismType
type as indicated by the xsi:type attribute.
Line (008) provides a name constraint.
Line (009) provides the name of the constraint type.
Line (010) provides a description of the constraint.
Lines (011) to (043) specify the instance of the
constraint mechanism in-line the conformance statement.
The W3CXMLSchemaConstraintMechanismType can be used to specify schema constraints
using URIs instead of the in-line approach. When this approach is used, the
simplest option is to use the the ProcessableConstraintURL element from the
BICS namespace to specify the schema location for the default namespace. This
requires that the XML information being check must have a default namespace
specified.
The following BICS states that if the two referenced W3C XML Schemas are
applied with no errors to the information under discussion, that the
information is considered conformant.
In this example, two W3C XML Schema constraints are specified to exists by
URI within a sequential constraint processing model, and the locations of the
schemas for the default namespace.
[1] <?xml version="1.0"
encoding="UTF-8"?>
[2]
<InformationConformanceStatement
xmlns="http://ibm.com/xml/namespaces/businessinformationconformancestatement"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:w3ccm="http://ibm.com/xml/namespaces/w3cxmlschemainformationconstraint"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ibm.com/xml/namespaces/businessinformationconformancestatement
[3]
./businessinformationconformancestatement.xsd
http://ibm.com/xml/namespaces/w3cxmlschemainformationconstraint
[4]
./w3cmechanism.xsd">
[5] <Description>This conformance
statement defines two W3C XML Schema constraint mechanisms by referencing a
URLs.</Description>
[6] <InformationConstraintProcessingModel
modelType="sequence">
[7] <InformationConstraint
xsi:type="w3ccm:W3CXMLSchemaInformationConstraintMechanismType">
[8]
<Name>Industry standard schema reference</Name>
[9]
<TypeName>W3C XML Schema Constraint Mechanism</TypeName>
[10]
<Description>This constraint mechanism, a W3C XML Schema for
member information, and is located at the URL below.</Description>
[11]
<ProcessableConstraintURL>http://members.org/constraintmechanisms/w3cxmlschema/member.xsd</ProcessableConstraintURL>
[12] </InformationConstraint>
[13] <InformationConstraint
xsi:type="w3ccm:W3CXMLSchemaInformationConstraintMechanismType">
[14]
<Name>Additional Constraints</Name>
[15]
<TypeName>W3C XML Schema Constraint Mechanism</TypeName>
[16]
<Description>This constraint mechanism, a W3C XML Schema has
increased constraint types for member information, and is located at the URL
below.</Description>
[17]
<ProcessableConstraintURL>http://company.com/constraintmechanisms/w3cxmlschema/modified-member.xsd</ProcessableConstraintURL>
[18]
</InformationConstraint>
[19]
</InformationConstraintProcessingModel>
[20] </InformationConformanceStatement>
Line (006) specifies the processing model as
sequential.
Lines (007) and (013) define the two concrete
InformationConstraints as W3CXMLSchemaInformationConstraintMechanismType.
The schemas for the default namespace to used for
conformance checking are located at the URLs specified on lines (011) and
(017).
The first constraint specifies the location of the
schema at an industry standard location, while the second constraint specifies
the location of the schema to be used at a specific company’s location. This
may specify increased schema constraints from the specific company within a B2B
interaction. The BICS document may be used to advertise, or agree upon, such
specification.
A more comprehensive approach to specifying schema locations uses the
SchemaLocation element of the the W3CXMLSchemaConstraintMechanismType. This
allows specifying a list of locations for schemas associated to namespaces,
essentially overriding locations that may be specified in XML instance
documents.
The following BICS also states that if the two (URI) referenced W3C XML
Schemas are applied with no errors to the information under discussion, that
the information is considered conformant, but the second constraint specifies
locations for multiple schema namespaces.
[1]
<?xml version="1.0" encoding="UTF-8"?>
[2]
<InformationConformanceStatement
xmlns="http://ibm.com/xml/namespaces/businessinformationconformancestatement"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:w3ccm="http://ibm.com/xml/namespaces/w3cxmlschemainformationconstraint"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ibm.com/xml/namespaces/businessinformationconformancestatement
[3]
./businessinformationconformancestatement.xsd
http://ibm.com/xml/namespaces/w3cxmlschemainformationconstraint
[4]
./w3cmechanism.xsd">
[5]
<Description>This conformance statement defines two W3C XML Schema
constraint mechanisms by referencing a URLs.</Description>
[6]
<InformationConstraintProcessingModel
modelType="sequence">
[7]
<InformationConstraint
xsi:type="w3ccm:W3CXMLSchemaInformationConstraintMechanismType">
[8]
<Name>Industry standard schema reference</Name>
[9]
<TypeName>W3C XML Schema Constraint Mechanism</TypeName>
[10]
<Description>This constraint mechanism, a W3C XML Schema for
member information, and is located at the URL below.</Description>
[11]
<ProcessableConstraintURL>http://members.org/constraintmechanisms/w3cxmlschema/member.xsd</ProcessableConstraintURL>
[12] </InformationConstraint>
[13] <InformationConstraint
xsi:type="w3ccm:W3CXMLSchemaInformationConstraintMechanismType">
[14]
<Name>Additional Constraints</Name>
[15]
<TypeName>W3C XML Schema Constraint Mechanism</TypeName>
[16]
<Description>This constraint mechanism, a W3C XML Schema has
increased constraint types for member information.</Description>
[17] <w3ccm:SchemaLocation>
[18]
<w3ccm:Namespace>http://members.org/member</w3ccm:Namespace>
[19]
<w3ccm:Location>http://company.com/constraintmechanisms/w3cxmlschema/modified-member.xsd</w3ccm:Location>
[20] </w3ccm:SchemaLocation>
[21] <w3ccm:SchemaLocation>
[22]
<w3ccm:Namespace>http://members.org/address</w3ccm:Namespace>
[23]
<w3ccm:Location>http://company.com/constraintmechanisms/w3cxmlschema/modified-address.xsd</w3ccm:Location>
[24] </w3ccm:SchemaLocation>
[25] </InformationConstraint>
[26] </InformationConstraintProcessingModel>
[27]
</InformationConformanceStatement>
Line (006) specifies the processing model as
sequential.
Lines (007) and (013) define the two concrete
InformationConstraints as W3CXMLSchemaInformationConstraintMechanismType.
Line (019) specifies the location of the schema to be
used for conformance checking for items in the namespace on line (018), and line
(023) specifies the location of the schema to be used for conformance checking for
items in the namespace on line (022).
The first constraint specifies the location of the
schema at an industry standard location, while the second constraint specifies
the location of the schemas to be for constraint checking at a specific company’s
location.
This section defines the normative W3C XML Schema Constraint Mechanism vocabulary
semantics as defined using W3C XML Schema representation.
Elements typed as SchemaLocationType
type provide the location of a schema which should be used during processing
for a given namespace.
<xs:complexType
name="SchemaLocationType">
<xs:sequence>
<xs:element name="Namespace"
type="xs:anyURI"/>
<xs:element
name="Location">
<xs:simpleType>
<xs:restriction
base="xs:string">
<xs:minLength value="1"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
The local Namespace element of the
SchemaLocationType defines the namespace name.
<xs:element name="Namespace" type="xs:anyURI"/>
The local Location element of the
SchemaLocationType defines the location of namespace name schema. The type is
defined as any URI however, this specification restricts this to a URL.
<xs:element name="Location" type=”xs:anyURI”/>
Elements typed as W3CXMLSchemaInformationConstraintMechanismType
type provide a W3C XML Schema specific concrete subtype of the
InformationConstraintmechanismType from the BICS namespace. This type supports
the ability for a BICS instance document to carry a W3C XML Schema in-line or
by location reference, and the ability to override declared schema locations
for declared namespace names within XML documents being checked for
conformance.
Location of the schema constraint within
BICS instance documents….
This type defines an optional extension
element reference to a schema element within the http://www.w3.org/2001/XMLSchema
namespace name for support of specifying an in-line schema constraint.
If an in-line schema constraint is present
via this extension element, the optional ProcessableConstraintURL within the
base type has no meaning.
If an in-line schema constraint is
not present (the schema exists via a URI), the ProcessableConstraintURL within
the base type is required and it represents the location of the schema
constraint.
Locations of declared schemas
within XML documents being checked for conformance….
Optional SchemaLocation elements (not
to be confused with the well known xsi:schemaLocation attribute) may be present
within elements of this type.
If none are present, the ProcessableConstraintURL
within the base type is required, and represents the schema location to be used
for processing of the default namespace name, and the information being checked
for conformance must be an XML document with a default namespace name.
Utilizing SchemaLocation elements in
this type allow a more powerful approach for constraint processing beyond just
overriding, or specifying, the location of the default namespace.
If at least one local SchemaLocation
elements are present, the ProcessableConstraintURL within the base type has no
meaning, and schema locations to be used for processing of declared namspaces
within the XML information document being checked are specified by the
SchemaLocation elements. If the XML information document being checked for
conformance contains locations of schemas for declared schema namespaces which
are not present in any SchemaLocation element, the location of the declared
schema within the information document be checked is to be used. This permits
over-riding or specifying the locations of all schemas to be used in XML
instance document validation for namespaces which may require alternate levels
of tightened settings to support specific business rules.
<xs:complexType
name="W3CXMLSchemaInformationConstraintMechanismType">
<xs:complexContent>
<xs:extension
base="bics:InformationConstraintMechanismType">
<xs:sequence>
<xs:element name="SchemaLocation"
type="xsic:SchemaLocationType" minOccurs="0"
maxOccurs="unbounded"/>
<xs:element
ref="xs:schema" minOccurs="0"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
Local SchemaLocation elements of the W3CXMLSchemaInformationConstraintMechanismType
define the locations of schemas for given namespaces to be used for processing.
This element is defined by the SchemaLocationtype type.
<xs:element name="SchemaLocation" type="xsic:SchemaLocationType" minOccurs="0" maxOccurs="unbounded"/>
Instance
documents utilizing the W3CXMLSchemaInformationConstraintMechanismType must
specify the a value of “W3C XML Schema Constraint Mechanism” for the
<TypeName> element in the http://ibm.com/xml/namespaces/businessinformationconformancestatement
namespace name.
[keywords]
S. Bradner, "Key words for use in RFCs to Indicate Requirement
Levels," RFC 2119,
T. Berners-Lee, R. Fielding, L. Masinter, "Uniform Resource
Identifiers (URI): Generic Syntax," RFC 2396, MIT/LCS, U.C. Irvine, Xerox
Corporation, August 1998, http://www.ietf.org/rfc/rfc2396.txt
Business Information Conformance Statements version 2.0, ?
W3C Recommendation, Namespaces
in XML, http://www.w3.org/TR/1999/REC-xml-names-19990114
Extensible Markup Language (XML) 1.0 (Second
Edition), http://www.w3.org/TR/REC-xml
W3C Recommendation, XML Schema
Part 1: Structures, http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/
W3C Recommendation, XML Schema Part 2: Datatypes, http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/
<?xml version="1.0"
encoding="UTF-8"?>
<!--
===================================================================
W3C XML Schema Information Constraint
Mechanism W3C XML Schema
Version 1.0
Copyright Notice
© 2005 International Business Machines
Corporation, All rights reserved. The presentation, distribution, or other
dissemination of the information contained in this specification is not a
license, either expressly or impliedly, to any intellectual property owned or controlled
by IBM. IBM may have patents, patent applications, trademarks, copyrights, or
other intellectual property rights covering subject matter in this document.
The furnishing of this document does not give you any license to IBM’s patents,
trademarks, copyrights, or other intellectual property. The example companies,
organizations, products, domain names, e-mail addresses, logos, people, places,
and events depicted herein are fictitious. No association with any real
company, organization, product, domain name, e-mail address, logo, person,
place, or event is intended or should be inferred. This specification and the
information contained herein is provided on an "AS IS" basis and to
the maximum extent permitted by applicable law, IBM provides the document AS IS
AND WITH ALL FAULTS, and hereby disclaim all other warranties and conditions,
either express, implied, or statutory, including, but not limited to, any (if
any) implied warranties, duties, or conditions of merchantability, of fitness
for a particular purpose, of accuracy or completeness of responses, of results,
of workmanlike effort, of lack of viruses, and of lack of negligence, all with
regard to the document. ALSO, THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET
ENJOYMENT, QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR NON-INFRINGEMENT
OF ANY INTELLECTUAL PROPERTY RIGHTS WITH REGARD TO THE DOCUMENT. IN NO EVENT
WILL IBM BE LIABLE TO ANY OTHER PARTY FOR THE COST OF PROCURING SUBSTITUTE
GOODS OR SERVICES, LOST PROFITS, LOSS OF USE, LOSS OF DATA, OR ANY INCIDENTAL,
CONSEQUENTIAL, DIRECT, INDIRECT, OR SPECIAL DAMAGES WHETHER UNDER CONTRACT,
TORT, WARRANTY, OR OTHERWISE, ARISING IN ANY WAY OUT OF THIS OR ANY OTHER
AGREEMENT RELATING TO THIS DOCUMENT, WHETHER OR NOT SUCH PARTY HAD ADVANCE
NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.
====================================================================
-->
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsic="http://ibm.com/xml/namespaces/w3cxmlschemainformationconstraint"
xmlns:bics="http://ibm.com/xml/namespaces/businessinformationconformancestatement"
targetNamespace="http://ibm.com/xml/namespaces/w3cxmlschemainformationconstraint"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xs:import
namespace="http://www.w3.org/2001/XMLSchema"/>
<xs:import
namespace="http://ibm.com/xml/namespaces/businessinformationconformancestatement"
schemaLocation="./businessinformationconformancestatement.xsd"/>
<xs:complexType
name="W3CXMLSchemaInformationConstraintMechanismType">
<xs:complexContent>
<xs:extension
base="bics:InformationConstraintMechanismType">
<xs:sequence>
<xs:element
name="SchemaLocation" type="xsic:SchemaLocationType"
minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="xs:schema"
minOccurs="0"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType
name="SchemaLocationType">
<xs:sequence>
<xs:element name="Namespace"
type="xs:anyURI"/>
<xs:element
name="Location" type="xs:anyURI"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
.