Refactor in DTD and added new escapes for % character