Live data from Hacker News

Parsing Malformed JSON

peteris.rocks

11–13 of 13 posts

Re: Parsing Malformed JSON

#11

Earlier quoted context omitted.

Malformed XML is everywhere. Especially in enterprise environments. And there's a reason web browsers have an extremely detailed spec on how to parse malformed XML.

Web browsers refuse to parse malformed XML.

Only when specific uncommon headers are set. Under normal circumstances, if you feed them a malformed xhtml document, they will parse it.

Re: Parsing Malformed JSON

#12

Earlier quoted context omitted.

Web browsers refuse to parse malformed XML.

Only when specific uncommon headers are set. Under normal circumstances, if you feed them a malformed xhtml document, they will parse it.

Sending XML with the proper application/xml (or some other) media type is rather common.

Sending XHTML with the HTML media type doesn't count. In that case you're just sending malformed HTML which the browser doesn't recognise as XML at all.

Re: Parsing Malformed JSON

#13

Earlier quoted context omitted.

Web browsers refuse to parse malformed XML.

What do you mean? They definitely try to. A lot of effort is made in this direction, and IMO the results are fairly impressive

No, they don't. Try putting

   
in foo.xml and open it in a browser.
Post reply on HN