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
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Provides methods to normalize MODS XML according to the Stanford guidelines
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