Method: IsoDoc::PresentationXMLConvert#termcontainers

Defined in:
lib/isodoc/presentation_function/terms.rb

#termcontainers(docxml) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/isodoc/presentation_function/terms.rb', line 3

def termcontainers(docxml)
  docxml.xpath(ns("//term")).each do |t|
    %w(preferred admitted deprecates related definition termsource)
      .each do |w|
      d = t.at(ns("./#{w}[last()]")) and d.after("<fmt-#{w}/>")
    end
  end
  docxml.xpath(ns("//termsource")).each do |s|
    s["id"] ||= "_#{UUIDTools::UUID.random_create}"
  end
end