#!/usr/bin/perl
use XML::DT ;
my $filename = shift;
%xml=( '-default' => sub{$element{$q}=1; 
                         for (keys %v){$att{$q}{$_}=1 }; ""});

dt($filename,%xml);

print <<'END';
#!/usr/bin/perl
use XML::DT ;
my $filename = shift;

%handler=(
#    '-outputenc' => 'ISO-8859-1',
#    '-default'   => sub{"<$q>$c</$q>"},
END

for $name (keys %element){
     print "     '$name' => sub{\"\$q:\$c\"},";
     print '# remember $v{',
            join('},$v{',keys %{$att{$name}}),
            '}' if $att{$name}; 
     print "\n";
}
print <<'END';
);
print dt($filename,%handler); 
END

