Hands up who agree XHTML 1.0 is the standard for today?

Really Mr Gates? You don't think so?

Internet explorer 5.5 came with a nice feature CONTENTEDITABLE which is easier to implement that it's DHTML counter part I give Microsoft that.

But somewhere, somehow, Microsoft screwed up, by not makeing CONTENTEDITABLE xhtml complient. They decided to obscurly make all the html tags captilized ie <B><P><A><FONT> etc what makes this worse is not putting quotes around atributes ie <P ALIGN=left>.

Ok enough with my frustration, I need some help, I need to make the misguided non (x)html garbage that comes from a CONTENTEDITABLE div into neat and tidy w3c XHTML. Does anyone know of a script that does this?

    Actually, I would suggest NOT using XHTML until the browsers fully support it, which they don't currently (Neither does php, look at the output that comes from highlight_string()). Really, there's no reason to jump straight into using XHTML, if you really want to just use Style Sheets, you can in HTML 4.01, but still allow for proprietry crap like contenteditable. Sure, it looks cool to have the little w3 XHTML verification image on your site, but apart from that the browsers aren't really noticing a difference.

    Anyway, about the script, I think it's going to be a matter of a few regular expressions to do what you want. Find out the tags the MS is using, and create regex's (PCRE would be better, because this will be SLOW anyway), and use preg_replace to fix them all up. AFAIK there isn't a script out there that will do that 😉

      Thanks, though there is no difference in browser compatability for XHTML. XHTML is simply a cleaner neater way of codeing. (You open a door, you close the door (you open a tag, you close the tag).

      XHTML is simply a format of codeing, rather than a codeing alternative, it's always been available, just some of us have been lazy and taken advantage of the forgivingness html offers.

      Besides that I have a client who is anal about makeing sure their website is XHTML complient. 😃

        Sorry, you're right, there is no difference for XHTML 1.0, however XHTML 1.1 does have compatibility issues 😉 I've gotta learn to read these bloody posts properly 😉

          Actually, there are a few subtle differences between html 4.01 and xhtml 1.0.
          http://www.w3.org/TR/xhtml1/#guidelines

          Some of them like the <br /> issue can bite you. I do try to code to at least xhtml 1.0. Running a page through a validator can catch quite a few errors where a page looks right in browser but is completely messed up in another.

          The lack of consistent CSS2 support in even the latest browsers is precludes using xhtml 1.1 let alone 2.0. Quite sad.

            Write a Reply...