Class: IsoDoc::NIST::Xref
- Inherits:
-
Xref
- Object
- Xref
- IsoDoc::NIST::Xref
- Defined in:
- lib/isodoc/nist/xref.rb
Constant Summary collapse
- SECTIONS_XPATH =
"//foreword | //introduction | //reviewnote | //executivesummary | //annex | "\ "//sections/clause | //bibliography/references | //acknowledgements | "\ "//bibliography/clause | //preface/clause".freeze
Instance Method Summary collapse
- #annex_name_lbl(clause, num) ⇒ Object
- #back_anchor_names(docxml) ⇒ Object
- #clause_names(docxml, sect_num) ⇒ Object
- #hiersep ⇒ Object
- #initial_anchor_names(d) ⇒ Object
- #middle_section_asset_names(d) ⇒ Object
Instance Method Details
#annex_name_lbl(clause, num) ⇒ Object
58 59 60 |
# File 'lib/isodoc/nist/xref.rb', line 58 def annex_name_lbl(clause, num) l10n("<strong>#{@labels['annex']} #{num}</strong>") end |
#back_anchor_names(docxml) ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/isodoc/nist/xref.rb', line 30 def back_anchor_names(docxml) i = Counter.new("@") docxml.xpath(ns("//annex")).each do |c| i.increment(c) annex_names(c, i.print) end docxml.xpath(ns("//bibliography/clause | "\ "//bibliography/references")).each do |b| preface_names(b) end docxml.xpath(ns("//bibitem[not(ancestor::bibitem)]")).each do |ref| reference_names(ref) end end |
#clause_names(docxml, sect_num) ⇒ Object
51 52 53 54 55 56 |
# File 'lib/isodoc/nist/xref.rb', line 51 def clause_names(docxml, sect_num) q = "//xmlns:sections/child::*" docxml.xpath(q).each do |c| section_names(c, sect_num, 1) end end |
#hiersep ⇒ Object
62 63 64 |
# File 'lib/isodoc/nist/xref.rb', line 62 def hiersep "-" end |
#initial_anchor_names(d) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/isodoc/nist/xref.rb', line 16 def initial_anchor_names(d) d.xpath("//xmlns:boilerplate/child::* | //xmlns:preface/child::*").each do |c| preface_names(c) end @in_execsummary = true hierarchical_asset_names(d.xpath("//xmlns:executivesummary"), "ES") @in_execsummary = false c = Counter.new clause_names(d, c) middle_section_asset_names(d) termnote_anchor_names(d) termexample_anchor_names(d) end |
#middle_section_asset_names(d) ⇒ Object
45 46 47 48 49 |
# File 'lib/isodoc/nist/xref.rb', line 45 def middle_section_asset_names(d) middle_sections = "//xmlns:preface/child::*[not(self::xmlns:executivesummary)] | "\ "//xmlns:sections/child::*" sequential_asset_names(d.xpath(middle_sections)) end |