[xsde-users] bad_cast when generating from schemas having element and attribute with same name

Vladimir Zykov vladimir.zykov at doctormobile.us
Tue Feb 11 06:29:46 EST 2014


Hello,

We found recently a problem in XSD/e. If we run the following command on the attached schemas we get bad_cast exception.

./xsde cxx-hybrid --file-per-type s1.xsd
warning D001: --extern-xml-schema is recommended when --file-per-type is specified to reduce generated code size
terminate called after throwing an instance of 'std::bad_cast'
  what():  std::bad_cast
Abort trap: 6


We fixed this by changing line 490 in xsde-3.2.0-1+dep/libxsd-frontend/xsd-frontend/parser.cxx to

if (ref.is_a<Element> () && m.is_a<Element> ())

However, it's not clear whether code generation goes as intended in this case.

Thanks

-------------- next part --------------
A non-text attachment was scrubbed...
Name: bad_cast.tar.gz
Type: application/x-gzip
Size: 493 bytes
Desc: bad_cast.tar.gz
Url : http://codesynthesis.com/pipermail/xsde-users/attachments/20140211/244a000b/bad_cast.tar.bin
-------------- next part --------------


Vladimir Zykov
Software Engineer
Doctor Mobile, LLC
 



More information about the xsde-users mailing list