The dissociation of OH and OD in comets by solar radiation