Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×
The Internet

Browser Support for XHTML? 73

eLoco asks: "What support do today's browsers have for XHTML? Maybe a better question would be: what support do the major browsers in current use have for formatting/display of XML with DTD defined? I don't have any browser prejudice per se (I use MSIE, Mozilla, Safari/KHTML, and Opera depending on the system I am working on and my mood), but I am primarily interested in the browsers with greater 'market share,' since my main reason for asking is this: If at least the "main" browsers in current use have decent support (vague, I know) for XHTML/XML rendering, why haven't we all converted over yet?" While it doesn't cover all browsers out there, this chart serves as a good starting point. For those of you working with application/xhtml+xml files, what issues have you run into when serving up your files to various browsers?
This discussion has been archived. No new comments can be posted.

Browser Support for XHTML?

Comments Filter:
  • by dJCL ( 183345 ) on Monday June 23, 2003 @03:57PM (#6276762) Homepage
    I would love to code XHTML strict, but there is the problem of my users, you see, they are not technical, they don't all upgrade thier browser when they can, even when they are told too. I have to code in many ways to the lowest common denominator, then add or modify features for the better browsers and try to avoid breaking things.


    If you're on a controlled intranet or something similar and can control the browser used, your set, but I wish the real world was like that.


    This is one reason that I love templates thou, I have a work in progress template for my main site that is XHTML strict, so browsers that support it can have it.


    Enjoy!

    • by Markusis ( 46739 ) * on Monday June 23, 2003 @05:00PM (#6277451) Homepage Journal
      I am the president of a Linux Users Group and I maintain the website we have. LUGSB [sunysb.edu] The site is fully XHTML1.1 and CSS2 compliant. (There are links at the bottom of the page that will validate it) For the most part support is very good. All of the layout is done with CSS. (there isn't one table on the site) A lot of it even works with NN4. But, the beauty with CSS layout and semantically correct XHTML is that it degrades really nicely. So, if someone hits my site with lynx it still renders in a very readable way with important links at the top and the data presented nicely. Try reading slashdot with lynx and having to wade through all the links that normally show up on the left side bar before you get to the articles. How annoying is that?
      We also serve the pages as application/xhtml+xml to mozilla and other gecko based browsers. If you send that to IE it won't work. I think it just prints out the XHTML instead of rendering it. But, if you send the same data as text/html it works fine. If only IE would support transparent PNG images.
      I think the best bet is drop support for Netscape 4.x. When I say drop support, I mean, make sure that the content of the site is still accessible even if NN4 users lose a little bit of the layout, it pays off with the benefits of CSS and XHTML.

      Just my 2 cents.

      • by JimDabell ( 42870 ) on Monday June 23, 2003 @05:24PM (#6277764) Homepage

        The only mime-type you should serve XHTML 1.1 as is application/xhtml+xml. If you serve it as text/html, you are violating the spec. The only type of XHTML you are allowed to serve as text/html is XHTML 1.0 that follows Appendix C of the XHTML 1.0 Recommendation.

        Also, when you serve it as text/html, the only thing browsers see is tag soup - they don't treat it as XHTML, just run-of-the-mill HTML that doesn't quite match HTML 4.01.

        • What to do, you can see by all the discussion here, that even when you follow standards, to get the most out of your efforts you have probably end up doing non standard things to trick the non standard compliant browsers into behaving in a standard type way.

          It's a vicious cycle. But still, these days, there are far more benefits to being as standard compliant as possible

          I think this is a legitimate strategy to serve documents in a correct manner because of browser bugs, especially as it is controlled

        • Well, technically it isn't breaking the spec, just bending it really far. The spec actually reads that html 4.01 _should_ be served as text/html, xhtml 1.0 _should_ be served as application/xhtml+xml, xhtml 1.1 _should_not_ be served as text/html, and it is very likely that the xhtml 2.0 spec will say that xhtml _must_not_ be served as text/html. So, while the spec strongly recommends against serving xhtml as text/html, if it keeps IE rendering the page, then I'm happy.

          This was all taken from Mark Pilgri
          • Well, technically it isn't breaking the spec, just bending it really far.

            No, it is actually breaking the spec. You (and Mark) are referring to an unofficial Note produced by a member of the W3C. A quote from that document:

            This document is a Note made available by the World Wide Web Consortium (W3C) for your information. Publication of this Note by W3C indicates no endorsement by W3C or the W3C Team, or any W3C Members.

            I am referring to RFC 2854 [ietf.org]. This RFC provides the list of document types

      • If only IE would support transparent PNG images.

        It does, in indexed mode (aka PNG8).

        In The Gimp, create a new image with Fill Type set to transparant. Right-click the image, "Image", "Mode", "Indexed". Save as PNG. Bingo, PNG with transparency that work in IE.

        More precisely, IE does not support the alpha channel of PNG.

    • by jdclucidly ( 520630 ) on Monday June 23, 2003 @05:12PM (#6277608) Homepage

      I think you're partially misinformed. XHTML will work in pretty much everything in existance. CSS, OTOH, is another story.

      Are we talking about content or design here?

      Because a number of sites (like this very popular one, Wired.com [wired.com]) use XHTML quite effectively with all known browsers. Sure, some browsers like Netscape Navigator will not render the design but all of the content is still accessible. Hell, I can even browse the thing in Lynx!

      So, I think the better question is: can the browsers display the content? And the answer is yes. Can they display all the new wiz-bang CSS layout stuff? The answer is probably. (Given that about 98% of the market is browsers that can.) Remember, it's far more important that your content is logically structured and accessible (which is what XHTML does) than it is that it looks classy (CSS).

    • You may loose your normal view of page layout formatting, but if you structure your XHTML Strict logically, it will still be a readable and navigateable document.

      If you structure your document well, with Strict DTD, you can apply different CSS to different media, and it takes very little editing and effort to do so.

      You can create printer friendly pages, mobile device pages, etc CSS, from exactly the same XHTML markup by applying different styles and displaying or hiding different sections.

      This also

    • I have to code in many ways to the lowest common denominator

      If all the people out there would just grow some balls and future proof their sites by implementing modern standards now, the sooner this problem will go away. A little "Your browser sucks, download Mozilla" won't hurt anyone. Then delete iexplore.exe to make them use Moz... nobody will miss the popups.

      • I hope you are kidding. I know that when designing a website for a client saying "Your browser sucks, download Mozilla" could definitely hurt. And deleting files? Come on. That could even be considered malicious.

        Sometimes you just have to code for what's out there. Try to change the world along the way, but realize that you're not going to convince everyone right away. There are ways to design for the standards and achieve backwards compatability at the same time.
    • I have to code in many ways to the lowest common denominator ...

      I see this phrase a lot, and nine times out of ten, the writer should be saying, "the higest common factor."

      You're likely coding for the *most* features supported by all of the browsers, i.e., the largest set of supported HTML features. For example , the lowest common denomintor would be something like HTML 1 or 2; the highest common factor is likely HTML 3.2

  • XHTML test suite (Score:5, Informative)

    by icemax ( 565022 ) <matthew_d_stone@ ... m ['il.' in gap]> on Monday June 23, 2003 @04:05PM (#6276841) Homepage
    is right here [www.hut.fi]! Seeing how you have all these browsers, run them against this suite, and see how they faire. Nothing like the fresh scent of google.
  • no problems here... (Score:5, Informative)

    by jdclucidly ( 520630 ) on Monday June 23, 2003 @04:12PM (#6276886) Homepage

    I've been using XHTML for all of my web developement for quite some time now. And in XHTML 1.0 Strict, mind you. Just stay away from using tables for layout and use CSS to accomplish your formatting and you'll be fine.

    The only quirk I ran in to was the new IE 6 "standards compliance mode" which should be rename "less-messed-up mode". While it fixes some bugs, it created new ones. To avoid developing for IE6's new quirks and to keep my documents compliant by having the !DOCTYPE declaration in there, I add the ?xml... declaration to the top of my files to kick IE back in to its 5.5ish quirky existance.

    Of course, IE still doesn't support the object tag correctly but will they ever?

    • To avoid developing for IE6's new quirks and to keep my documents compliant by having the !DOCTYPE declaration in there, I add the ?xml... declaration to the top of my files to kick IE back in to its 5.5ish quirky existance.

      There are problems with including the XML declaration/PIs in documents that you later serve as text/html, outlined in Appendix C of the XHTML 1.0 Recommendation. For instance, Pocket IE renders them as content.

  • Need a jump start?? (Score:5, Informative)

    by Monty67 ( 634947 ) on Monday June 23, 2003 @04:35PM (#6277130)
    Check out http://www.meyerweb.com/eric/css/edge/.
    Author of Cascading Style Sheets: The Definitive Guide. Or http://bluerobot.com/web/layouts/

    Both sites offer ready to go, CSS ideas that make moving to XHTML an absolute breeze. And the older browsers (including Netscape) have been covered.

    Excellent resource.

  • Moz been left out (Score:4, Informative)

    by Wuffle ( 651894 ) on Monday June 23, 2003 @04:37PM (#6277149) Homepage

    It seems that the chart linked to has no mentions of Mozilla/Netscape 7, which imo probably has the best support for the widest range of standards. Here's a page detailing the various XML stuff Mozilla supports. [mozilla.org]

  • by Trelane ( 16124 ) on Monday June 23, 2003 @04:43PM (#6277224) Journal
    The chart you supplied is lousy. Either it's vastly out of date, or it's deliberately slanted against non-IE browsers.

    For one, it simply lists an x for what is apparently full support, an (s) for somewhat supported, and nothing for no support. This is a terrible way of comparing things, since different browsers have different levels of support and different bugs in their implementation. CSS2 support is notoriously problematic, iirc. Not to mention that having "DHTML" and "JavaScript" support categories after this x/(s)/ fashion is fairly ludicrous. What about the various W3C CSS and DOM levels, and even the various components within DOM level 2?

    But the most blatant problem with the table is the fact that it covers Internet Explorer 6, Netscape 6, Netscape 4, and Opera 3.02(!), amongst others. While IE6 is current, NS4 and Opera 3.02 certainly are not! Not to mention that NS7, while quite nice, is lacking a lot from the cutting-edge Mozilla 1.3 and 1.4 versions.

    Anyone have a better comparison chart? Please post 'em below!
  • IE handles XML+XSLT+CSS pretty well, certainly in version 6.

    Mozilla's support would be OK, but it suffers from the same overly nitpicky irritation as it does with HTML+CSS: it stubbornly refuses to acknowledge that a file could possibly be XML or whatever unless the MIME type is correct. Given that even fewer servers, particularly those run by ISPs for their personal subscribers rather than run by companies for themselves, get the MIME type right for X* than they do for HTML+CSS, Moz is out of the race as

    • by Anonymous Coward
      So, let me get this straight. The browser should override the way someone else is specifically sending something? What if the browser guesses wrong? If I tell a browser to display something as text/plain, I don't want it rendered as html.
      • If I tell a browser to display something as text/plain, I don't want it rendered as html.

        Unfortunately, you are in a tiny minority. The vast majority of web sites I've seen trying to deliver XML content but sending it with a text/plain MIME type wanted it interpreted as XML.

        By all means leave the standard compliant interpretation in Moz, but at least provide an override to deal with the vast majority of cases where it's a simple error on the part of the server administrator (who frequently has nothing

        • Indeed, an option "Interpret this document as if it were of mime type ..." would be tremendously useful in lots of other contexts. Especially in situations where some clever admin decided to send you source code as application/x-c-source or whatever, and I just want to read it in the browser, some way to tell it "this is text/plain, dammit!" would make the world a less annoying place.
    • by JimDabell ( 42870 ) on Monday June 23, 2003 @05:48PM (#6278038) Homepage

      Mozilla's support would be OK, but it suffers from the same overly nitpicky irritation as it does with HTML+CSS: it stubbornly refuses to acknowledge that a file could possibly be XML or whatever unless the MIME type is correct.

      Stubborn? It's a required part of the HTTP specification. Every browser other than Internet Explorer gets this right.

      Given that even fewer servers, particularly those run by ISPs for their personal subscribers rather than run by companies for themselves, get the MIME type right for X* than they do for HTML+CSS, Moz is out of the race as a serious contender no matter how good its standards support may be.

      Granted, there are a few wonky servers out there, but they aren't anywhere near as widespread as you make out. If the server you are on is serving your files incorrectly, and you cannot fix this yourself, then complain. You are getting a substandard service.

      I agree that standards are important, but they are only a means to an end.

      If Mozilla and other browsers do the exact opposite of what the public specifications require, and instead blindly copy Internet Explorer, then they have essentially given control of that specification to Microsoft. How can this be a good thing?

      • It's a required part of the HTTP specification. Every browser other than Internet Explorer gets this right.

        And that makes what, 10% of the end user market between all of them? That's probably generous.

        Granted, there are a few wonky servers out there, but they aren't anywhere near as widespread as you make out. If the server you are on is serving your files incorrectly, and you cannot fix this yourself, then complain. You are getting a substandard service.

        Yes, I'm getting a substandard service. And

    • Given that even fewer servers, particularly those run by ISPs for their personal subscribers rather than run by companies for themselves, get the MIME type right for X* than they do for HTML+CSS...

      Have you tried using an .htaccess file? Some ISPs at least allow it.

      AddType application/xhtml+xml xhtml

      and variants may help. I haven't tried this myself though, as I'm quite comfortable serving up xhtml as html-lookalike 8-)
      • It would be nice to have one XHTML file on disk that would be served as application/xhtml+xml to clients that Accept it and as text/html to the others. Guess that could be done with mod_rewrite. However, you'd also need not to include the <?xml ... ?> declaration and processing instructions in that case, and for that you'd already need content handler (assuming Apache) that would work on the data in the stream, not just the meta information.

        Just switching everything to application/xhtml+xml will

        • It can be done with mod_rewrite - a quick search on Google will show how.

          You don't need to worry about the <?xml ...?> - the spec says it's optional, and in fact it is better to leave it out for IE6's sake, because it causes IE6 to enter quirks mode.
  • If at least the "main" browsers in current use have decent support (vague, I know) for XHTML/XML rendering, why haven't we all converted over yet?

    I think you answered your own question. As you point out, support for XHTML is "vague". That's another way of saying that compliance is very bad.

    Question: What's the problem XHTML is supposed to solve? Answer: the fact that too much web content only works correctly on a particular browser. (And often at a particular resolution!) XHTML does this by re-introduci

    • by JimDabell ( 42870 ) on Monday June 23, 2003 @05:54PM (#6278105) Homepage

      Question: What's the problem XHTML is supposed to solve? Answer: the fact that too much web content only works correctly on a particular browser. (And often at a particular resolution!) XHTML does this by re-introducing the strict content-presentation separation that is an essential feature of markup languages, but which HTML basically ignores.

      This is untrue. XHTML 1.0 (the only XHTML viable to the public web) is a direct translation from the SGML-based HTML 4.01. As such, it comes in three flavours:

      • XHTML 1.0 Transitional (includes the cruft that you claim is not in XHTML)
      • XHTML 1.0 Strict (The XHTML you describe)
      • XHTML 1.0 Frameset (ick)

      Later XHTML specifications build on XHTML Strict, but you can't use any of them with Internet Explorer without violating RFC 2854.

      • OK, I got sloppy about describing XHTML. But 1.0 transitional, is, well, transitional. The ultimate goal is ... well, see my previous post.
    • Question: What's the problem XHTML is supposed to solve? Answer: the fact that too much web content only works correctly on a particular browser. (And often at a particular resolution!)
      No, not just that. The main reason converting html to an xml specification is to allow user agents to use strict parsing and thus making the browser footprint smaller.
  • by jilles ( 20976 ) on Monday June 23, 2003 @05:58PM (#6278153) Homepage
    I try to make valid XHTML 1.0 strict pages. Of course if you turn your back for a second it is easy to let some none standard stuff slip in. But on the whole my sites should (mostly) validate as xhtml 1.0 strict.

    The nice thing about XHTML is that it is really straightforward to maintain. It's HTML the way it is supposed to be. If you don't use CSS to style it, it probably renders something usefull in any browser in use today. The problem is that you need to use CSS to provide layout and that no browser fully supports the CSS standards correctly. Mozilla does a nice job but does have many known bugs if you try to do some more exotic stuff. Internet explorer comes along nicely, as long as you avoid specific constructions. Opera and KHTML probably don't do a bad job either but I don't test for those.

    Overall I am positive about XHTML. I deliberately do not support netscape 4 (the handfull of users of that product have plenty of alternatives) and that does make life easier. If only it didn't try to interpret the CSS!

    The only downside of XHTML is that you have to use CSS, which IMHO is a very flawed language for what it's supposed to do. It is way too complex and that is also the reason why there is currently no fully compliant implementation available. In addition it is awfully limited in what it can do. It can be very frustrating to get very basic designs implemented in CSS. E.g. there is no obvious, clean way to get a status bar below three variable height columns. There's several dirty ways of doing it, though.

    Annoyingly, Internet Explorer always manages not to support features you absolutely need to get an elegant design working in it (this is not a problem with CSS of course). Really the only reason people resort to javascript for making menus is internet explorer's lack of support for CSS. You can do collapsible, nested menus with just a handfull of straightforward lines of CSS.

    Mozilla does a lot better and you are unlikely to run into bugs unless you really know your way around CSS. Typically the stuff that doesn't work requires a CSS expert to explain to mere mortals what it was supposed to do in the first place.

    I recently browsed through the CSS3 specs and I really hope to see some good implementations of it soon. It solves a lot of problems. Unfortunately I am very pessimistic about seeing any compliant implementations of it in wide use in the near future.

    Lately I have been giving some thought to doing mozilla only designs. It would make life much more pleasant. Unfortunately over 80% of my visitors are stuck with internet explorer.
    • I deliberately do not support netscape 4 (the handfull of users of that product have plenty of alternatives) and that does make life easier. If only it didn't try to interpret the CSS!

      if you load an external stylesheet using the @import command, NN4 doesn't know what you're on about and ignores the stylesheet altogether.
  • Warning: Google (Score:3, Informative)

    by ptaff ( 165113 ) on Monday June 23, 2003 @07:34PM (#6278993) Homepage
    I try to be as strict as possible. For this reason, I send my webpages (written in pure XHTML1.1) with a proper content-type: text/xml (XHTML should NOT be sent as text/html)

    Google will not correctly index pages sent as text/xml: it will simply write "File format: unrecognized", even with the proper !DOCTYPE, even with the html tag :( cloak your pages, everybody!

    MSIE has this nasty problem with the XHTML1.1 doctype, gives an error. Documents should be sent as text/html too. I guess it won't be fixed in the standalone version which is now to be discarded by Microsoft.

    The best way I've found to make browsers digest the HTML entities (we're not all using 7-bit clean languages!) is to never use entities, use plainly the numerical code.

    Apart from that, Mozilla is a great platform for XHTML, and even MathML and SVG (if your build has that enabled). So the modular nature of XHTML is becoming more and more useful ;) Great thing about Mozilla is its XML debugger: a "mismatched td in line 1226" is something you _need_.

    You must be careful with javascript in Mozilla too... old tricks a la document.write won't work; you have to do it the 'right way': through the DOM. And SGML comments wrapping STYLE and SCRIPT sections must be enclosed in proper CDATA marks.

    For those who complain that CSS is too complicated, it's just a matter of knowing, not understanding. The only thing you have to understand is that some elements are blocks, others are lines. All is declarative, there's not even a for loop or an if to confuse you :) After you know the names of the properties, it's really very easy.

    To conclude, yes, XHTML is the right way, but you have to polish it, like you'd do in other real programming languages. It's not for Aunt Sally anymore!
  • by h3 ( 27424 ) on Tuesday June 24, 2003 @02:13AM (#6281857) Homepage Journal
    This article has a great discussion on transitioning to XHTML and suggests a very cool trick for how to handle browsers that don't like application/xhtml+xml:

    http://www.xml.com/pub/a/2003/03/19/dive-into-xml. html [xml.com]

    -h3
    • The problem with the mod_rewrite suggested in that article, is the:
      RewriteCond %{REQUEST_URI} \.html$
      I follow the "cool URIs don't change" rules, and don't link to any .html pages, they are all served without extensions. So with no .html ending my REQUEST_URI the REWRITE will never be triggered.
  • If you want to be standards-compliant, and don't need the extras that XHTML provides, check out ISO/IEC 15445:2000 [cs.tcd.ie] and the associated User's Guide [cs.tcd.ie].
  • This isn't a troll. I browse with either Safari [apple.com] or a Mozilla [mozilla.org] derivative [mozilla.org], and use xhtml+css whenever I have to make a web page. That being said, if marketshare is the driving factor, then there's only one answer: MSIE for Windows. If you check out, say, Google's Zeitgeist survey [google.com], it's clear that the overwhelming majority of web surfers use MSIE, and that's what you have to cater too. Unfortunately for the rest of us.

  • And it's good fun. Sure, sometimes you miss the good old frames or the target attribute on your links (solvable via javascript) but all in all, using XHTML has made the layout on my site (www.sensenet.nu) alot easier. Also, the use of stylesheets meant that I could easily custimize/skin the site as needed.

    The only problem as I see it, is that XHTML 1.1 and CSS isn't always good. Just a simple thing such as aligning text & images in the center of a div means that I need to resort to tables since <cen
    • Just a simple thing such as aligning text & images in the center of a div means that I need to resort to tables since isn't allowed, and there is no horizontal-align (only text-align which "SHOULD" apply to text only, but some browsers seems to know better (ie, worse)).

      The text-align property applies to inline elements, including inline replaced elements such as images. That is all you need, and pretty much all browsers that support CSS understand this.

      Internet Explorer has problems relating

  • See this table [w3.org] for information on which browsers do or do not support the "application/xhtml+xml" media type. The only present browser that is a cause of problems with it is Internet Explorer.
  • No browser on Mac (I did not check iCab) are able to support UTF-8 as an XML declaration

    <?xml version="1.0" encoding="utf-8"?>

    Actually, I have to add an HTML declaration

    <meta http-equiv="content-type" content="text/html; charset=utf-8" />

    Removing it will make my pages appear "hieroglyphic". So I conclude it is not supported yet. What about IE6?

  • For crying out loud he WILLINGLY USES Internet Explorer! This usualy denotes phychoticness or what many psychiatrists use as a diagnosis "you are wack." But perhaps he is not all lost, he does use safari and mozilla...

Software production is assumed to be a line function, but it is run like a staff function. -- Paul Licker

Working...