SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Member
    Join Date
    Dec 2011
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    application/xhtml+xml renders ok in IE8?

    I've been reading this site and lately especially this thread and find it very informative. I've been using XHTML for as much time as I'm a conscious developer, and I admit - kind of a 'victim' of the XHTML hype, not realizing fully what it was in the first place back in the years. First, I was using HTML in ancient times some 6-7 years ago.
    I don't like where HTML(5) is headed to, there are still no clear standards, some browsers do implement some things, and we will have to reiterate the well known hell from when IE5/6, Netscape 4.x etc. were widespread.

    But I wanted to point on something - the IE8/9 application/xhtml+xml support and the alleged download dialog they throw upon it.

    Quote Originally Posted by felgall View Post
    The following page is done using PHP to add the MIME type header before the page is sent to the browser.

    http://www.felgall.com/realxhtml.php
    I tried this in IE8 and 9, this page is rendered prefectly in both, no download dialog, no nothing. I double checked - the server sends the content type HEADER as application/xhtml+xml.

    So where is the catch here? These are machines with Win7, and no registry hacks were ever applied. I kept reading here how IE (even 9) would offer real XHTML for downloading, still I do not witness this.

    Thanks in advance for any explanation.

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,807
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by tedych View Post
    I kept reading here how IE (even 9) would offer real XHTML for downloading, still I do not witness this.
    IE9 and all other modern browsers can handle XHTML properly without offering it for download.

    If you are not seeing it happen then you are probably serving the page with the wrong MIME type.

    Whether a page is HTML or XHTML is determined by whether the MIME type is text/html or application/xhtml+xml - what doctype is used is irrelevant.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  3. #3
    SitePoint Member
    Join Date
    Dec 2011
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    felgall, thanks for replying so fast.
    What I meant was I tried your link (opened it in various browsers), and even in IE8 it opens right. Although I could just try and write this myself, you've done it and I used it directly for the test. Obviously you created it to demonstrate the correct MIME type, which is what it does, still IE8 opens it right.
    Also I read here that even IE9 wouldn't support XHTML and its related MIME type. Thus my confusion.

    I'm in the process of looking around to update my front-end skills (I'm mainly PHP with mysql/ms sql) and wondered to what degree I could count on HTML5 right now..

  4. #4
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    To my knowledge M$ IE9 was the MS first browsers to properly support 'application/xhtml+xml' thus assuming you have IE9 is should display. If you only have a standalone IE8 it would ask you to save or download, etc. All my pages are 'application/xhtml+xml' to those browsers that support the MIME or given 'text/html' to the legacy browsers.

  5. #5
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,807
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by tedych View Post
    felgall, thanks for replying so fast.
    What I meant was I tried your link (opened it in various browsers), and even in IE8 it opens right.
    Attempting to open my real XHTML test page in IE8 will result in the file being offered for download. If it actually opens the page then it either isn't IE8 (or earlier) or you have somehow installed a plugin into IE8 that adds XHTML support. If the latter then I would be interested in knowing what plugins you have installed so as to work out which is adding that support. IE8 definitely offers that as a file for download when I try to access it using that browser (I just retested it and it displayed the save as dialog instead of the page). Tests I have done in IE9 do result in the page being displayed however if you try opening my broken XHTML page it also opens in IE9 when it shouldn't. Restesting that page in the latest version of Opera shows that Opera now also opens it rather than correctly displaying an error message the way it used to so it looks like the latest version of Opera has worse XHTML support than earlier versions - since having the page not display iof there are errors is one of the main benefits of using XHTML in the first place.

    Given that IE8 and earlier offer XHTML pages for download instead of displaying them, anyone trying to use them for live web pages and not just trying to demonstrate whether the browser does or doesn't support it will test to see if the browser supports it and will dynamically change the MIME type to the HTML version for those that don't. Of course this may lead to complications in any JavaScript that needs to interact with the page as the HTML and XHTML DOM are different and so generally people just serve the pages as HTML to everyone.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  6. #6
    SitePoint Member
    Join Date
    Dec 2011
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Actually it is a relatively rarely updated Win7 (virtual machine), I attach two screens:

    http://img716.imageshack.us/img716/6603/ie8xhtml1.png

    http://img844.imageshack.us/img844/8393/ie8xhtml2.png

    I have nothing installed in IE, this is a machine used seldom, I intended to keep it because of the IE8 that is not WinUpdated to 9.
    As you can see, no download, but displayed correctly.

    For now I have no explanation, but I didn't start diving deeply in browsers compatibility yet.

  7. #7
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,807
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by tedych View Post
    Actually it is a relatively rarely updated Win7 (virtual machine)
    The only thing I can think of then is that it is the Win 7 VM that is supplying the XHTML support. IE is so closely tied into the operating system that it is possible that it behaves differently on different versions of Windows. It definitely offers the page for download in IE8 on Win XP.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  8. #8
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,344
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    (Thread moved and split into topic of its own.)

  9. #9
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,276
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    zcorpan sent: http://my.opera.com/ODIN/blog/2011/0...-failed-errors cause I was wondering about it


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •