Jump to content

Convert RSS feed that is in HTML to XHTML


MrBiggZ

Recommended Posts

Greetings!

 

I did some searching on this and really didn't find anything.  I'm really surprised nobody has gone in this territory.

 

Here's my plight.  I include some RSS feed(s) on a side bar of my website.  I've been using the XHTML Transitional doc type.  The code on my pages (to the best of my ability) is adhering to the XHTML Trans doc type.  There are some feeds that I use that are not in XHTML but are in HTML.  Thus making the validator fail.  :(  The other crazy thing I'm getting is where the vaildator is running into URL's that have &'s in them and it needs them in internet way (don't have the errors in front of me and it's the best I can describe it).  I think the & is ;amp .. pretty sure.

 

Is there a way to run script again the converted RSS feed once it's pulled in and correct the HTML code so it then valid XHTML? 

 

I appreciate the help .. really do.  Just terribly terribly lost!  :o

Well, this is probably Regex territory.

You need to determine what particular things are html. Maybe there is a set of 4 that do that.

 

for & and other misc html things like that you can try the htmlentities function.

 

With regular expressions you can find a string with a <br> tag and change it to <br /> and any other things of that nature.

 

On another note - while it is good to follow coding practices (W3C recommendations) you shouldn't worry too much about it - 99% of your users don't know, care, etc. (This comes from someone who uses XHTML 1.1  (strict))

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.