Which spec to use?

Discussion in 'HTML' started by Scott Johnson, Apr 3, 2009.

  1. Most of my experience is in back-end coding with PHP and MySQL but am
    venturing out into the design area and need an opinion please.

    Which spec would be the smartest one to live up to?

    HTML 4.01 or XHTML 1.0 both being strict.

    Thanks
    Scotty
     
    Scott Johnson, Apr 3, 2009
    #1
    1. Advertising

  2. Scott Johnson

    rf Guest

    Scott Johnson wrote:
    > Most of my experience is in back-end coding with PHP and MySQL but am
    > venturing out into the design area and need an opinion please.
    >
    > Which spec would be the smartest one to live up to?
    >
    > HTML 4.01 or XHTML 1.0 both being strict.


    Given that the most common browser in use simply does not understand
    XHLTML[1] your choice is pretty clear.

    [1] Serve XHTML up to IE with the correct content type and it will politely
    ask you if you want to download it. If you lie and serve it as text/html
    then IE will happily error correct it to HTML.
     
    rf, Apr 3, 2009
    #2
    1. Advertising

  3. Scott Johnson

    rf Guest

    Ed Mullen wrote:
    > rf wrote:
    >> Scott Johnson wrote:
    >>> Most of my experience is in back-end coding with PHP and MySQL but
    >>> am venturing out into the design area and need an opinion please.
    >>>
    >>> Which spec would be the smartest one to live up to?
    >>>
    >>> HTML 4.01 or XHTML 1.0 both being strict.

    >>
    >> Given that the most common browser in use simply does not understand
    >> XHLTML[1] your choice is pretty clear.
    >>
    >> [1] Serve XHTML up to IE with the correct content type and it will
    >> politely ask you if you want to download it. If you lie and serve it
    >> as text/html then IE will happily error correct it to HTML.
    >>
    >>

    >
    > Is that still true with IE8?


    I believe so. There surely would have been conserable fuss raised if they
    had inadvertantly fixed it :)

    --
    Richard.
     
    rf, Apr 3, 2009
    #3
  4. Scott Johnson

    rf Guest

    Scott Johnson wrote:
    > rf wrote:
    >> Scott Johnson wrote:
    >>> Most of my experience is in back-end coding with PHP and MySQL but
    >>> am venturing out into the design area and need an opinion please.
    >>>
    >>> Which spec would be the smartest one to live up to?
    >>>
    >>> HTML 4.01 or XHTML 1.0 both being strict.

    >>
    >> Given that the most common browser in use simply does not understand
    >> XHLTML[1] your choice is pretty clear.
    >>
    >> [1] Serve XHTML up to IE with the correct content type and it will
    >> politely ask you if you want to download it. If you lie and serve it
    >> as text/html then IE will happily error correct it to HTML.
    >>
    >>

    >
    > OK Thanks for the info.
    >
    > I will stick to the html 4.01 strict specs then.
    >
    > BTW is this the rf from the PHP ng?


    Er, probably. I've never noticed another one. We all get around somewhat.
    Why? Oh yes, the bad dope bit :)

    --
    Richard.
     
    rf, Apr 3, 2009
    #4
  5. Scott Johnson

    Lars Eighner Guest

    In our last episode,
    <fKdBl.13451$>,
    the lovely and talented Scott Johnson
    broadcast on alt.html:

    > Most of my experience is in back-end coding with PHP and MySQL but am
    > venturing out into the design area and need an opinion please.


    > Which spec would be the smartest one to live up to?


    > HTML 4.01 or XHTML 1.0 both being strict.


    HTML 4.01. XHTML is not properly supported.

    The idea of XHTML was to make transition/conversion to XML and other
    sgml-type markup languages easier. However, XHTML leaves much to be
    desired, part of which is XHTML's fault and part of which is owing to a
    major browser not implementing it properly.

    Much of the good XHTML promised can be achieved in HTML. You can close all
    tags explicitly, you can use lowercase tag and attribute names, and you can
    give a boolean attribute its own name as a value. You cannot close empty
    tags, but if your markup is otherwise valid, it should be a simple matter to
    write a filter to do this if you ever need to make a conversion. If you
    are validating to strict you should have a leg up on avoiding deprecated
    elements and attributes.

    --
    Lars Eighner <http://larseighner.com/>
    72 days since Rick Warren prayed over Bush's third term.
    Obama: No hope, no change, more of the same. Yes, he can, but no, he won't.
     
    Lars Eighner, Apr 3, 2009
    #5
  6. Scott Johnson

    C A Upsdell Guest

    rf wrote:
    >> Most of my experience is in back-end coding with PHP and MySQL but am
    >> venturing out into the design area and need an opinion please.
    >>
    >> Which spec would be the smartest one to live up to?
    >>
    >> HTML 4.01 or XHTML 1.0 both being strict.

    >
    > Given that the most common browser in use simply does not understand
    > XHLTML[1] your choice is pretty clear.


    Given that the most common browser renders XHTML sites just fine if the
    sites are designed to conform to Appendix C of the XHTML 1 spec -- and
    Appendix A of the XHTML Media Types spec -- the choice is not so clear.

    (Hint: I have been making XHTML sites since the 1.0 spec spec appeared
    .... with nary a problem.)

    Of course the purists will wail and hunt you down if you use XHTML,
    hence cowardice may be the better part of valour.
     
    C A Upsdell, Apr 3, 2009
    #6
  7. Scott Johnson

    rf Guest

    C A Upsdell wrote:
    > rf wrote:
    >>> Most of my experience is in back-end coding with PHP and MySQL but
    >>> am venturing out into the design area and need an opinion please.
    >>>
    >>> Which spec would be the smartest one to live up to?
    >>>
    >>> HTML 4.01 or XHTML 1.0 both being strict.

    >>
    >> Given that the most common browser in use simply does not understand
    >> XHLTML[1] your choice is pretty clear.

    >
    > Given that the most common browser renders XHTML sites just fine if
    > the sites are designed to conform to Appendix C of the XHTML 1 spec


    Which basically just means that your XHTML is written so as to be able to be
    read as tag soup by an HTML user agent. You know, add a space before the /
    so <br /> may be error corrected to <br> and write <p></p> rather than <p/>.

    The title of appendix C even tells you this: HTML Compatibility Guidlines.
    In the first paragraph we find "... who wish their XHTML documents to render
    on existing HTML user agents."

    IE is an HTML user agent. It does not render XHTML, it error corrects it to
    HTML and renders that.

    Appendix C further states: "Note that this recommendation does not define
    how HTML conforming user agents should process HTML documents" to which I
    would further suggest that niether does it define how HTML conforming user
    agents should process XHTML documents, even appendix C conforming ones.

    Further to that, by writing correctly formed (even allowing for appendix C)
    XHTML you should have put a, XML declaration or whatever it is at the front
    of the document, before the DOCTYPE. This of course puts IE into quirks
    mode, where it carefully reproduces the layout bugs back to version 5.5.

    So, why are you risking your sites on the non-defined error correction
    capabilites of IE running in quirks mode?

    > (Hint: I have been making XHTML sites since the 1.0 spec spec appeared
    > ... with nary a problem.)


    You can make whatever sort of sites you want to, I personally make HTML
    sites :)

    --
    Richard.
     
    rf, Apr 3, 2009
    #7
  8. Scott Johnson

    rf Guest

    Ed Mullen wrote:
    > Lars Eighner wrote:
    >> In our last episode,
    >> <fKdBl.13451$>,
    >> the lovely and talented Scott Johnson
    >> broadcast on alt.html:
    >>
    >>> Most of my experience is in back-end coding with PHP and MySQL but
    >>> am venturing out into the design area and need an opinion please.

    >>
    >>> Which spec would be the smartest one to live up to?

    >>
    >>> HTML 4.01 or XHTML 1.0 both being strict.

    >>
    >> HTML 4.01. XHTML is not properly supported.
    >>
    >> The idea of XHTML was to make transition/conversion to XML and other
    >> sgml-type markup languages easier. However, XHTML leaves much to be
    >> desired, part of which is XHTML's fault and part of which is owing
    >> to a major browser not implementing it properly.
    >>
    >> Much of the good XHTML promised can be achieved in HTML. You can
    >> close all tags explicitly, you can use lowercase tag and attribute
    >> names, and you can give a boolean attribute its own name as a value.
    >> You cannot close empty tags, but if your markup is otherwise valid,
    >> it should be a simple matter to write a filter to do this if you
    >> ever need to make a conversion. If you are validating to strict you
    >> should have a leg up on avoiding deprecated elements and attributes.
    >>

    >
    > So, can someone make a case for using XHTM instead of HTML? I mean, is
    > there any case where it /should/ be (or /needs/ to be) used?


    You just might be exporting the page from something that uses XML in its
    underlying architecture. XML to XHTML is easy, because XHTML *is* XML. XML
    to HTML is a bit harder.

    This is of course a wild guess. I have never done such a thing.
    --
    Richard.
     
    rf, Apr 3, 2009
    #8
  9. Scott Johnson

    rf Guest

    C A Upsdell wrote:
    > rf wrote:
    >>> Most of my experience is in back-end coding with PHP and MySQL but
    >>> am venturing out into the design area and need an opinion please.
    >>>
    >>> Which spec would be the smartest one to live up to?
    >>>
    >>> HTML 4.01 or XHTML 1.0 both being strict.

    >>
    >> Given that the most common browser in use simply does not understand
    >> XHLTML[1] your choice is pretty clear.

    >
    > Given that the most common browser renders XHTML sites just fine if
    > the sites are designed to conform to Appendix C of the XHTML 1 spec
    > -- and Appendix A of the XHTML Media Types spec -- the choice is not
    > so clear.


    A further thing I forgot. You have to serve your XHTML document as text/html
    or IE will ask you if you want to download it.

    So, you aren't really serving XHTML at all, even to user agents that *do*
    understand XHTML (unless you indulge in some server side browser sniffing).
    Why go to all of the trouble to write XHTML (not that it's much trouble
    anyway) and then lie about it by telling the browsers it is actually HTML?

    --
    Richard.
     
    rf, Apr 3, 2009
    #9
  10. Scott Johnson

    Nik Coughlin Guest

    "Ed Mullen" <> wrote in message
    news:...
    > So, can someone make a case for using XHTM instead of HTML? I mean, is
    > there any case where it /should/ be (or /needs/ to be) used?


    If you want to be able to post-process your web pages in some way with
    another tool that understands well formed XML but not HTML
     
    Nik Coughlin, Apr 3, 2009
    #10
  11. Scott Johnson

    John Hosking Guest

    C A Upsdell wrote:
    >
    > Of course the purists will wail and hunt you down if you use XHTML,
    > hence cowardice may be the better part of valour.


    This could be the key I've been missing to let me unlock the door to
    true enlightenment. I think I will add this to my .sig, and meditate on
    the meaning of it. :)

    --
    John
    "Cowardice may be the better part of valour." -C A Upsdell
     
    John Hosking, Apr 3, 2009
    #11
  12. Scott Johnson

    David Segall Guest

    Scott Johnson <> wrote:

    >Most of my experience is in back-end coding with PHP and MySQL but am
    >venturing out into the design area and need an opinion please.
    >
    >Which spec would be the smartest one to live up to?
    >
    >HTML 4.01 or XHTML 1.0 both being strict.


    The main arguments against XHTML are at
    <http://www.hixie.ch/advocacy/xhtml>.
    An amusing counter-argument to Hickson's is here
    <http://lists.w3.org/Archives/Public/www-html/2007Jun/0008.html>.
    The main argument in favour of XHTML is that the World Wide Web
    Consortium, the source for HTML scripture, uses it
    <http://www.w3.org/MarkUp/Activity.html>.
     
    David Segall, Apr 3, 2009
    #12
  13. David Segall wrote:

    > The main argument in favour of XHTML is that the World Wide Web
    > Consortium, the source for HTML scripture, uses it
    > <http://www.w3.org/MarkUp/Activity.html>.


    Content-Type: application/xhtml+xml; charset=utf-8

    The amusing part of that page is that 58.3% of visitors will be asked if
    they want to "download the page." <lol>

    --
    -bts
    -Friends don't let friends drive Windows
     
    Beauregard T. Shagnasty, Apr 3, 2009
    #13
  14. Scott Johnson

    David Segall Guest

    Ed Mullen <> wrote:


    >So, can someone make a case for using XHTM instead of HTML? I mean, is
    >there any case where it /should/ be (or /needs/ to be) used?


    I don't think that is necessary. The W3C uses and recommends XHTML so
    it is up to its detractors to make a case for _not_ using XHTML. The
    entire argument is based on conforming to standards and the source of
    those standards is the W3C. There is a simple work-around for the
    failure of Internet Explorer to correctly interpret the XHTML standard
    and the DOCTYPE ensures that the author adheres to XHTML even if a
    browser does not.
     
    David Segall, Apr 3, 2009
    #14
  15. Scott Johnson

    dorayme Guest

    In article <>,
    David Segall <> wrote:

    > There is a simple work-around for the
    > failure of Internet Explorer to correctly interpret the XHTML standard
    > and the DOCTYPE ensures that the author adheres to XHTML even if a
    > browser does not.


    There are criticisms that IE does not "correctly" interpret the XHTML
    standard.

    --
    dorayme
     
    dorayme, Apr 3, 2009
    #15
  16. David Segall wrote:

    > Ed Mullen <> wrote:
    >> So, can someone make a case for using XHTM instead of HTML? I mean,
    >> is there any case where it /should/ be (or /needs/ to be) used?


    These folks have presented a fairly good argument for using HTML:
    <http://www.webdevout.net/articles/beware-of-xhtml>
    <http://www.spartanicus.utvinternet.ie/no-xhtml.htm>

    > I don't think that is necessary. The W3C uses and recommends XHTML so
    > it is up to its detractors to make a case for _not_ using XHTML.


    Um, but they cheat and send their pages as:
    Content-Type: text/html; charset=utf-8
    instead of:
    Content-Type: application/xhtml+xml; charset=utf-8
    which is the correct content-type for XHTML.

    This previous link you posted does use the correct content-type. How do
    you see this page in Internet Explorer?
    <http://www.w3.org/MarkUp/Activity.html>

    The page also uses the correct XML prologue, and IE just dies.
    <?xml version="1.0" encoding="utf-8"?>

    Besides, I do not see anything on that page which states the W3C
    actually recommends that anyone actually *use* XHTML. It's just an essay
    on what's happening with their committees.

    > The entire argument is based on conforming to standards and the source
    > of those standards is the W3C.


    I think you are confusing the meaning of "standards." Properly marked
    HTML is a "standard."

    > There is a simple work-around for the failure of Internet Explorer to
    > correctly interpret the XHTML standard and the DOCTYPE ensures that
    > the author adheres to XHTML even if a browser does not.


    ...and that work-around is to cheat and tell your server not to send it
    as XHTML, even though the markup may be valid.

    --
    -bts
    -Friends don't let friends drive Windows
     
    Beauregard T. Shagnasty, Apr 3, 2009
    #16
  17. Scott Johnson

    David Segall Guest

    "Beauregard T. Shagnasty" <> wrote:

    >David Segall wrote:
    >
    >> The main argument in favour of XHTML is that the World Wide Web
    >> Consortium, the source for HTML scripture, uses it
    >> <http://www.w3.org/MarkUp/Activity.html>.

    >
    > Content-Type: application/xhtml+xml; charset=utf-8
    >
    >The amusing part of that page is that 58.3% of visitors will be asked if
    >they want to "download the page." <lol>


    I had no trouble reading it on my computer. I use Firefox with the IE
    View Add On, so I let Microsoft decide which version of Internet
    Explorer they want me to use. They tell me it's currently 7.0.5730.11.

    I tried the page in browsershots
    <http://browsershots.org/http://www.w3.org/MarkUp/Activity.html> and
    it seems to work in IE 5.5 and later. Based on that, I would expect
    that only 13.8435% of visitors would have difficulty viewing the page.
    Why do you think your estimate is more accurate than mine?
     
    David Segall, Apr 4, 2009
    #17
  18. David Segall wrote:

    > "Beauregard T. Shagnasty" wrote:
    >>David Segall wrote:
    >>> The main argument in favour of XHTML is that the World Wide Web
    >>> Consortium, the source for HTML scripture, uses it
    >>> <http://www.w3.org/MarkUp/Activity.html>.

    >>
    >> Content-Type: application/xhtml+xml; charset=utf-8
    >>
    >> The amusing part of that page is that 58.3% of visitors will be
    >> asked if they want to "download the page." <lol>

    >
    > I had no trouble reading it on my computer. I use Firefox with the IE
    > View Add On, so I let Microsoft decide which version of Internet
    > Explorer they want me to use. They tell me it's currently
    > 7.0.5730.11.
    >
    > I tried the page in browsershots
    > <http://browsershots.org/http://www.w3.org/MarkUp/Activity.html> and
    > it seems to work in IE 5.5 and later. Based on that, I would expect
    > that only 13.8435% of visitors would have difficulty viewing the page.


    Note that the Activity.html page does some cheating [1]. While its
    server is sending as application/xhtml+xml, there is a meta line of:
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    and who knows how that will affect browsershots or your Firefox addon.

    I would suggest you use a real Internet Explorer running in some version
    of Windows, rather than an add-on, or a "viewer" that may or may not
    ignore the actual content type.

    Here's another test for you. Try one of the XHTML links here on my site:
    http://tekrider.net/html/doctype.php
    Use a real Internet Explorer.

    > Why do you think your estimate is more accurate than mine?


    What, that 58.3%? Heh, just a wild guess for today's IE users. There's
    no real way to get an accurate measurement; UA strings are easily
    forged.

    [1] The cheating at W3C implies to me that even they believe that the
    Web is not ready for XHTML. Not while Microsoft is in the browser
    business.

    --
    -bts
    -Friends don't let friends drive Windows
     
    Beauregard T. Shagnasty, Apr 4, 2009
    #18
  19. Scott Johnson

    David Segall Guest

    "Beauregard T. Shagnasty" <> wrote:

    >David Segall wrote:
    >
    >> "Beauregard T. Shagnasty" wrote:
    >>>David Segall wrote:
    >>>> The main argument in favour of XHTML is that the World Wide Web
    >>>> Consortium, the source for HTML scripture, uses it
    >>>> <http://www.w3.org/MarkUp/Activity.html>.
    >>>
    >>> Content-Type: application/xhtml+xml; charset=utf-8
    >>>
    >>> The amusing part of that page is that 58.3% of visitors will be
    >>> asked if they want to "download the page." <lol>

    >>
    >> I had no trouble reading it on my computer. I use Firefox with the IE
    >> View Add On, so I let Microsoft decide which version of Internet
    >> Explorer they want me to use. They tell me it's currently
    >> 7.0.5730.11.
    >>
    >> I tried the page in browsershots
    >> <http://browsershots.org/http://www.w3.org/MarkUp/Activity.html> and
    >> it seems to work in IE 5.5 and later. Based on that, I would expect
    >> that only 13.8435% of visitors would have difficulty viewing the page.

    >
    >Note that the Activity.html page does some cheating [1]. While its
    >server is sending as application/xhtml+xml, there is a meta line of:
    ><meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    >and who knows how that will affect browsershots or your Firefox addon.
    >
    >I would suggest you use a real Internet Explorer running in some version
    >of Windows, rather than an add-on, or a "viewer" that may or may not
    >ignore the actual content type.
    >
    >Here's another test for you. Try one of the XHTML links here on my site:
    >http://tekrider.net/html/doctype.php
    >Use a real Internet Explorer.
    >
    >> Why do you think your estimate is more accurate than mine?

    >
    >What, that 58.3%? Heh, just a wild guess for today's IE users. There's
    >no real way to get an accurate measurement; UA strings are easily
    >forged.
    >
    >[1] The cheating at W3C implies to me that even they believe that the
    >Web is not ready for XHTML. Not while Microsoft is in the browser
    >business.


    I'm sorry. My post extremely badly expressed. Let me try again.

    My Internet Explorer, Version 7.0.5730.11 displays the page correctly.
    The version 5.5, 6.0, 7.0 and 8.0 of Internet Explorer used by
    browsershots to render the page display it correctly. Why do you think
    that any browser released this century would ask the visitor if they
    want to download the page?

    I don't dispute that there is a problem and your page does demonstrate
    it. I just don't see a problem with the W3C page and I would be
    stunned if they included content that would be difficult to read using
    Internet Explorer.
     
    David Segall, Apr 5, 2009
    #19
  20. David Segall wrote:

    > "Beauregard T. Shagnasty" <> wrote:
    >>David Segall wrote:
    >> <snippage>
    >>>>> <http://www.w3.org/MarkUp/Activity.html>.
    >>>>
    >>>> Content-Type: application/xhtml+xml; charset=utf-8
    >>>
    >>> I tried the page in browsershots
    >>> <http://browsershots.org/http://www.w3.org/MarkUp/Activity.html>
    >>> and it seems to work in IE 5.5 and later. Based on that, I would
    >>> expect that only 13.8435% of visitors would have difficulty viewing
    >>> the page.

    >>
    >> Note that the Activity.html page does some cheating [1]. While its
    >> server is sending as application/xhtml+xml, there is a meta line of:
    >> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"
    >> /> and who knows how that will affect browsershots or your Firefox
    >> addon.
    >>
    >> I would suggest you use a real Internet Explorer running in some
    >> version of Windows, rather than an add-on, or a "viewer" that may or
    >> may not ignore the actual content type.
    >>
    >> Here's another test for you. Try one of the XHTML links here on my
    >> site: http://tekrider.net/html/doctype.php Use a real Internet
    >> Explorer.
    >>
    >> [1] The cheating at W3C implies to me that even they believe that
    >> the Web is not ready for XHTML. Not while Microsoft is in the
    >> browser business.

    >
    > I'm sorry. My post extremely badly expressed. Let me try again.
    >
    > My Internet Explorer, Version 7.0.5730.11 displays the [W3C] page
    > correctly. The version 5.5, 6.0, 7.0 and 8.0 of Internet Explorer
    > used by browsershots to render the page display it correctly.


    Since we don't know exactly how browsershots works, I'll take a stab at
    it. I'd say that their server does a wget of a submitted page, and
    stores the result to a temporary space. It then locally feeds the result
    to the various selected browser engines, on their server. Therefore, the
    actual page's server content-type is never seen by browsershots.

    > Why do you think that any browser released this century would ask the
    > visitor if they want to download the page?


    That would be a question to ask Microsoft, whose browsers do not
    understand properly-sent XHTML with the proper content-type of
    application/xhtml+xml.

    > I don't dispute that there is a problem and your page does demonstrate
    > it.


    So with my page in your own Internet Explorer, the problem was? It
    offered to "download the file" ?

    I've just sent my page to browsershots and chose IE 6 and 7.
    http://tekrider.net/html/doc.xhtml1.0.php
    After waiting about an hour, it came back and said that "IE6 not
    available" and displayed it correctly with IE7. So their tool does not
    recognize my server's content-type.

    > I just don't see a problem with the W3C page and I would be
    > stunned if they included content that would be difficult to read
    > using Internet Explorer.


    And again, this is because they cheat and send a content-type of
    text/html, which is something IE can comprehend.

    Would anyone else care to step in and confirm that Internet Explorer
    cannot comprehend XHTML sent as application/xhtml+xml? And that sending
    XHTML with the required XML Prolog line above the doctype throws IE into
    quirks mode?

    As I stated previously, I think the world is not ready for real XHTML as
    long as Microsoft is in the browser business.

    --
    -bts
    -Friends don't let friends drive Windows
     
    Beauregard T. Shagnasty, Apr 5, 2009
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. rp
    Replies:
    0
    Views:
    1,237
  2. Familyman
    Replies:
    3
    Views:
    543
    Alan J. Flavell
    Feb 9, 2006
  3. Andrew Chen
    Replies:
    1
    Views:
    226
    David Chelimsky
    Mar 25, 2008
  4. Peter Havens
    Replies:
    0
    Views:
    127
    Peter Havens
    Mar 17, 2011
  5. Peng Yu

    How to use File::Spec->no_upwards?

    Peng Yu, Nov 29, 2008, in forum: Perl Misc
    Replies:
    2
    Views:
    131
    Peter J. Holzer
    Nov 29, 2008
Loading...

Share This Page