karanba
asked on
Firefox Msxml2.DOMDocument equivalently
Hi, I have a code and trying to adept to firefox
// IE Version
// first part
var xmlDocument = new ActiveXObject("Msxml2.DOMD ocument.4. 0");
xmlDocument.loadXML(xmlStr ing);
// second part
function TransformXmlWithXsl(xmlDoc umentPath, xslDocumentPath){
var xml = xmlDocumentPath;
var xsl = new ActiveXObject("Msxml2.DOMD ocument.4. 0");
xsl.async = false;
xsl.load(xslDocumentPath);
return xml.transformNode(xsl);
}
// IE Version
// first part
var xmlDocument = new ActiveXObject("Msxml2.DOMD
xmlDocument.loadXML(xmlStr
// second part
function TransformXmlWithXsl(xmlDoc
var xml = xmlDocumentPath;
var xsl = new ActiveXObject("Msxml2.DOMD
xsl.async = false;
xsl.load(xslDocumentPath);
return xml.transformNode(xsl);
}
ASKER
// first part
var xmlDocument = new ActiveXObject("Msxml2.DOMD ocument.4. 0");
xmlDocument.loadXML(xmlStr ing);
What about fisrt part I try DOmParser but there in no propert to see xmlstring in it.
var xmlDocument = new ActiveXObject("Msxml2.DOMD
xmlDocument.loadXML(xmlStr
What about fisrt part I try DOmParser but there in no propert to see xmlstring in it.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
function TransformXmlWithXsl(xmlDoc
var xsltProcessor = new XSLTProcessor();
// *** load the XSL file
var myXMLHTTPRequest = new XMLHttpRequest();
myXMLHTTPRequest.open("GET
myXMLHTTPRequest.send(null
// *** get the XML document
xslStylesheet = myXMLHTTPRequest.responseX
xsltProcessor.importStyles
// *** load the xml file
myXMLHTTPRequest = new XMLHttpRequest();
myXMLHTTPRequest.open("GET
myXMLHTTPRequest.send(null
var xmlSource = myXMLHTTPRequest.responseX
// *** transform
return xsltProcessor.transformToF
}
the XMLHTTPRequest's really aren't necessary, but I'm not sure what you're sending in.
Also, you might want the transformToDocument function instead of fragment, but again that's up to you.