xhtml-1.1

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

xhtml-1.1

Curtis Napier
While I'm waiting for Aaron to create a new logo I am taking the time to
upgrade the site to xhtml-1.1. I put this in a blog post yesterday and
already have received numerous reports that I am doing it incorrectly.

I want everyone on the list to feel confident in this change:


The specification for xhtml-1.1 says that the server *should* send
application/xml+xhtml in the HTTP header but that it *can* send
text/html in order to remain backwards compatible with older user
agents, IE for example. As long as the doctype is set correctly (and it
is) it is still valid xhtml-1.1.

In fact, if you use the validator, http://validator.w3.org, and let it
auto detect the doctype it correctly detects xhtml-1.1 and validates the
page using that specification (ignore the errors, I'm still workin' on
it). Browsers will also detect it, including IE, and use the correct
specs to render the page. They also render the page in Standards
Compliance Mode, including IE.

Trust me on this, I researched it *extensively* before making the jump
to xhtml-1.1, I didn't just blindly decide to change. I read the entire
xhmtl-1.1 specification. I didn't just skim it or skip any parts I read
the entire thing. I read the XSLT-1.0 specification to make sure I was
doing it right in the xsl. I also read TONS of threads from all over the
world discussing this, including from IE support sites, apache, mozilla,
w3c (extensively) and web designer sites.

MS officially suggests using text/html in the HTTP header when serving
xhtml-1.1 documents to IE. Mozilla, Opera, Firefox, Konqueror can all
correctly use application/xml+xhtml and officially suggest that is what
you send in the HTTP header but **ALL** of them are also backwards
compatible with text/html.

None of the text browsers, as far as I know, can use
application/xml+xhtml yet but, just like IE, they can correctly render
an xhtml-1.1 page validly and in Standards Compliance Mode with
text/html in the HTTP header.

When viewing pages that have been saved locally **all** browsers can
correctly load and render the pages if you change the extension from
.xml to .html, just like pages that end in .php for example.

So, to sum it up:

The site is validly serving XHTML-1.1 (except for the errors I haven't
fixed yet) that is recognized by all browsers and correctly rendered.
The server doesn't have to send application/xml+xhtml in the HTTP header
in order for it to be valid, it can send text/html too.
--
[hidden email] mailing list

Reply | Threaded
Open this post in threaded view
|

Re: xhtml-1.1

Xavier Neys
Curtis Napier wrote:

> While I'm waiting for Aaron to create a new logo I am taking the time to
> upgrade the site to xhtml-1.1. I put this in a blog post yesterday and
> already have received numerous reports that I am doing it incorrectly.
>
> I want everyone on the list to feel confident in this change:
>
>
> The specification for xhtml-1.1 says that the server *should* send
> application/xml+xhtml in the HTTP header but that it *can* send
> text/html in order to remain backwards compatible with older user
> agents, IE for example. As long as the doctype is set correctly (and it
> is) it is still valid xhtml-1.1.

It also says "should not" in black on red.
http://www.w3.org/TR/xhtml-media-types/#summary

You've explained at greath lengths why you think it is acceptable to send
text/html as content-type, but not why a user agent that accepts
application/xhtml+xml and is sent application/xhtml+xml is not told the
content is application/xhtml+xml
It's a minor issue with browsers, but I guess we'll get bugs or a questions
about that regularly.

Anyway, you should stick to xhtml1, preferably strict, because libxml2 does
not support 1.1.
http://mail.gnome.org/archives/xslt/2003-December/msg00047.html
http://bugzilla.gnome.org/show_bug.cgi?id=313707
Old stuff, but still valid.

If you stick to the XHTML 1.0 doctype, you'll notice magic stuff happening to
your transforms such as the name space being added to <html>, or xml:lang="pl"
automatically added if you only have lang="pl"...

e.g.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
                 xmlns:exslt="http://exslt.org/common"
                 xmlns:func="http://exslt.org/functions"
                 xmlns:str="http://exslt.org/strings"
                 xmlns="http://www.w3.org/1999/xhtml"
                 extension-element-prefixes="exslt func str" >

<xsl:output     encoding="UTF-8"
                 method="xml"
                 media-type="application/xhtml+xml"
                 indent="yes"
                 doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
                 doctype-system=
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>


€0.02
--
/  Xavier Neys
\_ Gentoo Documentation Project
/  French & Internationalisation Lead
\  http://www.gentoo.org/doc/en
/\


--
[hidden email] mailing list