Lists Home |
Date Index |
Title: RE: [xml-dev] Best Practice - beyond schema
As I understand it, this is one of the problems with derivation by restriction. Yes, a change to the base type should carry through to the derived types. If I use extension and add an element to the base type definition, my derived types don't need to be touched - they will now require that extra element in any document CM conforming to their type. I don't need to go and explicitly change all schemas which extend this type. Changes DO carry through.
However, with restriction, the entire content has to be copied, then restrictions defined, so if I, for example, add an element to the CM of the base type definition, I need to then go and add that to all my derived type definitions. So changes do NOT carry through - they have to be made explicitly (well, they carry through in the sense that all the derived schemas will have errors, but this doesn't classify as "maintainability" in my book).
Restriction is reuse by copy, not reuse by inheritance.
Maybe I'm wrong about this, and the entire CT definition doesn't have to be duplicated in the restriction, but I've tried to get clarification of this in the past without much success, and the XSD primer and any experts I've heard talk about it say this is the case.
PS: TANSTAAFL is too long an acronym to parse. It sounds like the name of a South African province.
From: firstname.lastname@example.org [mailto:email@example.com]
Sent: 18 June 2002 13:47
To: Anderson, John
Subject: Re: [xml-dev] Best Practice - beyond schema
"Anderson, John" <John@Barbadosoft.com> writes:
> Unfortunately, this mechanism below would not seem to remove mainteneance of
> multiple schemas. If you use restriction, any change to the global type will
> (potentially) require all the redefines also to be modified (or at least,
> checked for consistency).
TANSTAAFL -- the whole _point_ of using derivation is so that changes
to the base carry through to the derived types -- if they make changes
to a changed part, then they have to change too -- how else could it
Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
W3C Fellow 1999--2002, part-time member of W3C Team
2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
Fax: (44) 131 650-4587, e-mail: firstname.lastname@example.org
[mail really from me _always_ has this .sig -- mail without it is forged spam]
The information transmitted by this e-mail message is intended solely for the use of the person to whom or entity to which it is addressed. The message may contain information that is privileged and confidential. Disclosure, dissemination, distribution, review, retransmission to, other use of or taking any action in reliance upon this information by anyone other than the intended recipient is prohibited. If you are not the intended recipient, please do not disseminate, distribute or copy this communication, by e-mail or otherwise. Instead, please notify us immediately by return e-mail (including the original message with your reply) and then delete and discard all copies of the message.
Although we have taken precautions to minimize the risk of transmitting viruses we nevertheless advise you to carry out your own virus checks on any attachment to this message. We accept no liability for any loss or damage caused by viruses.