homepage Welcome to WebmasterWorld Guest from 54.225.57.156
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / RSS, ATOM, and Related Technologies
Forum Library, Charter, Moderators: bill & werty

RSS, ATOM, and Related Technologies Forum

    
Problem with xml and charictors
escaping problems.
mack




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

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\"?>";
?>
<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.

 

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / RSS, ATOM, and Related Technologies
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved