homepage Welcome to WebmasterWorld Guest from 54.166.10.100
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / RSS, ATOM, and Related Technologies
Forum Library, Charter, Moderators: bill & werty

RSS, ATOM, and Related Technologies Forum

    
Help: Escaping Text/HTML for an RSS Feed
What's the best way to escape Text/HTML using PHP?
hiker_jjw




msg:1541323
 6:47 pm on Mar 5, 2005 (gmt 0)

I've created an RSS 2.0 Feed for a friend of mine using PHP and MySQL. The author writes a ton of articles. I've worked out all the details of creating the feed in PHP, except for escaping characters for XML/RSS.

What's the best way to escape Text/HTML for an RSS 2.0 Feed using PHP? Can RSS descriptions contain HTML?

And... How might I escape out those "Mikrsooft" characters that I know the author will copy into the RSS descriptions?

Thanks in advance,
Jeff

 

hiker_jjw




msg:1541324
 3:39 am on Mar 8, 2005 (gmt 0)

hmmm.... I guess nobody knows... Or is this posted in the wrong forum?

werty




msg:1541325
 4:47 am on Mar 8, 2005 (gmt 0)

I think this is the correct forum, but I do now if anyone knows the answer.

burnsal




msg:1541326
 11:37 am on Mar 8, 2005 (gmt 0)

You do need escape characters in an RSS Feed. You can use The codes that start with &xx; etc. There are only a few you really need to consider ie < >

You can use html in an RSS feed, in my opinion though you should not use them as the feeds will be parsed and the user should decide how to view them.

You can also use cdata[] within your feed, it means all chsracters between the brackets should be shown as literal ie you do not need to use escape characters.

Do a search on google, there is some info out there.

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