sul-dlss/mods_normalizer

Name: mods_normalizer

Owner: Stanford University Digital Library

Description: Provides methods to normalize MODS XML according to the Stanford guidelines

Created: 2018-03-14 14:39:34.0

Updated: 2018-03-14 15:00:08.0

Pushed: 2018-03-14 15:00:06.0

Homepage: null

Size: 13

Language: Ruby

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Build Status Gem Version

Stanford::Mods::Normalizer

Provides methods to normalize MODS XML according to the Stanford guidelines

Usage:

Normalizing an xml document

quire 'stanford/mods/normalizer'
put_file = 'bb936cg6081.xml' # starting mods document
tput_file = 'bb936cg6081-cleaned.xml' # cleaned up mods document
ds_xml = File.open(input_file) # read it in
ds_xml_doc = Nokogiri::XML(mods_xml) # create a nokogiri doc
rmalizer = Stanford::Mods::Normalizer.new
rmalizer.normalize_document(mods_xml_doc.root) # normalize it
le.write(output_file,mods_xml_doc.to_xml) # write it out

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.