Re:We Should Have Markdown Rendered Websites
by dtagames on Friday November 11, 2022 @10:26AM
(#33561960)
Me, too, having worked at IBM and used SGML there. But JSON is what really killed XML. It can be harder to read, especially at first, but it's shorter and fulfills all the same roles.
[ Parent
| on HN ]
Re:We Should Have Markdown Rendered Websites
by necovek on Saturday November 12, 2022 @02:05AM
(#33570803)
I wouldn't say JSON killed XML: it's still widely in use for documents whose type definition changes rarely and which are more content oriented. The one benefit to XML/SGML languages is that you've got simple, ubiquotious support for "attributes", plain text content and nested tree content.
I.e. to represent
<p>An <acronym expanded="HyperText Markup Language">HTML</> page was the driver for interactive web.
in JSON, you have to come up with your own conventions for attributes and content: [
{
"type": "p",
"content": [
{"type": "STRING", "value": "An "},
{"type": "acronym", "attributes": {"expanded": "HyperText Markup Language"}, "content": [{"type": "STRING", "content": "HTML"}]},
{"type": "STRING", "content": " page was the driver for interactive web."}
]
}
]
I know which one I'd prefer ;)So with JSON, everyone comes up with their own format. And in these cases that XML was designed for (to mark up textual content), it handily beats JSON in expressiveness, simplicity and terseness too. The fact that it was misused for defining protocols and objects (i.e. SOAP, ugh) is a different matter.
I would say that SGML/XML languages still have this benefit over even Markdown: any contextual modifier is either impossible or uses a one-off syntax (like images or links with text).