Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: Diamond problem using extensions and substitution groups

From: "Michael Kay" <mike@--------.--->
To: "'Antoli, Leo'" <Leo.Antoli@-----.--->, <xml-dev@-----.---.--->, <xmlschema-dev@--.--->
Date: 8/16/2006 7:35:00 PM
I don't think there's any way you can have MyCar in the substitution groups
of both Car and MyVehicle without one being in the substitition group of the
other.

Given that constraint, you can make Car, MyVehicle, and MyCar all derive
from Vehicle by extension, using named model groups to reuse the definitions
of the added elements.

Michael Kay
http://www.saxonica.com/
 

> -----Original Message-----
> From: xmlschema-dev-request@w... 
> [mailto:xmlschema-dev-request@w...] On Behalf Of Antoli, Leo
> Sent: 16 August 2006 17:35
> To: xml-dev@l...; xmlschema-dev@w...
> Subject: Diamond problem using extensions and substitution groups
> 
> 
> 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
> 
> 


From noah_mendelsohn@u... Wed Aug 16 18:24:16 2006
Received: from maggie.w3.org ([193.51.20


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent