Compressional waves in a magnetized plasma of arbitrary resistivity are treated with the lagrangian fluid approach. An exact nonlinear solution with a nontrivial space and time dependence is obtained with boundary conditions as in Harris' current sheet. The solution shows competition among hydrodynamic convection, magnetic field diffusion, and dispersion. This results in a collapse of density and the magnetic field in the absence of dispersion. The dispersion effects arrest the collapse of density but not of the magnetic field. A possible application is in the early stage of magnetic star formation.