Web Design and Development Forums

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 XML, RSS & Atom section. This forum, and the thread "Adding a style sheet to an RSS feed problem are both part of the Program Your Website category.


Go Back   Webforumz.com > Program Your Website > XML, RSS & Atom

Welcome to Webforumz.com.
Register Now Register now!

Reply
 
LinkBack Thread Tools Rate Thread
Old Feb 15th, 2008, 15:53   #1 (permalink)
Up'n'Coming Member
 
Join Date: Jul 2007
Location: Barry
Age: 22
Posts: 53
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
Andrew1986 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Feb 15th, 2008, 16:05   #2 (permalink)
Section Manager - WOTM
Assistant Editor - LZ
 
Jack Franklin's Avatar
 
Join Date: May 2007
Location: Cornwall, England
Posts: 1,102
Blog Entries: 5
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" ?>
__________________
Section Manager (WOTM)

My Weblog & E-Portfolio
Catch me daily on: Twitter | Digg | Flickr
Jack Franklin is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Feb 15th, 2008, 16:16   #3 (permalink)
Up'n'Coming Member
 
Join Date: Jul 2007
Location: Barry
Age: 22
Posts: 53
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
Andrew1986 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Feb 15th, 2008, 16:18   #4 (permalink)
Section Manager - WOTM
Assistant Editor - LZ
 
Jack Franklin's Avatar
 
Join Date: May 2007
Location: Cornwall, England
Posts: 1,102
Blog Entries: 5
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
__________________
Section Manager (WOTM)

My Weblog & E-Portfolio
Catch me daily on: Twitter | Digg | Flickr
Jack Franklin is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Feb 15th, 2008, 16:25   #5 (permalink)
Administrator
 
alexgeek's Avatar
 
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 4,102
Blog Entries: 9
Send a message via MSN to alexgeek
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" ?>
__________________
Languages: PHP, mySQL (queries), C#, (X)html, CSS, JS.


alexgeek is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Feb 19th, 2008, 10:31   #6 (permalink)
Up'n'Coming Member
 
Join Date: Jul 2007
Location: Barry
Age: 22
Posts: 53
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.
Andrew1986 is offline  
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
Rate This Thread
Rate This Thread:

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 CSS Forum 19 Dec 21st, 2007 01:10
CSS Print Style Sheet Problem bennyboy7 CSS Forum 1 Aug 14th, 2007 08:58
new to css: what's the best way to insert image using the external style sheet? mad samuel CSS Forum 14 Aug 10th, 2007 17:52
How to tell IE7 to use a pariticular style in a single style sheet figo2476 CSS Forum 5 May 25th, 2007 14:23
Linking to an external style sheet ahm531 CSS Forum 6 Aug 31st, 2006 13:23



Latest Updates

All Points SEO Security Advisory - CHECK YOUR SITE NOW!

Creative Coding :: February 2008

Webforumz is sponsored by: WESH UK Web Hosting
All times are GMT. The time now is 21:46.

Sleep Study Scoring :: Free Bet :: Website Templates :: Online Betting :: Bookmakers :: Funny Quotes :: Internet Recruitment Software :: Microsoft CRM Experts :: Online Casino :: Decorated Christmas Trees :: Midwife Forums :: Football Betting :: Ecommerce Software :: Web Hosting :: Football Stats :: Dry Cleaning Collection :: xtreme wales - extreme clothing :: Apuestas :: Sharepoint Consultants :: Website Optimisation :: Office Clearance London :: Sharepoint Experts :: Sports Betting :: Casino :: Website Templates :: Web Design Development India :: Online Gambling

Powered by: vBulletin Version 3.7, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
© 2003-2008 Webforumz.com : All Rights Reserved
Search Engine Friendly URLs by vBSEO 3.2.0 RC6


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59