I'm very new to XML, and I'm trying to parse out values from xml nodes. The xml stream being sent to the page looks like this:
I'm using an XMLHttpRequest to send the request, and the page returns the xml above.
My callback function looks like this:
All of that seems to work fine. Can someone give me a quick example of how I might iterate through the nodes in the above xml?
thanks
Information is not Knowledge, Knowledge is not Wisdom, Wisdom is not Truth, Truth is not Beauty, Beauty is not Love, Love is not Music, Music is the best.
Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<data>
<records>
<numrecs>2</numrecs>
<numfields>3</numfields>
</records>
<record>
<num>1</num>
<ID>1234</ID>
<STREET_NO>12</STREET_NO>
<STREET_NAME>MAIN ST</STREET_NAME>
</record>
<record>
<num>2</num>
<ID>124</ID>
<STREET_NO>14</STREET_NO>
<STREET_NAME>MAIN ST</STREET_NAME>
</record>
</data>
I'm using an XMLHttpRequest to send the request, and the page returns the xml above.
My callback function looks like this:
Code:
if (req.readyState == 4) {
if (req.status == 200) {
var xmldoc = new ActiveXObject("Microsoft.XMLDOM");
xmldoc.async = false;
xmldoc.loadXML(req.responseText)
var root = xmldoc.documentElement;
}
}
All of that seems to work fine. Can someone give me a quick example of how I might iterate through the nodes in the above xml?
thanks
Information is not Knowledge, Knowledge is not Wisdom, Wisdom is not Truth, Truth is not Beauty, Beauty is not Love, Love is not Music, Music is the best.