The code now assigns one category to each <app> containing variant <rdg>s.
It would be better, when needed, to refine the categorisation and organize the readings in <rdgGrp> (with @type). Something like:
<app ana="lexical">
<rdg>yellow</rdg>
<rdgGrp type="orthographic">
<rdg>gray</rdg>
<rdg>grey</rdg>
</rdgGrp>
</app>