obdurodon / dh_course

Digital Humanities course site
GNU General Public License v3.0
20 stars 6 forks source link

Schematron and stooges #453

Closed djbpitt closed 3 years ago

djbpitt commented 4 years ago

In class today (2020-02-26), one of you observed that when you check for duplicate stooges with something like:

<sch:rule context="results">
    <xsl:assert test="count(stooge/@name) = count(distinct-values(stooge/@name))">There
         are duplicate stooges</xsl:assert>
</sch:rule>

any error is reported on the <results> element, and you have to hunt down the duplicate values on your own. With only three stooges that isn’t a problem, but if you have to find the duplicates in a very large number of values, you would want the error to be reported on the duplicate stooges, and not globally on <results>.

So: how would you do that?