4 # get command line values:
6 die "Usage: $0 xml_infile xml_outfile\n";
11 die "Can't find file \"$infile\""
13 # check we can read infile
15 die "Can't read input $infile\n";
17 # check we can open infile
18 open( INFILE
,"<$infile" ) or
19 die "Can't input $infile $!";
21 #my $outfile = 'fmt-manual.xml';
23 #print "Infile: $infile, Outfile: $outfile\n";
24 # check we can write to outfile
25 open( OUTFILE
,">$outfile" ) or
26 die "Can't output $outfile $! for writing";
28 my ($prev, $curr, $str);
29 $prev = ''; $curr = '';
37 if ( $prev =~ /<programlisting>$|<screen>$/ ) {
39 $curr = join( '', $prev, "<![CDATA[", $curr );
43 elsif ( $curr =~ /<\/programlisting
>|<\
/screen>/ ) {
45 $curr = join( '', $prev, "]]>", $curr );