Re: [regrep] [XML Schema issue] Replace choice with type substitution

From
Chiusano Joseph <>
Date
2003-03-14T19:14:20+00:00
ID
Thread
Re: [regrep] [XML Schema issue] Replace choice with type substitution
<Quote1>
Where AdhocQueryType is the base type for both SQLQueryType and 
FilterQueryType.
</Quote1>

AND

<Quote2>
so that there is a AdhocQueryType class that is extended by SQLQueryType
and FilterQueryType classes. Either type of query may be abstractly 
represented as a AdhocQueryType.
</Quote2>

Just to clarify - I think you're saying that AdhocQueryType is an
abstract type, and SQLQueryType and FilterQueryType are derived from it?
If so, the following is not permitted:

<element name="Query" type="tns:AdhocQueryType" minOccurs="1">

because an element cannot be declared as an abstract type in W3C Schema 
only as a type that is derived from an abstract type.

Joe

Farrukh Najmi wrote:
> 
> Team,
> 
> In new V3 schema we have consistently used type substitution instead of
> choice construct when defining XMl schema. Choice in the pinion of many
> is not very object oriented and implementation experience has shown that
> it complicates design.
> 
> I would like to ask if any one has objections if we replace occurrences
> of <choice> in the schema with type substitution. Here is an example of
> how teh proposal effects the schema:
> 
> Old Way
> --------
> In query.xsd the definition of AdhocQueryRequest looks like:
> 
> <sequence>
>    <element ref = "tns:ResponseOption" minOccurs="1" maxOccurs="1" />
>    <choice minOccurs="1" maxOccurs="1">
>      <element ref = "tns:FilterQuery"/>
>      <element ref = "tns:SQLQuery"/>
>    </choice>
> </sequence>
> 
> New Way
> -------
> Above Old Way would look like this under the proposal:
> 
> <sequence>
>    <element ref = "tns:ResponseOption" minOccurs="1" maxOccurs="1" />
>    <element name="Query" type="tns:AdhocQueryType" minOccurs="1" </sequence>
> 
> Where AdhocQueryType is the base type for both SQLQueryType and
> FilterQueryType.
> 
> Benefits
> ---------
> Now code can be written using Object oriented principals so that there
> is a AdhocQueryType class that is extended by SQLQueryType and
> FilterQueryType classes. Either type of query may be abstractly
> represented as a AdhocQueryType.
> 
> Thanks for your input on this issue.
> 
> ----------------------------------------------------------------
> To subscribe or unsubscribe from this elist use the subscription
> manager: <http://lists.oasis-open.org/ob/adm.pl>