Hi,
I would like some guidance, please. I have been trying to implement an XML structure, then it gets parsed through PHP to get the final result. This system wasn’t set by me but someone else, so I am bit lost.
The structure seems fine until these two tags are added
Then I am getting the error: [b]"This page contains the following errors: error on line 1 at column 1: Document is empty Below is a rendering of the page up to the first error." [/b]If I remove these tags, the feed works fine, parses through PHP just fine.This is the structure:
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:msn="http://microsoft.com/msnrss" xmlns:dcterms="http://purl.org/dc/terms/">
<channel><source>Media</source><description>Video feed</description>
<item>
<title>***headline***</title>
<videoItems>
<videoItem>
<media:content url="***videoURL***" type="video/mp4"></media:content>
<videoFiletype>video/mp4</videoFiletype>
<videoDesc>***abstract***</videoDesc>
<videoLang>EN</videoLang>
<videoCover> <media:thumbnail height="650" width="1000" type="image/jpeg" url="***img1***"/></videoCover>
<media:keywords>
<![CDATA[ ***people*** ]]>
</media:keywords>
<videoTags>
<tag>***people***,***location***,***brands***</tag>
</videoTags>
</videoItem>
</videoItems>
<pubDate>***story_publish_ISO***</pubDate>
</item>
</channel>
</rss>
This is the part of PHP which parses the MRSS, where I think is problem:
[php] case ‘mrss’:
foreach ($items as $key => $item) {
$vidFile = $item->vurl;
$vidFilename = $this->rootPath . '/' . $target->filePath . '/' . $vidFile;
if ($this->devMode == true) {
$fileExists = true;
$item->vidfs = 12345;
} else {
$fileExists = file_exists($vidFilename);
if (!$fileExists) {
$this->saveFile($this->sourceHost . '/' . $item->vurl, $vidFilename);
$fileExists = file_exists($vidFilename);
if ($fileExists)
$item->vidfs = filesize($vidFilename);
}
}
if ($fileExists) {
$item->vidfn = 'http://' . $_SERVER['HTTP_HOST'] . $target->fileUrlRoot . '/' . $vidFile;
$data = str_replace($item->find, $item->vidfn, $data);
} else {
$this->errors[] = 'Missing Video ' . $vidFile;
}
}
if (isset($target->processContent)) {
$pc = $target->processContent;
$data = $pc($data);
}
$this->setContent($data);
break;
default:
if ($this->debug)
$this->debugging[] = 'Items Processing for ' . $details->expected . " is missing";
$this->errors[] = 'Items Processing is not configured';
}
return true;
} else {
$this->errors[] = 'Could not find any feed Items';[/php]
I have tried changing the header-type but it doesn’t make any difference either. I would appreciate some help with this.
I have also attached the exact error screenshot.