3 ms·
Interesting because this is the first time I’ve heard this kind of love for XSLT.
by leephillips 5y ago
Interesting because this is the first time I’ve heard this kind of love for XSLT.
- PaulDavisThe1st 5y agoGot about 600 of my mother's playlists after she died, all in Windows PlayList format (.wpl, an XML-ish variant). Could not find anything better than XSLT to generate portable .m3u files from them. Worked like a charm.
- marcosdumay 5y agoIt's a very badly designed language (that's true for anything that came from the XML way of thinking). But it's amazingly powerful and capable. XSLT is basically SQL for structured text.
- kaycebasques 5y agoTo be fair, I only used it that one time and I was new to programming. Nonetheless it was very much a "wow, this is a different way to do things" experience. And at the time it seemed to magically solve much more accurately and with much less work than an imperative approach.
- vidarh 5y agoXSLT is great when you try to do simple things. Then you try to e.g. format a date or something. As long as you stick to what it is good at and relegate everything else to another layer, it's fine (it could certainly be a lot better, though)
- dionidium 5y agoMost people who encountered it never really understood its programming model. In short, they tried to use it as an imperative language, but XSLT doesn't want to be an imperative language. The basic paradigm is pattern matching. You're supposed to create templates that say what to do when a node meeting certain characteristics is encountered (including how/whether to continue descending into the node's children/siblings/etc). Instead, what you see in most real-life XSLT programs is a whole bunch of xsl:if statements that attempt to conditionally (and, worse, procedurally) handle multiple node types within a single template. That's a dead giveaway that the program's author didn't really understand what they were trying to do or how to accomplish it in the language. XSLT doesn't do itself many favors, either, because the model depends on the execution of a few "hidden" default templates that drive the tree processing. If you don't know those are there or what they're doing -- or worse, if you don't know they're there and you accidentally override them -- then it's really hard to understand what the heck is going on. It just looks like poorly-defined magic. Plus, you need to understand XPath to write effective templates and most people don't understand it as well as they think they do. It's deceptively powerful. Finally, add on the fact that XSLT programs are themselves valid XML -- who the heck wants to write code in XML! -- and it really never had a chance to be understood, much less liked. But many of its ideas were good!
- leephillips 5y agoThis describes my one serious attempt to use XSLT pretty well. It seemed like a powerful idea. But after some weeks of struggling with it, I decided the syntax was too painful to deal with. But I know I never learned it properly, as you say.