Reputation: 140833
I need to transform quickly some object into an XML string. If my project would not been in Silverlight, I would simply use the [Serializable]
attribute with [XmlElement]
and [XmlAttribute]
. Unfortunately, this is not available in Silverlight. I can't use DataContract
because it does not give the control of if the property need to be attribute or element tag.
So, what is my other option? I can do manually the XML using Linq-To-Xml but is there anything else more fast?
Upvotes: 1
Views: 81
Reputation: 189457
Another option is to use System.Xml.Serialization.XmlSerializer
.
Upvotes: 1
Reputation: 56172
In terms of performance, XmlWriter
(fast, non-cached, forward-only) with self-implemented serialization is preferable.
Upvotes: 1