Implemented doctype handler for DOM builder.