3 ms·
I don't think the things that makes programmers gag is plain old XML. As other comments noted, the markup/content ratio is a matter of your choice. And, as op
by phoehne 4y ago
I don't think the things that makes programmers gag is plain old XML. As other comments noted, the markup/content ratio is a matter of your choice. And, as opposed to binary formats from the 80's and 90's, human readable (and debuggable). What I think makes programmers gag is the soul-killing universe of standards around XML and that there's always some architect or data person mandating their use. Things like SAML and XML signatures are a nightmare. Having to author a schema document or use a dozen namespaces every time you want to publish some data just makes it a drudge. XSLT was a bust. Average people didn't get it. You needed a rocket scientist to author the transforms. Let's not forget the joy of SOA and authoring WSDL documents. It wasn't XML, it was the uptight world of standards, best-practices, design by committee, and mandates that grew up around XML.
- _aleph2c_ 4y agoAs someone who is trying to learn XSLT, I totally agree that it is really hard to learn! It's a functional programming language (lisp-like) that you write with verbose XML syntax. You operate over entire trees, your variables can't be changed and all of your functions are suppose to be written as tail recursions. With this said, Michael Kay offers a nice series of patterns in chapter 17 of his book "XSLT 2.0 and XPath 2.0 Programmer's Reference". He shows how to use a "Fill-in-the-blanks" stylesheet that someone who only understands HTML can use, then he shows how to make a "Navigational Stylesheet", a "Rule-Based Stylesheet" and finally a "Computational Stylesheet". He shows that you don't necessarily need to use XSLT's functional programming powers, how you can get a lot with a little of it, and how to level up. So it seems like the language was designed to be written by people who don't understand it; it's declarative.
- spiralx 4y agoOnce you understand those three patterns it does get a bit simpler. I wrote a ton of XSLT and XQuery years back and it's incredibly powerful when used well, plus I wrote a nifty little stylesheet that transformed any HTML page into a formatted and highlighted version of itself :)
- chiph 4y agoJust wait. The same people are hard at working implementing them for JSON. (There is already a JSON Schema definition at https://json-schema.org/ https://json-schema.org/) Like you said - standard XML isn't terrible. Adding on an XSD isn't terrible, because now you can enforce structure and datatypes on files provided by outside parties. Creating an XSLT is much more of a mental challenge, and probably should be left to tools to define. Anything beyond those technologies is someone polishing up their resume.