3 ms·
> Tags are always in the empty string namespace unless an explicit namespace prefix is given, in which case the tag's namespace in the one corresponding to the
by cxr 3y ago
> Tags are always in the empty string namespace unless an explicit namespace prefix is given, in which case the tag's namespace in the one corresponding to the prefix.¶ That's it. That's all there is to namespaces and attributes.
This is at best misleading (or worse: misled—and wrong). The semantics of the following snippet is completely different:
<foo:bar baz="xyzzy"/>
... from this:
<foo:bar foo:baz="xyzzy"/>
(Assume the "foo" prefix is defined and mapped to a namespace.)
This is before even getting into the fact that unprefixed elements will belong to the default namespace (despite being written with no "explicit namespace prefix").
> The namespace is the thing declared as the attribute of the xmlns tag.
The "xmlns tag"? No.