|
|
|
|
|
by elmarschraml
4216 days ago
|
|
XSLT is one of those cases where the idea and the intention is great, but the actual implementation is horrible. I would love to see someone propose a modern alternative to XSLT, that works for the same use cases, but avoids XSLTs mistakes. |
|
I use XSLT as part of a reporting engine that generates HTML from fairly complex XML documents on the back end, and whenever I touch it I'm amazed by a) how powerful it is and b) how painful it is to use.
It isn't clear that it's possible to get similar power without similar pain, though, and I think it's beholden on anyone who claims it is to step us and give us an example. A lot of really smart people were involved in DSSSSL and XSLT, and they couldn't solve the problem. Even stripped of the awkward, ugly, syntax, the kind of thing you want to specify in XSLT is complicated and messy.
"Emit X when you encounter P except if the third element of type Z (if it exists) of the grandparent of P is a Q with attribute TUESDAY having value FIZBIN emit Q's content transformed according to rule Y" is never going to be pretty, and while you can argue that only badly designed document formats require things like "the third element" to be specified, the world we actually live in is full of such things. And because we will always re-purpose document formats to ends their designers never envisaged, it will always be the case.
[#] I can't actually remember how many S's DS*L has in it, although I once did know most of the words to the DSSSL Song.