implementing XSLT in rss feed

K

krishna.Mundra

HI ,

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

xml.instruct! :xml, :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>
 
Z

Zhe Lee

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top