I am using the below code in the javascript
text = LxmlHttp.responseText;
parser = new DOMParser();
xmlDoc = parser.parseFromString(text, "application/xml");
xmlDoc.setProperty('SelectionLanguage', 'XPath');
I am getting this error: Uncaught TypeError: Object #<Object> has no method 'setProperty'
Please help me solve the issue.
TIA..
Hi Felix,
I have the below xml structure
<?xml version="1.0"?>
<response status="200">
<ns3:op xmlns="http://xxx.com/details/"
xmlns:ns2="http://xxx.com/mgmt/"
xmlns:ns3="http://xxx.com/list/">
<ns2:ntfs count="140">
<ns2:ntf>
<ns2:Nid>4687807</ns2:Nid>
</ns2:ntf>
</ns2:ntfs>
</ns3:op>
</response>
I have to read this in IE 7, IE 8 , IE 9 , FF, safari and chrome
The namespace index may not be the same and might change.
I need to parse the xml independent of the namespace and browser.
I am trying to do this
var xmlDoc = new DOMParser().parseFromString(....);
xmlDoc.setProperty("SelectionNamespaces", 'xmlns:ns3="http://xxx.com/list/"');
xmlDoc.setProperty("SelectionLanguage", "XPath");
var op = xmlDoc.selectSingleNode("/response/ns3:op");
This works only in IE.
Please let me know how can i parse the xml in all browsers.