lib/metanorma/ogc/front.rb in metanorma-ogc-2.4.3 vs lib/metanorma/ogc/front.rb in metanorma-ogc-2.4.6

- old
+ new

@@ -9,12 +9,11 @@ corporate_author(node, xml) personal_author(node, xml) end def corporate_author(node, xml) - return unless node.attr("submitting-organizations") - + node.attr("submitting-organizations") or return csv_split(HTMLEntities.new .decode(node.attr("submitting-organizations")), ";")&.each do |org| xml.contributor do |c| c.role type: "author" c.organization do |a| @@ -47,12 +46,11 @@ else contrib.role type: type end end def ogc_editor(node, xml) - return unless node.attr("editor") - + node.attr("editor") or return xml.contributor do |c| c.role type: "editor" c.person do |p| p.name do |n| n.completename node.attr("editor") @@ -76,16 +74,19 @@ end end end def default_publisher - "Open Geospatial Consortium" + "OGC" end - def metadata_committee(node, xml) - return unless node.attr("committee") + def org_abbrev + { "Open Geospatial Consortium" => "OGC" } + end + def metadata_committee(node, xml) + node.attr("committee") or return xml.editorialgroup do |a| metadata_committee1(node, a) end end @@ -100,16 +101,14 @@ **attr_code(type: node.attr("workgroup-type"), number: node.attr("workgroup-number"))) end def externalid(node) - return node.attr("external-id") if node.attr("external-id") - + i = node.attr("external-id") and return i d = doctype(node) a = node.attr("abbrev") - return unless d && a - + d && a or return url = "http://www.opengis.net/doc/#{IsoDoc::Ogc::DOCTYPE_ABBR[d]}/#{a}" v = (node.attr("edition") || node.attr("version")) and url += "/#{v}" url end @@ -179,15 +178,15 @@ end when "best-practice" unless %w{general encoding extension profile profile-with-extension}.include? s @log.add("Document Attributes", nil, - "'#{s}' is not a permitted subtype of Standard: " \ - "reverting to 'implementation'") + "'#{s}' is not a permitted subtype of best-practice: " \ + "reverting to 'general'") s = "general" end end - s and xml.subdoctype s + s && !s.empty? and xml.subdoctype s end def title(node, xml) super at = { format: "text/plain", type: "abbrev" }