Post Archive
› February 22, 2005
Serving content to mobiles: XHTML 1.0 or XHTML Basic?
One of the often heard arguments in favor of XHTML 1.0 is the promise of future compatibility with browsers on mobile devices. Indeed, accessing non-table driven XHTML 1.0 sites with a (in my case, Japanese) mobile phone is perfectly possible. This should come as a surprise though—mobile phones usually only support XHTML Basic (actually most of them support XHTML-MP, which is a superset of XHTML Basic, but let's keep things simple and say they support XHTML Basic). The reason you can browse through XHTML 1.0 sites is that most mobile browsers are not too strict about doctypes and mimetypes—they just try to render all elements that look sort of familiar, resulting in reasonably displayed content.
Note the similarity with IE6's consumption of XHTML 1.0. As IE6 only understands HTML 4.01, one should expect it having problems with stuff like <br/>. However, luckily enough, it is lenient in its error handling and just interprets <br/> as a weird variant of <br>, meaning that in practice, XHTML pages look fine in IE6 - maybe the only problem with IE6 not understanding XHTML is the much talked about text/html mime issue.
So, to summarize: when serving XHTML 1.0 content to IE6 and mobile devices we actually rely on their tag soup rendering capabilities in order to render our content...
The difference between both however is that in case of IE6, we're talking about a bug or a not-yet-implemented standard—hopefully the next version of Internet Explorer will really support XHTML 1.0, but in the meantime, nothing should stop us from using it. In the case of mobile phones, the situation is different though. Support for XHTML Basic is here and that's probably how it will stay—there is no move to fully support XHTML 1.0 on mobile devices.
So what should we do? Offer two versions of a webpage and serve the appropriate version via CC/PP based content negotiation mechanisms? Or else, just don't care too much about all this stuff (yet) —it is a bit an esotheric issue as rendering isn't really affected— and continue offering the same XHTML 1.0 to both desktop and mobile browsers?(*) I tend to go for the latter solution, but that's just me. What do WebGraphics readers think of this? Am I making a mistake? And isn't it time to see some more discussion about this kind of issues?
(*) With the exception of, for instance, an XHTML + hi-res images mix that is too heavy to load on mobile browsers and where you have no other choice but to serve them a lightweight version (XHTML Basic + lo-res images).
Comments
1. February 22, 2005 03:08 PM
2. February 22, 2005 03:09 PM
Anne Posted…
So in the end, to answer the question, I think sticking to HTML 4.01 Strict is best.
3. February 22, 2005 06:55 PM
Dean Jackson Posted…
I work in a W3C group with a lot of mobile browser vendors. Nearly all of them say that their product can support XHTML 1.0 (and even 1.1) in full. They also certainly are interested in MIME types, given the amount of detailed discussion we have on them. It would be fair to say that mobile browser vendors are at least as dedicated in implementing the standards as desktop browser manufacturers (and probably more dedicated). I think the problem comes when they start to deal with putting code on the device. The handset manufacturers want the smallest footprint possible, and also want to conform to their requirements (eg. the OMA requires handsets support for XHTML-MP, with its different MIME type, and usually nothing more). Therefore they sometimes ask for the browsers to remove the extra functionality. Given that a huge number of people will be accessing the regular Web, I think it's probably ok for the browser to do its best. I also think it won't be too long before handsets just support XHTML 1.0 because it isn't that much more difficult. I'd guess that the jump from CSS-MP to CSS 2.1 is a much greater burden.
4. February 22, 2005 07:59 PM
Dejan Kozina Posted…
All this still leaves out the huge amount of people that believed the hype about XML-based languages being future-proof and bought WAP-phones when this meant WML. Phone browsers have a faster substitution rate than NN4 and IE5, but there is still a boatload of them waiting for the web to deliver the promised device independence. Plus all those millions using i-mode... I hope there is nobody more out there stuck with HDML.
Short answer is: every way you choose, you'll let somebody down. My (imperfect) solution is to let the browser decide using WURFL; it still doesn't guarantee a decent result, just a lot of work to hope to the best.
P.S. : next time somebody says that X-something is obviously going to win the world over because it's based on XML, just remember SMIL, WML, SVG, VoxML, XAML, XFDL, PGML, CDF, OSD...
5. February 23, 2005 01:40 AM
Andreas Posted…
I think the problem comes when they start to deal with putting code on the device. The handset manufacturers want the smallest footprint possible, and also want to conform to their requirements (eg. the OMA requires handsets support for XHTML-MP, with its different MIME type, and usually nothing more). Therefore they sometimes ask for the browsers to remove the extra functionality.
That's interesting.
Given that a huge number of people will be accessing the regular Web, I think it’s probably ok for the browser to do its best. I also think it won’t be too long before handsets just support XHTML 1.0 because it isn’t that much more difficult.
Nice. So there is a move to XHTML 1.0 even on mobile devices. So, if I understand you correctly, it's a good idea not to worry too much and offer XHTML 1.0 to all devices?
I’d guess that the jump from CSS-MP to CSS 2.1 is a much greater burden.
Probably. But I don't think we need this jump. CSS positioning for instance would be overkill on portable devices.
Dean, what are your thoughts on the WURFL Dejan mentions? (According to the WURFL site, UAProf, which is a CC/PP application, is flawed and hence, there is need for a universal resource file such as the WURFL.)
6. February 23, 2005 03:49 AM
Michael Smith Posted…
I'm extremely lazy, so I'm personally inclined to not bother with attempting to serve up a separate mobile-devices-only version of any "normal" existing Web content I might have, even if the work just amounts to creating an additional stylesheet.
Personally, when trying to get content to display in a worthwhile way on the 携帯 (handsets) I test with, the problems that I have run into relate (I think) more to device limitations -- not to browser limitiations. I believe most handsets have memory limitations that severely limit the size of the pages they can display. If you have pages with a lot of content -- especially pages with lots of images, the browser can't even load them because they're too big.
So I reckon that -- more important than trying to restrict pages to just using XHTML elements that browsers can handle correctly -- the main "best practice" to try to follow is to "chunk" content -- keep the size of individual pages relatively small, and add lots of navigation to help users get to what they need.
7. February 23, 2005 04:25 AM
Anne Posted…
So Dean, when I feed my mobile with a an application/xml page with some mixed namespace usage they will not parse it as HTML (tag soup)? What exactly does XHTML 1.0 support mean? What does it include? And supporting XHTML 1.1 is trivial when you already support XHTML 1.0. Except of course for image maps. How they act with that?
I do believe that the Opera mobile browser is pretty advanced. But I haven't had time to test it fully yet.
8. February 23, 2005 07:22 AM
Charl van Niekerk Posted…
I have to agree with Anne here. The only mobile browser I know that actually offers some real XHTML support is Opera Mobile, although I'm not an "advanced" mobile user myself and I'm not too hot on this issue.
XHTML Basic can be thrown out of the door IMHO. Mobile Browsers try to render as much of the current Internet correctly as possible, while some support more than others. And these browsers are advancing so fast that the need for WAP has virtually disappeared, and a similar thing has happened to XHTML Basic. As stated in the post, browsers already support more than that subset of XHTML.
XHTML Basic was created many years ago when mobile devices were still relatively primitive. And yeah, I would still like to see this so-called "XHTML Support" from many of these browsers...
9. February 23, 2005 06:24 PM
jacob Posted…
Here's some anecdotal data: I have a Sony Ericsson T610 mobile phone, and T-Mobile (USA) is my service provider. The web browser in my phone only seems to understand two content types: WML served with the "Content-Type: text/vnd.wap.wml" header, and XHTML Basic with the "Content-Type: application/vnd.wap.xhtml+xml". It does not seem to support HTML 4.01, XHTML 1.0, or XHTML 1.1, regardless of the content type header (i.e., "text/html", "application/xhtml+xml", "text/xml", or "application/xml").
I had never heard of CC/PP before, and I'll have to look into it. Currently, I'm serving either HTML/XHTML or XHTML Basic using content negotiation based on the user agent's Accept header. I only do this to satisfy my own need to tinker, not for any serious purpose -- thankfully. Finding good documentation and mobile device emulators seems more difficult than it ought to be.
10. March 23, 2005 03:54 AM
m0n5t3r Posted…
Funny, my SonyEricsson T300 seems to understand quite a lot, according to the HTTP_ACCEPT header:
application/vnd.wap.wmlc, application/vnd.wap.wbxml, application/vnd.wap.wmlscriptc, application/xhtml+xml, application/vnd.wap.xhtml+xml, application/vnd.wap.mms-message, application/vnd.wap.connectivity-wbxml, */*, text/vnd.wap.wml, text/xml, text/vnd.wap.connectivity-xml, text/vnd.wap.wmlscript
Oh, and you are right, finding info about these toys is terribly hard... For instance, I can't find anywhere the maximum page size that my mobile browser would accept (I guess it's the same for all of them).
11. March 29, 2005 11:52 PM
3g Phones Posted…
Does anyone know where I can find some sort of table for different phone devices and their support of XHTML, CSS etc?
12. April 8, 2005 09:33 PM
sirshannon Posted…
Does anyone know where I can find some sort of table for different phone devices and their support of XHTML, CSS etc?I would highly recommend you check into WURFL (at http://wurfl.sourceforge.net/ ), it is an open community-based project that has definitions for about 6000 devices at the moment (and the capability document is easily maintained and updated) and has a JSP tag library (WALL) that handles adaptive rendering for the different devices. It isn't perfect but I've found it indispensible in the mobile work that I've been doing lately.
There are also related projects that are based on other languages, if you're not working with JSP.
Anne Posted…
Last time I heard it mobile parsers are tag soup parsers meaning they accept everything. (I believe some do not even check the MIME type.)