4 ms·
XSLT can create client-side charts without JavaScript. For example: http://davidjarvis.ca/world-politics/xml/resources.xml http://davidjarvis.ca/world-politics
by thangalin 12y ago
XSLT can create client-side charts without JavaScript. For example:
http://davidjarvis.ca/world-politics/xml/resources.xml http://davidjarvis.ca/world-politics/xml/resources.xml
The source code is hosted on BitBucket:
https://bitbucket.org/djarvis/world-politics/src/master/xml/ https://bitbucket.org/djarvis/world-politics/src/master/xml/
Without JavaScript, the interactivity of the charts is limited.
- teleclimber 12y agoAre people still adopting XSLT for new projects? It seems it has fallen out of favor.
- Someone1234 12y agoIf 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.
- thangalin 12y agoI use XML/XSLT to transform data into multiple output formats (currently XHTML and ConTeXT/PDF): https://recipefiddle.com/recipe/15316/truffles https://recipefiddle.com/recipe/15316/truffles (web page) http://i.imgur.com/T71WhDJ.png http://i.imgur.com/T71WhDJ.png (editor) https://recipefiddle.com/book/examples/recipefiddle_sweet_treats_ebook.pdf https://recipefiddle.com/book/examples/recipefiddle_sweet_tr... (printable ebook) https://recipefiddle.com/book/examples/recipefiddle_sweet_treats_cards.pdf https://recipefiddle.com/book/examples/recipefiddle_sweet_tr... (recipe cards) Each recipe was created from the same XML recipe data, transformed using two different templates. To my knowledge, JSON cannot be directly transformed into *TeX, but XML can. To achieve the similar results with JSON, you'd have to first transform it to YAML, then Pandoc, then LaTeX, then finally PDF. Then you'd have to use a different infrastructure to render JSON as XHTML. Architecturally, in this case, XML/XSLT is the simpler solution. If you only care about mobile apps, and don't need to create beautiful ebooks, then XML/XSLT is not a good choice.
- tdicola 12y agoXSLT is kind of like complex regexs, it's a write-only language. I've written a few XSLT transformations over the years for various things and every single time without fail I realize at the end it was a huge mistake. Also most data is in CSV or similar delimited format and won't be usable with XSLT.