I have this xml file that i want to get values from :
<test>
<item>
<question audio='audio/AB2001Q.mp3' category='Alertness'>Before you make a U-turn in the road, you should</question>
<description audio='audio/s1,1.mp3'>If you want to make a U-turn, slow down and ensure that the road is clear in both directions. Make sure that the road is wide enough to carry out the manoeuvre safely.</description>
<image ></image>
<answers>
<answer title='a' audio='audio/AB2001A.mp3'>give an arm signal as well as using your indicators</answer>
<answer title='b' audio='audio/AB2001B.mp3'>signal so that other drivers can slow down for you</answer>
<answer title='c' audio='audio/AB2001C.mp3'>look over your shoulder for a final check</answer>
<answer title='d' audio='audio/AB2001D.mp3'>select a higher gear than normal</answer>
</answers>
<correctAnswers>
<answer>c</answer>
</correctAnswers>
</item>
</test>
How can I get the text content of question audio and the question text so for example
“audio/AB2001Q.mp3” is the question audio
“Before you make a U-turn in the road, you should” is the question text
this is what i have so far:
var doc = Ti.XML.parseString(blob);
var branch = doc.getElementsByTagName('item').item(0);
I am very new to xml!
It’s similarly to what you’d do in HTML, e.g.:
(it would be a bit easier if you’d use jQuery, Sencha or any other library)