Now I see (I was thinking of something else).
SQLQuery and FilterQuery elements would be substitutionGroup'ed to the
Query element. So in the schema we would have:
<xsd:element name="Query" type="tns:AdHocQueryType" abstract="true"/>
<xsd:element name="SQLQuery" substitutionGroup="Query"
type="SQLQueryType"/>
<xsd:element name="FilterQuery" substitutionGroup="Query"
type="FilterQueryType"/>
And in the instance documents (as you mentioned):
<Query xsi:type="SQLQuery">
....
</Query>
OR
<Query xsi:type="FilterQuery">
....
</Query>
Either way is fine with me.
Joe
Farrukh Najmi wrote:
>
> Chiusano Joseph wrote:
>
> ><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?
> >
> Above is correct understanding of the proposal.
>
> >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.
> >
> I believe that is not true. As far as I know, type substitution allows
> an abstract base type to be used as the type for element definition. It
> is like declaring a variable of base class type in Java to hold derived
> class instances.
>
> When you do an instance you specify (substitute) the precise type as
> follows:
>
> <Query xsi:type="SQLQuery">
> ....
> </Query>
>
> Am I missing something?
>
> --
> Regards,
> Farrukh