DOCTYPE Control (tick_24Pro, tick_24Std, cross_24Lite)

DOCTYPE Control Options

Validate HTML5 documents as - This option applies only to HTML5 documents. If you want to enforce XML rules for better structure and well-formedness, and to check to XHTML5, then set this option to 'XHTML5' or 'Polyglot'. The default is '(auto)'. (New v11.9915)

NOTE: If a MIME type is available for an HTML5 document, then the MIME type is used to decide whether to check to HTML5 (text/html) or XHTML5 (application/xhtml+xml). If the 'Validate HTML5 documents as' option is set to 'Polyglot', then polyglot checking is enabled regardless of the MIME type.

About XHTML5 and Polyglot HTML5

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.

We recommend that web developers consider polyglot documents because:

they can be served with 'text/html', which is widely supported,

they can also be served with 'application/xhtml+xml',

they can be parsed by XML parsers and can be processed and generated by XML tools,

a single document can be treated as HTML5 or XHTML5, without the need to maintain both an HTML5 and XHTML5 version of a document,

such documents are well-formed and follow stricter rules, and

validating only to HTML5 will likely result in 'messier' documents which may be more difficult to create, maintain, and reuse.

For more information, please visit:

Polyglot Markup: HTML-Compatible XHTML Documents

Benefits of polyglot XHTML5