You are here

function biblio_pm_xml_biblio_import in Bibliography Module 7

Same name and namespace in other branches
  1. 6.2 modules/pubmed/biblio_pm.module \biblio_pm_xml_biblio_import()
  2. 7.2 modules/pubmed/biblio_pm.module \biblio_pm_xml_biblio_import()

Imports article(s) from an XML file (exported) from PubMed Central.

Parameters

file object $file:

array $terms:

bool $batch:

string $session_id:

Return value

array

File

modules/pubmed/biblio_pm.module, line 248

Code

function biblio_pm_xml_biblio_import($file, $terms = array(), $batch = FALSE, $session_id = NULL) {
  libxml_use_internal_errors(TRUE);
  $xml = @simplexml_load_file($file->uri);
  if (empty($xml) || isset($xml->body->pre->ERROR)) {
    drupal_set_message(t("Could not parse file as PubMed XML"), 'error');
    return;
  }
  return _biblio_pm_create_node_from_xml($xml, $terms, $batch, $session_id);
}