Hydration of halide anions in ion-exchange resin and their dissociation from cationic groups.