IE9 beta finally seems to support xhtml properly

Discussion in 'HTML' started by cwdjrxyz, Sep 24, 2010.

  1. cwdjrxyz

    cwdjrxyz Guest

    Most modern browsers have been able to handle xhtml properly served as
    application/xhtml+xml for years, but no IE browser until the new IE9
    beta has been able to show a true xhtml page correctly.
    There has been much confusion about xhtml. Xhtml handles html, xml, or
    a mixture of both. The rules for xml are much more strict than for
    html, so an xhtml page must be parsed as xml, not html.
    The extension .html assigned to mime type text/html on the server is
    for html pages only. Thus one must associate another extension with
    the mime type application/xhtml+xml for serving xhtml for an xhtml
    page.
    Even if you have a page that validates as some version of xhtml, it
    will not be served correctly if you use the extension .html. I have
    some demo pages that hopefully will make this situation more clear.

    The example pages have a logo for the w3c validator to the bottom left
    of the page. You click this logo to validate the page. Then under
    Options check Show Source, check Verbose Output,and click Revalidate.
    IF the code is valid, you will get "This document was successfully
    fully checked as XHTML 1.1" or you will get red and error messages.
    This only tells you that the page has valid code, not if it is served
    properly. Next find "Content Type". If content type is text/html the
    page is being served as html. If the content type is application/xhtml
    +xml the page is being served as xhtml.

    Now view http://www.cwdjr.net/flash/Fatty.php . A server side php
    script, which can not be viewed, at the very top of the page is used
    for header exchange between the server and client computer browser
    before the page is downloaded. the server asks the browser if it can
    accept application/xhtml+xml. If so, the page is downloaded as
    written. If the browser tells the server it can not use application/
    xhtml+xmnl then some fairly complicated php script including regular
    expressions is used to rewrite the page as html4.01 strict and then
    download it to the browser. If you check the source code for this page
    after it downloads, you thus find it is written in xhtml for most
    modern browsers and as html 4.01 strict mainly for IE browsers through
    IE8 which can not properly show any version of xhtml served properly.

    Now view http://www.cwdjr.net/flash/FattyX.xhtml . This is an xhtml
    page only with no fancy header exchange to convert to html if needed.
    I think you will be able to view this properly on IE with IE9 beta
    only and of course most other modern browsers.

    Now, if you can view the xhtml page given just above, view
    http://www.cwdjr.net/flash/FattyXE.xhtml . This page has the single
    error of using <br> instead of <br /> near the top of this page. The
    page may not show at all or display only down to the error, or you may
    get an error report from the xml parser. This differs a bit on
    different browsers. On IE9 beta, click F12 for details.

    Next view http://www.cwdjr.net/flash/FattySE.html . Here the valid
    xhtml 1.1 page is served as html instead of xhtml. See the validator
    link to comfirm this and you will find the content type is just text/
    html. The page likely will work on older IE browsers since mis-serving
    as html kicks in the html parser rather than the much more strict xml
    parser. I would guess that over 90% of pages claiming to be xhtml are
    just this type of mis-served page.The page would have been better
    written with less effort by using html 4.01 strict in the first place,
    as the xhtml page can not be properly parsed with the html parser.

    Last view http://www.cwdjr.net/flash/FattySEE.html . This is the above
    xhtml page mis-served as html with the mentioned <br> error. Despite
    an error it will view well on a desktop because the html parser is not
    nearly as strict as the xml parser. However xml errors will be let
    through. If the page contained any xml code, and especially for small
    xml devices, the page might not work at all because everything in xml
    must be closed.
    cwdjrxyz, Sep 24, 2010
    #1
    1. Advertising

  2. cwdjrxyz

    Eric Bednarz Guest

    cwdjrxyz <> writes:

    > Even if you have a page that validates as some version of xhtml, it
    > will not be served correctly if you use the extension .html.

    ^^^
    *I* have no trouble at all serving whatever I want in response to *any*
    request, thank you. :)

    > Now view http://www.cwdjr.net/flash/Fatty.php .

    […]
    > If the browser tells the server it can not use application/
    > xhtml+xmnl then some fairly complicated php script including regular
    > expressions is used to rewrite the page as html4.01 strict and then
    > download it to the browser.



    Predictably, it doesn’t.


    HEAD /flash/Fatty.php HTTP/1.1
    Host: www.cwdjr.net
    Accept: text/html, application/xhtml+xml; q=0
    Connection: Close

    HTTP/1.1 200 OK
    Date: Fri, 24 Sep 2010 11:18:21 GMT
    Server: Apache
    Vary: Accept
    X-Powered-By: PHP/5.2.12
    Connection: close
    Content-Type: application/xhtml+xml;charset=UTF-8


    It’s beyond me why people who don’t understand HTTP feel this urge to
    come up with their own hoemgrown content negotiation from hell.
    Eric Bednarz, Sep 24, 2010
    #2
    1. Advertising

  3. cwdjrxyz wrote:

    > Most modern browsers have been able to handle xhtml properly served as
    > application/xhtml+xml for years, but no IE browser until the new IE9
    > beta has been able to show a true xhtml page correctly. ...


    Thanks for the nice research, cwd. Any wagers on whether or not this
    capability actually makes it into the final release of IE9? ;-)

    --
    -bts
    -Four wheels carry the body; two wheels move the soul
    Beauregard T. Shagnasty, Sep 24, 2010
    #3
    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. David Lozzi

    Try...Catch...Finally not firing finally?

    David Lozzi, Apr 23, 2007, in forum: ASP .Net
    Replies:
    12
    Views:
    783
    Alvin Bruney [MVP]
    May 11, 2007
  2. Chris F.A. Johnson

    IE9

    Chris F.A. Johnson, Apr 1, 2009, in forum: HTML
    Replies:
    3
    Views:
    509
  3. Gene Wirchenko

    IE9 textarea Problem

    Gene Wirchenko, Dec 29, 2011, in forum: HTML
    Replies:
    4
    Views:
    1,799
    Gene Wirchenko
    Dec 29, 2011
  4. P E Schoen
    Replies:
    0
    Views:
    641
    P E Schoen
    Mar 7, 2012
  5. Garrett Smith

    Microsoft and IE9 New Features

    Garrett Smith, Mar 16, 2010, in forum: Javascript
    Replies:
    33
    Views:
    499
    Dr J R Stockton
    Mar 22, 2010
Loading...

Share This Page