You are here

function _endnote8_XML_export in Bibliography Module 7.2

Same name and namespace in other branches
  1. 6.2 modules/endnote/endnote8_export.inc \_endnote8_XML_export()
  2. 6 endnote8_export.inc \_endnote8_XML_export()
  3. 7 modules/endnote/endnote8_export.inc \_endnote8_XML_export()
2 calls to _endnote8_XML_export()
BiblioImportExportUnitTest::testBiblioNodeExport in tests/import.export.test
biblio_xml_biblio_export in modules/endnote/biblio_xml.module

File

modules/endnote/endnote8_export.inc, line 2

Code

function _endnote8_XML_export($node, $part = 'record') {
  $style_attr = 'face="normal" font="default" size="100%"';
  switch ($part) {
    case 'begin':
      $xml = '<?xml version="1.0" encoding="UTF-8"?>';
      $xml .= "<xml><records>";
      break;
    case 'record':
      $xml = "<record>";
      $xml .= '<source-app name="Biblio" version="7.x">Drupal-Biblio</source-app>';
      $xml .= "<ref-type>" . _endnote8_type_map($node->biblio_type) . "</ref-type>";
      unset($node->biblio_type);

      //<!-- Author information -->
      $xml .= en8_add_contributors($node);
      $xml .= en8_add_titles($node);
      $xml .= en8_add_keywords($node);
      $xml .= en8_add_dates($node);
      $xml .= en8_add_urls($node);
      foreach ($node as $key => $value) {
        $entag = en8_field_map($key);
        if (!empty($entag) && !empty($value)) {
          $xml .= "<" . $entag . '><style face="normal" font="default" size="100%">' . htmlspecialchars($value) . "</style></{$entag}>";
        }
      }
      $xml .= "</record>";
      break;
    case 'end':
      $xml = '</records></xml>';
      break;
  }
  return $xml;
}