I asked a question yesterday How to get tag attributes using XML :: Simple? which I use to get XML:
http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=pubmed&id=19273512 (1)
http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=pubmed&id=19291509 (2)
I made very good progress and wrote the following code that goes through the tags and searches for the ones I need. I am looking for a doi tag in the "ArticleIds" section
foreach $item_node (@{$dataSummary->{DocSum}->{Item}})
{
if($item_node->{Name} eq 'ArticleIds')
{
foreach $item_node1 (@{$item_node->{Item}})
{
if ($item_node1->{Name} eq 'doi')
{
$doi= $item_node1->{content};
last;
}
}
last;
}
}
This code basically looks for the ArticleIds tag and then looks for subtopics under it to find the doi tag.
, , , , ArticleIds ( (2)), . , ArticleIds ( (1)), .
Simple Parser .
(1)
{ 'Type' => 'List', 'Item' => { 'Type' => 'String', 'content' => '19273512', 'Name' => 'pubmed' }, 'Name' => 'ArticleIds' }
(2)
{ 'Type' => 'List', 'Item' => [ { 'Type' => 'String', 'content' => '909564644', 'Name' => 'pii' }, { 'Type' => 'String', 'content' => '10.1080/13506120802676914', 'Name' => 'doi' }, { 'Type' => 'String', 'content' => '19291509', 'Name' => 'pubmed' } ], 'Name' => 'ArticleIds' }
. ArticleIds , , .
- ?