Browser Support for XHTML?
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?
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!
On Arrakis: early worm gets the bird. Magister mundi sum!
is right here! Seeing how you have all these browsers, run them against this suite, and see how they faire. Nothing like the fresh scent of google.
__________
Love conquers all... except CANCER
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?
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.
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.
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!
--
Given enough personal experience, all stereotypes are shallow.
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 a serious contender no matter how good its standards support may be.
In an attempt to preempt the inevitable slashbot responses, yes, I agree that standards are important, but they are only a means to an end. If you stick to standards so religiously that you can't actually do the job -- in this case, displaying the content as the provider and end user want -- what's the point?
If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
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.
Of course, your XHTML tags don't specify exactly how your document is presented, you have to put formatting information somewhere else. That somewhere else is in style sheets. And CSS2 support sucks, especially in Internet Explorer. So you can't just write a CSS2-compliant style sheet and assume it will display the same way no matter what your browser is.
Perhaps I'm overstating the compliance issue. Certainly awareness is a big problem as well. Most web developers just don't see any reason to worry about the difference between align="center" and style="text-align: center;". Come to think of it, I think the current version of Mozilla Composer is the first one that complies with XHTML this way.
What? XHTML served as text/html validates just fine.
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.
Jilles
OK, I got sloppy about describing XHTML. But 1.0 transitional, is, well, transitional. The ultimate goal is ... well, see my previous post.
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 makes Strict more attractive to documents stored in XML and rendered through XSLT. It makes the target format more flexible, and also makes it much more easy to radically change the design (if need be), via some changes to the Style Sheets, which is no where near as easy when trying to attempt the same in Transitional DTDs.
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)
:( cloak your pages, everybody!
;) Great thing about Mozilla is its XML debugger: a "mismatched td in line 1226" is something you _need_.
:) After you know the names of the properties, it's really very easy.
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
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
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
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!
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:
. html
http://www.xml.com/pub/a/2003/03/19/dive-into-xml
-h3
I disagree. I think it's a poorly thought out security policy that runs executable code without proper checks that has done that. The fact that the flaw was in how MIME types were handled is coincidental. There are no MIME types in propagating a Word macro virus, but the underlying problem is the same.
If another client provided an option to be compatible with the Microsoft client used by 90% of the world, then users wouldn't be forced to use Microsoft's, would they? :-)
If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
If you want to be standards-compliant, and don't need the extras that XHTML provides, check out ISO/IEC 15445:2000 and the associated User's Guide.
WeRelate.org - wiki-based genealogy
This isn't a troll. I browse with either Safari or a Mozilla derivative, 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, 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 <center> 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)).
As for compatibility, Opera, IE and Mozilla has sucessfully rendered my pages. Ofcourse, there are some minor bugs (Mozilla sets borders on hidden form field, Opera adds lots of space between lines on <ul> lists) but all in all, I like it.
Now, if only pseudoclasses worked as advertised on all browsers, my work would be alot easier
Anyway, thats my five cents...
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
Java is the blue pill
Choose the red pill
See this table 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.
It is entirely the point. Compatibility with existing software, particularly such dominant software as IE, is vital to any competitor that hopes to go anywhere. Can you name a single widely-used and successful product that has taken the crown in its field from an incumbent market leader without being compatible with it?
I'm not bending any of my principles. I value a useful product that is compatible with its peers above some theoretical advantage of compliance with a standard to which more than 90% of users do not adhere. One of the great claims of the whole "open whatever" movement is that it promotes compatibility and you can't be locked out. And yet here is a leading open product deliberately locking itself out of being compatible with the tool most people use.
You can face Microsoft, play by their rules but better, and win. Linux, Apache and Java come to mind as examples where Microsoft has lost overall control of a market it previously dominated to a superior product.
Now study OSS and ask yourself why tools like Mozilla and OpenOffice still have a market penetration that barely registers, when Mozilla is superior to IE in several important ways, and OpenOffice is a plausible and much cheaper alternative to Word for casual home users. They have the same disadvantages as so much open source: incompatibility, poor usability and poor marketing compared to the big players.
If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
That's just covering up a symptom of the underlying problem. Why do applications like web browsers, word processors and spreadsheets need the ability to run code, and automatically at that, when that code can damage the data on my computer?
If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
No browser on Mac (I did not check iCab) are able to support UTF-8 as an XML declaration
Actually, I have to add an HTML declaration
Removing it will make my pages appear "hieroglyphic". So I conclude it is not supported yet. What about IE6?
-- Force & respect, Vrykolaka
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...
You can't blame the end users for the sort of screw-ups we're talking about. There is little need for any web browser or word processor to provide scripting facilities that can affect data on my hard drive anyway. Even if the facilities are there, the problem is that "autoexec" scripts for WP documents, or automatically rendering HTML e-mail as if it were a web page, scripts included, allow the end user to run executable code when they wouldn't expect to be doing so.
And if you're going to talk about liabilities, you might start with relying on a "standard" such as MIME types that is violated by large numbers of content providers, and by the browser that dominates the market. Such a standard isn't really standard at all, is it?
I'm sorry, but your whole argument is just aiming at the wrong target.
If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.