[xsd-users] Polymorphism, am I doing something wrong?

Boris Kolpackov boris at codesynthesis.com
Fri May 2 11:58:43 EDT 2014


Hi Rob,

Rob Ursem <Rob.Ursem at cmgl.ca> writes:

>    Consider the following schema:

For some reason your emails come really garbled up. I can barely
decipher what's going on. Could you try to send thing in plain
text next time.

>    Am I missing something?

If I managed to understand your question, you are not clear on how
to discover what the concrete (derived) type of the instance is
and how to get hold of it. If that's the case, then what you use
is dynamic_cast to discover and get the concrete type at runtime.
Section 2.11, "Mapping for xsi:type and Substitution Groups" in
the C++/Tree Mapping User Manual shows how to do this:

http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/manual/#2.11

Boris



More information about the xsd-users mailing list