Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RSS feeds with XSL

Status
Not open for further replies.

decomplexity

IS-IT--Management
Dec 4, 2007
8
GB
I have been trying in vain to persuade an XML RSS feed of mine to use XSL for some custom formatting. I have extracted the gist of what I am trying to do into two test files (below). Can anyone spot what I am doing wrong please?

Feed file: Stylesheet:
The feed appears to completely ignore the existence of the stylesheet!
Note that the colour scheme is purely for illustration!
 
[1] In xml
><?xml-stylesheet href="testnewsfeed.xsl" type="application/xml" ?>
[tt]<?xml-stylesheet href="zu26_test.xsl" type="text/xsl" ?>[/tt]

[2] In xsl
><xsl:for-each select="/">
><p><a href="{rss/channel/item/link}"><xsl:value-of select="rss/channel/item/title"/></a></p>
><p style="color:red"><xsl:value-of select="rss/channel/item/description" disable-output-escaping="yes"/></p>
></xsl:for-each>
[tt]<xsl:for-each select="rss/channel/item">
<p><a href="{link}"><xsl:value-of select="title"/></a></p>
<p style="color:red"><xsl:value-of select="description" disable-output-escaping="yes"/></p>
</xsl:for-each>[/tt]
 
Amendment
zu26 is my test file. You should use yours.
[tt]<?xml-stylesheet href="testnewsfeed.xsl" type="text/xsl" ?>[/tt]
 
The changes I made is all that can be done. If a version of browser decides not to support anymore xml-stylesheet processing instruction, it is up to them. ff2 and ie7 may take their design decision. Below ff2, just ff1.5 like ie6, it is supporting it fine. And then, some people decide browser should override that piece of pi. Some like it, some like it not. moz is now making it a debat issue _after_ they made the change. The deeper issue is that pi is always an enfant mal aimée. One day, you have to do it server-side if you want specific format.
 
Many thanks tsuji.
You have confirmed what what I was starting to think.
Why IE7 and FFox2 don't offer an RSS 'permit XSL' config override does indeed seem strange.
Max
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top