RE: Type Derivation Problems

How about using Substitution Groups?

Dave

> -----Original Message-----
> From: xmlschema-dev-request@w3.org
> [mailto:xmlschema-dev-request@w3.org]On Behalf Of qyz@clickmarks.com
> Sent: Friday, November 16, 2001 10:52 AM
> To: xmlschema-dev@w3.org
> Subject: Type Derivation Problems
>
>
>
> Hello,
>
> I can't figure out a way to extend a type which
> has an empty content model to create a sub-type with a simple content
> model.  The problem is that the only way to declare a type with a simple
> content model is to restrict a simple type?  So I essentially need
> multiple inheritance to do this :-(
>
> Example:
>
>        <xs:complexType name="PropertyType">
>        </xs:complexType>
>
>        <xs:complexType name="BooleanPropertyType" >
>                <xs:simpleContent>
>                        <xs:extension base="PropertyType">
>                                <xs:simpleType>
>                                        <xs:restriction base="xs:boolean"/>
>                                </xs:simpleType>
>                        </xs:extension>
>                </xs:simpleContent>
>        </xs:complexType>
>
> I'm trying to create BooleanPropertyType so that it is a sub-type of
> PropertType, with a content model that allows only Boolean values.  I know
> the above is not valid XML Schema; is there any way to express this?  It
> seems to me that it should be allowed, because PropertyType has an empty
> content model, so a boolean content model should be a valid extension? But
> the type declaration doesn't let me specify: type="xs:boolean" (unlike an
> element declaration which does allow that).  So the only way to declare a
> boolean content model is by restricting from "xs:boolean"?  Which of
> course means I can't derive from another type.
>
> Thanks for any help!
>
> Quinton
>
>
>

Received on Friday, 16 November 2001 11:19:22 UTC