[Mono-list] RE: System.Xml.Serialization.XmlSerializer
Thu, 30 Jan 2003 14:15:41 -0700
> > Does the mono implementation of System.Xml.Serialization.XmlSerializer
> > methods or properties to use interfaces? An interface and an abstract
> > should work exchangeable but the Microsoft runtime does not allow
> > even when using the XmlElement(Type = typeof(someType)) attribute on
> > property.
> ...Oops, your code didn't work well with current mono library.
> There must be something wrong with XmlSerializer class;-)
That's a shame :(, but at least we have a sample to fix it.
Who is working on the XmlSerializer again?
> IMHO, it it impossible to serialize instance fields because we cannot
> decide that interface field is of a public class, and we cannot create
> instance only from interface information (i.e. without any concrete
> class information). Hmm... I wonder how Castor handles such things...
Well first of all, why should [XmlInclude(typeof(S))] not work, since it
works on an abstract class that cannot be constructed as well. I'm a
compiler constructor myself, and would argue that an abstract class with
just abstract methods/properties and an interface should be very similar if
At runtime the class of the property is known and it can be serialized as
The output should still be, no matter if A is an abstract property or an
interface property, as long as "S" is inherited/implements that
<?xml version="1.0" encoding="utf-16"?>
> This page might informative for you:
Thanks a lot for that link. I already saw that, and hoped that the mono
implementation would be better.