PDA

View Full Version : Validating XHTML Mobile Profile


gran
06-20-2006, 01:35 PM
Hi

I've been trying to validate XHTML MP code with w3c's validator but whitout success, and it seems as if I can't figure this out by my own. Below is a link to the result of the validation of a simple XHTML MP page that I wrote:

Result of validating my simple XHTML MP (http://validator.w3.org/check?uri=http%3A%2F%2Fportal.miun.se%2F%7Eangr0602%2Fsimple.html&charset=%28detect+automatically%29&doctype=Inline&ss=1)

Other people seem to have this problem to. I have tried validating every "-//WAPFORUM//DTD XHTML Mobile 1.0//EN!" I have found but with the same result almost every time. Even google's page doesn't validate:

Result of validating google.se/xhtml (http://validator.w3.org/check?uri=http%3A%2F%2Fwww.google.se%2Fxhtml&charset=%28detect+automatically%29&doctype=Inline&ss=1)

There is one exception though. A swedish service called hitta.se has done it, but I can't figure out how. Link:

Result of validating mobil.hitta.se (http://validator.w3.org/check?uri=http%3A%2F%2Fmobil.hitta.se%2F&charset=%28detect+automatically%29&doctype=Inline&ss=1)

What is the trick? What am I doing wrong?

Thanks for your help!

jdandrea
06-30-2006, 06:57 PM
Greetings! I'm running into the exact same problem.

My first guess is the Content-Type must be set to "application/xhtml+xml" on the server end. In my case I can't change the server's content-type (yet) so I tried influencing this via metadata (using http-equiv), to no avail.

More clues/ideas welcome!

- Joe

jdandrea
06-30-2006, 07:55 PM
Here's how I worked around being unable to modify the Content-Type on the server end. It requires running your own installation of the W3C Validator (which, it turns out, I already had on the trusty PowerBook).

The idea is simple enough: allow text/html as a Content-Type. I suppose this practice is debatable, but for now I must point to the validator already allowing XHTML 1.0 (even Strict) to use a Content-Type of text/html. (The key here is that we're talking v1.0, not 1.1 or higher.)

With that, add this to the end of /etc/w3c/types.conf ... and you're done!

<XHTML_MOBILE_1_0>
Name = xhtml
Display = XHTML Mobile 1.0
Info URL = http://www.openmobilealliance.org/tech/DTD/
PubID = -//WAPFORUM//DTD XHTML Mobile 1.0//EN
SysID = http://www.wapforum.org/DTD/xhtml-mobile10.dtd
Namespace = http://www.w3.org/1999/xhtml
Parse Mode = XML
<Types>
Allowed = text/html
Allowed = application/xhtml+xml
Preferred = application/xhtml+xml
</Types>
<Badge>
URI = http://www.w3.org/Icons/valid-xhtml10
Height = 31
Width = 88
Alt = Valid XHTML Mobile 1.0
</Badge>
</XHTML_MOBILE_1_0>

davecasserly
07-25-2006, 01:47 PM
Remove the xml declaration:

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

(if you have one) - then it should validate. I had similar problem.