3 ms·
XSLT is a turing-complete programming language. Really, the moment your source XML has a slightly different structure from the target output, XSLT files become
by skrebbel 13y ago
XSLT is a turing-complete programming language. Really, the moment your source XML has a slightly different structure from the target output, XSLT files become monsters.
Programming in XML is never a good idea. It isn't in XSLT, it isn't in Spring, it isn't in Maven. Anything that's XML and has elements or attributes with names like "if", "else" or "while", something went horribly, horribly wrong somewhere. It's horribly verbose, you can't reasonably debug it, and there's virtually no engineering best practices, which results in near-impossible maintenance tasks.
Any modern programming language with a good, consice, XML parsing library is a more effective tool to transform XML into something else than XSLT.
Don't code in XML.
- ygra 13y agoWould you say »Programming in S-expressions is never a good idea« as well?
- skrebbel 13y agoNo. Why?
- ygra 13y agoThen where do you draw the line between XML as data vs. XML as code (which seems to be bad) and sexpr as data vs. sexpr as code (which seems to be good)? Just curious; it's just syntax, after all, and I think that XSLT really has an advantage in transforming XML to other XML (or text) compared to a program in other languages.
- habosa 13y agoI was just saying XML and XSLT is really cool, which it is. It's a tool that does one job, which at a time was a very common job.