Loading share/xml2json +13 −0 Original line number Diff line number Diff line Loading @@ -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 ); Loading @@ -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); Loading Loading
share/xml2json +13 −0 Original line number Diff line number Diff line Loading @@ -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 ); Loading @@ -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); Loading