my $profile_xml = $li->request(
request_url => 'http://api.linkedin.com/v1/people/~:(id,first-name,last-name,positions,industry,distance)',
access_token => $access_token->{token},
access_token_secret => $access_token->{secret},
);
my $parser = XML::Parser->new( Style => 'Tree' );
my $tree = $parser->parse( $profile_xml );
我已经使用了上面的代码并得到了下面的答案,但我不知道如何访问 from xml 字符串
<person>
<id></id>
<first-name></firstname>
</person>
这些是字符串中的一些节点
$VAR1 = [ 'person', [ {}, 0, ' ', 'id', [ {}, 0, 'bEdA7NgdV8' ], 0, ' ', '名字', [ {}, 0, ' imm' ], 0, ' ', '姓氏', [ {}, 0, 'dee' ], 0, ' ', '职位', [ { 'total' => '1' }, 0, ' ', 'position', [ {}, 0, ' ', 'id', [ {}, 0, '3454532' ], 0, ' ', 'title', [ {}, 0, '软件工程师' ] , 0, ' ', '开始日期', [ {}, 0, ' ', '年', [ {}, 0, '2003' ], 0, ' ', '月', [ {}, 0 , '6' ], 0, ' ' ], 0, ' ', 'is-current', [ {}, 0, 'true' ], 0, ' ', '公司', [ {}, 0, ' ', '名称', [ {}, 0, 'Ara Systems' ], 0, ' ','行业', [ {}, 0, '信息技术和服务'], 0, ' ' ], 0, ' ' ], 0, ' ' ], 0, ' ', '行业', [ {}, 0 , '信息技术与服务' ], 0, ' ', '距离', [ {}, 0, '0' ], 0, ' ' ] ];