News for hackers. Stuff that matters.
Re:Open Letter to XSLT Fans by zdw on Saturday April 07, 2012 @03:25PM (#3811863)
XML, and surrounding technologies like XPath, XSLT, Schematron, RelaxNG, etc. by extension, are extremely useful as data storage and validation languages. If I was planning to keep structured data around for a long time on disk, and want to make sure that I didn't have garbage stored, I'd definitely want it in XML, with a fairly strict schema to validate that data.

If you're writing an API that works with files (not an over the wire format), and you don't want to be locked into any one language or toolset, XML is pretty hard to beat. Being able to write just one XSLT file, and have it processed by any compliant processor is pretty impressive - no other templateing format works that way.

The problem for most people is that they never touch those other technologies that make XML great, because they're looking at basic data serialization, and don't care so much about validation and transform. Most web technologies fall into this category. Any tool can and will be abused - how many of us have seen a monstrous unmaintainable Excel file that performs a task that would be much better done in a scripting language?

TL;DR: XML tech has it's uses, but it's very frequently abused.

Re:Open Letter to XSLT Fans by doc4t on Saturday April 07, 2012 @03:45PM (#3811906)
Although I find XML to be much too cumbersome and bloated for any practical situation I can still understand the technical arguments in favor of using it. What I don't understand is why anyone would choose XSLT over a full featured scripting language like PHP, ASP, JSP or similar. As you obviously have much more experience than I in this field can you provide an example where XSLT would be the preferred choice?
Re:Open Letter to XSLT Fans by silentOpen on Saturday April 07, 2012 @05:28PM (#3812180)
http://www.khronos.org/registry/webgl/extensions/OES_texture...

No dynamic server-side templating language, easily transformable to other XML formats (docbook, atom (see front page of registry)). If the user/client has libxml, the processor command is already installed. The specifications are now provided in an application specific format that is language-agnostic instead of manually maintained ad hoc HTML. The extension registry index page is now automatically generated into static HTML instead of manual HTML+JavaScript for sorting the lists.

Finally, the restricted power of XSLT is an advantage for this application vs PHP, ASP, or JSP. If browsers actually implemented web technologies like XSLT, sending XML specs and generating HTML on the client side with cached XSLT would save bandwidth.

Re:Open Letter to XSLT Fans by aurelianito on Saturday April 07, 2012 @10:14PM (#3812794)
How is XML + XSLT better than JSON + JavaScript for generating the view in the browser?

Note: You can generate HTML using JavaScript but it is not needed. You can manipulate the DOM to change what the user sees.

Re:Open Letter to XSLT Fans by silentOpen on Sunday April 08, 2012 @01:12AM (#3813148)
It is easier for crawlers to ingest.
Re:Open Letter to XSLT Fans by chris_wot on Monday April 16, 2012 @06:40AM (#3846803)
Can you prove this?
Re:Open Letter to XSLT Fans by showerst on Saturday April 07, 2012 @04:06PM (#3811960)
If you want store your data in a validateable, language agnostic way, why not apply the same logic to your transformations and templates?

...there are a million oft-argued reasons why not, but that's one line of thinking that will lead you to do it.

These discussion always remind me of my favorite old Slashdot quote: "XML is like violence. If it's not solving your problem, you're not using enough of it."

Re:Open Letter to XSLT Fans by dlubarov on Saturday April 07, 2012 @04:06PM (#3811961)
Well, it's convenient for simple things. You don't need to run a web server, or run a script to generate HTML.
Re:Open Letter to XSLT Fans by doc4t on Saturday April 07, 2012 @04:12PM (#3811972)
You don't need to run a web server for PHP either...can you give an example of one of these simple things?
Re:Open Letter to XSLT Fans by sk5t on Saturday April 07, 2012 @07:03PM (#3812416)
Well said -- I think of the same topics every time I hear someone heaping scorn on XML for its wordy serialization output and complex spec (specifically as compared to JSON). All the other tooling around XML is so much richer and more mature... that said, the learning curve for XML and XSLT is certainly much longer and steeper than recent fads like moustache.js.
Re:Open Letter to XSLT Fans by mike-cardwell on Saturday April 07, 2012 @04:21PM (#3812003)
+1 for XSLT being cross-platform. I recently started rewriting a Perl application in NodeJS. It sends out HTML emails. The HTML is constructed using XSLT. This meant I could just continue using the same template. If I'd written it in something like Template Toolkit I would have had to rewrite it in EJS or something.
Re:Open Letter to XSLT Fans by JepZ on Sunday April 08, 2012 @04:59AM (#3813451)
From my perspective XSLT is a horrible language. Nevertheless I use it for every of my web projects. Besides the fact that I hate the language I love the thing it does: abstraction. In the backend I only have to care about the information I want to provide and for the frontent I can do whatever I want to do with this information. My largest problems are the verbosity of the language and the incomplete implementations (also xpath). Btw. I think the Excel formulas are much closer to a functional language than XSLT should ever be ;-)