Interview Questions

Are universal names universally unique?

XML Interview Questions and Answers


(Continued from previous question...)

113. Are universal names universally unique?

No, but it is reasonable to assume they are.
Universal element type and attribute names are not guaranteed to be universally unique -- that is, unique within the space of all XML documents -- because it is possible for two different people, each defining their own XML namespace, to use the same URI and the same element type or attribute name. However, this occurs only if:
* One or both people use a URI that is not under their control, such as somebody outside Netscape using the URI http://www.netscape.com/, or
* Both people have control over a URI and both use it.

The first case means somebody is cheating when assigning URIs (a process governed by trust) and the second case means that two people within an organization are not paying attention to each other's work. For widely published element type and attribute names, neither case is very likely. Thus, it is reasonable to assume that universal names are universally unique. (Since both cases are possible, applications that present security risks should be careful about assuming that universal names are universally unique.)
For information about the ability of universal names to uniquely identify element types and attributes (as opposed to the names themselves being unique).

(Continued on next question...)

Other Interview Questions