# Can't get my rss to validate with feedtools

**URL:** <https://www.ruby-forum.com/t/cant-get-my-rss-to-validate-with-feedtools/84290>\
**Category:** Rails\
**Created:** [March 20, 2006, 7:31pm UTC](https://www.ruby-forum.com/t/cant-get-my-rss-to-validate-with-feedtools/84290 "2006-03-20T19:31:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![beachguy82](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/9dc877/32.png) [@beachguy82](https://www.ruby-forum.com/u/beachguy82)\
**Post date:** [March 20, 2006, 7:31pm UTC](https://www.ruby-forum.com/t/cant-get-my-rss-to-validate-with-feedtools/84290/1 "2006-03-20T19:31:42Z")

</div>

I know that I’m doing something wrong, but I can’t figure out what.  
I’ve looked at every wiki and tutorial I can find on feedtools but I  
still can’t get my rss feed working. Here’s my code.

feed = FeedTools::Feed.new

feed.entries \<\< FeedTools::FeedItem.new

feed.entries[0].author.name = “Charlie B.”  
feed.entries[0].title = @post.title  
feed.entries[0].link = “[http://server:3000/pragmatic/](http://server:3000/pragmatic/)”  
feed.entries[0].content = @post.post

# Assumes this is inside a .rxml file

feed.entries[0].build\_xml(“rss”, 2.0,xml)

Here’s what the validator tells me. Thanks for any input!

This feed does not validate.

```
*

  line 1, column 0: Undefined root element: item [help]

      <item>

*

  line 4, column 2: XML parsing error: <unknown>:4:2: unbound prefix 

```

[help]

```
        <dc:creator>Charlie B.</dc:creator>
        ^

```

Source: [http://server:3000/pragmatic/rss](http://server:3000/pragmatic/rss)

1. 
2. er
3. http://server:3000/pragmatic/
4. dc:creatorCharlie B.\</dc:creator\>
5. content:encoded
6. gdf

7. \</content:encoded\>
8. Mon, 20 Mar 2006 18:52:17 -0000
9. [http://server:3000/pragmatic/](http://server:3000/pragmatic/)
10. 
11. 

Home Â· About Â· News Â· Docs

---

<div class="post-metadata">

**Author:** ![beachguy82](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/9dc877/32.png) [@beachguy82](https://www.ruby-forum.com/u/beachguy82)\
**Post date:** [March 21, 2006, 4:37am UTC](https://www.ruby-forum.com/t/cant-get-my-rss-to-validate-with-feedtools/84290/2 "2006-03-21T04:37:38Z")

</div>

On Monday 20 Mar 2006 18:31, charlie bowman wrote:

> I know that I’m doing something wrong, but I can’t figure out what.  
> I’ve looked at every wiki and tutorial I can find on feedtools but I  
> still can’t get my rss feed working. Here’s my code.

Surely you need to add the XML prolog and say what RSS version you’re  
using  
and so on? See:  
[http://searchenginewatch.com/sereport/article.php/2175271](http://searchenginewatch.com/sereport/article.php/2175271)

For example, your output code needs to be something more like:

\<?xml version="1.0" ?\> My funky RSS feed If it's happening, you'll find it here! http://www.mysite.com Â er Â http://server:3000/pragmatic/ Â Charlie B. Â Â Â \<![CDATA[

gdf

]]\> Â Â Mon, 20 Mar 2006 18:52:17 -0000 Â http://server:3000/pragmatic/ 

Hmm… actually, I hadn’t found FeedTools yet (until right this second).  
Anyway, from the tutorial at:

[http://sporkmonger.com/articles/2005/08/11/tutorial/](http://sporkmonger.com/articles/2005/08/11/tutorial/)

… looks like you need to call something in your view like:

@feed.build\_xml((@feed\_type or “atom”), 0.0, xml)

Are you doing that? From the source you posted, it basically looks like  
you  
aren’t turning it into a proper XML document, which should hopefully  
explain  
why it won’t validate, since you’re only generating half of it.

Any help?

~Dave

–

Dave S.  
Rent-A-Monkey Website Development

> **[Tree Removal Service For Home & Businesses in Salt Lake City, UT](https://www.rentamonkey.com/)**
>
> Rent A Monkey Tree Service provides the safest, highest-quality tree removal for Salt Lake City, UT homes and businesses. Request a service today!

PGP Key: [http://www.rentamonkey.com/pgpkey.asc](http://www.rentamonkey.com/pgpkey.asc)

---

<div class="post-metadata">

**Author:** ![beachguy82](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/9dc877/32.png) [@beachguy82](https://www.ruby-forum.com/u/beachguy82)\
**Post date:** [March 21, 2006, 2:40pm UTC](https://www.ruby-forum.com/t/cant-get-my-rss-to-validate-with-feedtools/84290/3 "2006-03-21T14:40:00Z")

</div>

Actually, I gave up on feedtools and decided just to write some xml. I  
tried to follow sporkmongers tutorial for creating a feed but couldn’t  
get it to work.

On Tue, 2006-03-21 at 03:37 +0000, Dave S. wrote:

> \<?xml version="1.0" ?\>
> 
> ```
> <![CDATA[<p>gdf</p>]]>
> 
> ```
> 
> Any help?
> 
> ~Dave

Charlie B.  
Programmer  
Castle Branch Inc.

---

<div class="post-metadata">

**Author:** ![beachguy82](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/9dc877/32.png) [@beachguy82](https://www.ruby-forum.com/u/beachguy82)\
**Post date:** [July 10, 2006, 9:40pm UTC](https://www.ruby-forum.com/t/cant-get-my-rss-to-validate-with-feedtools/84290/4 "2006-07-10T21:40:01Z")

</div>

> feed.entries[0].link = “[http://server:3000/pragmatic/](http://server:3000/pragmatic/)”  
> feed.entries[0].content = @post.post
> 
> # Assumes this is inside a .rxml file
> 
> feed.entries[0].build\_xml(“rss”, 2.0,xml)

Sorry for digging up this old post, but I only just saw it. Mea culpa.

Simple fix:

You’re building the XML for the feed item. You need to build the XML  
for the feed itself:

feed.build\_xml(“rss”, 2.0, xml)

## Cheers, Bob A.

AIM: sporkmonger  
Jabber: removed\_email\_address@domain.invalid
