function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
cmarkiewiczcmarkiewicz 

scontrol - cross browser - xml parser...

I am trying to create an scontrol that works in Mozilla (it already works in IE). The issue is with XML parsing. The IE version contains the following (create a doc, load, ans set properties):

xmlDoc = new ActiveXObject("Msxml2.DOMDocument.3.0");
xmlDoc.loadXML(msxml.responseText);
xmlDoc.setProperty("SelectionNamespaces", "xmlns:sf='urn:sobject.enterprise.soap.sforce.com'");
xmlDoc.setProperty("SelectionLanguage", "XPath");
var objNodeList = xmlDoc.documentElement.selectNodes("//sf:TotalPrice");

In Mozilla, I've gotten as far as creating and loading the doc. But where do I go from there? What API am I using to get at the elements? (Or is there a better way?)

xmlDoc=document.implementation.createDocument("urn:sobject.enterprise.soap.sforce.com","",null);
xmlDoc.load(msxml.responseText);

thanks
chris
adamgadamg
Use the AJAX toolkit.

http://blog.sforce.com/sforce/2005/07/ajax_toolkit.html
Ron HessRon Hess
I'll second that, the AJAX code is working well for me to create scontrols which work in both IE and Firefox.