Hacker News new | ask | show | jobs
by wongarsu 1168 days ago
I just had to comment on the irony of this comment being embedded in a document that is delivered via HTTP and very close to valid XML.

Even if XHTML died on the wayside, HTML is imho a stereotypical example where XML is a good fit. Most of the complexity has valid use cases, and it's mostly obvious what should be an attribute and what should be content of the tag. And at least in HTML 4 you even had a doctype tag filling the role of specifying the schema used. Of course SVG is a better showcase for some other aspects of XML, with every editor putting their own metadata in, nicely partitioned into separate namespaces.

2 comments

In broad strokes, I suppose you're right to see the irony. Even with that, we need specific client applications (aka browsers) to translate that into something readable.
(X)HTML can be pretty readable, if it's formatted well. If it wasn't, JSX wouldn't be a thing.

I think it's not so much about readability but about complexity. XML is meant to represent complex data, like complex rich text or nested vector graphics. That makes XML complex, conceptually, visually, and in implementation. If you use it to represent something that could have been a csv you're going to have a bad time (as everyone had in the 90s).

> HTML is imho a stereotypical example where XML is a good fit

Indeed, this was what XML was created for. From W3C's XML specification:

> The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML.

Honestly, what's absurd is GP comment's cluelessness.