私がこのようなxmlを持っているとしましょう:
<Server Active="No">
<Url>http://some.url</Url>
</Server>
C#クラスは次のようになります。
public class Server
{
[XmlAttribute()]
public string Active { get; set; }
public string Url { get; set; }
}
Activeプロパティをtypeに変更しbool、XmlSerializerにbool値に「Yes」「No」を強制させることは可能ですか?
編集:Xmlを受信しましたが、変更できません。したがって、実際には、逆シリアル化のみに関心があります。