PDA

View Full Version : [PHP] Dynamicly tidy HTML to XHTML (without php tidy ext.)



koorb
January 26th, 2005, 05:59 PM
Ok so I thought this would be dead easy quick google, but I cant seem to find anything.

Basicly I want to convert a string (document) of HTML into valid XHTML including styles rather than <font> etc. Thing is I want to do it dynamicly with PHP, I have seen the tidy extention for php, but it's not really practical for my application (I want it to be easy to install - independant of extentions) .

I am using http://tinymce.moxiecode.com/ which in itself seems a tidy editor but doen't produce valid XHTML. I just wanted a php class to do this for me and I dont have time to write my own!

Anyone know of anything ?

Thanks much.

b0b0
January 27th, 2005, 06:41 AM
hmm.. i made this litte app. in java (for a school project) that fixes some small things to valid xhtml. just paste (or open file) your code to the app press the fixit button (doctor)
and it tidys it up. It also fixes <br/> to <br /> can't remember what more it does.. it's a bit buggy, but please try it out!

www.robertvs.1go.dk/xhtml_magic.zip

koorb
January 27th, 2005, 10:54 AM
thanks b0b0 I will have a look at that!