Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / Languages / Javascript

XSLT transformation with the Processor object

0.00/5 (No votes)
14 Sep 2011CPOL 14.1K  
How to do XSLT transformation with the Processor object

In order to optimize XSLT transformation in Internet Explorer, you can use the Processor object. See this example:

JavaScript
var xml = new ActiveXObject("Microsoft.XMLDOM");
var xslt = new ActiveXObject("MSXML2.FreeThreadedDOMDocument");
   
xml.load("data.xml");
xslt.load("transformxsl.xml");
   
var processor   = new ActiveXObject("Msxml2.XSLTemplate");
processor.stylesheet = xslt;

var objXSLTProc = processor.createProcessor();
objXSLTProc.input = xml;
objXSLTProc.transform();

I wrote about the performance of XSLT transformation in Internet Explorer here.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)