C#C
C#2y ago
27 replies
Cyclomatic

XML Deserialization

Hi, I want to deserialize an XML document and I'm using an XmlSerializer. That's all fine, but the order of the elements in the XML is important to me.

For example, I might have some xml that looks like:

<books>
    <book>
      <header>header one</header>
      <title>title one</title>
    </book>
    <book>
      <title>title two</title>
      <header>header two</header>
    </book>
</books>


Where the title and header order is important to me. Is there any way to pull out the "index" of the xml tag when deserializing?
Was this page helpful?