application/xhtml+xml in IE

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gustaf

    application/xhtml+xml in IE

    I just read this article from today:



    I need some help understanding this sentense:

    The W3C recommends XHTML 1.1 should be served with the
    application/xhtml+xml MIME type, something that Internet
    Explorer does not currently support.

    I thought it was the web *server* that serves documents in a certain
    MIME type, not the web *browser*. I don't see why it matters whether IE
    *knows* it's dealing with XHTML as long as the page is valid, is served
    with a correct Content-Type header, and displayed correctly in the browser.

    Gustaf
  • Benjamin Niemann

    #2
    Re: application/xhtml+xml in IE

    Gustaf wrote:
    [color=blue]
    > I just read this article from today:
    >
    > http://webstandards.org/buzz/archive/2005_09.html
    >
    > I need some help understanding this sentense:
    >
    > The W3C recommends XHTML 1.1 should be served with the
    > application/xhtml+xml MIME type, something that Internet
    > Explorer does not currently support.
    >
    > I thought it was the web *server* that serves documents in a certain
    > MIME type, not the web *browser*. I don't see why it matters whether IE
    > *knows* it's dealing with XHTML as long as the page is valid, is served
    > with a correct Content-Type header, and displayed correctly in the
    > browser.[/color]

    It certainly matters, if the document is not displayed at all ;)

    IE does not recognize documents *served* as application/xhtml+xml as a
    document it could display. It will popup a 'Save as..', 'Open with..' or
    dunno dialog, if you try to load such a document. And a XHTML 1.1 document
    is not valid, if it is served as text/html - the only MIME type IE
    understands (for displaying (X)HTML documents).

    Serving XHTML 1.0 as text/html is valid and advocated by the W3C as a
    temporary workaround, but many people (including me) think that this is an
    ugly, unnecessary hack that should be avoided. XHTML 1.0 has no added value
    over HTML 4.01, especially if served as text/html.

    --
    Benjamin Niemann
    Email: pink at odahoda dot de
    WWW: http://www.odahoda.de/

    Comment

    • Gustaf

      #3
      Re: application/xhtml+xml in IE

      Benjamin Niemann wrote:
      [color=blue]
      > IE does not recognize documents *served* as application/xhtml+xml as a
      > document it could display. It will popup a 'Save as..', 'Open with..' or
      > dunno dialog, if you try to load such a document.[/color]

      That's strange. I started to make the switch to XHTML 1.1, and I have no
      problem in IE6 on Windows XP SP2. Maybe the problem you mention occurs
      in IE5 (which is bad enough). Can anyone confirm this? I saw that IE6
      doesn't include "applicatio n/xhtml+xml" in the "Accept" HTTP header in
      the request, but the page still renders properly. Maybe it shouldn't.

      For those interested, I wrote a bit on how to write conformant XHTML 1.1
      documents (the URL is temporary). Enjoy. :-)



      It looks identical IE and Firefox. In Opera, the <pre> elements are
      displayed in a smaller font.

      Gustaf

      Comment

      • Darin McGrew

        #4
        Re: application/xhtml+xml in IE

        Gustaf <gustafl@algone t.se> wrote:[color=blue]
        > For those interested, I wrote a bit on how to write conformant XHTML 1.1
        > documents (the URL is temporary). Enjoy. :-)
        >
        > http://gusgus.cn/www/xhtml/authoringxhtml11.html
        >
        > It looks identical IE and Firefox. In Opera, the <pre> elements are
        > displayed in a smaller font.[/color]

        Interesting. My copy of MSIE renders it as

        File Download

        You have chosen to download a file from this location.

        authoringxhtml1 1.html from gusgus.cn

        What would you like to do with this file?
        ( ) Open this file from its current location
        (*) Save this file to disk

        [OK] [Cancel] [More Info]

        If I select "Open this file from its current location", then calls Opera to
        display the file.
        --
        Darin McGrew, mcgrew@stanford alumni.org, http://www.rahul.net/mcgrew/
        Web Design Group, darin@htmlhelp. com, http://www.HTMLHelp.com/

        "I used to have a handle on life, but it broke."

        Comment

        • Alan J. Flavell

          #5
          Re: application/xhtml+xml in IE

          On Thu, 1 Sep 2005, Darin McGrew wrote:
          [color=blue]
          > Gustaf <gustafl@algone t.se> wrote:[color=green]
          > >
          > > http://gusgus.cn/www/xhtml/authoringxhtml11.html[/color]
          >
          > Interesting. My copy of MSIE renders it as
          >
          > File Download[/color]
          [...][color=blue]
          > ( ) Open this file from its current location[/color]
          [...]

          Yup, back with Win/NT4 I configured IE to to use Mozilla to open this
          content-type ...
          [color=blue]
          > If I select "Open this file from its current location", then calls
          > Opera to display the file.[/color]

          I've no argument with that...

          But interestingly, if I try to use MSIE to access the above URL, I get
          an alert saying "Your current security settings do not allow this file
          to be downloaded".

          MSIE always seems to have a new trick up its sleeve.

          Maybe you haven't applied the latest MS security fixes? :-}

          Comment

          • Jukka K. Korpela

            #6
            Re: application/xhtml+xml in IE

            Gustaf <gustafl@algone t.se> wrote:
            [color=blue]
            > Benjamin Niemann wrote:
            >[color=green]
            >> IE does not recognize documents *served* as application/xhtml+xml as a
            >> document it could display. It will popup a 'Save as..', 'Open with..' or
            >> dunno dialog, if you try to load such a document.[/color]
            >
            > That's strange. I started to make the switch to XHTML 1.1, and I have no
            > problem in IE6 on Windows XP SP2. Maybe the problem you mention occurs
            > in IE5 (which is bad enough).[/color]

            No, it occurs on IE6 as well.
            [color=blue]
            > I saw that IE6
            > doesn't include "applicatio n/xhtml+xml" in the "Accept" HTTP header in
            > the request, but the page still renders properly.[/color]

            IE6 does not explicitly mention application/xhtml+xml but it includes */*,
            which means "anything goes".
            [color=blue]
            > http://gusgus.cn/www/xhtml/authoringxhtml11.html
            >
            > It looks identical IE and Firefox.[/color]

            Not here. I don't know what is going on, but on IE6 I see a dialog pop up,
            then vanish, and the page opens in the browser _but_ with no CSS effects
            and with no images, apparently because the browser shows a copy that it has
            stored in the Temporary Internet Files folder.

            I don't know a way to check what a server sends to IE6 specifically. It
            could be something different from what one gets by just talking to the
            server at port 80: the response is something like

            HTTP/1.1 200 OK
            Date: Thu, 01 Sep 2005 22:11:04 GMT
            Server: Apache/1.3.33 (Unix) mod_ssl/2.8.22 OpenSSL/0.9.7e PHP/4.4.0
            Last-Modified: Tue, 30 Aug 2005 16:22:23 GMT
            ETag: "4bfc82-1a71-431487bf"
            Accept-Ranges: bytes
            Content-Length: 6769
            Content-Type: application/xhtml+xml; charset=utf-8

            That looks pretty normal, and essentially the same as for XHTML files that
            IE6 refuses to open.

            But now I notice that if I use the filename suffix .html for an XHTML file,
            then I get the same reaction from IE6 as with your document. It seems that
            IE6 (on my system at least) automagically downloads the file and opens it
            in the browser - but from the temporary folder

            --
            Yucca, http://www.cs.tut.fi/~jkorpela/
            Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

            Comment

            • Gustaf

              #7
              Re: application/xhtml+xml in IE

              Jukka K. Korpela wrote:
              [color=blue]
              > IE6 does not explicitly mention application/xhtml+xml but it includes */*,
              > which means "anything goes".[/color]

              Yes, I noticed. My guess is that resources fetched as */* triggers the
              File Download dialog. But I still don't understand why I can browse
              pages served as "applicatio n/xhtml+xml" in IE6. Am I really alone about
              this?

              My Windows is fully updated. My version of IE is:

              6.0.2900.2180.x psp_sp2_gdr.050 301-1519
              [color=blue]
              > But now I notice that if I use the filename suffix .html for an XHTML file,
              > then I get the same reaction from IE6 as with your document.[/color]

              If I use an .xhtml suffix, I get the File Download dialog, like the
              others here. (There's a copy of the same document with an .xhtml suffix
              at the same place now.)

              Gustaf

              Comment

              • Brian

                #8
                Re: application/xhtml+xml in IE

                Alan J. Flavell wrote:
                [color=blue]
                > interestingly, if I try to use MSIE to access the above URL, I get an
                > alert saying "Your current security settings do not allow this file
                > to be downloaded".
                >
                > MSIE always seems to have a new trick up its sleeve.
                >
                > Maybe you haven't applied the latest MS security fixes? :-}[/color]

                :-D That was just plain mean. And rather funny, too. Thanks for that.

                --
                Brian

                Comment

                • Henri Sivonen

                  #9
                  Re: application/xhtml+xml in IE

                  In article <0YmdnbwO1ZVdC4 reRVnyuw@gigane ws.com>,
                  Gustaf <gustafl@algone t.se> wrote:
                  [color=blue]
                  > But I still don't understand why I can browse
                  > pages served as "applicatio n/xhtml+xml" in IE6. Am I really alone about
                  > this?[/color]

                  Do you have the MathPlayer plug-in installed? Or have you tweaked the
                  registry manually so that application/xhtml+xml becomes an alias for
                  text/html?

                  --
                  Henri Sivonen
                  hsivonen@iki.fi

                  Mozilla Web Author FAQ: http://mozilla.org/docs/web-developer/faq.html

                  Comment

                  • Jukka K. Korpela

                    #10
                    Re: application/xhtml+xml in IE

                    Gustaf wrote:
                    [color=blue]
                    > But I still don't understand why I can browse
                    > pages served as "applicatio n/xhtml+xml" in IE6. Am I really alone about
                    > this?[/color]

                    No, you aren't. Now testing on Win XP SP 2, using IE 6 to access

                    opens your document as intended, with styles and images. However, on the
                    status line I see, for a short time, a message about _loading_ a file,
                    i.e. a message I don't normally see when accessing a web page.

                    If I try to access

                    I get the dialog. This seems to be the same as your experience.

                    My conjecture is that IE 6 (on XP) first recognizes the document as
                    being of an unknown application type (from the HTTP headers, since IE 6
                    does not grok application/xhtml+xml). Then, after downloading it, it
                    starts to wonder what to do with it. It uses its usual suffix sniffing
                    and decides that .html means it's HTML (good old HTML) after all, and
                    automagically opens it in the browser window - whereas .xhtml is Greek
                    to it, at least by default.

                    I guess if I played with the filename suffix association settings in
                    Windows, IE 6 might open even URLs ending with .xhtml as (good old) HTML
                    documents. I'm not particularly interested in messing around that,
                    though, and it wouldn't really be that relevant to HTML authoring for
                    the WWW - we can't expect users to play such games just to see our
                    glorious XHTML documents rendered by HTML rules.

                    Comment

                    • Guy Macon

                      #11
                      Re: application/xhtml+xml in IE




                      Jukka K. Korpela wrote:
                      [color=blue]
                      >No, you aren't. Now testing on Win XP SP 2, using IE 6 to access
                      >http://gusgus.cn/www/xhtml/authoringxhtml11.html
                      >opens your document as intended, with styles and images. However, on the
                      >status line I see, for a short time, a message about _loading_ a file,
                      >i.e. a message I don't normally see when accessing a web page.
                      >
                      >If I try to access
                      >http://gusgus.cn/www/xhtml/authoringxhtml11.xhtml
                      >I get the dialog. This seems to be the same as your experience.[/color]

                      I just tried it on a fresh install of Windows 2000 Advanced Server
                      with no customization, and with a standard install of Mozilla
                      Firefox 1.06. IE is 6.0.2800.1106. All security updates are
                      installed.


                      WITH FIREFOX
                      http://gusgus.cn/www/xhtml/authoringxhtml11.xhtml and .html display fine.


                      WITH INTERNET EXPLORER
                      http://gusgus.cn/www/xhtml/authoringxhtml11.xhtml and .html display the
                      same dialog box:

                      File Download

                      Some files can harm your computer. If the file information below looks
                      suspicious, or you do not fully trust the source, do not open or save this
                      file.

                      File name: authoringxhtml1 1.html

                      File Type: FIERFOXHTML (looks like FireFox set up a file association...)

                      From: gusgus.cn

                      Would you like to open the file or save it to your computer?

                      [Open] [Save] {Cancel] [More info] (save is the default)

                      [ ] Always ask before opening this type of file (selected by default)

                      Save and Cancel do what you would expect.
                      More Info pulls up the downloading files section of IE help.
                      Open displays the page in FireFox with no CSS formatting and a URL of
                      file:///i:/Documents%20and %20Settings/Administrator/Local%20Setting s/Temporary%20Int ernet%20Files/Content.IE5/8IA23D5F/authoringxhtml1 1%5B1%5D.html

                      The Always Ask check box is checked and won't stay unchecked.

                      Adding gusgus.cn to trusted sites in IE does not change the behavior.







                      Comment

                      • Guy Macon

                        #12
                        Re: application/xhtml+xml in IE




                        http://gusgus.cn/www/xhtml/authoringxhtml11.html says...

                        "According to the rules of XML, skipping the XML declaration
                        is okay only when using either UTF-8 or UTF-16 as character
                        encoding in the document."

                        I was under the impression that US-ASCII was OK as well.
                        Does anyone have a reference for the above?

                        Comment

                        • Gustaf

                          #13
                          Re: application/xhtml+xml in IE

                          Guy Macon wrote:
                          [color=blue]
                          > "According to the rules of XML, skipping the XML declaration
                          > is okay only when using either UTF-8 or UTF-16 as character
                          > encoding in the document."[/color]
                          [color=blue]
                          > I was under the impression that US-ASCII was OK as well.
                          > Does anyone have a reference for the above?[/color]

                          If the encoding declaration is omitted, XML only admits UTF-8 or UTF-16.



                          But you can write pure ASCII documents just fine, since characters in
                          the ASCII range are encoded the same in UTF-8. That is, you don't need
                          an XML declaration for pure ASCII documents, since they will be treated
                          as UTF-8 documents.

                          Gustaf

                          Comment

                          • Gustaf

                            #14
                            Re: application/xhtml+xml in IE

                            Henri Sivonen wrote:
                            [color=blue]
                            > Do you have the MathPlayer plug-in installed? Or have you tweaked the
                            > registry manually so that application/xhtml+xml becomes an alias for
                            > text/html?[/color]

                            Of course not. I would have mentioned that.

                            Gustaf

                            Comment

                            • Alan J. Flavell

                              #15
                              Re: application/xhtml+xml in IE

                              On Fri, 2 Sep 2005, Guy Macon wrote:
                              [color=blue]
                              > http://gusgus.cn/www/xhtml/authoringxhtml11.html says...
                              >
                              > "According to the rules of XML, skipping the XML declaration
                              > is okay only when using either UTF-8 or UTF-16 as character
                              > encoding in the document."
                              >
                              > I was under the impression that US-ASCII was OK as well.[/color]

                              US-ASCII is just a special case of utf-8, in this sense: so yes,
                              that's OK too.[1]

                              Note that (to use recent Unicode terminology), the "character
                              encoding" of utf-16 comprises three "character encoding schemes":
                              utf-16 with BOM (where the byte ordering is discerned by reading the
                              BOM), utf-16LE and utf-16BE (where the byte ordering is laid down by
                              the name of the encoding scheme). I rather suspect that only the
                              first of those three schemes is legal XML without using the ?xml
                              thingy to specify the encoding (scheme!).
                              [color=blue]
                              > Does anyone have a reference for the above?[/color]

                              I'll leave that to someone who happens to have it at their fingertips,
                              if you didn't find it yourself.

                              But the character encoding scheme which is advertised from an HTTP
                              server via the MIME "charset=" is authoritative, according to RFC2616,
                              and this attribute should not be omitted according to security alert
                              CA-2000-02, so the <?xml thingy should really only be getting *used*
                              in non-HTTP contexts (e.g reading a local file): if the ?xml thingy
                              specified an encoding in an HTTP context, that evidently needs to be
                              consistent with what the server's HTTP Content-type header says.[2]

                              cheers

                              [1] Amusingly, HTTP rules say that the default is iso-8859-1.

                              So you can present us-ascii to XML, and allow it to assume that it's
                              utf-8, and at the same time present it to HTTP and allow -it- to
                              assume that it's iso-8859-1. and *both of them are correct*, in this
                              special case ;-)

                              [2] Readers should not confuse this with any "meta http-equiv"
                              content-type, which has no meaning as far as XML is concerned.
                              But you knew that, right?

                              Comment

                              Working...