#!/usr/bin/perl -w #======================================================================= # $Id$ # Eat stdin, smack those @ENGLISH* markers around it and send it to # stdout. After that, print all the XML elements with all the text # outside of the elements removed. Some attempt to automate things a # bit. # # This complicated piece of software is licensed under the GNU General # Public License version 2 or later. #======================================================================= use strict; $| = 1; use Getopt::Std; our ($opt_h) = (0); getopts('h') || die("Option error. Use -h for help.\n"); $opt_h && usage(0); my $Data = join("", <>); my $Orig = $Data; my $Indent = ""; # Save indent for the rest of the lines $Orig =~ /^(\s+)/ && ($Indent = $1); # Remove everything except elements $Data =~ s/>[^<>]+?\n" . "$Data"); sub usage { my $Retval = shift; print(<