This question already has an answer here:
I need to be able to parse XML using JavaScript. The XML will be in a variable. I would perfer not to use jQuery or other frameworks.
I have looked at this, XML > jQuery reading.
Thanks
This question already has an answer here: I need to be able to parse XML using JavaScript. The XML will be in a variable. I would perfer not to use jQuery or other frameworks. |
|||||||||||||||||||||
marked as duplicate by Vivin Paliath, maerics, acdcjunior, Mike Samuel, animuson♦ Jul 12 '13 at 0:56This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question. |
|||||||||||||||||||||
|
I'm guessing from your last question, asked 20 minutes before this one, that you are trying to parse (read and convert) the XML found through using GeoNames' FindNearestAddress. If your XML is in a string variable called
Then you can parse the XML with Javascript DOM like this:
And get specific values from the nodes like this:
|
|||||
|
Which I got from http://stackoverflow.com/a/8412989/1232175. |
|||
|