Doping and dimensionality effects on the core-level spectra of layered ruthenates