Preparing by oxyhalogenation