Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



Would you say »Programming in S-expressions is never a good idea« as well?


No. Why?


Then 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.


I 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.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: