Not getting image in xml

Hi

I have the following code written to create rss feed using the simplepie xml parser. It is showing all title, description, etc properly. But I also want the media:thumbnail to be seen in the xml feed.

<?php
require_once(‘php/newsblocks.inc.php’);
header(‘Content-type:text/html; charset=utf-8’);
?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=“http://www.w3.org/1999/xhtml” xml:lang=“en-US” lang=“en-US”>
<head>
<title>Mash of feeds</title>
<?
require(“simplepie/simplepie.inc”);
require_once(‘simplepie/shorten.inc’);
?>
</head>
<body>

<?php
$feed = new SimplePie();
$feed->set_feed_url(‘http://www.example.com/feed/’);
$feed->enable_cache(true);
$feed->set_cache_duration(3600);
$feed->set_cache_location(‘cache’);
$feed->init();
$feed->handle_content_type();

// code to to get xml

$file= fopen("results.xml", "w");
$_xml ="&lt;?xml version=\\"1.0\\" encoding=\\"UTF-8\\" ?&gt;\\r\

";

$_xml .="&lt;rss version='2.0' xmlns:blogChannel='http://backend.userland.com/blogChannelModule' xmlns:dc='http://purl.org/dc/elements/1.1/'

xmlns:content=‘http://purl.org/rss/1.0/modules/content/’ xmlns:atom=‘http://www.w3.org/2005/Atom’ xmlns:media=‘http://search.yahoo.com/mrss/’>";

$_xml .="&lt;channel&gt;\\r\

";

$_xml .="&lt;title&gt;Blogs&lt;/title&gt;";
$_xml .="&lt;link&gt;http://www.example.com&lt;/link&gt;";
$_xml .="&lt;description&gt;Latest updates of bollywood blogs&lt;/description&gt;";

$_xml .="&lt;atom:link href='results.xml' rel='self' type='application/rss+xml' /&gt;";

// code to get xml ends

foreach ($feed->get_items(0,3) as $item)
{
//echo $item->get_title();
//echo “<br />”;

$_xml .="\	&lt;item&gt;\\r\

“;
$_xml .=”\ \ <link>" . $item->get_permalink() . “</link>\r
“;
$_xml .=”\ \ <description>” . shorten($item->get_content(),50) . “</description>\r
“;
$_xml .=”\ \ <title>” . $item->get_title() . “</title>\r
“;
$_xml .=”<dc:date>” . $item->get_date(‘Y-m-d’) . “</dc:date>”;
$_xml .=“<guid isPermaLink=‘false’>” . $item->get_title() . “</guid>”;
$_xml .=“<media:group><media:thumbnail url=‘http://www.example.com/example.jpg’ type=‘image/jpeg’ width=‘126’ height=‘126’ /><media:title> FeedForAll file sample </media:title></media:group>”;
$_xml .="\ </item>\r
";

} // main for each item ends

$_xml .="&lt;/channel&gt;";

$_xml .="&lt;/rss&gt;";

fwrite($file, $_xml);

fclose($file);
echo "XML has been written.  &lt;a href=\\"results.xml\\"&gt;View the XML.&lt;/a&gt;";

?>
</body>
</html>

If I try parsing the xml through simplepie again it shows the image as a podcast. Instead of that I want that image to be seen in the xml. Please tell me if I am doing it the right way or not? And if not what is the right way to do it.

Thanks

Sounds like a bug in the SimplePie() API. Tell its developers about it.