lib/isodoc/mpfd/metadata.rb in metanorma-mpfd-0.1.10 vs lib/isodoc/mpfd/metadata.rb in metanorma-mpfd-0.2.0
- old
+ new
@@ -6,11 +6,10 @@
module Mpfd
class Metadata < IsoDoc::Metadata
def initialize(lang, script, labels)
super
- # set(:status, "")
end
def title(isoxml, _out)
main = isoxml&.at(ns("//bibdata/title[@language='en']"))&.text
set(:doctitle, main)
@@ -29,12 +28,12 @@
docnumber = isoxml.at(ns("//bibdata/docidentifier"))
set(:docnumber, docnumber&.text)
end
def doctype(isoxml, _out)
- b = isoxml.at(ns("//bibdata")) || return
- return unless b["type"]
- t = b["type"].split(/[- ]/).
+ b = isoxml&.at(ns("//bibdata/ext/doctype"))&.text || return
+ return unless b
+ t = b.split(/[- ]/).
map{ |w| w.capitalize unless w == "MPF" }.join(" ")
set(:doctype, t)
end
def status_abbr(status)