Hi, I am trying to attach an xsl sheet to xml using
javascript in and html page. I am able to get it to
work in IE using Microsoft.XMLDOM but I can not get it
to work in Mozila browsers using the following script.
<html>
<script type="text/javascript">
var xslStylesheet;
var xsltProcessor = new XSLTProcessor();
var myDOM;
var xmlDoc;
function Init(){
document.write("in here");
// load the xslt file, example1.xsl
var myXMLHTTPRequest = new XMLHttpRequest();
myXMLHTTPRequest.open("GET", "oddset7.xsl", false);
myXMLHTTPRequest.send(null);
xslStylesheet = myXMLHTTPRequest.responseXML;
xsltProcessor.importStylesheet(xslStylesheet);
// load the xml file, example1.xml
myXMLHTTPRequest = new XMLHttpRequest();
myXMLHTTPRequest.open("GET", "matchups2.xml",
false);
myXMLHTTPRequest.send(null);
xmlDoc = myXMLHTTPRequest.responseXML;
var fragment =
xsltProcessor.transformToFragment(xmlDoc, document);
document.getElementById("example").innerHTML = "";
myDOM = fragment;
document.getElementById("example").appendChild(fragment);
}
</script>
<body onLoad="Init();">
<div ="example"></div>
</body>
</html>
Both the XML and XSL document seem to be good. It
works in IE and if I attach the xsl directly to the
xml. Thanks in advance for any advice.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--