You are here

function _endnote_XML_import in Bibliography Module 5

1 call to _endnote_XML_import()
_biblio_import in ./biblio.module

File

./biblio.module, line 2967

Code

function _endnote_XML_import(&$data, $nodedata, $version = 8) {
  global $user, $records, $rec_count, $node_array, $node, $node_id;
  $node_array = array();
  $node = $nodedata;
  $xml_parser = drupal_xml_parser_create($data);

  // use case-folding so we are sure to find the tag in
  xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, false);
  xml_parser_set_option($xml_parser, XML_OPTION_SKIP_WHITE, true);
  if ($version == 8) {
    require_once drupal_get_path('module', 'biblio') . '/endnote8_parser.inc';
    xml_set_element_handler($xml_parser, "en8_startElement", "en8_endElement");
    xml_set_character_data_handler($xml_parser, "en8_characterData");
    xml_parse($xml_parser, $data, 1);
  }
  elseif ($version == 7) {
    require_once drupal_get_path('module', 'biblio') . '/endnote7_parser.inc';
    xml_parse_into_struct($xml_parser, $data, $values);
    en7_parse($values, $node_array, $node);
  }
  xml_parser_free($xml_parser);
  $node_ids = _biblio_save_imported_nodes($node_array);
  return $node_ids;
}