Is there a way to make a serialized member to serialize as an attribute?

Posted by Shimmy on Stack Overflow See other posts from Stack Overflow or by Shimmy
Published on 2010-04-22T05:45:58Z Indexed on 2010/04/22 5:53 UTC
Read the original article Hit count: 287

Is there a way to make a serialized member to serialize as an attribute:

<Serializable> 
Public Class Person
    Public Property Name As String
End Class

I want than when this class is xml-serialized, it should produce:

<Person Name="John Doe" />

And what I mean is that instead of the Name property should be serialized as an element, it should be serialized as an xml attribute.

© Stack Overflow or respective owner

Related posts about ixmlserializable

Related posts about xmlserializer