{"id":184,"date":"2006-10-24T21:25:28","date_gmt":"2006-10-25T04:25:28","guid":{"rendered":"http:\/\/wapreview.com\/?p=184"},"modified":"2020-09-25T09:46:27","modified_gmt":"2020-09-25T16:46:27","slug":"validation-is-your-friend","status":"publish","type":"post","link":"https:\/\/wapreview.com\/184\/","title":{"rendered":"Validation is Your Friend"},"content":{"rendered":"
It constantly amazes me that so many mobile web sites fail validation. And it’s not just new sites, even some of the biggest names in the industry have mobile pages that have been failing for years when validated by the W3C’s online validator<\/a>. Probably a third of all the sites I look at don’t validate. The most common problems are:<\/p>\n I’m sure a lot of you who are web developers are saying, “Yeah, but validation is an academic thing, what really matters is that my site works in the real world”. Of course you are right, users don’t care about validation they just want stuff to work. Furthermore, when building PC web pages validation really isn’t very helpful. Desktop browsers silently ignore almost all markup problems -the real trick is getting the pages to look good in the various browsers. Six PC browsers have something like 99% of the market so you can test a page in a few minutes with at most three PCs.<\/p>\n Mobile is different world, browser designers are faced with severe memory and processor constraints as well as the need to obtimize performance on an already slow system. For the browser to work around invalid markup is just a waste of resources. There are literally hundreds of different mobile browser versions. Testing on real devices is great but it’s impractical to actually test on more than a small fraction of the various mobile browsers out there. Most mobile development shops are probably testing with just a few devices, maybe a recent Nokia, a Palm Treo or something with Openwave 6. The trouble is that those are among the most forgiving of browsers when it comes to bad markup. Pages that work fine on an N70 will fall over on Opera Mobile or Mini or the Teleca browser used on many Samsungs, LG’s and Sony Ericsson’s. The good news is that if your markup is valid and page size is under 20 KB (including images) your site will load and display without errors on 99% of WAP2 browsers.<\/p>\n It’s easy to validate a single mobile page. The W3C validator I mentioned above is a no brainer – just paste in the page’s URL and press Validate<\/em>. For proper results the page should be on a public server and sent with the correct mime type (application\/xhtml+xml for WAP2 or text\/vnd.wap.wml for WAP1 – the validator doesn’t support application\/vnd.wap.xhtml+xml but then neither do many mobile browsers.) Also note that while the site can validate an html page uploaded from a local disk file that feature doesn’t work properly for XML based markup like wml or xhtml-mp.<\/p>\n It’s even easier is to use Firefox to validate mobile pages. You do need to install a few Firefox extensions first:<\/p>\n Validating an entire large mobile site one page at a time is a painful process. Fortunately the Web Design Group has a validator<\/a> that will validate a site recursively. It doesn’t give as detailed reports as the W3C validator and it displays the message “Level of HTML: Unknown (XML)” when validating xhtml-mp pages. But I spot checked it’s results against the W3C validator and it found the same errors; unescaped ampersands, improperly nested tags, unclosed tags and even tags like strike and center that are valid in html but not in xhtml. Unfortunately, it’s limited to only validating 100 pages per site. Anyone know of a recursive validator with a higher or no limit? It constantly amazes me that so many mobile web sites fail validation. And it’s not just new sites, even some of the biggest names in the industry have mobile pages that have been failing for years when validated by the W3C’s online validator. Probably a third of all the sites I look at don’t validate. The most common problems are: “Naked” ampersands in text and URLs (XML based markup requires that all ampersands be represented by the appropriate html entity). … Continue reading \n
\n
\n
\n
\n
\n
\nIf you don’t validate your xhtml mobile sites you risk losing at least 10% of your potential audience. That’s the approximate combined market share of the Opera Mobile, Opera Mini and Teleca browsers. Ten percent of US mobile web users is 3.5 million users. The W3C claims<\/a> that there are 1.1 billion web capable handsets worldwide. Do you want to give up reaching 100 million sets of eyeballs because of trivial errors in your site’s markup? I don’t think so – validate! Incidentally, if you are still maintaining wml sites validation is even more important , very few browsers can handle ANY errors in wml markup.
\nRelated:<\/p>\n\n