[xsde-users] Re: Polymorphic type is serialized as based

Boris Kolpackov boris at codesynthesis.com
Tue Dec 1 09:04:06 EST 2015


Hi Andrey,

Andrey Filimonov <andrey.v.filimonov at gmail.com> writes:

> Do you mean it doesn't assign prefixes specifically when serializing
> polymorphic types? Because for non polymorphic types it assigns perfectly.

The underlying, low-level serializer (genx) assigns prefixes automatically
when one writes attributes/elements with un-mapped namespaces. Here we are
talking about the xsi:type attribute. genx has no idea about its semantics
thus the higher level code has to translate the dynamic type's namespace to
a prefix. That's what XSD/e serializer runtime does in set_type(). It,
however, doesn't automatically add a mapping if there isn't one already.

In real life, any self-respecting application will assign meaningful
prefixed instead of generating XML with a p1, p2, etc.

Boris



More information about the xsde-users mailing list