-
XML Deserialization
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks