65.9K
CodeProject is changing. Read more.
Home

XSLT transformation with the Processor object

emptyStarIconemptyStarIconemptyStarIconemptyStarIconemptyStarIcon

0/5 (0 vote)

Sep 14, 2011

CPOL
viewsIcon

14070

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:

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.