xslt.js

Transform XML with XSLT

xslt.js is a tiny (less than 2 KB) JavaScript library that lets you asynchronously transform XML with XSLT on the client. Why transform XML on the server when the client can do it, too?

In Microsoft Internet Explorer, no instantiation of ActiveX controls are necessary, so xslt.js works nicely in companies where admins have deployed “hardened” versions of IE that cannot instantiate any ActiveX controls.

xslt.js includes a jQuery plugin and the ability to use inline XML.

Download

Example code

<div id="transformResult"></div>
<script type="text/javascript">
window.onload = function() {
    new Transformation().setXml("document.xml")
        .setXslt("document.xsl").transform("transformResult");
}
</script>

jQuery plugin example code

<div id="transformResult"></div>
<script type="text/javascript">
$(function() {
 $('#transformResult').xslt("document.xml", "document.xsl");
});
</script>

Compatibility

The current version of xslt.js supports the following browsers:

  • Mozilla 0.9.4 and greater.
  • Microsoft Internet Explorer 5 and greater, Internet Explorer 6 and greater if using the jQuery plugin.
  • Opera 9 and greater.
  • Safari 3 or greater.

Other resources

Subscribe

RSS 2.0, Atom or subscribe by Email.

Top Posts

  1. DynaCloud - a dynamic JavaScript tag/keyword cloud with jQuery
  2. 6 fast jQuery Tips: More basic Snippets
  3. xslt.js version 3.2 released
  4. xslt.js version 3.0 released XML XSLT now with jQuery plugin
  5. Forum Scanners - prevent forum abuse
  6. Automate JavaScript compression with YUI Compressor and /packer/

Navigation