Copyright © W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark and document use rules apply.
This document is an editors' copy that has no official standing.
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/.
1. Introduction
2. Issues facing multiple schema
languages/type systems
3. Examples of Specifications of Extension
Elements for Alternative Schema Language Support.
1. Introduction
2. Issues facing multiple schema
languages/type systems
3. Examples of Specifications of Extension
Elements for Alternative Schema Language Support.
3.1 DTD
3.1.1 namespace attribute information item
3.1.2 location attribute information item
3.1.3 References to Element Definitions
3.2 RELAX NG
3.2.1 Importing RELAX NG
3.2.1.1
ns attribute information
item
3.2.1.2
href attribute information
item
3.2.2 Embedding RELAX NG
3.2.2.1
ns attribute information
item
3.2.3 References to Element Declarations
WSDL describes Web Service interaction in terms of exchanges of typed messages. WSDL 2.0: Part 1 only provides general support for type systems based on the XML infoset [XML Information Set.]. and specific support for the W3C XML Schema Description Language. Describing messages with WSDL using schema languages other than XML Schema or non-XML infoset type systems requires extending the WSDL component model. While the WSDL working group has not defined any such extensions, there were discussions in the working group about how those extensions might be defined and used. This document is the result of those disucussions and captures part of the working group's thinking about schema language and type system extensibilty at the time of its publication.
Without the use of an extension, a WSDL document can only use a single type system, XML Schema. If extensions are defined to support alternative schema languages or non-XML type systems, then issues regarding the mixing of type systems in a single document arise. Part 1 does not define the behavior of mixed type system documents, so it is incumbent on extension authors to do so.
For example, suppose a WSDL author used a extension supporting Relax NG along side the native support for XML Schema. Further suppose that there is an element component which has a definition in both the referenced XML Schema and Relax NG schema. There are several possibilities for interpreting such a document:
Multiple definitions in distinct type systems is always an error
Multiple definitions must be in some sense equivalent, for example, if XML Schema type and an Relax NG production validate exactly the same set of Infoset fragments, otherwise, an error
Multiple definitions are legal, and are interpreted as a union type constraint
The last interpretation suggests a further general possibility: being able to define a union type (or other compound type) that spans distinct type systems (and, to further generalize, where the unioned types had distinct QName identifiers). The Data Access Working Group had a use case wherein their return message could either be in RDF/XML, which cannot have an interesting XML Schema but does have an interesting Relax NG schema, and their other results format, which they would prefer to specify with an XML Schema. This example is little artificial, as the Data Access Working Group could easily describe the entire results format in Relax NG.
The first interpretation is most in the spirit of WSDL and was strongly preferred by the working group. Since WSDL extensibility points are generally quite unrestricted, the group did not try to enforce the first option, but the general belief of the group was that the other options were confusing and unwise.
A DTD may be used as the schema language for WSDL. It may not be
embedded; it must be imported. A namespace must be assigned. DTD
types appear in the {element declarations} property of <specref
ref="Definitions_details"/> and may be referenced from the
wsdl:input , wsdl:output and
wsdl:fault elements using the element
attribute information item.
The prefix, dtd, used throughout the following is mapped to the namespace URI "http://www.example.org/dtd/".
The dtd:import element information item
references an external Document Type Definition, and has the
following infoset properties:
A [local name] of import.
A [namespace name] of "http://www.example.org/dtd".
One or two attribute information items, as follows:
A REQUIRED namespace attribute information
item as described below.
An OPTIONAL location attribute information
item as described below.
namespace attribute information itemThe namespace attribute information item
sets the namespace to be used with all imported element definitions
described in the DTD. It has the following infoset properties:
A [local name] of namespace.
A [namespace name] which has no value.
The type of the namespace attribute information
item is xs:anyURI.
The WSDL author should ensure that a prefix is associated with the namespace at the proper scope (probably document scope).
location attribute information itemThe location attribute information item,
if present, provides a hint to the processor as to where the DTD
may be located. Caching and cataloging technologies may provide
better information than this hint. The location
attribute information item has the following infoset
properties:
A [local name] of location.
A [namespace name] which has no value.
The type of the location attribute information
item is xs:anyURI.
The element attribute information item
MUST be used when referring to an element definition
(<!ELEMENT>) from a Message Reference component; referring to
an element definition from a Interface Fault component is similar.
The value of the element definition MUST correspond to the content
of the namespace attribute information item
of the dtd:import element information item.
The local name part must correspond to an element defined in the
DTD.
Note that this pattern does not attempt to make DTDs namespace-aware. It applies namespaces externally, in the import phase.
A RELAX NG schema may be used as the schema language for WSDL.
It may be embedded or imported; import is preferred. A namespace
must be specified; if an imported schema specifies one, then the
[actual value] of the namespace attribute
information item in the import element
information item must match the specified namespace. RELAX NG
provides both type definitions and element declarations, the latter
appears in the {element declarations} property of <specref
ref="Definitions_details"/> respectively. The following
discussion supplies the prefix rng which is mapped to the URI
"http://www.relaxng.org/ns/structure/1.0".
Importing a RELAX NG schema uses the rng:include mechanism
defined by RNG, with restrictions on its syntax and semantics. A
child element information item of the types
element information item is defined with the Infoset
properties as follows:
A [local name] of include.
A [namespace name] of "http://www.relaxng.org/ns/structure/1.0".
Two attribute information items as follows:
A REQUIRED ns attribute information item
as described below.
An OPTIONAL href attribute information
item as described below.
Additional attribute information items as defined by the RNG specification.
Note that WSDL restricts the rng:include
element information item to be empty. That is, it cannot
redefine rng:start and rng:define
element information items; it may be used solely to import
a schema.
ns attribute
information itemThe ns attribute information item defines
the namespace of the type and element definitions imported from the
referenced schema. If the referenced schema contains an
ns attribute information item on its
grammar element information item, then the
values of these two attribute information items must be
identical. If the imported grammar does not have an ns
attribute information item then the namespace specified
here is applied to all components of the schema as if it did
contain such an attribute information item. The
ns attribute information item contains the
following Infoset properties:
A [local name] of ns.
A [namespace name] which has no value.
The type of the ns attribute information
item is xs:anyURI.
href attribute
information itemThe href attribute information item must
be present, according to the rules of the RNG specification.
However, WSDL allows it to be empty, and considers it only a hint.
Caching and cataloging technologies may provide better information
that this hint. The href attribute information
item has the following Infoset properties:
A [local name] of href.
A [namespace name] which has no value.
The type of the href attribute information
item is xs:anyURI.
Embedding an RNG schema uses the existing top-level
rng:grammar element information item. It may
be viewed as simply cutting and pasting an existing, stand-alone
schema to a location inside the wsdl:types element
information item. The rng:grammar element
information item has the following Infoset properties:
A [local name] of grammar.
A [namespace name] of "http://www.relaxng.org/ns/structure/1.0".
A REQUIRED ns attribute information items
as described below.
Additional attribute information items as specified for
the rng:grammar element information item in
the RNG specification.
Child element information items as specified for the
rng:grammar element information item in the
RNG specification.
ns attribute information itemThe ns attribute information item defines
the namespace of the type and element definitions embedded in this
schema. WSDL modifies the RNG definition of the
rng:grammar element information item to make
this attribute information item required. The
ns attribute information item has the
following infoset properties:
A [local name] of ns.
A [namespace name] which has no value.
The type of the ns attribute information
item is xs:anyURI.
Whether embedded or imported, the element definitions present in a schema may be referenced from a Message Reference or Interface Fault component.
A named rng:define definition MUST NOT be referenced from the Message Reference or Interface Fault components.
A named Relax NG element declaration MAY be referenced from a
Message Reference or Interface Fault component. The QName is
constructed from the namespace (ns attribute
information item) of the schema and the content of the
name attribute information item of the
element element information item An
element attribute information item MUST NOT
be used to refer to an rng:define element
information item.