Welcome to WebmasterWorld Guest from

Forum Moderators: bill & werty

Message Too Old, No Replies

Problem with xml and charictors

escaping problems.

5:13 am on May 18, 2005 (gmt 0)

Moderator from GB 

WebmasterWorld Administrator mack is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:June 15, 2001
votes: 37

Hi all,

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\"?>";
<title>feed title</title>
<description>info about the feed</description>
<copyright>Copyright all rights reserved</copyright>
include "http://www.example.com/cgi-bin/rss.cgi?q=$term" ;

The .cgi file that is being included in the abouve file is like folows...


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.



Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members