summaryrefslogtreecommitdiff
path: root/share/xml2json
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2020-10-22 21:22:14 +0200
committerDaniel Friesel <derf@finalrewind.org>2020-10-22 21:22:14 +0200
commit57646c41189df6004bb757688aebc712d5c429fd (patch)
tree219048c20d857b03abc6c823782f8270f2d1314b /share/xml2json
parent4567c962ce1dbca9dc2ef8b831fa5c8d80812b1a (diff)
xml2json: optionally print missing stations
most belong to SEV though
Diffstat (limited to 'share/xml2json')
-rwxr-xr-xshare/xml2json13
1 files changed, 13 insertions, 0 deletions
diff --git a/share/xml2json b/share/xml2json
index 8769a94..4429245 100755
--- a/share/xml2json
+++ b/share/xml2json
@@ -20,10 +20,17 @@ for my $station ( $tree->findnodes('//station') ) {
my $eva = $station->getAttribute('eva');
my $ds100 = $station->getAttribute('ds100');
+ my $found = 0;
+
for my $j_station ( @{$stations} ) {
my $j_name = $j_station->{name};
my $j_ds100 = $j_station->{ds100};
my $j_eva = $j_station->{eva};
+
+ if ( $name eq $j_name or $eva == $j_eva ) {
+ $found = 1;
+ }
+
if ( $j_ds100 eq $ds100 and $j_name ne $name ) {
printf( "%8s has been renamed: %30s -> %30s\n",
$ds100, $j_name, $name );
@@ -44,6 +51,12 @@ for my $station ( $tree->findnodes('//station') ) {
last;
}
}
+
+ if ( not $found
+ and not( $ds100 =~ m{ ^ [OPXZ] }x or $name =~ m{ ^ Bahnhof, }x ) )
+ {
+ #say "missing $eva $ds100 \"$name\"";
+ }
}
my $json_out = JSON->new->utf8->canonical->pretty->encode($stations);