Unfortunately, it is XmlSerializerintended to create XML, described using a standard XML schema; which were part of the .Net 1.0 phase (which means xs: integer is not supported).
IXmlSerializable
BigInteger IXmlSerializable. XSD round-tripping (, WebService), .
public class BigInteger : IXmlSerializable
{
public int Value;
public System.Xml.Schema.XmlSchema GetSchema()
{
return null;
}
public void ReadXml(System.Xml.XmlReader reader)
{
Value = int.Parse(reader.ReadString());
}
public void WriteXml(System.Xml.XmlWriter writer)
{
writer.WriteValue(Value.ToString());
}
}
- ( , , )
( , xs: string) intellisense.
[XmlRoot("foo")]
public class SerializePlease
{
[XmlIgnore]
public BigInteger BigIntValue;
[XmlElement("BigIntValue")]
[EditorBrowsable(EditorBrowsableState.Never)]
public string BigIntValueProxy
{
get
{
return BigIntValue.ToString();
}
set
{
BigIntValue = BigInteger.Parse(value);
}
}
}