The soft X-ray spectra of metals near the emission edge