Forum Moderators: open
I have been working on a script to prooduce a dynamic xml feed and have hit a problem.
My feed is based on a dynamic .cgi page. What I have done is create a page in php to form the bases of the rss feed. then call the .cgi as an include. My php page is renamed to .rss and I has set up the server via .htaccess to render this .rss file as a php page.
The .cgi file is basicaly a template page for a search interface.
The php (rss) page...
<? header('Content-type: text/xml');?>
<?
print "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>";
?>
<Channel>
<title>feed title</title>
<description>info about the feed</description>
<link>www.example.com</link>
<copyright>Copyright all rights reserved</copyright>
<?php
include "http://www.example.com/cgi-bin/rss.cgi?q=$term" ;
?>
</channel>
The .cgi file that is being included in the abouve file is like folows...
<ITEM>
<TITLE><![CDATA[$Title]]></TITLE>
<URL><![CDATA[$url]]></URL>
<DESCRIPTION>
<![CDATA[$Desc]]>
</DESCRIPTION>
</ITEM>
The problem is that the output looks very bad. The cdata commands are removing certain charictors and replacing then with alternative (legal)charictors liek nbsp; etc
Can anyone suggest a suitable alternative to cdata or a workround to help tidy up my feed.
Thank you very much in advance.
Mack.