User-933407369 posted
hi Siddu,
According to your description, I understand you want to “.documentElement.selectSingleNode("something")" is supported by the browsers like FF,CHrome,Safari to get the selected node value.
I would suggest you to try the following methods:
Path support
xmldoc.setProperty("SelectionLanguage", "XPath");
var books = xmldoc.documentElement.selectNodes("//book");
var secondBook = xmldoc.documentElement.selectSingleNode("//book[2]");
var secondAuthor = secondBook.selectSingleNode("author[2]");
Namespace support
<books xmlns:wrox="http://www.wrox.com/" xmlns="http://www.amazon.com/">
<wrox:book>Professional JavaScript</book>
</books>
xmldoc.setProperty("SelectionNamespaces",
"xmlns:wrox='http://www.wrox.com/' xmlns='http://www.amazon.com/'");
var book = xmldoc.documentElement.selectSingleNode("wrox:book");
Please read the reference below for more information:
http://www.nczonline.net/blog/2009/04/04/xpath-in-javascript-part-3/
I hope it helps you.