How can I perform XSLT transformations during a callback?

Mozilla comes with a very convenient XSLTProcessor, which of course means it's available in Jaxer. Here's an example of how to use it to transform an XML file in a callback and return the resulting HTML. The content is partially borrowed from the Mozilla XSLT example.

Note: To instantiate an XSLTProcessor during a callback, you must explicitly reference it off the window object! This is only necessary within functions used during callbacks, when they need to reference "global" objects.

Create a page as follows:

Now create the following files, in the same folder:

Here's the XML to be transformed, in a file called "original.xml":

And here's the XSLT transformation, in a file called "transform.xslt":

Now serve the page through Jaxer, and click the transform button. You should see: