I have xml data that I can load into my flex app; however, I need to sort it by node.
I'm trying to create a combobox or listbox that can display a list of locations sorting them either alphabetically or by the category they are in...
I can't get my head around how to format the xml or how to code the flash file to sort according to location name alphabetically and then press a button that will sort it by category 1st and second by name alphabetically.
Should I format the xml like this:
<POIs>
<location>
<name>Barbaras Bagels</name>
<additional nodes inbetween here>
<category>Restaurants</category>
</location>
<location>
<name>Bobs Powerwashing</name>
<addition nodes inbetween here>
<category>Services</category>
</location>
</POIs>
or Should I format it like this:
<POIs>
<Restaurants>
<location>
<name>Barbaras Bagels</name>
<additional nodes inbetween here>
</location>
</Restaurants>
<Services>
<location>
<name>Bobs Powerwashing</name>
<addition nodes inbetween here>
</location>
</Services>
</POIs>
the above example only has one name in each category but I'm sure you can understand