Class: IsoDoc::Iec::PresentationXMLConvert

Inherits:
IsoDoc::Iso::PresentationXMLConvert
  • Object
show all
Includes:
Init
Defined in:
lib/isodoc/iec/presentation_xml_convert.rb

Instance Method Summary collapse

Methods included from Init

#convert1, #i18n_init, #metadata_init, #xref_init

Instance Method Details

#bibdata_i18n(b) ⇒ Object



31
32
33
34
35
36
37
38
39
40
41
# File 'lib/isodoc/iec/presentation_xml_convert.rb', line 31

def bibdata_i18n(b)
  fr = IsoDoc::Iec::I18n.new("fr", "Latn")
  en = IsoDoc::Iec::I18n.new("en", "Latn")
  [{ lang: "en", i18n: en }, { lang: "fr", i18n: fr }].each do |v|
    hash_translate(b, v[:i18n].get["doctype_dict"], "./ext/doctype", v[:lang])
    hash_translate(b, v[:i18n].get["stage_dict"], "./status/stage", v[:lang])
    hash_translate(b, v[:i18n].get["substage_dict"], "./status/substage", v[:lang])
    hash_translate(b, v[:i18n].get["function_dict"], "./ext/function", v[:lang])
    hash_translate(b, v[:i18n].get["horizontal_dict"], "./ext/horizontal", v[:lang])
  end
end

#clause(docxml) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/isodoc/iec/presentation_xml_convert.rb', line 7

def clause(docxml)
  docxml.xpath(ns("//clause[not(ancestor::annex)] | "\
                  "//definitions | //references | "\
                  "//preface/introduction[clause]")).
  each do |f|
    clause1(f)
  end
  docxml.xpath(ns("//terms")).each do |f|
    termclause1(f)
  end
end

#clause1(f) ⇒ Object



26
27
28
29
# File 'lib/isodoc/iec/presentation_xml_convert.rb', line 26

def clause1(f)
  IsoDoc::PresentationXMLConvert.instance_method(:clause1).bind(self).
    call(f)
end

#termclause1(f) ⇒ Object



19
20
21
22
23
24
# File 'lib/isodoc/iec/presentation_xml_convert.rb', line 19

def termclause1(f)
  return clause1(f) unless @is_iev
  return if @suppressheadingnumbers || f["unnumbered"]
  lbl = @xrefs.anchor(f['id'], :label, true) or return
  prefix_name(f, " ", "#{lbl}#{clausedelim}", "title")
end