W3C home > Mailing lists > Public > xmlschema-dev@w3.org > August 2006

Diamond problem using extensions and substitution groups

From: Antoli, Leo <Leo.Antoli@Misys.com>
Date: Wed, 16 Aug 2006 17:34:44 +0100
Message-ID: <8ADC468FAD0DD811ABE500065BFE3CDA04FB6A13@pat.slough.midas-kapiti.com>
To: xml-dev@lists.xml.org, xmlschema-dev@w3.org

Dear all,

I have the following schema element types:


Vehicle  <---   MyVehicle

     ^               ^  
     |               |

    Car    <-- 	 MyCar


Vehicle is the base element type. Car extends from Vehicle.

I want to add new elements to Vehicle, so I've created MyVehicle.
Now I want to extend Car with MyCar, but I want MyCar also to have MyVehicle
new child elements.


Any idea about how to get this? I don't want to change or redefine Vehicle
or Car as they are official elements, but I want to be able to extend them
to add new child elements.

The problem in Java or other languages is only solved for operations (using
interfaces) but not for properties.

I was thinking in using element groups instead of inheritance but then I
can't use substitution groups. I want to use them so I could be able to use
MyVehicle in all places in a XML document where Vehicle is allowed. 

Thank you very much.

Kind Regards,
Leo Antoli
Received on Wednesday, 16 August 2006 16:36:32 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 16 August 2006 16:36:33 GMT