Sha256: a91a4549e336a6c49a566719cd286d3236c4deb5c23f019ea80f493c9e9ba69c

Contents?: true

Size: 1.39 KB

Versions: 7

Compression:

Stored size: 1.39 KB

Contents

module IsoDoc
  class PresentationXMLConvert < ::IsoDoc::Convert
    def clause(docxml)
      docxml.xpath(ns("//clause | "\
                      "//terms | //definitions | //references")).
                     each do |f|
        clause1(f)
      end
    end

    def clause1(f)
      level = @xrefs.anchor(f['id'], :level, false) || "1"
      t = f.at(ns("./title")) and t["depth"] = level
      return if !f.ancestors("boilerplate").empty?
      return if @suppressheadingnumbers || f["unnumbered"]
      lbl = @xrefs.anchor(f['id'], :label,
                          f.parent.name != "sections") or return
      prefix_name(f, "<tab/>", "#{lbl}#{clausedelim}", "title")
    end

    def annex(docxml)
      docxml.xpath(ns("//annex")).each do |f|
        annex1(f)
      end
    end

    def annex1(f)
      lbl = @xrefs.anchor(f['id'], :label)
      if t = f.at(ns("./title"))
        t.children = "<strong>#{t.children.to_xml}</strong>"
      end
      prefix_name(f, "<br/><br/>", lbl, "title")
    end

    def term(docxml)
      docxml.xpath(ns("//term")).each do |f|
        term1(f)
      end
    end

    def term1(f)
      lbl = @xrefs.get[f["id"]][:label] or return
      prefix_name(f, "", "#{lbl}#{clausedelim}", "name")
    end

    def references(docxml)
    end

    def index(docxml)
      docxml.xpath(ns("//index | //index-xref | //indexsect")).each do |f|
        f.remove
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
isodoc-1.6.2 lib/isodoc/presentation_function/section.rb
isodoc-1.6.1 lib/isodoc/presentation_function/section.rb
isodoc-1.6.0 lib/isodoc/presentation_function/section.rb
isodoc-1.5.5 lib/isodoc/presentation_function/section.rb
isodoc-1.5.4 lib/isodoc/presentation_function/section.rb
isodoc-1.5.3 lib/isodoc/presentation_function/section.rb
isodoc-1.5.2 lib/isodoc/presentation_function/section.rb