[xsd-users] Parsing exception with XSD hierarchy - No type information available for a type

Jürgen Waser jwaser at vrvis.at
Wed Jun 23 06:58:16 EDT 2010


On 22.06.2010 20:18, Boris Kolpackov wrote:
> Hi Jürgen,
>
> Jürgen Waser<juergenwaser at gmx.at>  writes:
>
>    
>> SET(PLUGIN_XSD_ARGS
>>      cxx-tree
>>      --extern-xml-schema "Schema.h"
>>      --hxx-suffix .h
>>      --cxx-suffix .cpp
>>      --generate-serialization
>>      --generate-ostream
>>      --generate-doxygen
>>      --generate-default-ctor
>>      --generate-intellisense
>>      --generate-wildcard
>>      --function-naming java
>>      --type-regex "/ \(.+\)_t/\\u$1/"
>>      --polymorphic-type-all
>>      --generate-polymorphic
>>      --import-maps
>>      --include-regex "|^(.+)/(.+)|\\u$2|"
>> )
>>      
> I see that you don't have --export-symbol option for schemas that
> you put in plugin DLLs. This will most likely cause problems. You
> will need to have a separate export symbol for each DLL and define
> it accordingly when building such DLLs.
>
>
>    
>> Now the problem:
>> -------------------
>>
>> Recently we have introduced unit tests into the framework. A unit test
>> is an executable, e.g test.exe (and NOT a dll) and has a schema that
>> derives from BaseSettings.xsd too. i.e
>>
>> test.exe  has  TestSettings.xsd  extends  BaseSettings.xsd
>>
>> TestSettings.xsd is compiled with the same arguments as the plugin XSDs
>> (PLUGIN_XSD_ARGS).
>>
>> =>  test.exe  loads the base.dll and master.dll.
>> =>  Parsing an XML of type MasterSettings FAILS with the following exception:
>>
>> 'No type information available for a type: No type information available
>> for TestSettings.xsd'
>>      
> Provided that you fix the problem mentioned above, I don't see why
> you get this error. Generally, to make sure that polymorphism maps
> work correctly across DLLs, you will need to do the following:
>
> 1. Have a 'root' DLL with schemas compiled with the --export-maps.
>
> 2. All 'derived' DLLs with schemas should be compiled with --import-maps
>     and linked to the root DLL.
>
> 3. All executables with schemas should be compiled with --import-maps
>     and linked to the root DLL.
>
> Boris
>
>
>    
Thanks for your fast response.
In our case, it works without the --export-symbol option in the plugin 
dlls because we do not include the generated plugin schema classes 
outside the plugin. Also, we are exactly following your guidelines for 
polymorphism maps.

We have a theory why this could be going wrong. The executable (using 
--import-maps) creates the factory map at the time of static 
initialization. In this map, the TestSettings are registered. However, 
at this point, base.dll has been loaded but it's static initialization 
has not yet happened. Since base.dll has --export-maps specified, it 
creates its own factory. This second factory is used when parsing but it 
lacks the TestSettings entry. Could that be the problem?

Jurgen

-- 
------------------------------------------------------------------
Dipl.-Ing. Jürgen Waser, (Researcher), Simulation and Visualization
VRVis Forschungs-GmbH, www.VRVis.at, FN: 195369h, HG Wien
mail: jwaser at vrvis.at, tel +43(0)1 20501 30803



More information about the xsd-users mailing list