Hi,
I am trying to serialize an operation to an xml file and have a specific xml format.
I have 4 classes "Recipe" and the other 3 classes implement class "Recipe", being classes "Breakfast", "Lunch" and "Dinner". Class "Recipe" implements members "name" while the other 3 classes have the member "description". Also I have a list "recipeList" that holds the class instances then I serialize the instances to an xml file.
What I am trying to do is to have the xml output as such
<Recipe>
<Breakfast>
<Name>A</Name>
<Name>B</Name>
</Breakfast>
<Lunch>
<Name>C</Name>
</Lunch>
<Dinner>
<Name>D</Name>
</Dinner>
</Recipe>
rather than what it outputs at this time which is
<Recipe>
<Breakfast>
<Name>A</Name>
<Name>B</Name>
</Breakfast>
<Lunch>
<Name>C</Name>
</Lunch>
<Breakfast>
<Name>D</Name>
</Breakfast>
<Dinner>
<Name>E</Name>
</Dinner>
</Recipe>
In other words, the elements are serialized to the xml file in the order that they are added, rather I am seeking to have the elements displayed as the former.
Thanks.