Can anyone tell me if there is a way to do an XML/XSLT transformation on the client side using Javascript or JQuery, a way that works in all major browsers? (Chrome, Safari, Firefox and IE)? Thanks.
-
1Maybe this: http://stackoverflow.com/questions/9847395/using-client-side-xslt-transformations-in-the-html5-era – rene Feb 20 '13 at 19:50
-
1or this: http://stackoverflow.com/questions/5722410/how-can-i-use-javascript-to-transform-xml-xslt – Shai Aharoni Feb 20 '13 at 19:52
4 Answers
I should state from the start that I wrote this script, but if you're looking to just do some transformations and pass some parameters to your XSLT (nothing too fancy) then you can try Magic XML.
You can also have it automatically pull in your data and apply transformations by setting some data-
attributes on your DOM elements. For example...
<div data-xml="example.xml" data-xslt="transform.xslt"></div>
...would automatically pull in data from example.xml and apply the transform.xslt to it.
It works in Opera, Chrome, Firefox and IE and is open source.

- 899
- 6
- 20
-
The MagicXML URL seems to be non-responsive, and I believe it is hosted by you juddging from the domain name. I'm interested in the library. – tzot Oct 11 '13 at 07:00
-
1Hey tzot, sorry about that! Updated the URL now, should be good to go. – Tom Davies Oct 18 '13 at 23:27
-
-
1magic xml is just a wrapper around "client side example" found in w3c. It wont fix any upcoming problems. I am wondering if I can reimplement the node-set function using wgx. – yan bellavance Sep 23 '16 at 22:51
Have you considered Saxon CE? It used to require a commercial licence for deployment but the latest version has been released as open source.

- 120,891
- 16
- 170
- 183
-
1Coincidentally, the open source Saxon-CE 1.1 release was announced on the same day as this answer: [Saxon-CE 1.1](http://www.saxonica.com/ce/index.xml) – pgfearo Feb 23 '13 at 07:13
-
@pgfearo thanks for the heads up, I've edited the answer accordingly. – Ian Roberts Feb 23 '13 at 09:51
-
There's a client side example.

- 11,812
- 19
- 76
- 129

- 4,658
- 2
- 14
- 23
-
does not work when xsl stylesheet contains node-set in edgeHTML 14 – yan bellavance Sep 22 '16 at 23:20
-
@yanbellavance Yes, browsers have moved on a bit since that article was written – John Sep 23 '16 at 19:23
-
@MarkKCowan Missed your comment when you first posted it, but it only uses MSXML when it detects IE – John Sep 23 '16 at 19:26
I've had reasonably good experiences with Sarissa. The transformation interface supported by some XForms engines is also a convenient way to manage transformations in the client.

- 24,596
- 5
- 38
- 65