- From: Michael[tm] Smith <mike@w3.org>
- Date: Mon, 19 Aug 2013 20:07:48 +0900
- To: "Jukka K. Korpela" <jkorpela@cs.tut.fi>
- Cc: "www-validator@w3.org" <www-validator@w3.org>, Andry Rendy <master.skywalker.88@gmail.com>
"Jukka K. Korpela" <jkorpela@cs.tut.fi>, 2013-08-19 11:35 +0300: > 2013-08-19 4:21, Michael[tm] Smith wrote: > > If Microdata and RDFa are separate, shouldn’t validators treat them as > separate? That is, accept each of them under its own rules. I guess so. But I don't think about it much. I just implement what the specs say. The separate specs -- since there is no spec that says "This is what should happen when you use Microdata and RDFa together." > There seems to be a conflict between HTML5 CR (Candidate Recommendation) and > the HTML 5.1 Nightly (Editor's Draft that typically changes daily). HTML5 CR > says about the meta element that "exactly one of the name, http-equiv, > charset attributes must be specified". Right. That's the core requirement in the HTML 5.0 spec. It doesn't provide either for Microdata or RDFa. Instead, the Microdata and RDFa specs extend the HTML spec by overriding that requirement and replacing it with separate other requirements that allow meta to have other attributes. > No mention of itemprop, so it will > presumably be governed by the general rules for general attributes only. > HTML 5.1 Nightly currently has itemprop, too, in the list, making <meta > itemprop=... name=... ...> invalid at the moment. That's always invalid, regardless. No version of the HTML spec anywhere -- whether it includes the definitions for Microdata or not -- defines meta@name with itemprop as valid, and neither does the HTML+RDFa spec. > That's a bit confusing, but what about <meta property=... itemprop=...>? > Which rule forbids it? The W3C HTML 5.0 spec forbids it; it doesn't allow the meta element to have either a "property" attribute or an "itemprop" attribute. And the Microdata requirements -- either in the separate Microdata spec or the Microdata requirements that are part of the WHATWG HTML spec and the W3C HTML 5.1/Nightly spec -- do not define a "property" attribute nor extend/override the HTML spec to allow a "property" attribute for meta. The HTML+RDFa spec extends/overrides the HTML 5.0 spec to allow the meta element to have an "property" attribute, but the HTML+RDFa spec does not define an "itemprop" attribute nor extend/override the HTML 5.0 spec to allow for an "itemprop" attribute on meta in addition to "property". I suppose some future version of the HTML+RDFa spec could provide for a definition of how to combine RDFa and Microdata attributes for the meta element. But at this point there is no such spec. > >The solution is to not use "itemprop" and property on the same element. > > Well, <p itemprop=foo property=bar> seems to pass validation today. Super. > Is this problem really specific to the meta element? It's specific to the meta element and to the link element. Because the HTML spec places certain constraints on how both of those can be used in the case where they lack Microdata or RDFa attributes, and different constraints on how they can be used if they have Microdata attributes or if they have RDFa attributes. > Is the effective rule really "exactly one of the name, http-equiv, > charset, itemprop, and property attributes must be specified"? No, I guess it's a bit more complicated than that. If you want more details, examining the following might help: https://github.com/validator/syntax/blob/master/relaxng/microdata.rnc#L41 https://github.com/validator/syntax/blob/master/relaxng/microdata.rnc#L68 https://github.com/validator/syntax/blob/master/relaxng/microdata.rnc#L76 https://github.com/validator/syntax/blob/master/relaxng/rdfa.rnc#L175 https://github.com/validator/syntax/blob/master/relaxng/rdfa.rnc#L179 https://github.com/validator/syntax/blob/master/relaxng/rdfa.rnc#L212 https://github.com/validator/syntax/blob/master/relaxng/rdfa.rnc#L246 https://github.com/validator/syntax/blob/master/relaxng/rdfa.rnc#L263 > Does this mean that if you wish to present metadata both according to > Microdata and according to RDFa, you need to duplicate meta tags? Yes > Instead of > <meta property=foo itemprop=xxx content=bar> > you would write > <meta property=foo content=bar> > <meta itemprop=xxx content=bar> Yes > This sounds odd, and I cannot find such a requirement in HTML 5.1 Nightly. There is no requirement at all in HTML 5.1 Nightly about "property". The "property" element's not valid in HTML 5.1 Nightly. > And I cannot see how a dual meta tag could cause harm. If by "dual meta tag" you mean a meta element that has both "property" and "itemprop" attributes, then I guess I also don't see any harm in it. But I also can't think of a non-pedantic real-world case where in which there'd be any practical value in doing it. It's all moot anyway since it's not defined by any spec to be valid. If by "dual meta tag" you mean using two separate meta elements, one with "property" and one with "itemprop", then I don't see any harm in that either. Again though I don't see any real-world case in which there'd be any practical value in doing it. But at least there are specifications that define it: meta@itemprop is defined as part of Microdata, and meta@property as part of RDFa (which does not mean that <meta itemprop.. property..> is defined). If you're unhappy with that answer, then I guess the solution is that you could ask somebody to write a specification that (unlike the existing specifications) actually defines document-conformance criteria for combining Microdata and RDFa attributes with the meta element (and link element). --Mike -- Michael[tm] Smith http://people.w3.org/mike
Received on Monday, 19 August 2013 11:08:11 UTC