WordPress.org

Ideas

Use HTML doctype NOT XHTML

  1. John Kilroy
    Member

    12345

    I know the current fad is to serve web pages using XHTML doctype, but this is, in almost all situations, wrong. OK, count to ten, and read on.

    Unless you are going to serve your pages with a mime-type of application/xml (which virtually nobody does), and therefore make your pages innaccessible to the 65% of your viewers who use Microsoft browsers - you should NOT use the XHTML doctype.

    I do sympathise with the WordPress developers, who've clearly gone to a lot of effort to provide output that validates using the W3C HTML validator. However, whilst admirable it is, nevertheless, a mistake, and if WordPress is really interested in standards and valid markup they should head back to HTML - awaiting the release of HTML 5 (the likely successor to HTML 4.01).

    This is a rather technical issue and to explain it fully needs more detail than I can afford here. However, there are some clear explanations of the major issues here:
    http://webkit.org/blog/68/understanding-html-xml-and-xhtml

    and a more technical discussion here:
    http://www.hixie.ch/advocacy/xhtml

    Please either revert back to HTML as the default, provide the option to select it in the Dashboard, or write a plugin that will translate back to HTML (thereby allowing WordPress to serve valid markup).

    Posted: 7 years ago #
  2. migol
    Member

    12345

    I don't think this is a good idea to remove XHTML Strict from WordPress. It is a new standard and have to get in place. But I don't mind if there will be a choice.

    Posted: 7 years ago #
  3. nickohrn
    Member

    12345

    I understand what you're saying, John, and I understand the issue, but I don't think this should take precedence over some of the other features WordPress needs.

    Posted: 7 years ago #
  4. Just switch the doctype in your theme and then write dozen line plugin to str_replace( ' />', '>', $content ) via ob_start() and such.

    XHTML is the latest standard and we should stick with it IMO.

    Posted: 7 years ago #
  5. John Kilroy
    Member

    12345

    With due respect guys, I believe that producing standards compliant (or at least error-free) code is vital for any website or web publishing platform. It increases accessibility, usability and portability.

    XHTML is not the "standard" most people believe it is, and I almost guarantee that noone who uses wordpress actually serves their blog using Mime Type: "Application/XML". In which case, NOBODY, is serving valid markup!!! (read my links above)

    In terms of it being the "latest" standard - you should look at the facts. Work started on it nearly 10 years ago, it has remained stagnant (no W3C progress made whatsoever) for eight years - this for what was always intended to be a transitional format between HTML and XML, back in the days when everyone thought that we'd all be using pure XML by 2008.

    XHTML is a dead duck. It is not a living technology and will soon be replaced not by XHTML 2.0, but by HTML 5.

    Sticking with it is both technically wrong, problematic, and at best, simply a fad.

    Honestly, read the links above then decide.

    Posted: 7 years ago #
  6. subone
    Member

    I added this page to StumbleUpon:

    I completely agree and I am trying to get mine to use HTML strict atm. The problem here isn't whether they want to use XHTML or HTML; the problem resides with the fact that no code that is output should be generated outside of what's in the theme files. Even though my theme uses only HTML and serves with the HTML strict doctype, WordPress still puts XHTML in there.

    Posted: 6 years ago #
  7. netcomstudios
    Member

    12345

    I really wish WordPress would use the HTML Strict doctype instead of XHTML. XHTML isn't necessary most of the time.

    Posted: 6 years ago #
  8. Steven Vachon
    Member

    HTML 5 is probably a dead duck too.

    Honestly, I like XHTML. I don't really mind that it's only 99% there due to the mime type. The main thing for me is that it is valid XML (with regards to properly closed tags) and can be parsed as such if need be.

    Posted: 5 years ago #
  9. Covi
    Member

    12345

    XML is still the future: clear, useful, portable... The problem is not if your site have errors in XML, the problem is a non valid markup powered by years making not standars webs.
    I think... in a full world of applications in XML, HTML -even v5- is absolutely lost and deprecated.

    Example: If you write XHTML code, it's XML, you can apply Javascript, server processes (I mean standard processes or natively, parsers, etc), XSLT, XPath, XLink, XPointer, XInclude... SVG... pfff.
    You have nothing using HTML! ^^

    Posted: 5 years ago #
  10. briansage
    Member

    12345

    I agree with John. XHTML compliance is faddish, and unnecessary without Mime Type: "Application/XML".

    Without the application mime type, XHTML practically is HTML strict -- it's simply a different set of strict syntax.

    Thanks to the Google devs, HTML5 is picking up a lot of steam again (e.g., Google Wave). I'd prefer it if we could start tagging our HTML 4.01 properly in the mean time.

    Posted: 5 years ago #

RSS feed for this topic

Reply »

You must log in to post.

  • Rating

    12345
    25 Votes
  • Status

    This is theme territory