[xsd-users] abstract types access

Boris Kolpackov boris at codesynthesis.com
Mon Jan 26 13:52:19 EST 2009


Hi Azadeh,

Azadeh Omrani <a.omrani at gmail.com> writes:

> I have a schema file A1.xsd in which two schema files B.xsd and C.xsd are
> imported. I also have A2.xsd in which the schema files B.xsd and C.xsd are
> imported too.
> 
> The schema structures of A1 and A2 are not the same but they have lots of
> types in common (i.e  SessionDescriptionBaseType) but in different levels 
> of the tree.
>
> the error I told you happened during parsing A1.xml. but when I remove
> A2.hxx and A2.cxx from the project, that mentioned error does not happen
> during parsing A1.xml!!

If the types in A1.xsd and A2.xsd have the same name and the same 
XML namespace, then that would explain your problem. To implement
support for polymorphism, XSD maintains a type map where every type
is registered. The key in this map is type's qualified name (name + 
XML namespace). So if you have two schemas that have the same type
in the same XML namespace, even though they may be mapped to two 
different C++ classes, they will conflict in that map.

Internally, we have support for what we call "plates" where two sets
of schemas can be compiled to use two different type maps. However,
this mechanism is not yet exposed to the user since the situations
where it would be needed are quite rare.

> I'm going to make a clear  test case consisting of all those files to
> send to you. is that OK?

If the above analysis is correct then I don't think it is necessary.
It is quite clear what's going on now.

Boris




More information about the xsd-users mailing list