Bobby Fischer can escape US if Iceland makes him citizen: Japanese lawmaker by Hiroshi Hiyama ATTENTION - ADDS quotes from immigration official, details /// TOKYO, March 16 Bobby Fischercan escape US if Iceland makes him citizen: Japanese lawmaker by Hiroshi Hiyama ATTENTION - ADDS quotes from immigration official, details /// Chess legend Bobby Fischer, who faces prison if he returns to the United States, can only avoid deportation from Japan if Iceland upgrades its granting of residency to full citizenship, a Japanese lawmaker said Wednesday. #### Bobby Fischer can escape US if Iceland makes him citizen: Japanese lawmaker by Hiroshi Hiyama ATTENTION - ADDS quotes from immigration official, details /// TOKYO, March 16 Bobby Fischercan escape US if Iceland makes Bobby Fischer citizen: Japanese lawmaker by Hiroshi Hiyama ATTENTION - ADDS quotes from immigration official, details /// Chess legend Bobby Fischer, who faces prison if Bobby Fischer returns to the United States, can only avoid deportation from Japan if Iceland upgrades Iceland's granting of residency to full citizenship, a Japanese lawmaker said Wednesday. #### #!/bin/perl -w use strict; use XML::Twig; my $twig=new XML::Twig(twig_roots => {'TEXT' =>1} ,twig_handlers=>{'REF' => \&REF}); # change the address of root to TEXT element because REF is the children of TEXT my $field='REF'; $twig->parsefile("AFP_ENG_20050316.0102.xml"); #Parse the file my $root=$twig->root; my $rootchild=$root->children; sub REF { my ($twig ,$field)=@_; my $extension = $field->text;#keep the value of REF element my $att=$field->att('EXT'); #keep the value of Ext ( some REF elements do not have EXT attribute) print "$extension\n"; $att->set_text($field); $extension=$att; } $twig->print;