Imagine the following xml:

Old Version:
<ph audience="test">
  my text...
</ph>

New Version:
<ph audience="test dev">
  my text...
</ph>

All that changed is the attribute "audience". While this should be flagged as change, when audience is filtered by dev. But it should not be flagged, when audience is filtered by test.

Solution: Pass a ditaval file as an optional parameter to DitaCompare.compare()

Another solution seems more complicated to me: integrate the diffing into the build process of DITAOT and operate, when files have been filtered (but not yet flagged).