code: public int getIdForNamespace(String uri)
    {
       int index = m_values.indexOf(uri);
       if (index < 0)
       {
         m_values.addElement(uri);
         return m_valueIndex++;
       }
       else
         return index;
    }
docs: Get a prefix either from the uri mapping, or just make
  one up!
  
  @param uri The namespace URI, which may be null.
  
  @return The prefix if there is one, or null.