Hi, Actually I am just a starter of XML. In one of my task, I am doing the following:
var req = new XMLHttpRequest();
req.open('GET', 'http://www.mohin.com/test.xml', false);
req.send();
var xmlObj = req.responseXML;
Now, I am getting the XML as:
<?xml version="1.0" encoding="utf-8"?>
<Items status="as">
<Song title="Helios (Original Mix)">
<Artist name="Chris Hingher" ID="291728"></Artist>
<Info StartTime="19:37:39" JazlerID="2219" PlayListerID="" />
</Song>
<Song title="I Was Drunk">
<Artist name="Riva Starr Feat. N�ze" ID="292052"></Artist>
<Info StartTime="19:45:38" JazlerID="2267" PlayListerID="" />
</Song>
.............
</Items>
You can see that there is a special character in tag's name attribute in the second tag and for that I am getting a parsing error and for this I cant read the XML object. See this tag: <Artist name="Riva Starr Feat. N�ze" ID="292052"></Artist>
and look at it's name attribute.
Is there anyone who can give me a solution to this issue? I really need to retrieve each artist name like this:
var info = xmlObj.getElementsByTagName("Song")[0];
var artistName = info.childNodes[j].attributes.getNamedItem('name').nodeValue;
Thanks Mohin