[xsd-users] Member of derived class is sliced on ouptut

Victor Fine victor.fine at gmail.com
Sun Aug 4 04:35:18 EDT 2013


Thank you Boris,
 --polymorphic-type solved the problem indeed.


2013/8/2 Boris Kolpackov <boris at codesynthesis.com>

> Hi Victor,
>
> Victor Fine <victor.fine at gmail.com> writes:
>
> > I've generated cxx-tree classes from XSDs. I've used the following flags:
> > --root-element-all --generate-polymorphic --generate-serialization
> >
> > One of the members of the object I'm serializing is holding a derived
> type
> > (at least it is derived in the XSD schema)
> >
> > Though I can see the derived class members in the debugger, they are not
> > included in output.
>
> It is hard to say for certain what's wrong without more details.
> I don't even know what kind of output you are talking about, XML,
> ostream, binary?
>
> But, most likely, you didn't tell XSD that the root of your
> hierarchy is polymorphic with the --polymorphic-type option.
> You could also use --polymorphic-type-all though that is not
> recommended since it can result in significant code bloat.
>
> Boris
>


More information about the xsd-users mailing list