Determination of the electronic-structure of transition-metal compounds - 2p x-ray photoemission spectroscopy of the nickel dihalides