Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions app/models/doi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2334,9 +2334,14 @@ def update_types
end

def update_schema_version
if current_metadata.present? && current_metadata.valid?
self.schema_version = current_metadata.namespace
end
return nil if xml.blank?

doc = Nokogiri.XML(xml, nil, "UTF-8", &:noblanks)
ns =
doc.collect_namespaces.detect do |_k, v|
v.start_with?("http://datacite.org/schema/kernel")
end
self.schema_version = Array.wrap(ns).last
end

def update_publisher
Expand Down