I have the following class to be serializing:
[Serializable]
public class LabelRectangle {
[XmlAttribute]
public int X { get; set; }
[XmlAttribute]
public int Y { get; set; }
[XmlAttribute]
public int Width { get; set; }
[XmlAttribute]
public int Height { get; set; }
}
and it is going to be serialized and looks like this
<LabelRectangle X="15" Y="70" Width="10" Height="1" />
but I would like to get the following result:
<LabelRectangle X=15 Y=70 Width=10 Height=1 />
that is serializing int type values without quotes. Is it possible and how if yes?
this would not be a well formed XML anymore - you defined the Attribute
[XmlAttribute]
Attribute values are always in quotes!!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With