The program which produces the EAD markup for the inventory relies on some slight, simple hand-coding of the data:
.s or .s1 => <c01 level="series"><did><unittitle>
.ss or .s2, =><c02 level="subseries"><did><unittitle>
(similarly .s3, etc.)
{[date]} => <unitdate>[date]</unitdate>
and on the output of a pre-processor which uses heuristics in the data to produce similar markup:
SERIES DESCRIPTION => .sc => <scopecontent><p> BOX => .b => <c0x><did><container type="Box"> Folder[s] => .f => <container type="folder">
This produces the inventory (the dsc element), which is then validated. The goal is to simplify as much as possible the creation of a finding aid suitable for automatic conversion into EAD.
A shell script unites the front matter and the inventory into an EAD-formatted finding aid, which is now validated as a whole.