W3C home > Mailing lists > Public > www-archive@w3.org > January 2013

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

From: Michael[tm] Smith <mike@w3.org>
Date: Sat, 26 Jan 2013 18:51:50 +0900
To: Leif Halvard Silli <xn--mlform-iua@xn--mlform-iua.no>
Cc: www-archive@w3.org
Message-ID: <20130126095149.GI42246@sideshowbarker>
Hi Leif,

Moving this to www-archive because I think we've gotten off-topic already.

> @2013-01-25 04:24 +0100:
> Back to polyglot markup validation:
> 2) Validating polyglot XHTML5 as HTML5 by selecting XML parser 
>    plus HTML5 preset should also have worked, but there is a 
>    weird bug 20766 which sees the @lang attribute as invalid
>    <https://www.w3.org/Bugs/Public/show_bug.cgi?id=20766>.
>    When you fix that bug, then pretty good one-pass polyglot
>    checking will be possible for XML documents as well ...

As far as I can tell from the examples in your comments for that bug, what
you seem to be wanting to do is to have a document parsed as XML but then
checked against the HTML5 schema instead of the XHTML5 schema.

If so, the solution to that problem is: Don't do that.

I don't think the validator is designed to necessarily do something
completely sensible in that case. I guess this may not be clear from the
validator UI, but I think the schema that's labeled "HTML5" in the
validator UI is explicitly intended for validation with documents that have
been parsed as text/html. (Henri can correct me if I'm wrong.) Certainly
from my understanding of the spec at least, that *should* be the intent.

I can say at least that I'm certain about the intent in the schema that's
labeled "XHTML5" in the validator UI. That certainly is not intended for
use with text/html documents -- because if you choose the HTML5 parser for
the parser option, the UI doesn't even allow you to choose any of the
XHTML5 schema options; the validator grays them out and doesn't allow you
to select them.

So perhaps the fix for the bug you reported is that we need to do the same
thing if you chose the XML parser; that is, we need to then gray out all
the HTML5 schema options so that you can't select them and so won't run
into the unexpected condition you're running into now, which the HTML spec
doesn't actually define any behavior for.

Anyway, the only reason why I can see why anybody would take the time
needed to force the validator options into this state rather than just
going with the sane defaults the validator provides is if you had the
notion of a Polyglot document in your head and were trying to convince the
validator to recognize a document as such even though it's not intended to
and not advertised as providing any means for doing that.

And now I've had to read through that bug and try to figure out the real
problem is, it makes me realize the Polyglot spec is already introducing a
validator-maintenance cost terms in terms of time I need to spend on bug
reports due to expectations created by the Polyglot spec.

  --Mike

-- 
Michael[tm] Smith http://people.w3.org/mike
Received on Saturday, 26 January 2013 09:52:02 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 26 January 2013 09:52:02 GMT