Lurker News

Comments (229) 60 threads

Show all comments

Showing thread 14 of 60

Animats1 reply#
I think someone just re-invented XSLT.
flyx86#
Okay so I wondered whether we can leverage XSLT in order to render the JSON without quirks mode. The idea is:

* We have an XSL stylesheet that ignores input and renders out the HTML contained in "#render"
* Along with the JSON file, we send a header `Link ; rel="stylesheet"; type="text/xsl"`
* We send the JSON with `Content-Type application/xml`
* Browser renders the HTML via the stylesheet and then the JavaScript takes over and renders the page without quirks mode
Sadly, this doesn't work because when the browser can't parse the JSON as XML, it stops processing and doesn't call the stylesheet :(