Normally in C# Xml types are marked with attributes to define the way how they get serialized:
/// <remarks/>
[System.Xml.Serialization.XmlTypeAttribute(Namespace=
"urn:xmlns:25hoursaday-com:my-bookshelf")]
public class bookType {
/// <remarks/>
public string title;
/// <remarks/>
public string author;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("publication-date",
DataType="date")]
public System.DateTime publicationdate;
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string publisher;
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute("on-loan")]
public string onloan;
}
现在,我想在没有这些属性的情况下使用POCOS,即我有可能重复使用OR-Mapping,例如。 那么,在不改变序列化类型的情况下确定序列化方式是明智的。
问题在于:是否有办法确定某种类型的序列化方式,例如:测绘Xml文档。