Class: IsoDoc::Iec::Metadata

Inherits:
IsoDoc::Iso::Metadata
  • Object
show all
Defined in:
lib/isodoc/iec/metadata.rb

Instance Method Summary collapse

Instance Method Details

#docfunction(xml) ⇒ Object



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

def docfunction(xml)
  b = xml.at(ns("//bibdata/ext/function#{NOLANG}"))&.text || return
  b and set(:function, status_print(b))
  b1 = xml.at(ns("//bibdata/ext/function#{currlang}"))&.text || b
  b1 and set(:function_display, status_print(b1))
  b1 = xml.at(ns("//bibdata/ext/function[@language = 'en']"))&.text || b
  b1 and set(:function_en, status_print(b1))
  b1 = xml.at(ns("//bibdata/ext/function[@language = 'fr']"))&.text || b
  b1 and set(:function_fr, status_print(b1))
end

#dochorizontal(isoxml) ⇒ Object



43
44
45
46
47
48
49
50
51
52
# File 'lib/isodoc/iec/metadata.rb', line 43

def dochorizontal(isoxml)
  b = isoxml&.at(ns("//bibdata/ext/horizontal#{NOLANG}"))&.text || return
  b and set(:horizontal, status_print(b))
  b1 = isoxml&.at(ns("//bibdata/ext/horizontal#{currlang}"))&.text
  b1 and set(:horizontal_display, status_print(b1))
  b1 = isoxml&.at(ns("//bibdata/ext/horizontal[@language = 'en']"))&.text
  b1 and set(:horizontal_en, status_print(b1))
  b1 = isoxml&.at(ns("//bibdata/ext/horizontal[@language = 'fr']"))&.text
  b1 and set(:horizontal_fr, status_print(b1))
end

#docstatus(isoxml, _out) ⇒ Object



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

def docstatus(isoxml, _out)
  docstatus = isoxml.at(ns("//bibdata/status/stage"))
  substage = isoxml.at(ns("//bibdata/status/substage"))
  published = published_default(isoxml)
  if docstatus
    set(:stage, docstatus.text)
    set(:stage_int, docstatus.text.to_i)
    set(:statusabbr, substage["abbreviation"])
    !published and set(:stageabbr, docstatus["abbreviation"])
  end
  revdate = isoxml.at(ns("//bibdata/version/revision-date"))
  set(:revdate, revdate&.text)
end

#doctype(xml, _out) ⇒ Object



21
22
23
24
25
26
27
28
29
30
# File 'lib/isodoc/iec/metadata.rb', line 21

def doctype(xml, _out)
  super
  b = xml.at(ns("//bibdata/ext/doctype#{NOLANG}"))&.text
  b1 = xml.at(ns("//bibdata/ext/doctype[@language = 'en']"))&.text || b
  b1 and set(:doctype_en, status_print(b1))
  b1 = xml.at(ns("//bibdata/ext/doctype[@language = 'fr']"))&.text || b
  b1 and set(:doctype_fr, status_print(b1))
  docfunction(xml)
  dochorizontal(xml)
end