xml to Object

  • Thread starter Thread starter AA
  • Start date Start date
A

AA

I have this xml..

<xmlData>
<Names>
<Name>John</Name>
<Name>Peter</Name>
<Name>Maria</Name>
</Names>
</xmlData>


and this object...

Public Class xmlData
Public Names() as String
End Class

But I Can't make the serialization

Why??
I Can modify my object, but the Xml document don't
 
Sorry, .. my problem is not the serialization himself, the problem is that
the serialization process don't recognizes the <Name> element as a part of
the <Names> Collection

The Members collection is empty after the serialization. But, If I change
the element name <Name> by <string> The collection is filled


Thanks

michaelw said:
First off if you are planning on serializing an object it is best to
implement ISerializable or use the Serializable attribute.
Another option is using the classes in the System.Xml.Serialization
namespace.
 
Back
Top