function tripal_pub_PMID_parse_journal_issue
2.x tripal_pub.PMID.inc | tripal_pub_PMID_parse_journal_issue($xml, &$pub) |
3.x tripal_chado.pub_importer_PMID.inc | tripal_pub_PMID_parse_journal_issue($xml, &$pub) |
1.x PMID.inc | tripal_pub_PMID_parse_journal_issue($xml, &$pub) |
1 call to tripal_pub_PMID_parse_journal_issue()
- tripal_pub_PMID_parse_journal in tripal_pub/
includes/ importers/ PMID.inc
File
- tripal_pub/
includes/ importers/ PMID.inc, line 677 - Tripal Pub PubMed Interface
Code
function tripal_pub_PMID_parse_journal_issue($xml, &$pub) {
while ($xml->read()) {
$element = $xml->name;
if ($xml->nodeType == XMLReader::END_ELEMENT and $element == 'JournalIssue') {
// if we're at the </JournalIssue> element then we're done
return;
}
if ($xml->nodeType == XMLReader::ELEMENT) {
switch ($element) {
case 'Volume':
$xml->read();
$pub['Volume'] = $xml->value;
break;
case 'Issue':
$xml->read();
$pub['Issue'] = $xml->value;
break;
case 'PubDate':
$date = tripal_pub_PMID_parse_date($xml, 'PubDate');
$year = $date['year'];
$month = $date['month'];
$day = $date['day'];
$medline = $date['medline'];
$pub['Year'] = $year;
if ($month and $day and $year) {
$pub['Publication Date'] = "$year $month $day";
}
elseif ($month and !$day and $year) {
$pub['Publication Date'] = "$year $month";
}
elseif (!$month and !$day and $year) {
$pub['Publication Date'] = $year;
}
elseif ($medline) {
$pub['Publication Date'] = $medline;
}
else {
$pub['Publication Date'] = "Date Unknown";
}
break;
default:
break;
}
}
}
}