Xml serialization as elements with properties

Moniqueso92

New Member
I generally use the DataSet.GetXml() method to serialize datasets, and I came across a problem: Is there an easy way to serialize a dataset object using properties rather than elements? For example, the GetXml() method might generate this from a data set: \[code\]<foo><height>bleem</height><color>yurple</color></foo>\[/code\]but, I would like to see something like:\[code\]<foo height="bleem" color="yurple" />\[/code\]I realize there are constraints on the property oriented approach, but I am using database data, so uniqueness shouldn't be an issue. I have been digging around SO, but I cannot find anything covering this. Any XML experts out there have any ideas?
 
Back
Top