Probing the effect of atomic substitution in the superconductor Y-Ba-Cu-O by X-ray absorption