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

Vladimir Zykov vladimir.zykov at doctormobile.us
Wed Feb 12 06:16:16 EST 2014


Hi Boris,

Where can we obtain the latest source code for XSD/e? We have xsde-3.2.0-1 and we thought this is the latest.

Thanks

On Feb 12, 2014, at 7:01 AM, Boris Kolpackov <boris at codesynthesis.com> wrote:

> Hi Vladimir,
> 
> Vladimir Zykov <vladimir.zykov at doctormobile.us> writes:
> 
>> We fixed this by changing line 490 in parser.cxx to
>> 
>> if (ref.is_a<Element> () && m.is_a<Element> ())
> 
> This bug has already been fixed and the correct fix is to change
> this line (478):
> 
>            Member& ref (resolve<Member> (ns_name, uq_name, s_, cache_)); 
> 
> To read:
> 
>            // Resolve the name to the same type. It is legal to have
>            // an element and an attribute with the same name.
>            //
>            Member& ref (
>              m.is_a<Element> ()
>              ? static_cast<Member&> (
>                  resolve<Element> (ns_name, uq_name, s_, cache_))
>              : static_cast<Member&> (
>                  resolve<Attribute> (ns_name, uq_name, s_, cache_)));
> 
> Thanks for the report and let me know if you run into any other
> problems.
> 
> Boris

Vladimir Zykov
Software Engineer
Doctor Mobile, LLC




More information about the xsde-users mailing list