Created
December 1, 2015 18:22
-
-
Save underhilllabs/4560a8eb612f61b39810 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'nori' | |
def parse_file(file) | |
f = File.read(file) | |
parser = Nori.new(:convert_tags_to => lambda { |tag| tag.snakecase.to_sym }, :strip_namespaces => true) | |
parser.parse(f) | |
end | |
x = parse_file("./newvap_oc.xml") | |
refs = [] | |
puts "here are the Study event Refs" | |
puts x[:odm][:study][:meta_data_version][:protocol][:study_event_ref] | |
x[:odm][:study][:meta_data_version][:protocol][:study_event_ref].each do |ref| | |
refs << ref[:@study_event_oid] | |
end | |
puts "here are the refs!" | |
refs.each do |ref| | |
puts ref | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment