validateeach.csh
     1  #!/bin/csh
     2
     3  foreach file ( $DLXSROOT/prep/s/samplefa/data/*.xml )
     4  echo "working on $file"
     5  perl -p -e 's,<\!DOCTYPE.*?\>,,s;' $file  > $file.tmp
     6  onsgmls -s -f $file.err $DLXSROOT/misc/sgml/xml.dcl DLXSROOT/prep/s/samplefa/samplefa.text.inp $file.tmp
     7  rm $file.tmp
     8  end
     9
    10
    11  find $DLXSROOT/prep/s/samplefa/data -type f -size 0 -prune -exec rm {} \;
    12
samplefa.text.inp
<!DOCTYPE ead SYSTEM "/l1/release/13/misc/sgml/ead.dtd" [
<!ENTITY gt "&gt;" >
<!ENTITY lt "&lt;" >
<!ENTITY mdash "&mdash;" >
<!ENTITY amp "&amp;" >
]>
Note:The character entities are not needed and will be removed in next release of FindaidClass However, if you have other entities in your DTD you should put them in samplefa.text.inp as well as in samplefa.xml.inp. See http://openjade.sourceforge.net/doc-1.5.1/nsgmls.htm for more info on onsgmls