Page 1 of 1

polyglot

PostPosted: Sat Oct 20, 2012 7:02 am
by roedygr
I saw a note saying the beta contained new features for polyglots.

I expected this to mean either:

<span lang="de"> would engage a German dictionary. It does not.

Napol&eacute;on would look up Napoléon in the spell check dictionary. It does not.

What is the new feature?

Re: polyglot

PostPosted: Mon Oct 22, 2012 8:55 am
by Albert Wiersch
roedygr wrote:<span lang="de"> would engage a German dictionary. It does not.


I'd like to implement this, but currently CSE HTML Validator does not support changing dictionaries

roedygr wrote:What is the new feature?


This is some basic information from the documentation:
The common way to serve HTML is with the MIME type 'text/html', but XHTML5 must be served with the MIME type 'application/xhtml+xml'. This creates problems for older browsers like IE8, so developers may not want to serve documents with 'application/xhtml+xml' to the general public. Fortunately IE9 added support for 'application/xhtml+xml', but that still leaves a lot of older browsers, like IE8 and below, that don't support 'application/xhtml+xml'.

'Polyglot' documents can be served with either 'text/html' or 'application/xhtml+xml', without any changes to the document itself (only the MIME type differs). This is because polyglot XHTML5 documents follow the rules for both HTML5 and XHTML5 documents and thus can be parsed by both HTML and XML parsers. Polyglot documents also result in the same DOM, whether parsed by an HTML parser or by an XML parser. This ensures that CSS and JavaScript work the same, regardless of the parser.


Here is a good article:
Benefits of polyglot XHTML5

And a specification:
http://dev.w3.org/html5/html-xhtml-author-guide/