# Implementing XSLT in rss feed

**URL:** <https://www.ruby-forum.com/t/implementing-xslt-in-rss-feed/83857>\
**Category:** Ruby\
**Created:** [January 30, 2007, 8:36am UTC](https://www.ruby-forum.com/t/implementing-xslt-in-rss-feed/83857 "2007-01-30T08:36:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![krishna.Mundra](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/ac8455/32.png) [@krishna.Mundra](https://www.ruby-forum.com/u/krishna.Mundra)\
**Post date:** [January 30, 2007, 8:36am UTC](https://www.ruby-forum.com/t/implementing-xslt-in-rss-feed/83857/1 "2007-01-30T08:36:55Z")

</div>

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" ?\> 9193 115 Olives, ripe, canned (small-extra large) Olives,Ripe,Cnd (Small-Extra Lrg) 8.4 1.0 tbsp . . . . 

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…

thanks for ur ideas…

regards  
krishna

---

<div class="post-metadata">

**Author:** ![krishna.Mundra](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/ac8455/32.png) [@krishna.Mundra](https://www.ruby-forum.com/u/krishna.Mundra)\
**Post date:** [April 6, 2007, 8:11am UTC](https://www.ruby-forum.com/t/implementing-xslt-in-rss-feed/83857/2 "2007-04-06T08:11:51Z")

</div>

> 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
