converting xml file contents into string using javascript [on hold]



I am writing a Javascript program to find out if an xml file in a given url is valid or not. I am planning to use the DOMParser object to parse the converted string and display an alert saying the file is invalid if the root node is a "parsererror" but I am not able to convert the said file.


I tried using the XMLSerializer object to convert the file to string but i am getting only the content inside the tags, but not the tags. I need both the tags and the content.


Or is there another way to find out if an xml file is invalid or not using XMLHttpRequest.responseXML.


My apologies if this seems vague but I have no idea how to go about it and I am also new to XML so please don't mind.


Thanks


No comments:

Post a Comment