Re: Deriving various simpleContent and complexContent types from the same base?

Simon Cox <Simon.Cox@dem.csiro.au> writes:

> "Henry S. Thompson" wrote:
> > 
> > Simon Cox <Simon.Cox@dem.csiro.au> writes:
> > 
> > > 1.  I want to define an abstract element <_Observation>,
> > > whose substitutionGroup includes elements such as
> > >   <Quantity> which has simple content of type xsd:double
> > >   <Value> with simple content of type xsd:string
> > >   <Count> with simple content of type xsd:nonNegativeInteger
> > >
> > > e.g. Can I define an abstract base type with no content
> > > (complexType?), or of "anyType" (can this be a simpleType?),
> > > and then "restrict" the base to the various simpleTypes?
> > 
> > Yes.
> 
> How?

<xs:element name="_Observation" abstract="true"/>

<xs:element name="Quantity" substitutionGroup="_Observation" type="xs:double"/>

<xs:element name="Value" substitutionGroup="_Observation" type="xs:string"/>

<xs:element name="Count" substitutionGroup="_Observation" type="xs:nonNegativeInteger"/>

ht
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2001, part-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/

Received on Thursday, 22 February 2001 06:25:07 UTC