[Mono-devel-list] Re: xml serialization framework

ginga at kit.hi-ho.ne.jp ginga at kit.hi-ho.ne.jp
Wed Apr 23 23:17:29 EDT 2003

Hello Erik, Adam,

Both analysis are of excellent insight! Thank you for sharing them.
While reading your long, detailed messages, I found many things 
what I hadn't got to, especially in callbacks, error handlings,
and usecases of some classes.

> I'm not sure what the mono policy is for undocumented (but public)
> classes from the MS assemblies.

Sure. IMHO, it is necessary to analyze System.Xml.Serialization 
classes, for the purpose of improving XmlSerializer in depth.
It helps xml serializer to be more compliant with MS.NET.

I was confused about the usecases of XmlSchemaImporter/Exporter 
and so on, but with Adam's help, I could found that they don't
have to be used in those serialization classes.

> (this would require that fetching member
> info also lookup the appropriate override info. what to do when
> serializing and Xml Attribute though. they don't use the same
> XmlAttributes info?).

I could not understand what "override" means, but let me explain:

As for XmlAttributeOverrides, it is not simple collection but
has a map from Type to XmlAttributes. See XmlAttributeOverrides.Add().

As for derived classes, to serialize an object of overriden classes,
we need to add Types explicitly, as XmlIncludeAttributes are required.
Then its overriden attributes will be used.

> XmlReflectionImporter related: this class' methods return several
> structures meant only for use within the serializer. XmlTypeMapping,
> XmlMembersMapping and indirectly XmlMemberMapping. The first sets the
> tone for the other two. Its properties are all read-only. Its

These classes might use XmlReflectionMember, which has full 
public access.

I wonder if once the XmlMembersMappings are created, XmlAttributes
might no more required... It would be, but one concern is about that
I could't find where XmlAny{Element|Attribute}Attributes to be set.

> TypeTranslator: this is the core type to xml name mapper. It does not
> take into consideration attribute overrides or member status, and is
> used by XmlReflectionImporter to fetch the default name for all types.
> The results are returned as TypeData objects.

I assume TypeData might be replaceable with XmlReflectionMember,
with support of SchemaTypes as an internal member (if required).
TypeTranslator and TypeData is only for current Mono serializer.

Thanks again,
  Atsushi Eno

More information about the Mono-devel-list mailing list