account for the fact the script can appear in amongst the DTD and xml declarations