Resonant soft x-ray scattering was used to study the magnetic ordering of the multiferroic materials SmMn2O5 and GdMn2O5. In the case of SmMn2O5, the results confirm that antiferromagnetic ordering of Mn magnetic moments occurs with magnetic propagation vector qM=(1/2,0,1/3+δ′) in the incommensurate magnetic phase, followed by the appearance of the commensurate magnetic phase with qM=(1/2,0,0) as the temperature is decreased. The energy spectrum around Mn LII,III edges suggests that the Mn ions adopt unique electronic states in the CM phase of SmMn2O5. No evidence was found for spin polarization of oxygen ions through 2p-3d orbital hybridization between oxygen and Mn ions in this compound, although this phenomenon is clearly evident in GdMn2O5 and other RMn2O5 (R = Y, Er, Tb) compounds. The energy spectra around O K edge strongly suggest that electronic polarization resulting from charge transfer between oxygen and Mn ions has little contribution to the ferroelectricity while lattice distortion likely plays a key role in promoting ferroelectricity in SmMn2O5.