[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XHTML 5 and validation

  • From: Jesper Tverskov <jesper.tverskov@gmail.com>
  • To: xml-dev@lists.xml.org
  • Date: Fri, 20 May 2011 18:05:44 +0200

Re:  XHTML 5 and validation
Good news!

All the issues I have so aggressively raised, have been solved.

The solution is to use the wonderful polyglot version of XHTML5,
http://www.w3.org/TR/html-polyglot/, that is an XML document that
validates as HTML5 if served with mimetype "text/html" and as XHTML5
if served with mimetype "application/xhtml+xml".

I have made a test document and both W3C Markup Validator and
Validator.nu work right away. The document validates without the need
for settings as HTML5 and as XHTML5 depending only on the mimetype
used!

The W3C Markup Validator could be better. It doesn't say what mimetype
was detected, and report "valid HTML5" in both cases.

*** There is another problem with the the W3C Validator, I would like
to ask the list about.

The W3C guidelines, "Polyglot Markup: HTML-Compatible XHTML Documents"
(see link above) recommends to use one of three methods, separately or
in combination, to get encoding right:

Within the document
1.	Byte Order Mark (BOM) character (preferred).
2.	<meta charset="UTF-8"/>.
Outside the document
3.	When setting the mimetype.

I use all three methods.

The W3C Markup Validator validates the document but gives the following warning:

"Byte-Order Mark found in UTF-8 File. The Unicode Byte-Order Mark
(BOM) in UTF-8 encoded files is known to cause problems for some text
editors and older browsers. You may want to consider avoiding its use
until it is better supported."

Is this still relevant? Should I drop the BOM (the polyglot guidelines
call it the preferred method) and only use the two other methods?

By the way, some other good news.

*** It is easy to create polyglot XHTML5 with XSLT 2.0 ( I used
Saxon). The following serialization
attributes should be used:

method="xhtml"
omit-xml-declaration="yes"
include-content-type="no"
byte-order-mark="yes" (optional)
encoding="UTF-8" (optional)
indent="yes" (optional)

And you should remember to place <meta charset="UTF-8"/> in the head
section of the XHTML document.
That is it. Thanks for the help.

Cheers,
Jesper Tverskov
http://www.xmlplease.com


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.