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

Link to comment
Share on other sites

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))

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.