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

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.




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

Search: