Hi! I’m using XML, once again, and I’m getting pretty annoyed. I have an XML file similar to this:
<channel>
<item>
<name>Item 1</name>
<type>item</type>
<purpose>no</purpose>
</item>
<item>
<name>Item 2</name>
<type>item</type>
<purpose>yes</purpose>
</item>
</channel>
What would I do if I wanted to make an array of the names of each Item? This gets an array of each item:
xml.results.firstChild.firstChild.childNodes
But adding a .firstChild after that makes it undefined.
What should I do?