Firefox & XML
-
I have an HTML file that loads an XML and XSL. If I open the file locally, it works. If I open it remotely, it fails. It works in IE both ways. My folder structure is like this. FILE.HTML ./includes/css/FILE.css ./includes/js/FILE.js ./includes/xml/FILE.xml --- (XML_file_name) --- ./includes/xsl/FILE.xsl --- (XSL_file_name) --- Here's the FF part of the code.
// For Firefox. else if (document.implementation && document.implementation.createDocument) { // Load XSL. var processor = new XSLTProcessor(); var xslt = document.implementation.createDocument("", "", null); xslt.async = false; xslt.load(XSL_file_name); processor.importStylesheet(xslt); // Load XML. var src_doc = document.implementation.createDocument("","", null); src_doc.async = false; src_doc.load(XML_file_name); var result = processor.transformToDocument(src_doc); // Transform. var xmls = new XMLSerializer(); output = xmls.serializeToString(result); }
Anyone knows why this won't work? Do all my XML and XSL have to be in the same path? Thanks!
"I know which side I want to win regardless of how many wrongs they have to commit to achieve it." - Stan Shannon Web - Blog - RSS - Math - LinkedIn - BM