I am currently developing a HTML game whereby a user drags items and drops them into their correct categories. The categories and their items are defined in an XML document.
My XML format:
<config>
<game>
<title>Dementia</title>
<cat>
<catTitle>Mild</catTitle>
<item>mild-1</item>
<item>mild-2</item>
<item>mild-3</item>
</cat>
<cat>
<catTitle>Moderate</catTitle>
<item>Moderate-1</item>
<item>Moderate-2</item>
<item>Moderate-3</item>
</cat>
<cat>
<catTitle>Severe</catTitle>
<item>Severe-1</item>
<item>Severe-2</item>
</cat>
</game>
I want to parse this XML file using jQuery into seperate arrays based on their category.
So for example:
array1 = [mild-1,mild-2,mild-3]
array2 = [Moderate-1,Moderate-2,Moderate-3] etc...
This would allow me to check if the dropped item's attribute is correct based on the category array.
If you have any other ideas of how this could be done please do suggest.
Thank you in advance.