pearweb content type: xhtml 1.0 vs html5

[email protected] ("Daniel O'Connor") Sat, 19 Mar 2011 17:23:46 +1030
Newsgroups php.pear.webmaster
Message-ID <[email protected]>
Christian, Helgi & others -

The question is... what do we want pearweb serving up?
XHTML 1.0 Transitional
XHTML 1.0 Strict + RDFa
HTML5
XHTML5
(X)HTML5 + RDFa/others


So; what are the benefits of each?
XHTML 1.0 Transitional - relaxed version of XHTML 1.0; fixes all of the bad
stuff from html 4; when served up as text/html works in many browsers in
their tag soup mode; etc. Not a bad goal to aim at. We get to stick a "we
make valid html" badge up and have a bit of respect from our users for
having nice XHTML.


XHTML 1.0 Strict - similar to above. If we want to do this right; we need to
serve it up as text/xml; internet explorer 6 won't like that; is very picky
when validated that *only* recognised XHTML attributes are in there. When
served as text/xml; if you have an xml problem = no page for user.


XHTML 1.0 Strict + rdfa - as above; but lets you put in metadata (stuff like
DOAP, FOAF, etc); which can be mined by tools that are aware of it. As an
example: Google and Yahoo extract rdfa for products, receipes; etc, and
there's a large amount of structured data out there growing rather quickly.


HTML5 - lots of new shiny toys are in there. Increasingly, browsers are
supporting parts of this; such as http://diveintohtml5.org/forms.html
Simply put; we can mark fields *required* and have FF4  (March 22nd release
date!) or Chrome (already doing it; chromium not so much yet) prevent a form
from being submitted. Neat. Worth noting, it's not a standard yet; but the
W3C is now involved in the process. Some core parts are doing going to
change dramatically (again, form controls).

XHTML5: as above. Extra provision - you include the xhtml namespace and
should be serving content as text/xml. Allows you to mix in any other
namespaces.

<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
lang="en" >

So what should we pick & why?
1) The inclusion of metadata such as RDFa allows us to treat pearweb as a
data provider in tools we write (such as XML_GRDDL); and search engines can
extract structured data from us.

2) Pragmatically; tools which deal with extracting content from HTML have a
tag soup parser or something like tidy to turn it into well structured data.

3) The usability benefits of form controls available in html5 are
significant

4) We're currently serving up xhtml 1.0 transitional without the xmlns;
making it just a bunch of html - see http://test.pear.php.net/ vs
validator.w3.org. We're also missing the xml declaration (to keep IE6 from
freaking out) and serving it up as text/html. If we were aiming at standards
compliance, I think we can say we've missed the target ever so slightly.
The impact to end users? Not that much actually.

5) Internet explorer 6 users account for 3.5% of traffic on w3cshool's
statistics - http://www.w3schools.com/browsers/browsers_explorer.asp ; all
higher versions of IE don't freak out with the text/html vs xml declaration
as I understand it. I imagine our statistics would be similar.


It's for these reasons I think we should:
 1. Swap to XHTML5 - DTD and xmlns declaration. Start using basic html5
things; like the form controls; where it provides benefit.
 2. Look at possibly swapping to text/xml or application/xml+xhtml as
appropriate in the near future; provided its not a huge pain and breaks half
of the pages - basically browsers >  xml tools for us.
 3. Watch what other people (drupal's html5 module folks for instance) are
doing in regards to rdfa vs html5; and copy that approach where it makes
sense.

Thoughts? Should I get my flamesuit?