Below is the code i am using to create a video list of my movies. for some reason i cant get the media:content to work.
This is what I have now
$xml_output .= "\t<media:content url='" . $row['name'].".m4v" . " type='video/mpg' />\n";
Here is the whole thing
$xml_output = "<?xml version=\"1.0\"?>\n";
$xml_output .= "<channel>\n";
$xml_output .= "\t\t<title>Ellucid Movies</title>\n";
$xml_output .= "\t\t<link>http://google.com</link>\n";
for($x = 0 ; $x < mysql_num_rows($resultID) ; $x++){
$row = mysql_fetch_assoc($resultID);
$xml_output .= "\t<item>\n";
$xml_output .= "<title>" . $row['name'] .".m4v" . "</title>\n";
$xml_output .= "<link>" . $row['link'] . "</link>\n";
$xml_output .= "\t<media:content url='" . $row['name'].".m4v" . " type='video/mpg' />\n";
$xml_output .= "\t</item>\n";
}
$xml_output .= "</channel>";
echo $xml_output;
when i comment out the media content the xml works as expected… when i add the media it does nothing.
You are adding a namespaced element
but did not declare the namespace anywhere. Add
to your root element.
Also see my answer to Assigning xml generated by a while loop to a variable on how to use DOM for generating XML with DOM.