Sha256: 3cf8ee481cbe25d423d872967422ab44b0ec5e4306e55819377d3e6b9ff3f6cc
Contents?: true
Size: 1.38 KB
Versions: 1
Compression:
Stored size: 1.38 KB
Contents
module IsoDoc module Iec class Xref < IsoDoc::Iso::Xref def parse(docxml) id = docxml&.at(ns("//bibdata/docnumber"))&.text @is_iev = id == "60050" id = docxml&.at(ns("//bibdata/docidentifier[@type = 'ISO']"))&.text m = /60050-(\d+)/.match(id) and @iev_part = m[1] super end def introduction_names(clause) super unless @is_iev end def initial_anchor_names(docxml) super return unless @is_iev if @parse_settings.empty? || @parse_settings[:clauses] terms_iev_names(docxml) end end def terms_iev_names(docxml) docxml.xpath(ns("//sections/clause/terms")).each_with_index do |t, i| num = "#{@iev_part}-%02d" % [i + 1] @anchors[t["id"]] = { label: num, xref: l10n("#{@labels['section_iev']} #{num}"), level: 2, type: "clause", elem: @labels["section_iev"] } t.xpath(ns("./term")).each_with_index do |c, j| num2 = "%02d" % [j + 1] section_names1(c, "#{num}-#{num2}", 3) end end end def annex_name_lbl(clause, num) obl = l10n("(#{@labels['inform_annex']})") clause["obligation"] == "normative" and obl = l10n("(#{@labels['norm_annex']})") l10n("<strong>#{@labels['annex']} #{num}</strong><br/>#{obl}") end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
metanorma-iec-2.5.7 | lib/isodoc/iec/xref.rb |