Beam-foil Spectra of Chlorine and Oxygen Ions at Beam Energies of 6-42 MeV