diff --git a/lib/avm/image.rb b/lib/avm/image.rb index 8ae72c9..25b6cd7 100644 --- a/lib/avm/image.rb +++ b/lib/avm/image.rb @@ -280,10 +280,14 @@ module AVM AVM_SINGLES.each do |tag, field| if node = refs[:avm].at_xpath("./avm:#{tag}") - if !(list_items = node.search('.//rdf:li')).empty? - options[field] = list_items.collect(&:text) + if field == :categories + options[field] = node.text.split(";").collect(&:strip) else - options[field] = node.text + if !(list_items = node.search('.//rdf:li')).empty? + options[field] = list_items.collect(&:text) + else + options[field] = node.text + end end end end diff --git a/lib/avm/observation.rb b/lib/avm/observation.rb index 982a559..e5ccea9 100644 --- a/lib/avm/observation.rb +++ b/lib/avm/observation.rb @@ -42,7 +42,7 @@ module AVM document.get_refs do |refs| AVM_SINGLES.each do |name, method| if node = refs[:avm].at_xpath(".//avm:#{name}") - observation_parts[method] = node.text.split(',').collect(&:strip) + observation_parts[method] = node.text.split(';').collect(&:strip) end end end diff --git a/spec/sample_files/image/both.xmp b/spec/sample_files/image/both.xmp index 39ad877..2c071a3 100644 --- a/spec/sample_files/image/both.xmp +++ b/spec/sample_files/image/both.xmp @@ -38,12 +38,7 @@ ID Observation Good - - - Category one - Category two - - + Category one; Category two Light years diff --git a/spec/sample_files/image/light_years.xmp b/spec/sample_files/image/light_years.xmp index ba88b23..1b3aebd 100644 --- a/spec/sample_files/image/light_years.xmp +++ b/spec/sample_files/image/light_years.xmp @@ -38,12 +38,7 @@ ID Observation Good - - - Category one - Category two - - + Category one; Category two Light years ICRS 100 diff --git a/spec/sample_files/image/redshift.xmp b/spec/sample_files/image/redshift.xmp index a2e8f8c..cfbade3 100644 --- a/spec/sample_files/image/redshift.xmp +++ b/spec/sample_files/image/redshift.xmp @@ -18,7 +18,6 @@ Name two - @@ -45,12 +44,7 @@ Redshift - - - Category one - Category two - - + Category one; Category two ICRS 100 diff --git a/spec/sample_files/image/single_value_light_years.xmp b/spec/sample_files/image/single_value_light_years.xmp index b3c6a29..85cedbf 100644 --- a/spec/sample_files/image/single_value_light_years.xmp +++ b/spec/sample_files/image/single_value_light_years.xmp @@ -39,12 +39,7 @@ Observation Good Light years - - - Category one - Category two - - + Category one; Category two ICRS 100 diff --git a/spec/sample_files/observation/two.xmp b/spec/sample_files/observation/two.xmp index d30b454..869ea82 100644 --- a/spec/sample_files/observation/two.xmp +++ b/spec/sample_files/observation/two.xmp @@ -2,15 +2,15 @@ - HST,Chandra - ACS,X-Ray - Blue,Green - em.opt,em.x-ray - B,C - 2.5,- - 2010-01-01T00:00,2010-01-02 - 300,400 - 12345,23456 + HST;Chandra + ACS;X-Ray + Blue;Green + em.opt;em.x-ray + B;C + 2.5;- + 2010-01-01T00:00;2010-01-02 + 300;400 + 12345;23456