lib/isodoc/xref_sect_gen.rb in isodoc-0.5.7 vs lib/isodoc/xref_sect_gen.rb in isodoc-0.5.8

- old
+ new

@@ -12,11 +12,11 @@ def initial_anchor_names(d) introduction_names(d.at(ns("//introduction"))) section_names(d.at(ns("//clause[title = 'Scope']")), "1", 1) section_names(d.at(ns( "//references[title = 'Normative References']")), "2", 1) - section_names(d.at(ns("//sections/terms")), "3", 1) + section_names(d.at(ns("//sections/terms | //sections/clause[descendant::terms]")), "3", 1) middle_section_asset_names(d) end def middle_section_asset_names(d) middle_sections = "//clause[title = 'Scope'] | "\ @@ -25,10 +25,10 @@ "//sections/symbols-abbrevs | //clause[parent::sections]" sequential_asset_names(d.xpath(ns(middle_sections))) end def clause_names(docxml, sect_num) - q = "//clause[parent::sections][not(xmlns:title = 'Scope')]" + q = "//clause[parent::sections][not(xmlns:title = 'Scope')][not(descendant::terms)]" docxml.xpath(ns(q)).each_with_index do |c, i| section_names(c, (i + sect_num).to_s, 1) end end