Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I prevent Firefox/IE from formatting feeds?

I wrote an XSLT for RSS feeds and it works fine in Chrome. However, FF and IE have a default feed formatter, so they ignore my XSLT. Is there a way to prevent FF/IE from formatting my feeds and use my XSLT instead?

Edit: I'm looking for something to add in my XML file, not how to change FF/IE settings.

like image 465
Leo Jiang Avatar asked Jul 14 '14 19:07

Leo Jiang


1 Answers

Could you serve an html file instead? In other words does this solution look good for you?

in case you cant:

Fix for firefox:

  1. Make sure the mime type for both source and stylesheet are set to an XML mimetype, namely text/xml or application/xml.
  2. The XSLT namespace is http://www.w3.org/1999/XSL/Transform. Use the processing instruction instead of the non-standard xml:stylesheet.
  3. Make sure to load XSLT stylesheets from the same domain for security reasons.
  4. For RSS or ATOM feed firefox override styles. A known workaround is to add a sufficiently long XML comment to the beginning of your XML file in order to "push" the or tag out of the first 512 bytes, which is analyzed by Firefox to determine if it's a feed or not.

Source: https://developer.mozilla.org/en-US/docs/XSL_Transformations_in_Mozilla_FAQ

like image 153
Jose Ch. Avatar answered Nov 16 '22 22:11

Jose Ch.