Ask HN: Is there a future in XSLT?
I don't know XSLT. I've read a lot of negative opinions on it browsing reddit and HN, so I'm not sure if it's worth learning or not just to use Symphony. I also don't see it mentioned that much on the web, and there's not too many recent books on it on Amazon. I've been using HTML 5 recently as well, and I have read about some difficulties using HTML 5 and XSLT together.
Just thought I'd get HN's opinion on what they think of XSLT and its future.
[+] [-] roel_v|16 years ago|reply
In general, I get the impression that the 'XML everywhere' fad has passed and that technologies like XSLT, xsl:fo and the myriad of xml replacements for DTD's have passed their peak a few years ago.
[+] [-] yesimahuman|16 years ago|reply
Ultimately it always seemed to me like it was a tool to deal with the non-uniform hacky XML data the company had literally everywhere. Perhaps that's the problem that needs to be fixed.
[+] [-] Eldila2|16 years ago|reply
[+] [-] borisk|16 years ago|reply
[+] [-] grayrest|16 years ago|reply
So on its own as a templating language, XSLT 1.0 had problems of varying size. The biggest by far was that the 1.0 spec had the absolute worst string handling of any language I've ever come across. It's erlang bad with the syntactic elegance of being an XML language. This is somewhat corrected in more recent versions but I think this is the primary reason the language has failed to gain adoption. If you're doing whole node manipulation, XSLT is adequate. It's not elegant, but it's flexible and I generally don't have problems getting the results I want in short order.
I do like a number of ideas present in XSLT, particularly the concept of templating documents as trees (guarantees well formed output) and transformation by pattern matching. Those both carry over into my preferred templating language, Python's Genshi, which some people like and some hate. To me it provides a good balance between purity and practicality.
As to your specific questions, I did one site in pure XSLT back in 2003-2004 and vowed I'd never do it again. I have a guy at work who really likes Symphony and produces good quality stuff with it. If I had to do PHP it'd actually be one of my top choices (I don't like PHP either...). I've never regretted learning xpath, since it seems to pop up regularly in unexpected places and isn't THAT complex. The complexity in xpath comes from many implementations not fully implementing the spec. HTML 5 has an XML encoding, so there's no reason that XSLT would work worse with HTML 5 than it does with XHTML.
XSLT will never be the one true path for templating, but its presence as a standard will always attract people who appreciate that sort of thing (I'm not one of those people) so it's not really a dead end either.
[+] [-] xsltuser2010|16 years ago|reply
I wouldn't use it for a web framework, it just seems to be the wrong place. I use xslt for simple document transformation. Say you often have to deal with ridiculously complicated xml files and want to adapt them quickly and in batch to something, then using xslt is a nice way to go.
You should know functional programming to get anything more done than just throwing out some nodes, though. And the hard part about xslt ist actually xpath, which I still have problems with even after years to get the syntax right..
(I'm not a daily user, but it's my usual tool for that matter)
[+] [-] matwood|16 years ago|reply
At the time I wrote the reporting system it was to replace Crystal which I found to be much more of a pita and more expensive.
[+] [-] kj12345|16 years ago|reply
Personally I think XSLT is an interesting language from a theory perspective, and it taught me some interesting things about rule-based programming. However there are too many serious limitations in it in terms of everyday practical use. In addition to the verbosity problems others have mentioned, here's a good list of things XSLT can't do:
http://www.dpawson.co.uk/xsl/sect2/nono.html
[+] [-] flatline|16 years ago|reply
[+] [-] jamesbritt|16 years ago|reply
[+] [-] pook|16 years ago|reply
There is a future, but the real question is: is it a future worth going into?
I wonder if there's any attempt to fork Symphony onto a different templating system.
[+] [-] InclinedPlane|16 years ago|reply
[+] [-] Tichy|16 years ago|reply
[+] [-] xchaotic|16 years ago|reply
[+] [-] aristus|16 years ago|reply
I personally would not bother. I played with XSLT and its predecessor called DSSSL or something like that, back in the late 90's. It hasn't taken over the world yet, and I don't expect it to surprise us. There are many other ways to manipulate a DOM, eg Javascript, that are much more sophisticated and widely supported.
If you want to get a particular job that requires deep expertise in XSLT, well, that's your decision. But I would not peg it as a generally-useful skill.
[+] [-] Amanjeev|16 years ago|reply
1. It is bulky and comes with a lot of baggage. 2. Writing even a small statement like int x=2 in xslt is an arduous task of <xsl:variable select="blah blah"/> (this is the shortest way, it gets even longer if you need to do more complex stuff. 3. It is not advanced enough like 'real' programming languages.
The only thing I would use XSLT for is document transformation. I totally agree with xsltuser2010 (http://news.ycombinator.com/item?id=1330691)
[+] [-] lsc|16 years ago|reply
The problem I have with most templating systems is that they are extremely language specific. I want the design guy to be able to style any page, be it generated by perl, php, C, etc...
[+] [-] arethuza|16 years ago|reply
[+] [-] cwisecarver|16 years ago|reply
It's a very fast, computer time not developer time, way to make HTML if your datasource is XML.
[+] [-] drawkbox|16 years ago|reply
Ok to elaborate, there are too many walls you hit in using XSLT. You'd be better off with a templating layer with a faster language much like tenjin, mako, jinja etc in the python world but every platform has them.
[+] [-] percept|16 years ago|reply