[xsd-users] XSD compilation fails: "Global element declared more than once"

Boris Kolpackov boris at codesynthesis.com
Thu May 14 16:26:13 EDT 2015


Hi Björn,

Björn Stresing <bjoern.stresing at gmx.de> writes:
 
> The schema that stopped working using xsd binary 4.1.0:
>
> 'cpl::BaseResourceType' : cannot instantiate abstract class

Ok, I took a look and here is what happens: BaseResourceType
is abstract but is used as a type of an element. This means
that this type (hierarchy) is polymorphic. You, however,
do not tell the XSD compiler as much (--polymorphic-type
option). In the previous versions of XSD this would result
in wrong runtime behavior. Now that XSD translates abstract
XML Schema types to abstract C++ classes, this results in
a compile-time error (admittedly a bit obscure).

Boris



More information about the xsd-users mailing list