You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
2.4 KiB

  1. <?php
  2. // Project: Web Reference Database (refbase) <http://www.refbase.net>
  3. // Copyright: Matthias Steffens <mailto:refbase@extracts.de> and the file's
  4. // original author(s).
  5. //
  6. // This code is distributed in the hope that it will be useful,
  7. // but WITHOUT ANY WARRANTY. Please see the GNU General Public
  8. // License for more details.
  9. //
  10. // File: ./includes/transtab_endnotexml_refbase.inc.php
  11. // Repository: $HeadURL$
  12. // Author(s): Matthias Steffens <mailto:refbase@extracts.de>
  13. //
  14. // Created: 18-Jul-07, 13:15
  15. // Modified: $Date: 2008-07-30 14:16:35 +0000 (Wed, 30 Jul 2008) $
  16. // $Author$
  17. // $Revision: 1182 $
  18. // Search & replace patterns for conversion from Endnote XML text style markup to refbase markup. Converts fontshape markup (italic, bold, underline) as well
  19. // as super- and subscript into appropriate refbase markup. Note that greek letters are left as is, so import of greek letters will require an UTF-8 database.
  20. // Notes: - search & replace patterns must be specified as perl-style regular expression and search patterns must include the leading & trailing slashes
  21. $transtab_endnotexml_refbase = array(
  22. '#<style face="italic"[^<>\r\n]*>(.+?)</style>#i' => "_\\1_",
  23. '#<style face="bold"[^<>\r\n]*>(.+?)</style>#i' => "**\\1**",
  24. '#<style face="underline"[^<>\r\n]*>(.+?)</style>#i' => "__\\1__",
  25. '#<style face="superscript"[^<>\r\n]*>(.+?)</style>#i' => "[super:\\1]",
  26. '#<style face="subscript"[^<>\r\n]*>(.+?)</style>#i' => "[sub:\\1]",
  27. '#<style face="[^<>"]*"[^<>\r\n]*>(.+?)</style>#i' => "\\1", // remove all remaining <style> information
  28. // Bibutils 'endx2xml' v3.34 seems to require that titles are enclosed within a <style> container, so we put one back in:
  29. '#(?<=<title>)(.+?)(?=</title>)#i' => '<style face="normal" font="default" size="100%">' . "\\1" . '</style>', // title
  30. '#(?<=<secondary-title>)(.+?)(?=</secondary-title>)#i' => '<style face="normal" font="default" size="100%">' . "\\1" . '</style>', // secondary-title
  31. '#(?<=<full-title>)(.+?)(?=</full-title>)#i' => '<style face="normal" font="default" size="100%">' . "\\1" . '</style>', // full-title
  32. '#(?<=<alt-title>)(.+?)(?=</alt-title>)#i' => '<style face="normal" font="default" size="100%">' . "\\1" . '</style>', // alt-title
  33. );
  34. ?>