I'm using the C# serialization on one of my objects:
StringWriter outStream = new StringWriter();
XmlSerializer s = new XmlSerializer(obj.GetType());
XmlSerializerNamespaces ns = new XmlSerializerNamespaces();
s.Serialize(outStream, obj, ns);
string xml = outStream.ToString();
The object is:
public class Points
{
[System.Xml.Serialization.XmlAttribute]
public string Type;
public double Number;
}
My Points
class is being used by another program expecting it in the form:
<Points Type="Credit">123</Points>
I was trying to work if I can use any attributes to force this format?
Thanks