Unique-witnesses-within-app
In general, a given witness should only be referred to once within an
<app> (either on the @wit of
<rdg> or of <lem>).
This snippet of ODD code may be included in the
<elementSpec> for app to test the collection
of pointers to witnesses within a given <app> for
duplicates.
This test is insufficient for a variety of reasons. First,
the TEI Guidelines explicit permit the specification of witnesses (on
@wit) for one reading to be omitted. (See
12.2.3 The Parallel Segmentation Method.)
Second, this code only tests the string value of a given pointer, not
what it points at. Thus the value of @xml:base is not
taken into account, and the values "witnesses.xml#A"
& "./witnesses.xml#A" will incorrectly be considered
as different. Similarly, this code will consider it OK when two
@wit pointers point two two different
witness elements that list the same MSS. (Arguably bad
encoding, but not technically incorrect.)
This also means that a repeated pointer to a witness (also bad encoding, but not technically incorrect) will be flagged as an error.
And, perhaps most importantly, it means that this test does not check
that the pointers on @wit actually point to
witnesses, as opposed to, say, persons.
<constraintSpec ident="unique-witness-within-app" scheme="isoschematron">
<constraint>
<sch:let name="wits" value="tokenize( normalize-space( string-join( .//@wit,' ') ),' ')"/>
<sch:let name="witless" value="distinct-values( $wits )"/>
<sch:report test="count( $wits ) ne count( $witless )">Duplicate witness within 'app'</sch:report>
</constraint>
</constraintSpec>