function tripal_pub_PMID_parse_medline_journal_info

2.x tripal_pub.PMID.inc tripal_pub_PMID_parse_medline_journal_info($xml, &$pub)
3.x tripal_chado.pub_importer_PMID.inc tripal_pub_PMID_parse_medline_journal_info($xml, &$pub)
1.x PMID.inc tripal_pub_PMID_parse_medline_journal_info($xml, &$pub)

Parses the section from the XML returned from PubMed that contains information about the Journal

Parameters

$xml: The XML to parse

$pub: The publication object to which additional details will be added

Related topics

1 call to tripal_pub_PMID_parse_medline_journal_info()
tripal_pub_PMID_parse_pubxml in tripal_pub/includes/importers/tripal_pub.PMID.inc
This function parses the XML containing details of a publication and converts it into an associative array of where keys are Tripal Pub ontology terms and the values are extracted from the XML. The XML should contain only a single publication record.

File

tripal_pub/includes/importers/tripal_pub.PMID.inc, line 457
This file provides support for importing and parsing of results from the NCBI PubMed database. The functions here are used by both the publication importer setup form and the publication importer.

Code

function tripal_pub_PMID_parse_medline_journal_info($xml, &$pub) {
  while ($xml->read()) {
    // get this element name
    $element = $xml->name;

    // if we're at the </Article> element then we're done with the article...
    if ($xml->nodeType == XMLReader::END_ELEMENT and $element == 'MedlineJournalInfo') {
      return;
    }
    if ($xml->nodeType == XMLReader::ELEMENT) {
      switch ($element) {
        case 'Country':
          // the place of publication of the journal
          $xml->read();
          $pub['Journal Country'] = $xml->value;
          break;
        case 'MedlineTA':
          // TODO: not sure how this is different from ISOAbbreviation
          break;
        case 'NlmUniqueID':
          // TODO: the journal's unique ID in medline
          break;
        case 'ISSNLinking':
          // TODO: not sure how this is different from ISSN
          break;
        default:
          break;
      }
    }
  }
}