3 ms·
Here's the thing: for that article standard use case, if I want to do anything more interesting with the document body than just hand it off to a web browser, I
by regularfry 5y ago
Here's the thing: for that article standard use case, if I want to do anything more interesting with the document body than just hand it off to a web browser, I need to parse it anyway. I've not saved any work at all. For the specific case of semi-structured documents, JSON just isn't the right tool. The problem is that it is a good tool for the far simpler and more common case of trivial string key-value maps, so everyone tries to ram their pegs into that hole, regardless of shape.
As far as it being easy to consume goes, if we're in the browser, DOMParser is right there - it's a one-liner to get a DOM out.
This annoys me more than it probably should. But it also annoys me that XML didn't inherit `</>` as a generic closing tag from SGML. That would have gone a long way towards satisfying people who think XML is too verbose.