Automatically choose first available template for a doctype
Changes for schema fragment-ref and field-choice