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

Andrey Filimonov andrey.v.filimonov at gmail.com
Fri Dec 4 19:36:53 EST 2015


Many thanks, Boris,
Adding namespace mapping made it work.
As for assigning meaningful names, generally i agree, but for embedded
applications this may be arguable. The generated/parsed xmls [at least in
my case] are never meant to be human readable. At the same time assigning
meaningful [we should read human readable] prefixes will cause size
increase which may be a problem for resource-limited embedded platforms.

Andrey.

2015-12-01 17:04 GMT+03:00 Boris Kolpackov <boris at codesynthesis.com>:

> 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