#!/usr/bin/perl -w
#
# cleandtd.pl - removes HTML markup added to dtd by livedtd.pl
#
# flag to skip lines from output
my $skiplines = 1;

while (<>) {
    if ( /<\?LIVEDTD ENDHEAD\?>/ ) {
        $skiplines = 0;
        next;
    }
    if ( /<\?LIVEDTD EOF\?>/ ) {
        $skiplines = 1;
    }
    next if ( $skiplines ) ;
    s/<[^>]*>//g;
    s/&amp;/&/g;
    s/&lt;/</g;
    s/&gt;/>/g;
    s/&quot;/"/g;
    print;
}
