Not signed in (Sign In)

SkillShare - A place to discuss Web Standards and Web Design topics

Categories

Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthormariachi77
    • CommentTimeDec 15th 2005
     permalink
    Does anyone have any thoughts on Doctype? I originally read that it was better to start using XHTML because of future compatibility, device independence, etc. Then I read that feeding an XHTML document with a "text/html" charset was harmful, or at least would be interpreted as "tag soup" by IE. So, now I use HTML4.01 Strict as a default doctype.

    At this point, is there really any advantage to using XHTML (Transitional or Strict) over HTML 4.01 Strict? If so, how are you feeding your XHTML documents? Are you using browser-sniffing to dynamically determine doctype and charset? Is it worth it?

    Any thoughts on this would be great.

    Cheers,

    Mike
    • CommentAuthorffreak
    • CommentTimeDec 16th 2005
     permalink
    As long as you can't figure out a point to use xhtml you obviously don't need it.
    But if you write good code that follows most of xml rules, then why not use xhtml (but NOT xhtml1.1 of course)? You probably won't benefit from this right now, but you get used to it.
    •  
      CommentAuthornifkin
    • CommentTimeDec 16th 2005
     permalink
    Then I read that feeding an XHTML document with a "text/html" charset was harmful, or at least would be interpreted as "tag soup" by IE.

    Well, 1- everything gets interpreted as tag soup in IE right now anyway, I believe.

    And 2- only the XHTML1.1 spec specifies that it needs to be sent as content-type application+xml/xhtml anyway. XHTML 1.0 transitional and strict are both perfectly valid when sent as text/html.

    That said my personal site is XHTML1.1 and uses a combination of browser sniffing through .htaccess and PHP to serve acceptable content-types to appropriate browsers. (More info is over here: Hacks.Oreilly.com: Fix Web Servers to Support Firefox Content and I use the Content-Negotiation plugin to achieve the same results with wordpress.)
    • CommentAuthormariachi77
    • CommentTimeDec 16th 2005
     permalink
    ffreak -- exactly, I honestly don't know if there are any benefits at this point

    nifkin -- thanks for the link, I will look into it
    • CommentAuthoreightface
    • CommentTimeDec 16th 2005
     permalink
    The more important choice in terms of doctype is going with a strict variant over the transitional variety, mostly because you should have better treatment in rendering engines across browsers (in theory). 24 Ways has a good article up that covers the topic, Transitional vs Strict Markup.
    • CommentAuthorWevah
    • CommentTimeDec 17th 2005 edited
     permalink
    only the XHTML1.1 spec specifies that it needs to be sent as content-type application+xml/xhtml anyway.

    application/xhtml+xml, sir.

    ;)
    •  
      CommentAuthornifkin
    • CommentTimeDec 17th 2005
     permalink
    heh, i was ALMOST right. :P
  1.  permalink
    I agree that it's the "Strict" that matters more than anything. It is my understanding that transitional doctypes are rendered in quirks mode in IE. I have better luck getting CSS to render properly across platforms with a strict doctype, therefor it's always XHTML 1.0 Strict for me.
    • CommentAuthorffreak
    • CommentTimeDec 17th 2005
     permalink
    1. It is not totally forbidden to send XHTML 1.1 documents as text/html. xhtml specification says that xhtml1.1 _SHOULD NOT_ be send with 'text/html', and "should not" according to rfc2119 mean "not recommended", "there may exist valid reasons in particular circumstances when the particular behavior is acceptable or even useful, but the full implications should be understood and the case carefully weighed before implementing any behavior described with this label".

    2. XHTML code served as 'text/html' _is not_ XHTML - it is (malformed!) HTML.

    3. I do not see the point in browser sniffing just for setting doctype and content-type if document is full functional as 'text/html'. Can this be useful?
    • CommentAuthormariachi77
    • CommentTimeDec 19th 2005
     permalink
    Thanks for all the feedback -- but no one has produced a reason for why they use XHTML.

    What would be the advantage of serving XHTML Strict documents? Are they read by more devices (ie: PDAs, smartphones, mobile phones)? What advantages do they offer over HTML 4.01 Strict documents?

    If I knew that XHTML Strict documents were being rendered in more devices that would be reason enough to change over -- any thoughts?
    •  
      CommentAuthornifkin
    • CommentTimeDec 19th 2005
     permalink
    XHTML is supported by more devices than HTML4. (I can browse XHTML transitional and strict sites on my cellphone with support for handheld media CSS.)

    XHTML (thanks to being a subset of XML) can be transformed using XSLT if you really need to present content in an alternate format.

    I just personally don't know any compelling arguments to keep using HTML4 at this point.
Add your comments
    Username Password
  • Format comments as (Help)