X-ray photoelectron spectroscopy of the high-temperature superconductor YBa2Cu3O7−x and the copper oxides