X-ray-absorption studies of YBa2Cu