xsl-list
[Top] [All Lists]

Re: Dynamic processing of xml file using xsl and javascript

2004-11-15 13:45:02
I'm trying the code submitted by Anton on 29 October 2004 :

 <script type="text/javascript" language="JavaScript">

   var processor = new XSLTProcessor();

   var dataXML = document.implementation.createDocument("", "", null);
   dataXML.load("data.xml");

   var dataXSL = document.implementation.createDocument("", "", null);
   dataXSL.addEventListener("load", onload, false);
   dataXSL.load("data.xsl");

   function onload()
   {
     processor.importStylesheet(dataXSL);
   }

function XSLTransform(outputElement)
{
var ownerDocument = document.implementation.createDocument("", "", null);
var newFragment = processor.transformToFragment(dataXML, ownerDocument);
var oldLink = document.getElementById("xsllink");
document.getElementById(outputElement).replaceChild(newFragment, oldLink);
}

 </script>

but get the error

Error: [Exception... "Component returned failure code: 0x80004001
(NS_ERROR_NOT_IMPLEMENTED) [nsIXSLTProcessor.importStylesheet]"  nsresult:
"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)"  location: "JS frame ::
file:///g:/sjc/data_moz.html :: onload :: line 31"  data: no]
Source File: file:///g:/sjc/data_moz.html
Line: 31

Line 31 is the "processor.importStylesheet(dataXSL);" line.

I've tested my data.xml and data.xsl file in an IE script and they work
fine.

I've also upgraded from Firefox 0.8 to 1.0

Any ideas?

Thanks,
Alan





--~------------------------------------------------------------------
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>
--~--