Question XML Deserialization

mtan

New member
Joined
Apr 2, 2012
Messages
1
Programming Experience
10+
I have an XML document that looks like this:
<boat>
<sailboat index=1>
<description>blue</description>
<vesselname>aloha</vesselname>
</sailboat>
<sailboat index=2>
<description>red</description>
<vesselname>firehawk</vesselname>
</sailboat>
</boat>
<boat>
<fishingboat index = 1>
<color>blue</color>
<model>honda</model>
</fishingboat>
<fishingboat index = 2>
<color>yellow</color>
<model>model2</model>
</fishingboat>
</boat>


I want to deserialize them into a
List(of SailBoat)
List(of FishingBoat)


<XmlArray("boat"), XmlArrayItem("sailboat")> _ Public ReadOnly Property SailBoats() As List(Of SailBoat)

<XmlArray("boat"), XmlArrayItem("fishingboat")> _ Public ReadOnly Property FishingBoats() As List(Of FishingBoat)SailBoat and FishingBoat classes inherit from Boat classI am getting an error saying The XML element "boat" from namespace "" is already present in the current scope. Use XML attributes to specify another XML name or namespace for the element.
 
Back
Top