I have a structure
I am deserializing this structure from an XML file
Notice that the order of the structure and the order of the XML is different - that shouldn't matter. But... the order I present the data to the user is important. The data was entered in a specific order and needs to be presented in the same order.
So based on the XML I need to present the data as follows.
Pittbulls
So the structure fills out just fine, but the order in the XML file is different each time and I need to honor that in my display of the data. Ok - my actual program is not about dogs, this is just for illustrative purposes.
Does anyone have a suggestion (or is this too obtuse)?
!NoItAll
Code:
Structure Dogs Dim Boxers as Dog() Dim Pitbulls as Dog() Dim Mutts as Dog() End Structure Structure Dog Dim Color as String Dim Name as String End Structure
Code:
<Dogs>
<Pitbulls>
<Dog>
<Color>Brown</Color>
<Name>Charlie</Name>
</Dog>
<Dog>
<Color>Black</Color>
<Name>Hermione</Name>
</Dog>
</Pitbulls>
<Mutts>
<Dog>
<Color>Tan</Color>
<Name>Riley</Name>
</Dog>
<Dog>
<Color>Red</Color>
<Name>Sam</Name>
</Dog>
</Mutts>
<Boxers>
<Dog>
<Color>Tortoise</Color>
<Name>Sargent</Name>
</Dog>
<Dog>
<Color>White</Color>
<Name>Missy</Name>
</Dog>
</Boxers>
</Dogs>
So based on the XML I need to present the data as follows.
Pittbulls
Charlie/Brown
Hermione/Black
MuttsHermione/Black
Riley/Tan
Sam/Red
BoxersSam/Red
Sargent/Tortoise
Missy/White
Missy/White
So the structure fills out just fine, but the order in the XML file is different each time and I need to honor that in my display of the data. Ok - my actual program is not about dogs, this is just for illustrative purposes.
Does anyone have a suggestion (or is this too obtuse)?
!NoItAll