[xsd-users] Polymorphic problems.

Bill Pringlemeir bpringle at sympatico.ca
Wed Dec 3 18:15:42 EST 2008


On  3 Dec 2008, boris at codesynthesis.com wrote:

> Bill Pringlemeir <bpringle at sympatico.ca> writes:

>> The custom implementation of batman_base seems to mix batman and
>> batman_base in the static initializers.

> Yes, this is exactly what happens. We register batman_base in the
> parsing map and batman in the serialization map and, as a result,
> typeid's don't match. This is definitely a bug and I fixed it for
> the next release of XSD. If your would like, I can build you a pre-
> release binary(ies) with the fix. Just let me know which platform(s)
> you need.

I have used a make rule to do the same thing (I think).  It boils down
to the sed script,

  sed -e -i 's+\(::xsd::cxx::tree::type_factory_initializer.*char,  \)\([A-Za-z][A-Za-z]*\)_base >$+\1\2 >+' $@

Is that the correct fix to remove the '_base' from the
type_factory_initializer?  Or is the fix more involved.  For my simple
test case, this seems to correct the problem on Linux.  

However, I still have issues with AIX; AIX throws the no_type_info
exception. I was using CXX=xlC_r CXXFLAGS=-qrtti=all for the XL C++
options.  Do you have this problem with XL C++ as well?

Can you think of any more issues that using the '--custom-type
batman=/batman_base' with polymorphism might cause.  There are no
other methods that the batman class needs to implement, or global
operators?  Or are the XSD changes more extensive that the simple sed
line I used above?

Regards,
Bill Pringlemeir.

-- 
I find this continuous feedback and interplay between pure mathematics
and theoretical physics most fascinating. - Marco




More information about the xsd-users mailing list