parse doctype