class IsoDoc::Iec::Xref
Public Instance Methods
annex_name_lbl(clause, num)
click to toggle source
# File lib/isodoc/iec/xref.rb, line 38 def annex_name_lbl(clause, num) obl = l10n("(#{@labels["inform_annex"]})") obl = l10n("(#{@labels["norm_annex"]})") if clause["obligation"] == "normative" l10n("<strong>#{@labels["annex"]} #{num}</strong><br/>#{obl}") end
initial_anchor_names(d)
click to toggle source
Calls superclass method
# File lib/isodoc/iec/xref.rb, line 16 def initial_anchor_names(d) super return unless @is_iev terms_iev_names(d) middle_section_asset_names(d) termnote_anchor_names(d) termexample_anchor_names(d) end
introduction_names(clause)
click to toggle source
Calls superclass method
# File lib/isodoc/iec/xref.rb, line 12 def introduction_names(clause) return super unless @is_iev end
parse(docxml)
click to toggle source
Calls superclass method
# File lib/isodoc/iec/xref.rb, line 4 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
terms_iev_names(d)
click to toggle source
# File lib/isodoc/iec/xref.rb, line 25 def terms_iev_names(d) d.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" } t.xpath(ns("./term")).each_with_index do |c, i| num2 = "%02d" % [i+1] section_names1(c, "#{num}-#{num2}", 3) end end end