I need to deserialize a XML file in VB.NET.
I'm using the standard XML library. I'm not able to write down the vb code to define the following structure:
<myvar>
<var>...</var>
<troublecodes>
<troublecode>
...
</troublecode>
<troublecode>
....
</troublecode>
<statusbyte>
....
</statusbyte>
<statusbyte>
....
</statusbyte>
<statusbyte>
....
</statusbyte>
</troublecodes>
</myvar>
My definitions are:
Public Class MyVar
<XmlElement("var")> Public name As String
<XmlElement("troublecodes")> Public troubleCodes As TroubleCodes
End Class
Public Class TroubleCodes
<XmlArrayItem("troublecode")> Public troubleCode() As TroubleCode
<XmlArrayItem("statusbyte")> Public statusByte() As StatusByte
End Class
Public Class TroubleCode
<XmlElement("one")> Public one As String
<XmlElement("two")> Public two As String
End Class
Public Class StatusByte
<XmlElement("three")> Public threeAs String
<XmlElement("four")> Public four As String
End Class
but the objects are not populated by the deserialization.
How can i define them?