Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > implementing XSLT in rss feed

Reply
Thread Tools

implementing XSLT in rss feed

 
 
krishna.Mundra
Guest
Posts: n/a
 
      01-30-2007
HI ,

Can anyone help me in implementing rss feed with stylesheet of user's
choice....

xml.instruct! ml, :version=>"1.0"
xml.foods{
for food in @foods
xml.food do
xml.id(food.id)
xml.calroies(food.calories)
xml.description(food.description)
xml.short_description(food.short_description)

for portion in food.portions
xml.portion do
xml.grams(portion.grams)
xml.amount(portion.amount)
xml.serving(portion.serving)
end
end
end
end
}

the above code generates rss like this
<?xml version="1.0" encoding="UTF-8" ?>
<foods>
<food>
<id>9193</id>
<calroies>115</calroies>
<description>Olives, ripe, canned (small-extra large)</description>
<short_description>Olives,Ripe,Cnd (Small-Extra
Lrg)</short_description>

<portion>
<grams>8.4</grams>
<amount>1.0</amount>
<serving>tbsp</serving>
</portion>
 
Reply With Quote
 
 
 
 
Zhe Lee
Guest
Posts: n/a
 
      04-06-2007
> but i want to include the root tag of XSL sheet in the generated rss
> <?xml-stylesheet type="text/xsl" href="cdcatalog.xsl"?>
>
> can anyone help me in this....



xml.instruct! 'xml-stylesheet', :type => "text/xsl", :href =>
"cdcatalog.xsl"


will work


zhelee

--
Posted via http://www.ruby-forum.com/.

 
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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Two ways to generate RSS - rss/maker and rss/2.0 - which is better? Jonathan Groll Ruby 1 06-27-2009 03:53 AM
How do you get feed discovery to work? I go to web pages I know has feeds, but the feed discovery button is disabled. Help! Tim Bryant Computer Support 1 02-13-2007 05:01 AM
Post RSS feed w/o RSS-to-Javascript.com Scott Gordo HTML 5 08-29-2006 01:34 AM
RSS Feed - need an Idiot's Guide to RSS News on my website teach_me6@hotmail.com HTML 5 02-25-2005 11:01 AM
Searches in multiple RSS feeds -> new rss feed Motta XML 1 06-09-2004 10:55 PM



Advertisments