I know why we need namespace in XML, which is to differentiate potential same named element with different definition or meaning, like 'table' in HTML and furniture.
But I could not tell the reason why we need a URI in an xmlns
declaration. What is it for, and why is it a URI ?
Should XML parser use the content in the URI to checkout some useful info to parse the XML?
If not, why I cannot just use some random numbers to be my URI.
And in my opinion, as long as the prefix does not collide in a single XML, there would not be any collision, because of which we don't need that URI.
Give me some hints, thanks.
XML and JSON are both for data transfering, but it's kind of weird that JSON doesn't have namespaces while XML have namespace and sees it as an important topic? Kind of weird, am I misunderstood something?