[xsd-users] [Problem] Types not found.

Boris Kolpackov boris at codesynthesis.com
Fri Jan 12 12:06:58 EST 2007


Hi Romain,

Romain Garrigues <romain.garrigues at c-s.cnes.fr> writes:

> I'm trying to use xsd executable to generate C++ from my XSD file.
> My root xsd file includes 5 others xsd files.
> I have some errors i can't resolve, all are of this type :
>
> "error: Type not found in :outlineType"
> "error: Type not found in :pointType"
> ...
>
> But for example outlineType is defined in one of the 5 "secondary" files,
> but not where this error occurs.

I think I know what's going on. You probably have one of the secondary
schemas that uses say outlineType which is defined in another secondary
schema, but that schema is not included directly but rather into the
"main" schema. While this is legal per XML Schema, XSD requires that
each included or imported schema file be self-sufficient since you will
need to compile each one of them. The way to fix your schemas would be
to include secondary schemas into each other where necessary.


> I have tried to generate code with others XML data binding
> products (trial version, not interesting for me...), and there is
> no problem.

Some data binding products employ the so called "One file per type"
generation schema which results in each type being generated into
a separate C++ file. XSD uses the so called "One file per schema"
approach where each XML Schema file results in one C++ file, with
the XML Schema include and import directives mapped to the C++
preprocessor #include directives. Since each schema file is compiled
separately, XSD requires that they be valid by themselves.


hth,
-boris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 652 bytes
Desc: Digital signature
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20070112/dc00d999/attachment.pgp


More information about the xsd-users mailing list