I always wondered how an XML parser handle the check of a URI namespace. is it string based, or URI based? in other words, this is the standard URI for SVG
xmlns='http://www.w3.org/2000/svg'
suppose that I write instead
xmlns='http://www.w3.org/2000/../2000/svg'
or
xmlns='http://www.w3.org/2000/svg/'
or even
xmlns='http://www.w3.org:8000/2000/svg'
Will these cases be recognized as svg namespaces (URI based) or not (string based)?
Thanks
Edit : the fact that you can use URNs (like a uuid) makes me feel like it’s string based, because you cannot apply the proper URL/URI considerations to a non URL-like URI. But maybe in that case it will just work as a string ?
Edit: As Tormod points out it is made with a string comparison. This prompts me to wonder if there are recommendations for defining URIs (like: no slash at the end, all lowercase, etc…). Or is it just a free-for-all ?
They are string based. All your sample URIs resolve to different namespaces.
http://www.w3.org/TR/REC-xml-names/#NSNameComparison