Electronic structure of the carbon nanotube tips studied by x-ray-absorption spectroscopy and scanning photoelectron microscopy