cancel
Showing results for 
Search instead for 
Did you mean: 

RSS feeds with XSL stylesheets

decomplexity
Rising Star
Posts: 493
Thanks: 26
Registered: ‎30-07-2007

RSS feeds with XSL stylesheets

I have been trying in vain to persuade an XML RSS feed of mine to use XSL for a bit of tarting up. I have extracted the gist of what I am trying to do into two test files (below). Can anyone (including the PN blog developers who must be familiar with this!) spot what I am doing wrong please?
Feed file: http://www.decomplexity.com/testnewsfeed.xml
Stylesheet: http://www.decomplexity.com/testnewsfeed.xsl
The feed appears to completely ignore the existence of the stylesheet.
Note that the colour scheme is purely for illustration!
Zen from May 17. PN Business account from 2004 - 2017
7 REPLIES 7
Colin
Community Veteran
Posts: 1,264
Registered: ‎04-04-2007

Re: RSS feeds with XSL stylesheets

It seems to work for me with xsltproc at the command line if I feed it the XSL and the XML file. It's been a while since I used it in a browser though.
Colin
Community Veteran
Posts: 1,264
Registered: ‎04-04-2007

Re: RSS feeds with XSL stylesheets

I wonder if it's not working because browsers are picking it up as RSS feeds and most now do some fancy processing on it?
http://ccgi.csogilvie.plus.com/uni/tut4.xml for example, appears to work.
decomplexity
Rising Star
Posts: 493
Thanks: 26
Registered: ‎30-07-2007

Re: RSS feeds with XSL stylesheets

Tnks Colin. I had assumed (perhaps wrongly) that the RSS feed formatters in common browsers would allow XSL overriding.
In both IE7 and FFox 2, the example you gave just listed the text with no formatting whatever (IE didn't even insert CR/LFs; Messrs Mozilla are more considerate...); my Attensa feedreader came up with 'XML parsing problem'...
Zen from May 17. PN Business account from 2004 - 2017
Colin
Community Veteran
Posts: 1,264
Registered: ‎04-04-2007

Re: RSS feeds with XSL stylesheets

Mine isn't an RSS feed, it's something I randomly wrote for a Tutorial at Uni about 3 years ago, and the XSL is set to just export it as text rather than HTML.
decomplexity
Rising Star
Posts: 493
Thanks: 26
Registered: ‎30-07-2007

Re: RSS feeds with XSL stylesheets

After a lot of ferretting around on MSDN and Moz blogs, I appear to have answered my own question: IE7 and Firefox 2 DO NOT SUPPORT user XSL stylesheets! And apparently both are sources of contention witin the world of feed developers.
There exist feed kludges to get around this but these merely prevent the browsers from recognising the .xml as an RSS feed entirely, and do not permit sensible overrides to the browsers' own internal RSS style sheets. 
Well well!
Zen from May 17. PN Business account from 2004 - 2017
Colin
Community Veteran
Posts: 1,264
Registered: ‎04-04-2007

Re: RSS feeds with XSL stylesheets

Quote from: decomplexity
IE7 and Firefox 2 DO NOT SUPPORT user XSL stylesheets!

I'm assuming only in the case of RSS feeds, as they quite clearly support it for non-RSS feeds?
decomplexity
Rising Star
Posts: 493
Thanks: 26
Registered: ‎30-07-2007

Re: RSS feeds with XSL stylesheets

Yes Colin - just for RSS feeds.
Firefox 2 can be persuaded to ignore the <rss> tag if a 512 (or greater) byte string (e.g. of comment) is included before the tag. Any linked.xls is then applied correctly and FFox's default RSS layout is bypassed.
IE7 is more of  mystery. MSoft's own IE development blogs say that this 512 byte kludge should work for IE7 also - but it doesn't. One needs to suppress the <rss> and </rss> tags entirely.   
Zen from May 17. PN Business account from 2004 - 2017