1 |
#!/usr/bin/perl -w |
2 |
|
3 |
use strict; |
4 |
|
5 |
|
6 |
foreach my $file (@ARGV) { |
7 |
|
8 |
open(XML,$file) || die "can't open '$file': $!"; |
9 |
|
10 |
my $xml; |
11 |
while (<XML>) { |
12 |
$xml .= $_; |
13 |
} |
14 |
|
15 |
close(XML); |
16 |
|
17 |
<<<<<<< .working |
18 |
if ($xml =~ s,<(\w+)\s+delimiter\s*=\s*"(\s[^"]+|[^"]+\s)"\s*>(.*?)</\1>,<$1>\n\t\t\t<delimiter>$2</delimiter>\n\t\t\t<value>$3</value>\n\t\t</$1>,gis) { |
19 |
======= |
20 |
if ($xml =~ s,<(\w+)(\s+[^>]*)delimiter\s*=\s*"(\s[^"]+|[^"]+\s)"([^>]*)>(.*?)</\1>,<$1$2$4>\n\t\t\t<delimiter>$3</delimiter>\n\t\t\t<value>$5</value>\n\t\t</$1>,gis) { |
21 |
>>>>>>> .merge-right.r290 |
22 |
open(XML,"> $file-new") || die "can't create '$file-new': $!"; |
23 |
print XML $xml; |
24 |
close(XML); |
25 |
|
26 |
rename "$file-new","$file" || die "can't update original file '$file' with '$file-new': $!"; |
27 |
|
28 |
print "$file converted\n"; |
29 |
} |
30 |
} |
31 |
|