redirectOnSave throwing errors when used with parameters

I am trying to redirect to a page after a form is filed with some parameters as documented in openmrs documentation

The error message below is what it shows when i try to save the htmlform

The reference to entity “encounterId” must end with the ‘;’ delimiter.

I will appreciate any useful information on how to go about this