#!/bin/sh

TMPFILE=tmpfile

for filename in *.xml; do
    echo '<?xml version="1.0"?>
<!DOCTYPE TEI.2 PUBLIC "-//TEI P4//DTD Main DTD Driver File//EN" "../../dtd/PersDrama.dtd" [
<!ENTITY % TEI.XML "INCLUDE">
%PersDrama;
]>' > $TMPFILE

    sed -n '7,$p' $filename >> $TMPFILE
    mv $TMPFILE $filename
done

echo 'check header of tgv.xml, must be 6,$p'
