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

Romain Garrigues romain.garrigues at c-s.cnes.fr
Mon Jan 15 03:28:43 EST 2007


You were right.
If i add includes in secondary schemas, there is no more errors!
I will now try to use generated code.
Thanks for advice ! 

Best Regards.

----- Original Message ----- 
From: "Boris Kolpackov" <boris at codesynthesis.com>
To: "Romain Garrigues" <romain.garrigues at c-s.fr>
Cc: <xsd-users at codesynthesis.com>
Sent: Friday, January 12, 2007 6:06 PM
Subject: Re: [xsd-users] [Problem] Types not found.

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




More information about the xsd-users mailing list