I want to extract the data from every planet and asteroid (not in this example) and put it in a list of strings. So one planetlist would contain (in order):
- name
- position x
- position y
- radius
- speed x
- speed y (any) - neighbour
I have a lot of trouble traversing the xml's, and there's not a lot of good tutorials on this imo.
The xml:
<galaxy>
<planet>
<name>Kobol</name>
<position>
<x>45</x>
<y>310</y>
<radius>7</radius>
</position>
<speed>
<x>0.3</x>
<y>-0.6</y>
</speed>
<neighbours>
<planet>Unicron</planet>
<planet>Koarth</planet>
</neighbours>
<color>blue</color>
<oncollision>blink</oncollision>
</planet>
<planet>
<name>Namek</name>
<position>
<x>60</x>
<y>102</y>
<radius>15</radius>
</position>
<speed>
<x>0.1</x>
<y>0.2</y>
</speed>
<neighbours>
<planet>Helicon</planet>
<planet>Synnax</planet>
<planet>Xenex</planet>
<planet>Alderaan</planet>
</neighbours>
<color>orange</color>
<oncollision>blink</oncollision>
</planet>
</galaxy>
Can anyone help?