These invariants allow a wide range of implementations, including using hash tables as in my example. The crucial detail is that the hashing is on identity instead of equality, which means that two equal but not identical names are hashed differently. That is, the hash key is generated from the reference to the name, not the characters in the name.
Hash tables indexed on identity are much faster than hash tables indexed on equality.
Note that this is just an example of an implementation for recovering namespaces from names. Parsers have many alternative ways to achieve the same. I suggest that SAX2 limits its recommendation to an eventual interface for recovering the namespace from a name, without describing any implementation details.