1

I have xml that part of structure looks like this:

<IDList>
    <ValuesList ID="1">
        <Value>1</Value>
        <Value>2</Value>
        <Value>3</Value>
    </ValuesList>
    <ValuesList ID="2">
        <Value>1</Value>
        <Value>2</Value>
        <Value>3</Value>
    </ValuesList>
</IDList>

What should be model classes for xmlserializer, so I could deserialize it properly? On the level of IDList it's quite easy:

    [XmlArray("IDList")]
    [XmlArrayItem("ValuesList")]
    public List<CValuesList> idList = new List<CValuesList>();

but how can I do it when the array element has extra xml attribute?

I tried to do ot in the way shown here:

http://www.codemeit.com/xml/c-xmlserializer-add-an-attribute-to-an-array-element.html

but it didn't worked for me. The elements of the array haven't been deserialized.

Cœur
  • 37,241
  • 25
  • 195
  • 267
rideronthestorm
  • 727
  • 1
  • 13
  • 32

1 Answers1

0

There is no simple way to do that.

Sauleil
  • 2,573
  • 1
  • 24
  • 27