How to display Atom / RSS feeds in a browser using custom XSLT?

Back in 2006, I wrote a nice XSLT that converted my RSS feeds into custom HTML. That way, if the user clicks the browser, it will appear as a simple page, not a bunch of unwanted XML. If the same URL was used in the feed reader, it was handled correctly and everything was stain.

Currently, most browsers (IE, Firefox, Safari, Opera) seem to capture styles and don't let go. And Chrome just ignores the conversion of style sheets.

Given that several years have passed, am I just forgetting some details? Isn't it that simple?

<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="/atom2html.xslt"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <!-- ... -->
</feed>

Does anyone know if there is a way to override those browsers with very specific feed style ideas? And is there a way to get something good from Chrome?

+3
source share
3 answers

Perhaps Chrome only applies the XSLT processing instruction if the Content-Type parameter for the response to the channel is set to XML, not Atom.

This displays XSLT in Chrome:

Content-Type: application/xml

This does not display the style (which is technically the more correct type):

Content-Type: application/atom+xml
+4
source

XSLT Atom/RSS, , . mime-/atom + xml Atom application/rss + xml RSS

, 512 crud . XSL. , IE8 , 512 . , .

+2

I don’t know how to trick the automatic display of RSS and Atom in IE and FF and Safari, but in Chrome XSLT is correctly applied using the processing command xml-stylesheet; Here is an example from the Randonneur Group pool on flickr .

+1
source

Source: https://habr.com/ru/post/1728116/


All Articles