[xsd-users] Schema and inheritance
Vera Mickael
vera.mickael at free.fr
Mon Sep 12 08:16:33 EDT 2005
Hi,
I have another question about schema and inheritance :
I have problems with the code generated by JAXB when we use
inheritance in our schemas.
Tell me if I'm wrong but I think inheritance is not really
supported by schema. Suppose I define an element type A and
another one B that extends A and another one C that extends
A. In my schema if I define another element type X that
contains A, I can't use B or C in an XML file instead of A
in an element of type X.
So we use another element type that is a choice between B
and C, and wherever we want B or C in the schema we use the
choice. The generated code is very ugly, we obtain something
close to a union in C langage.
How does xsd handle this problem ? I want to describe a
model with two or more classes that extend a class, what is
important to me is the quality of the generated code,
polymorphism in this case.
Mickaël
More information about the xsd-users
mailing list