NU’s polyglot possibilities (Was: The non-polyglot elephant in the room)

Michael[tm] Smith, Mon, 21 Jan 2013 23:47:40 +0900:
> Martin J. Dürst, 2013-01-21 20:14 +0900:

>> What would be the effort of checking for polyglot markup?

> In the simplest implementation, the validator would need to 
> automatically parse and validate the document twice

1 Could you do that? Just guide the user through two steps:
  HTML-validation + XHTML-validation? The second step could also
  produce a comparison of the DOM produced by the two steps.

2 But if the author uses a good, XHTML5-aware authoring tool that
  keeps the code well-formed, then a *single* validation as
  text/html should already bring you quite far.

3 Finally, one very simple thing: polyglot dummy code! The NU
  validator’s Text Field contains a HTML5 dummy that validates,
  but only as HTML, since the namespace isn't declared. Bug 
  20712 proposes to add a dummy for the XHTML5 presets as well.[1]
  Such a dummy no doubt serves as a teachable moment for many. And
  as long as you just add the namespace and otherwise keep the 
  current dummy document intact, it would also, without banging
  it into anyone’s head, be a polyglot example.

[1] https://www.w3.org/Bugs/Public/show_bug.cgi?id=20712

-- 
leif halvard silli

Received on Thursday, 24 January 2013 00:23:48 UTC