#! /usr/bin/perl -w # Written by Dirk Stöcker # Public domain, no rights reserved. use strict; my $item; my $comment = 0; # This is a simple conversion and in no way a complete XML parser # but it works with a default Perl installation while(my $line = <>) { chomp($line); if($line =~ //) { print "tr(\"$1/ \") /* empty item \"$1\" */\n"; } elsif($line =~ //) { print "/* empty item */\n"; } elsif($line =~ // || $line =~ // || $comment) { print "\n"; } else { print "/* unparsed line $line */\n"; print STDERR "Unparsed line $line\n"; } # note, these two must be in this order ore oneliners aren't handled $comment = 1 if($line =~ //); }