Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Aren't there other ways to load and parse a technical format like RSS to a human-readable format? Like you would do with JSON.

Or can't you polyfill this / use a library to parse this?



You can do the transformation server-side, but it's not trivial to set it up. It would involve detecting the web browser using the "Accept" header (hopefully RSS readers don't accept text/html), then using XSLT to transform the XML to XHTML that is sent to the client instead, and you probably need to cache that for performance reasons. And that's assuming the feed is just a static file, and not dynamically generated.

In theory you could do the transformation client side, but then you'd still need the server to return a different document in the browser, even if it's just a stub for the client-side code, because XML files cannot execute Javascript on their own.

Another option is to install a browser extension but of course the majority of users will never do that, which minimizes the incentive for feed authors to include a stylesheet in the first place.


How about using Javascript to fetch the XML (like you would do with JSON), and then parse/transform it with a Javascript or wasm XSLT library? Just like you would do with JSON.

You need a server to serve Json as well. Basically, see XML as data format.

RSS readers are not chrome, so they have their own libraries for parsing/transforming with XSLT.


Not without servers rendering the HTML or depending on client-side JS for parsing and rendering the content.

Its also worth noting that the latest XSLT spec actually supports JSON as well. Had browsers decided to implement that spec rather than remove support all together you'd be able to render JSON content to HTML entirely client-side without JS.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: