Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This page explains how to use OpenRefine and xml_split to create DAMS MODS XML from a spreadsheet. The workflow is adapted from the blog post "Converting Spreadsheets into MODSXML using Open Refine" by The Digital Scholarship Unit (DSU) at the UTSC Library. Credit is also due to Benn Chang for adapting the workflow and developing the script for renaming files.

...

  • A good text editor for XML editing - in principle, even Windows notepad should do the job, but for greater comfort we recommend Notepad++ (https://notepad-plus-plus.org/) with the XML Tools plugin. For the Mac, there seem to be fewer free or Open Source tools available, one would be Eclipse (https://www.eclipse.org). If you plan on working a lot with XML files, you might want to look into asking for a license for Oxygen XML (https://www.oxygenxml.com/, available for both Mac and Windows)
  • OpenRefine 2.8 or higher (http://openrefine.org/)
  • A Unix/Linux shell that allows you to run bash shell scripts and Perl commands - e.g. your Mac's Terminal or the Windows Subsystem for Linux (WSL) with e.g. Ubuntu
  • xml_split command-line tool from XML::Twig

    Expand
    titleClick here for installation instructions for macOS
    1. Open Terminal on your Mac.
    2. Log in with admin credentials. Type in your admin password when prompted for it.
      login adminusername
    3. Install
    4. Download stable release of XML::Twig
    5. . Type in your admin password when prompted for it.
      sudo cpan XML::Twig
    6. Press 'y' to install all tools. If you don't have a compiler installed on your system, you'll be prompted to get one. A compiler is required for the installation to be successful. Xcode is recommended, and was used in this documentation. If XML::Twig installation is successful, the last installation line will read "/usr/bin/make install  -- OK."
    7. Type the logout command to return to your user prompt.
      logout
    8. from https://www.xmltwig.org/xmltwig/
    9. Extract the archive
    10. In System Preferences, got to Users & Groups and elevate logged in user from standard to admin. Standard users with an appadmin account can unlock preferences in order to elevate their standard user account.
    11. In Terminal, change directory to the unpacked archive
    12. Paste the Readme file's Installation commands into Terminal
    13. Check for xml_split command in Terminal


    Expand
    titleClick here for installation instructions for Ubuntu
    1. Open the Ubuntu command line.
    2. Update software package information. Type admin password if prompted for it.
      sudo apt update
    3. Install the package containing XML Twig
      sudo apt get xml-twig-tools
      sudo apt install xml-twig-tools


  • xpath command-line tool, e.g. from XML::XPath (should be pre-packaged with macOS)

    Expand
    titleClick here for installation instructions for Ubuntu
    1. Open the Ubuntu command line.
    2. Update software package information. Type admin password if prompted for it.
      sudo apt update
    3. Install the package containing XML Twig
      sudo apt get libxml-xpath-perl
      sudo apt install libxml-xpath-perl


...