Transesterification with an anion-exchange resin