W3C home > Mailing lists > Public > xmlschema-dev@w3.org > April 2002

Re: [RESEND] Derivation by restriction

From: Jeni Tennison <jeni@jenitennison.com>
Date: Tue, 2 Apr 2002 09:07:46 +0100
Message-ID: <972065500.20020402090746@jenitennison.com>
To: Simon.Cox@csiro.au
CC: costello@mitre.org, xmlschema-dev@w3.org, gml30.rwg@opengis.org
Hi Simon,

> But we also need to move up one step: we need for circle-container
> and polygon-container to both be geometry-containers.
>
> But the definition of a circle (i.e. a centre and radius) and
> polygon (a list of coordinates) do not have an obvious common
> ancestor from which they can both be derived by restriction. So we
> had defined GeometryType as a (more or less) empty abstract super
> type, and then derived CircleType and PolygonType by extension.
>
> This is where we hit the wall, since using XSD we now cannot define
> circle-container and polygon-container as restrictions of
> geometry-container ... the types of the content particles are not
> restrictions of the type of the content particle in the base type.

The only way I can see of solving this problem is to change the way
that you declare either GeometryType or the geometry-container.

First, you could change the definition of GeometryType so that you can
derive CircleType and PolygonType by restriction. Since you want it to
contain anything, you could use something along the lines of:

<xs:complexType name="GeometryType">
  <xs:sequence>
    <xs:any minOccurs="0" maxOccurs="unbounded" />
  </xs:sequence>
  <xs:anyAttribute />
</xs:complexType>

You could then derive CircleType and PolygonType from this general
type by restriction.

Alternatively, you could change the definition of geometry-container
so that you can derive both circle-container and polygon-container
from it by extension.

I think that changing your definition of GeometryType is probably the
best option.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/
Received on Tuesday, 2 April 2002 03:08:03 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:30 GMT