I'm not sure this was really the best way.  But here we dispatch on `(tag_type, type_attribute)` - it will generally be one or the other.  So eg we fill in a `<input type='text' .. >` by the latter because there are other kinds of `input`.

This makes the code a bit longer, but allows anyone to add more element types wherever they want.  And I think it conveys the various paths better.