OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

regrep message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


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


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
begin:vcard 
n:Chiusano;Joseph
tel;work:(703) 902-6923
x-mozilla-html:FALSE
url:www.bah.com
org:Booz | Allen | Hamilton;IT Digital Strategies Team
adr:;;8283 Greensboro Drive;McLean;VA;22012;
version:2.1
email;internet:chiusano_joseph@bah.com
title:Senior Consultant
fn:Joseph M. Chiusano
end:vcard


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]