[xsd-users] Re: problem while compiling the class generated by
boris at codesynthesis.com
Tue Jun 26 11:41:26 EDT 2007
[I've CC'ed xsd-users to my reply in case someone else is/will be wrestling
with these schemas (http://www.dmpf.org/schemas/index.html).]
I've tried to compile these schemas with just-released 3.0.0.b2.
Compiling the code generated with this version also results in an
error. The problem is in the cyclic importing of the schemas. For
example, dmp2rdm-2006-02.xsd imports dmp2ipmpinfo.xsd and
dmp2ipmpinfo.xsd imports dmp2rdm-2006-02.xsd. XSD can generate
compilable code for such a situation but only if there is no
inheritance between types in the separate files. Unfortunately,
there is such inheritance in your case. The only way to work
around this problem is to break the cyclic dependency by factoring
out a subset of one of the files into a separate schema and including
that "base" into the other file. In other word, right now you have:
"a.xsd" <==> "b.xsd"
After the refactoring you will have:
"a.xsd" --> "b.xsd"
The idea is to move to "a-base.xsd" declarations which a necessary
In the future we are planning to add an option to XSD to "merge"
such cyclic schemas into a single "blob" and generate the code
into a single file.
More information about the xsd-users