[xsd-users] Groups and AttributeGroups

Mark Watson mark at digitalfountain.com
Thu Feb 8 15:07:26 EST 2007


Is there a way to avoid duplication of code generated for groups and
attributeGroups when they are included in multiple elements ?

When an attribubuteGroup is used within two distinct elements, then separate
code seems to be generated in each element for the individual attributes in
the group. Is it possible to generate a class for the attribute group as a
whole and include this as a contained class (or super-class, if the
resulting multiple inheritance is not too much of a problem) within each
element which has the group ?

This would make handling the resulting objects easier, as a single piece of
code could handle the common attributes across the various objects which use
those attributes.

Alternatively, is there a different Schema construction instead of
attributeGroup which could achieve the same thing. I thought of defining a
type with the attributes and deriving the other types from that, but as I
have several attribute groups to play with and (unless I missed something)
XML does not support multiple inheritance (perhaps wisely).

Regards,

Mark Watson





More information about the xsd-users mailing list