Forum Moderators: open
Never mind that the server sent the proper "application/xhtml+xml" MIME-type!
I'm not sure if it's still *that* broken, but it certainly was yesterday...
Jim
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd"> When validating a document with a non-W3C DTD, I usually turn to the WDG validator [htmlhelp.com] for comparison with the w3.org version (the WDG validator tends to handle custom DTDs better). However, a simple document with the above doctype fails completely in both validators.
Looking deeper, I don't think it is a validator issue at all, rather a MIME type issue. As I understand it (I'm willing to be corrected on this), when encountering a "new" (ie. not the usual W3C HTML/XHTML doctypes), the validator will fetch the DTD referenced in the doctype and parse the document according to that DTD. Such an approach would at the very least be logical.
The problem comes when you view the wapforum.org DTD (use Firefox and follow this link):
[wapforum.org...]
XML Parsing Error: syntax error
Location: [wapforum.org...]
Line Number 19, Column 1:
So the referenced DTD throws an XML error! Of course, we're talking about a DTD here, not an XML document: the DTD is served up as
text/xml - which is totally wrong, as DTD files use SGML syntax, not XML. This shows a few things - firstly, the dangers of relying on an external DTD, secondly, the importance of sending files with the right MIME code, and thirdly, the weakness of XML on the web.
On a not totally unrelated topic, does using
application/xhtml+xml work well these days with mobile devices? My understanding was (and I don't develop for mobiles so I may be out of date) that most if not all authors blithely ignored the specification regarding MIME types and served everything as text/html instead.
I used that DTD and the application/xhtml+xml MIME-type on the recommendation of ready.mobi, and it passes *their* validator.
[added] As I recall, the "Mobile Specification" said that servers *should* serve as application/vnd.wap.xhtml+xml or application/xhtml+xml, but that clients *must* accept text/html. Google didn't like application/vnd.wap.xhtml+xml either, as I recall, so I'm using application/xhtml+xml. Frankly, I just kept adjusting things until everything worked in all the emulators, search engines, and phones/PDAs I could get my hands on. As usual, it looks like it'll be awhile before the "standards" are standard. [/added]
Jim
[edited by: jdMorgan at 1:47 am (utc) on July 17, 2007]