serializing properties and attributes

  • Thread starter Thread starter farseer
  • Start date Start date
F

farseer

Hi,
i have an object containing several properties thati would like to
serialize to an xml. i'd like certain properties serialized as
attributes and others as elements. What is the best way to do this?
can i simply preface the property with XmlAttribute?
If wanted them to be added with a specific namespace...how do i do
this?

thank you
 
farseer,

Yes, you would use the XmlAttribute attribute for this. You can set the
Namespace property to the namespace that you would like the attribute to be
in as well.

Hope this helps.
 
Back
Top