The Artima Developer Community
Sponsored Link

Java Buzz Forum
Neat RSS + XSL Trick

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Russell Beattie

Posts: 727
Nickname: rbeattie
Registered: Aug, 2003

Russell Beattie is a Mobile Internet Developer
Neat RSS + XSL Trick Posted: Sep 18, 2003 4:55 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Russell Beattie.
Original Post: Neat RSS + XSL Trick
Feed Title: Russell Beattie Notebook
Feed URL: http://www.russellbeattie.com/notebook/rss.jsp?q=java,code,mobile
Feed Description: My online notebook with thoughts, comments, links and more.
Latest Java Buzz Posts
Latest Java Buzz Posts by Russell Beattie
Latest Posts From Russell Beattie Notebook

Advertisement
I'm such a dork sometimes. You'd figure with all the time I'm spending on XML lately, I would have thought of this myself, but I hadn't. What I'm talking about is putting an XSL Stylesheet header in your RSS documents so that when a browser like Moz or IE6 sees it, it'll render the XML instead of dumping raw tags in case you click on it.

I got this from Rafe's All About Symbian New Series 60 App Feed which shows the latest S60 applications that appear on Handango. When I clicked on it from a chat window, it rendered as readable in my browser and I was like "Huh? How'd that happen?" And was thinking embedded HTML (duh) and it took seriously, less than a second for me to think "No HTML, must be a stylesheet..." and poof there it was right at the top. I don't know why I hadn't thought about doing that to RSS feeds before! Neato!

It's as simple as hell to do, just add a XSL declaration after your initial XML header like:

<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="http://www.allaboutsymbian.com/rss/rss2html.xsl"?>

If you're using a decent browser, it'll pick up the XSL and format it accordingly. This is *very* cool. Having links on pages to RSS for those who have no idea what RSS is, is a real user-unfriendly thing to do. The monkies don't like when they click on links and receive a boatload of XML in their face.

Rafe claims he copied it from somewhere else, and I'll be copying it from him, so no biggie. Nice find Rafe!

-Russ

Comment

Read: Neat RSS + XSL Trick

Topic: The Bile - Hani finds his true voice Previous Topic   Next Topic Topic: Where .NET is (much) worse then Java

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use