homepage Welcome to WebmasterWorld Guest from 54.227.41.242
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / RSS, ATOM, and Related Technologies
Forum Library, Charter, Moderators: bill & werty

RSS, ATOM, and Related Technologies Forum

    
Styling with two stylesheets
XSL and CSS together?
R1chard




msg:3282162
 9:53 pm on Mar 14, 2007 (gmt 0)

OK, I have recently set up an RSS feed, and the xml has the following line:

<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="newstyle.xsl"?>

So far, so good, I'm able to style it myself in terms of item sorting, link layout and bg colors when somebody browses the page directly. However, I would also like to link our CSS stylesheet to style the appearance of H1 and link hovers. But when I add a <link> in the XML to the CSS, nothing seems to happen (both normally and using the xml stylesheet format above). I then tried putting the <link> in the XSL <head>, but this didn't work either. No errors, just no styling.

I presume this must be possible, so am I doing something wrong?

Thanks for any help.

 

bill




msg:3283346
 1:42 am on Mar 16, 2007 (gmt 0)

Something like this should work:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.example.com/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.example.com/itemcontent.css" type="text/css" media="screen"?>

R1chard




msg:3283613
 10:14 am on Mar 16, 2007 (gmt 0)

Thanks for your input Bill.

In the end, I solved it myself - I was keen to link the stylesheet from the xsl rather than the xml, if possible, since I guess that should save bandwidth for me and the users because it will be called less often (ie in a dedicated newsreader it displays the feed in a different way).

Anyway, as far as I can tell, the problem was to do with case sensitivity differences between xml and css. When I changed my css to make it all lower case, it all worked. I had been using "A:hover" before, which was ok for html but not for this.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / RSS, ATOM, and Related Technologies
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved