I am trying to look at the tag of a in XML. I have my script running down to the dbReferences (there are several for an entry), but I only want to take the 'id' if the 'type' = "EC".
I am thinking of doing some type of if statement, where it will look at the 'type' of the dbReference before taking the id:
foreach $entry (@{$data->{entry}}) {
foreach $ref (@{$entry->{dbReference}}) {
if($ref type ="EC"){
#then print the id
}
}
}
Edit: The entry XML would be formatted like this, with a lot of dbReferences in a row, that need to be checked:
<dbReference type="NCBI Taxonomy" id="9606"/>
<dbReference type="PubMed" id="8274401"/>
<dbReference type="EC" id="1.1.5.54"/>
Any ideas?