M
mickieparis
Hello, I hope someone can help me. I need to load an xml element to a
dictionary using the attribute as the key. Here is a sample of the
xml.
<Colors>
....
<FlagColors>
<USA>
<red order="0"/>
<white order="1"/>
<blue order="2"/>
</USA>
</FlagColors>
</Colors>
I need a sorted list or a dictionary so the colors are in a specific
order. For example in the USA the colors need to be ordered red
first, white second and blue third. So I need to use the order
attribute as the key for the dictionary and the element value as the
value in the dictionary.
I've been playing around with no success. I hope someone knows how to
do this.
Thanks,
Michelle
dictionary using the attribute as the key. Here is a sample of the
xml.
<Colors>
....
<FlagColors>
<USA>
<red order="0"/>
<white order="1"/>
<blue order="2"/>
</USA>
</FlagColors>
</Colors>
I need a sorted list or a dictionary so the colors are in a specific
order. For example in the USA the colors need to be ordered red
first, white second and blue third. So I need to use the order
attribute as the key for the dictionary and the element value as the
value in the dictionary.
I've been playing around with no success. I hope someone knows how to
do this.
Thanks,
Michelle