Using the Mozilla JavaScript interface to XSL Transformations – MDC Docs.
1 var testTransform = document.implementation.createDocument("", "test", null); 2 // just an example to get a transform into a script as a DOM 3 // XMLDocument.load is asynchronous, so all processing happens in the 4 // onload handler 5 testTransform.addEventListener("load", onload, false); 6 testTransform.load("test-transform.xml"); 7 function onload() { 8 processor.importStylesheet(testTransform); 9 }