note sections with no notes

Issue #73 resolved
Craig Berry created an issue

We now have 1,450 documents that have divs in the back matter specifically for notes but no longer contain notes since they were moved back where they belong inline. This breaks PDF generation and should probably be a schema violation. It also causes tables of contents to have pointers to these empty sections that go nowhere. The XQuery below finds them, but we probably need an XSLT script that:

  1. Removes elements of <div type="notes"> in the back matter when there are no descendant <note> elements.
  2. Removes <back> elements that have no descendants at all.
xquery version "3.1";
declare namespace tei="http://www.tei-c.org/ns/1.0";
let $col := collection('/db/apps/EarlyPrintTexts/texts')
for $doc in $col
    for $div in $doc//tei:back/tei:div[@type='notes']
           return if (count($div//tei:note) = 0) then util:document-name($doc) else ()

Comments (2)

  1. Log in to comment