my $content= $resp->content;
# print STDERR "[[[$content]]]\n";
- $xp->parse($content);
+ my $commodmapxmltmp= '_commodmap.xml';
+ if (!eval {
+ $xp->parse($content); 1;
+ }) {
+ open R, ">./$commodmapxmltmp" or die $!;
+ print R $content or die $!;
+ close R or die $!;
+ die "$@ parsing commodmap";
+ }
+ unlink $commodmapxmltmp or $!==&ENOENT or die $!;
close $o or die $!;
rename "_commodmap.tsv.tmp","_commodmap.tsv" or die $!;
}