function tripal_pub_PMID_parse_pagination

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

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

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_pagination()
tripal_pub_PMID_parse_article in tripal_pub/includes/importers/tripal_pub.PMID.inc
Parses the section from the XML returned from PubMed that contains information about an article.

File

tripal_pub/includes/importers/tripal_pub.PMID.inc, line 711
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_pagination($xml, &$pub) {
  while ($xml->read()) {
    $element = $xml->name;

    if ($xml->nodeType == XMLReader::END_ELEMENT and $element == 'Pagination') {
      // we've reached the </Pagination> element so we're done.
      return;
    }
    if ($xml->nodeType == XMLReader::ELEMENT) {
      switch ($element) {
        case 'MedlinePgn':
          $xml->read();
          if (trim($xml->value)) {
            $pub['Pages'] = $xml->value;
          }
          break;
        default:
          break;
      }
    }
  }
}