Re: Status of ISSUE-126 and ISSUE-139

Hi Manu,

Thanks for pinging me. Comments below.

> @2012-09-02 21:30 -0400:
> I was asked to write up a summary of the current status of ISSUE-126 and
> ISSUE-139. Alex, Mike, your feedback on the items below would be
> appreciated.
> 
> ISSUE-126: Can xmlns: be reported as a warning?
> -----------------------------------------------
> http://www.w3.org/2010/02/rdfa/track/issues/126
> 
> Mike Smith would like us to state this in the HTML+RDFa spec:
> 
> "Conformance checkers may report the use of xmlns: as an error."
> 
> This is a change from what the spec says right now, which is:
> 
> "Conformance checkers must accept attribute names that have a case
> insensitive prefix matching "xmlns:" as conforming. Conformance checkers
> should generate warnings noting that the use of xmlns: is deprecated."
> 
> The base reason for asking for this change is that it is technically
> difficult to implement what we have in the spec right now in the
> validator.nu conformance checker at W3C.

Actually, the base reason is that the HTML spec does not recognize
attributes with names that start with "xmlns:" as special in any way --
any more than attributes that start with with "aslka:" or "kopoh:" or
whatever. It just treats them as unknown, invalid, attributes. So in order
to conform to the spec, the validator *must* report those as errors.

The HTML+RDFa spec could override that restriction and allow attributes
with xmlns:* names in HTML+RDFa documents -- but the HTML spec would still
prohibit them in non-RDFa documents. So in order to have xmlns* attributes
not reported as errors in RDFa documents, I would need to make the
validator have some kind of modal behavior where it treats xmlns:*
attributes differently depending on whether the user has requested
HTML+RDFa validation or not.

> The SAX implementation that it
> is using doesn't expose xmlns: declarations to the RDFa processor. This
> seems strange to me, as well as being a bug in the toolchain that the
> new validator is using.

Actually, it's the parser that doesn't expose them as namespace
declarations. The parser doesn't do anything special at all with them -- it
just exposes them as normal attributes with the literal names xmlns:foo or
whatever. Because it's an HTML parser, not an XML parser. And the HTML+RDFa
spec is about handling of RDFa attributes in documents that are parsed as
HTML, so what matters is what the parsing rules and validity rules are for
HTML. And the validity rules are that attributes that have names starting
with "xmlns:" are not special in any way, no more than attributes that
start with "pmakl:" or whatever. They are just unknown attributes, and any
unknown attribute is invalid. So the validator reports them as errors.

What would be required for me to have the xmlns:* instances not reported as
errors is that I'd need to do one of the following:

  A. Add XML namespace support to the HTML parser -- but only have that
     support enabled if the user has chosen to do HTML+RDFa validation.

  B. Add a custom SAX ContentHandler that would drop the xmlns:* attributes
     from the output of the parser before it gets passed on to the code
     that does the actual validation. And then I would need to add some
     other code to ensure that handler only gets invoked if the user has
     chosen to do HTML+RDFa validation.

> Still, we have an implementer requesting that
> the spec be changed due to implementation impossibility for this
> particular (heavily used) toolchain.
> 
> I'd be fine with making the change, as the Web Developer world/HTML5 has
> moved away from xmlns: declarations. Note that this only applies to
> conformance checkers... RDFa processors must still process the xmlns:
> declaration.
> 
> Mike, does this capture your current stance on this issue?

I hope my comments above help to make it or clear why I requested that the
HTML+RDFa spec be changed to say that "Conformance checkers may report the
use of xmlns: as an error."

  --Mike

-- 
Michael[tm] Smith http://people.w3.org/mike

Received on Tuesday, 4 September 2012 16:35:51 UTC