[xsd-users] xsd:include

Boris Kolpackov boris at codesynthesis.com
Fri Jun 12 04:51:39 EDT 2009


Hi Al,

Al Niessner <Al.Niessner at jpl.nasa.gov> writes:

> Is it possible through the long list of XSD options that I thumbed
> through tom make XSD actually include all of hte xsd:includes into a
> larger more complete schema and map that new thing to C++?

No there is no such option. Normally, when people split their schemas
into several files it is to make them more manageable and facilitate
reuse. It makes sense to preserve the same properties when generating
the corresponding C++ code. For cases like yours, where included
schemas are invalid by themselves, there is the file-per-type mode.


> I tried --file-per-type but that did not do it either. It still crashed
> when it hit an unknown in b.xsd that was referencing a.xsd even though
> a.xsd was included just before b.xsd.

In the file-per-type mode you only compile the "top" schema, that is,
the schema that includes all other schemas (d.xsd in your case). If
that schema is complete then you shouldn't get any errors. See this
article for more information:

http://www.codesynthesis.com/~boris/blog/2008/02/13/codesynthesis-xsd-3-1-0-released/

If you are still getting errors while compiling your d.xsd with the
--file-per-type option, then I will need to take a look at your
schemas or a test case that reproduces the problem.

Boris




More information about the xsd-users mailing list