Maciej Stachowiak wrote:
> ...
>>> I got the impression that at least some RDFa advocates thought it was
>>> acceptable and desirable to base semantics on nodeName (or indeed how
>>> an attribute was spelled in the source text) instead of on the
>>> {namespaceURI, localName} ordered pair. And indeed, that is how a
>>> number of RDFa implementations seem to work in practice. I'm not sure
>>> how much of the seeming confusion in the discussion was genuine and
>>> how much was the result of trying to justify a hacky solution.
>>
>> Using nodeName + prefix mappings obtained separately instead of
>> namespaceURI/localName is a workaround for environments where DOM L2
>> either isn't there (IE), or doesn't work as desired (HTML5 for now).
>
> Prefix mapping obtained separately how? There's no obtaining of a prefix
> mapping involved when you look at nodeName in order to treat
> {null}xmlns:foo as {http://www.w3.org/2000/xmlns/}foo.
We had this discussion before :-)
It doesn't make a difference for the results of parsing an XHTML or HTML
document. It's only relevant if script code on a single page combines
both L1 and L2 function calls. Don't do it. It hurts.
It appears to me that whenever people complain over here about the
complexity of XML namespaces, they really *mean* the complexity of how
to deal with them in the DOM, in particular as long as you can't rely on
consistent DOM Level 2 support. I agree that this is a pain, but that's
a problem of that particular API, not XML namespaces in general.
>> It has nothing to do with not understanding how namespaces work.
>> Otherwise those implementations wouldn't pass tests, right?
>
> The RDFa text/html tests are written to expect checks of nodeName rather
> than namespaceURI/localName. The implementations do checks of nodeName
> rather than namespaceURI/localName. That is why the tests pass. A test
> case that used script to insert {null}xmlns:foo into an XML document
> would give results that show the mapping in effect, in JS-based
> implementations (I haven't tested, but I'm pretty sure, given how they
> are coded). A test that resulted in {null}xmlns:foo
> and {http://www.w3.org/2000/xmlns/}foo attributes on the same element
> would give unpredictable results.
>
> I think this shows either a failure to understand namespaces on the part
> of the test writers and implementors, or a deliberate decision to go
> against the Namespaces in XML model.
No, it's a deliberate decision to do a best-effort in absence of DOM
Level 2 support.
> ...
BR, Julian