Infinite recursion in generated code. (was: Re: [xsd-users] For <xs:restriction base="xs:anyType"> generated code does not compile.)

Jeroen N. Witmond [Bahco] jnw at xs4all.nl
Sun Nov 18 04:16:33 EST 2007


Hi Boris,

Boris Kolpackov wrote:
> Hi Jeroen,
>
> You get infinite recursion because you removed the required c-tor
> with DOMAttr as first argument and added unnecessary c-tor with
> simple_type as first argument. As a result, when a simple type is
> constructed from DOMAttr in parsing.txx:82, the base type's c-tor
> is called. While there is no constructor that takes DOMAttr, there
> is one that takes simple_type. Implicit conversion is then used
> and this continues forever.
>
> You need to remove the c-tor with the simple_type argument and
> add one with DOMAttr back.

Oops, my bad! The files used in the custom type were not really designed.
They evolved during my attemtps to get them to work. Implementating the
changes you give above made the infinite recursion disappear. (This did
require that I do a 'make clean'. Otherwise I still got an unresolved
external reference for the constructor taking simple_type.) I have merged
these changed into the files for the custom-intended implementation on
http://www.xs4all.nl/~jnw/codesynthesis/xmlnamespace/index.html

Is there an overview of which constructors are required for which kinds of
custom types? Or is there a way to get xsd to generate an overview? (I
noticed that in examples/cxx/tree the constructor taking DOMAttr is
generated only for custom/calendar.)

Thanks,

Jeroen.




More information about the xsd-users mailing list