3 foreach $inputfile (@ARGV) {
4 print "Now splitting file $inputfile\n";
5 open(IN, "<$inputfile");
7 if (not ($line =~ /^<?xml/ || $line =~/^<(\/|)occurrences>/)) {
8 if ($line =~ /^<!--/) {
9 # Begin of a new output file
10 $line =~ s/^<!--(.*)-->$/$1/;
11 $line =~ s/^cic:/rdf/;
12 $line =~ s/#xpointer\(1\/([^\/]*)\/([^\/]*)\)/,$1,$2/;
13 $line =~ s/#xpointer\(1\/([^\/]*)\)/,$1/;
15 $dir =~ s/\/[^\/]*$//;
17 system("mkdir -p $dir");