Hacker News new | ask | show | jobs
by bmn__ 2656 days ago
> XML where parsing is order of magniture more complex than JSON

You're supposed to use an off-the-shelf XML/JSON parser, not write it yourself.

1 comments

Even if you don't parse it yourself, XMLs data model is usually more of a chore to consume.
XML/SGML is highly appropriate for representing rich text, though, which is the purpose of chat apps/logs. Using JSON you'd have to invent ad-hoc markup on top of JSON, loosing any advantage it may have.
Nobody uses rich text formatting, and even if they did, the message body is only a small fraction of the total protocol content.
> Using JSON you'd have to invent ad-hoc markup on top of JSON

That's basically a description of ActivityPub that wraps HTML in JSON!

Will activitypub let me do:

  <body> markdown text </body>
And ship some js to convert to html?
No, each server has their own rules what and how will they present content. Usually they accept limited subset of HTML and filter out everything else.