4 ms·
If you have a hammer everything looks like a nail. Or in this case if you already have XML then XSL looks like the solution. I suspect XSL has fallen out of fa
by Someone1234 12y ago
If you have a hammer everything looks like a nail. Or in this case if you already have XML then XSL looks like the solution.
I suspect XSL has fallen out of favor because a lot of people don't have XML anymore, they instead have JSON which is more naturally processed using a JS library (per the OP).
In order to process JSON with XSL you'd have to go through the rigmarole of first converting it to XML and then exporting that as an iFrame which can then be rendered into HTML/CSS/JS via XSL. And nobody has got time for all of that, least of all when we care about creating "mobile first" properties which XLS was just never designed for (and, yes, the underlying HTML/CSS which it outputs CAN be designed for mobile-first, but XSL itself offers no functionality there).
TL;DR: I'd never go XSL in 2014 unless I already had XML. It offers little or nothing if your data source is either straight from the database or JSON (just adds an additional intermediate layer, you'll still ultimately outputting to JS/HTML/CSS). It does remain useful for generating CSV however (as you can set the output encoding type to text, strip XML headers, and so on). Which is not true for JavaScript.