Adding a style sheet to an RSS feed problem

This is a discussion on "Adding a style sheet to an RSS feed problem" within the Other Programming Languages section. This forum, and the thread "Adding a style sheet to an RSS feed problem are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > Other Programming Languages

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Feb 15th, 2008, 15:53
Up'n'Coming Member
Join Date: Jul 2007
Location: Barry
Age: 22
Posts: 54
Thanks: 0
Thanked 0 Times in 0 Posts
Adding a style sheet to an RSS feed problem

ok here it goes,

im looking to make and RSS feed for the company i work for and i have a small problem. its not making the RSS thats the problem, its adding a style to it, here is my code.

the sample feed.
Code: Select all
<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="rss.css"?>
<rss version="2.0">
 <channel>
  <title>xxxxxxxxx</title>
  <link>http://www.xxx.com/</link>
  <item><title>3 in 1 Sharpening System - Smith's 3-in-1 Sharpening System</title>
   <description>
   <![CDATA[<IMG alt="3 in 1 Sharpening System - Smith's 3-in-1 Sharpening System" hspace=0 src="http://www.xxxxx.com/uploads/images_products/424.jpg" align=baseline border=0><br>The Smith's 3-in-1 Sharpening System is a handy sharpener you can not only take anywhere but will do three jobs in one. Features pre-aligned carbides for quick edge setting, 750 grit interrupted surface diamond sharpener and pre-aligned ceramic sharpeners for sharpening standard and serrated blades. The rods easily store in the base.]]></description>
   <link>http://www.xxxx.com/product.asp?P_ID=424</link>
   <label>Smiths</label>
   <pubDate>Tue, 12 Feb 2008 09:11:48 +0000</pubDate>
  </item>
 
</channel>
</rss>
and the stylesheet
Code: Select all
rss {
display: block;
font-family: verdana, arial;
background-color:#000000;
}
title {
display: block;
margin: 5px;
padding: 2px;
color: gray;
border-bottom: 1px solid silver;
}
link {
display: block;
font-size: small;
padding-left: 10px;
}
item {
display: block;
padding: 2px 30px 2px 30px;
}
docs {
display: block;
background-color: #ffffe6;
margin: 20px;
text-align: center;
padding: 5px;
color: #7f7f7f;
border: 1px solid silver;
}
/* all hidden elements */
language, lastBuildDate, ttl, guid, cataegory, description, pubDate {
display: none;
}
for some reason it wont add the style to the feed am i doing somthing wrong
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Feb 15th, 2008, 16:05
Jack Franklin's Avatar
Moderator

SuperMember
Join Date: May 2007
Location: Cornwall, England
Posts: 1,410
Blog Entries: 8
Thanks: 18
Thanked 14 Times in 14 Posts
Re: Adding a style sheet to an RSS feed problem

Change this line
Code: Select all
<?xml-stylesheet type="text/css" href="rss.css"?>
To this:
Code: Select all
<?xml-stylesheet type="text/css" href="rss.css" ?>
__________________
Jack Franklin - Webforumz Moderator
(x)HTML | CSS | PHP | MySQL | JQuery (Javascript)
Contact: My Blog | Twitter | Delicious
Want Lessons? PM me.
If you think I've helped, please press the 'Thanks' Button.
Last Blog Entry: A Week with VBulletin (Aug 28th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Feb 15th, 2008, 16:16
Up'n'Coming Member
Join Date: Jul 2007
Location: Barry
Age: 22
Posts: 54
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Adding a style sheet to an RSS feed problem

Quote:
Originally Posted by jackfranklin View Post
Change this line
Code: Select all
<?xml-stylesheet type="text/css" href="rss.css"?>
To this:
Code: Select all
<?xml-stylesheet type="text/css" href="rss.css" ?>

nope still not working
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Feb 15th, 2008, 16:18
Jack Franklin's Avatar
Moderator

SuperMember
Join Date: May 2007
Location: Cornwall, England
Posts: 1,410
Blog Entries: 8
Thanks: 18
Thanked 14 Times in 14 Posts
Re: Adding a style sheet to an RSS feed problem

Ok. In the first line you have:
Code: Select all
<?xml version="1.0"?>
Add a space before the '?'

Take a look here: http://creativecoding.webforumz.com/...ips-tricks/#q3
__________________
Jack Franklin - Webforumz Moderator
(x)HTML | CSS | PHP | MySQL | JQuery (Javascript)
Contact: My Blog | Twitter | Delicious
Want Lessons? PM me.
If you think I've helped, please press the 'Thanks' Button.
Last Blog Entry: A Week with VBulletin (Aug 28th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Feb 15th, 2008, 16:25
alexgeek's Avatar
Moderator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,812
Blog Entries: 9
Thanks: 2
Thanked 2 Times in 2 Posts
Re: Adding a style sheet to an RSS feed problem

Are you sure it's picking up the right stylesheet? you could try an absolute link like:
Code: Select all
<?xml-stylesheet type="text/css" href="http://www.example.com/rss.css" ?>
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Feb 19th, 2008, 10:31
Up'n'Coming Member
Join Date: Jul 2007
Location: Barry
Age: 22
Posts: 54
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Adding a style sheet to an RSS feed problem

Quote:
Originally Posted by alexgeek View Post
Are you sure it's picking up the right stylesheet? you could try an absolute link like:
Code: Select all
<?xml-stylesheet type="text/css" href="http://www.example.com/rss.css" ?>

Still a no go, here is a copy of the souce it brings up when i open the feed in IE7


<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:cf="http://www.microsoft.com/schemas/rss/core/2005"><channel xmlns:cfi="http://www.microsoft.com/schemas/rss/core/2005/internal" cfi:lastdownloaderror="None"><title cf:type="text">example - Knives, Pocket Tools and Accessories</title><link>http://www.example.com/</link><item><title xmlns:cf="http://www.microsoft.com/schemas/rss/core/2005" cf:type="text">3 in 1 Sharpening System - Smith's 3-in-1 Sharpening System</title><description xmlns:cf="http://www.microsoft.com/schemas/rss/core/2005" cf:type="html">
&lt;img alt="3 in 1 Sharpening System - Smith's 3-in-1 Sharpening System" hspace=0 src="http://www.example.com/uploads/images_products/424.jpg" align=baseline border=0&gt;&lt;br&gt;The Smith's 3-in-1 Sharpening System is a handy sharpener you can not only take anywhere but will do three jobs in one. Features pre-aligned carbides for quick edge setting, 750 grit interrupted surface diamond sharpener and pre-aligned ceramic sharpeners for sharpening standard and serrated blades. The rods easily store in the base.</description><link>http://www.example.com/product.asp?P_ID=424</link><pubDate>Tue, 12 Feb 2008 09:11:48 GMT</pubDate><atomublished xmlns:atom="http://www.w3.org/2005/Atom">2008-02-12T09:11:48Z</atomublished><atom:updated xmlns:atom="

Last edited by Andrew1986; Feb 19th, 2008 at 10:33.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Why Style sheet isnt working kaz Web Page Design 19 Dec 21st, 2007 01:10
CSS Print Style Sheet Problem bennyboy7 Web Page Design 1 Aug 14th, 2007 08:58
new to css: what's the best way to insert image using the external style sheet? mad samuel Web Page Design 14 Aug 10th, 2007 17:52
How to tell IE7 to use a pariticular style in a single style sheet figo2476 Web Page Design 5 May 25th, 2007 14:23
Linking to an external style sheet ahm531 Web Page Design 6 Aug 31st, 2006 13:23


All times are GMT. The time now is 04:59.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved