Use `if` instead of `case` in read_doc_with_atts/2

BugzID: 26566