dynamically read doctype and process instructions