Hacker News new | ask | show | jobs
by zeveb 3359 days ago
Honestly, I think the statement, 'XML should NEVER be used, period,' is true as well: for any use case I can imagine there are superior alternatives to XML. Even if you have to interface with other services using XML, just use SXML (https://en.wikipedia.org/wiki/SXML) in your own code and marshal to XML at the very last instant.

Ultimately, XML was a colossal mistake carried out to perfection.

2 comments

SGML and XML were invented as a meta-language for encoding semistructured text such as HTML with plain text editor programs, and excels in that use case like nothing else. That XML is abused as config language, payload meta-syntax for web services, for encoding component models, and even as meta-syntax for programming languages is hardly SGML/XML's fault.
I've never seen SXML before, but that looks way worse. All of Lisp's frustration of trying to match closing parens with none of Lisp's power.
As opposed to closing tags? All decent text editors have matching parens highlighting.

SXML is much easier to parse and it's more concise.

HTML itself allows SGML-style tag omission since HTML was originally an application of SGML. A simple example can be found at [1], and can also be seen in action in my talk slides linked from [2].

[1] http://sgmljs.net/docs/html5.html#tag-omission-on-document-l...

[2] http://sgmljs.net/blog/blog1701.html

We're talking XML rather than HTML (and omitting certain closing tags isn't compliant HTML5 anyway).

In XML there's also the concept of using self-closing tags only for "empty tags". Meaning, <tagname val="123"/> isn't "correct" and <tagname>123</tagname> should be used instead; while s-expressions simplify this.

Sorry but your comment re XML is incorrect. I suggest you study the HTML and XML specs, especially if want to convince us of an alternate XML serialization.