[xsd-users] Re: [xsde-users] how to handle xsd:include?

Boris Kolpackov boris at codesynthesis.com
Fri Feb 15 08:02:26 EST 2008


Hi Gennady,

Gennady Khokhorin <gok at aerometric-ak.com> writes:

> Did try both approaches:
> 1. including main.xsd (myType declared here) in sect01.xsd:<xsd:include
> schemaLocation="main.xsd"/>
> just before myType declaration. main.xsd has the same include:
> <xsd:include schemaLocation="sect01.xsd"/>

>From your description I gather that the dependency between main.xsd
and sect01.xsd involves inheritance. If that's the case then this
approach won't work (in C++ you cannot have two headers including
each other with a type in one header inheriting from a type in the
other).

> 2. using --file-per-type option for main.xsd only. This produced double
> declarations for otherTypes in sect01.hxx and in otherType.hxx

I guess I haven't explained this clear enough. With the --file-per-type
option you *only* compile your root schema (main.xsd). You don't run the
XSD compiler on sect01.xsd in this mode since sect01.hxx will be
automatically generated while you are compiling main.xsd.

Boris




More information about the xsd-users mailing list