TEIC / TEI

The Text Encoding Initiative Guidelines
https://www.tei-c.org
Other
271 stars 88 forks source link

variantEncodingLocation test should be simplified #2259

Closed sydb closed 2 years ago

sydb commented 2 years ago

The assertion test of the "variantEncodingLocation" constraint in variantEncoding.xml reads

(@location != 'external') or (@method != 'parallel-segmentation')

While I believe that is exactly correct (in that it returns true() appropriately) it is quite hard to understand (especially considering you have to, even if just for a moment, consider what happens if one of the things being compared is a sequence — only for a brief moment because none of the things being compared can be a sequence), IMHO, compared to

not( @location eq 'external'  and  @method eq 'parallel-segmentation' )

Which, of course, can be further reduced to the following by using <sch:report> instead of <sch:assert>:

@location eq 'external'  and  @method eq 'parallel-segmentation'