Re: extension vs restriction

Wouldn't it get just a bit hairy if we had to repeat all the elements and
attributes of the base type if we wanted to do a derivation by restriction?

For example, the base type could itself be derived by extension from another
type, e.g.

type 1
        element 1 minOccurs = 0 maxOccurs=1
        element 2 minOccurs = 0 maxOccurs=1
        element 3 minOccurs = 0 maxOccurs=1

type 2 derives from type 3 by extension
        element 4 minOccurs = 0 maxOccurs=1
        element 5 minOccurs = 0 maxOccurs=1

Do we also have to declare the elements inherited from super type of the
base type, such as

type 3 derives from type 4 by restriction
        element 1 minOccurs = 0 maxOccurs=1
        element 2 minOccurs = 0 maxOccurs=1
        element 3 minOccurs = 0 maxOccurs=1
        element 4 minOccurs = 0 maxOccurs=1
        element 5 minOccurs = 0 maxOccurs=0

If so, then it could get really ugly. A type could be part of a long type
hierarchy chain. Then, you would have to look up all the ancestors that a
type derives from, and do a tedious copy-and-paste job. Also, types can be
derived from types in other files through import/include statements, which
makes it more inconvenient. And you may have to go through all this effort
to just change one small item in a declaration.

Has this been resolved? I'm probably repeating what others may have pointed
out. And if so, what is the new situation on derivation by restriction? I'd
also like to know how derivation by restriction would work with groups -
attribute groups, model groups, group components - but that's opening
another can of worms.

Zar

Received on Friday, 8 September 2000 00:43:45 UTC