xslt.js version 3.2 released

Posted 2008-08-30 in JavaScript by Johann.

Version 3.2 of xslt.js, my JavaScript library to perform client-side XML transformations, is now available for download.

New Feature

I’ve added the often requested ability to use inline XML and XSLT as arguments in addition to using URIs to this version. Here’s an example.

// If using the regular code
new Transformation()
    .setXml('<?xml version="1.0"?><bla/>')
    .setXslt('<?xml version="1.0"?><xsl:stylesheet …')
    .transform('rofl');

// If using the jQuery plugin
$('#rofl').xslt('<?xml version="1.0"?><bla/>',
    '<?xml version="1.0"?><xsl:stylesheet …');

Thanks to a number of optimizations, the size of xslt.js has stayed pretty much the same.

Gotchas

One thing I spent considerable amounts of time on is on the way Gecko (the rendering engine behind Firefox) handles the MIME types in XMLHttpRequests. By default, my web server sent XSLT files as text/xsl, however, Gecko expects them to be delivered as text/xml (and possibly application/xml). If the MIME type doesn’t match, Gecko returns a null XMLResponse object.

6 comments

#1 2008-10-08 by Rusco

Great News !
Compared with a similar plugin at:
http://jiles.fairweatherhonesty.com/?page_id=4
your solution seems to be more lightweight, at least in code-size.

One feature is missing though: Parameter support.
Is this on on the roadmap ?
Best Regards
Rusco.

#2 2008-11-17 by Johann

Rusco,

I cannot use XSLT parameters in xslt.js because it uses XML data islands in Internet Explorer. The good thing is that this makes xslt.js work in Internet Explorer if ActiveX controls are disabled and the bad thing is that this makes transformation parameters impossible.

#3 2009-02-04 by Howard

Great! I like it so much. Thanks Johann Burkard

#4 2009-04-22 by Concho

Works great on Safari!! any ideas on how to make it work on Firefox? Maybe the MIME is acting up again.

#5 2009-04-22 by Johann

Concho,

it should work fine in Firefox. Do you have any demo URL?

#6 2009-04-28 by Concho

Johann,

Well... I don't know what I was doing wrong, but it works now. Thanks a lot... this really will make my life easier.

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