I've been struggling with this error all evening and have not gotten any closer to fixing the problem, but I have made a couple of very odd discoveries that make absolutely no sense to me.
Here is the loop that is generating the XML doc
PHP Code:
while($feed_jobs->have_posts()) : $feed_jobs->the_post();
$b = $doc->createElement( "job" );
$title = $doc->createElement("title");
$title->appendChild($doc->createCDATASection( $post->post_title));
$b->appendChild( $title );
$company_name = "Sample Company Name";
$company = $doc->createElement("company");
$company->appendChild($doc->createCDATASection($company_name));
$b->appendChild($company);
$date = $doc->createElement("date");
$date->appendChild($doc->createCDATASection($post->post_date));
$b->appendChild($date);
$referencenumber = $doc->createElement("referencenumber");
$referencenumber->appendChild($doc->createCDATASection($post->ID));
$b->appendChild($referencenumber);
$url = $doc->createElement("url");
$url->appendChild($doc->createCDATASection($post->guid));
$b->appendChild($url);
$description = $doc->createElement("description");
$description = createCDATASection($post->post_content);
$description->appendChild($description);
$b->appendChild($description);
//query postmeta table for city and state// then parse it into an array
$location = get_post_meta($post->ID,'geo_address',true);
$location = explode(',',$location);
$city = $doc->createElement("city");
$city->appendChild($doc->createCDATASection($location[0]));
$b->appendChild($city);
$state = $doc->createElement("state");
$state->appendChild($doc->createCDATASection($location[1]));
$b->appendChild($state);
$r->appendChild( $b );
endwhile;
I've noticed that if I remove the "url" and "description" nodes the feed generates correctly. Similarly, if I remove "company_name", "date", and "description", I can leave the "url" node in and everything will again function properly.
Any help would be greatly appreciated. This is a very critical problem for my business.
Bookmarks