diff --git a/lib/isodoc/function/inline.rb b/lib/isodoc/function/inline.rb index 6d299a5f..dc64f512 100644 --- a/lib/isodoc/function/inline.rb +++ b/lib/isodoc/function/inline.rb @@ -21,7 +21,7 @@ def location_parse(node, out); end SPAN_UNWRAP_CLASSES = %w[fmt-caption-label fmt-label-delim fmt-caption-delim fmt-autonum-delim fmt-element-name fmt-conn fmt-comma fmt-enum-comma fmt-obligation - fmt-xref-container].freeze + fmt-xref-container fmt-designation-field].freeze def span_parse(node, out) klass = node["style"] || node["class"] @@ -203,6 +203,7 @@ def children_parse(node, out) def xref_label_parse(node, out); end def name_parse(node, out); end + def semx_definition_parse(node, out); end def floating_title_parse(node, out); end diff --git a/lib/isodoc/function/terms.rb b/lib/isodoc/function/terms.rb index fbb1e352..08fdacd5 100644 --- a/lib/isodoc/function/terms.rb +++ b/lib/isodoc/function/terms.rb @@ -10,21 +10,44 @@ def modification_parse(node, out) para.children.each { |n| parse(n, out) } end + def semx_deprecated_term_parse(node, out); end + def deprecated_term_parse(node, out) - out.p class: "DeprecatedTerms", style: "text-align:left;" do |p| - node.children.each { |c| parse(c, p) } + node.children.each do |c| + if c.name == "p" + out.p class: "DeprecatedTerms", style: "text-align:left;" do |p| + c.children.each { |c1| parse(c1, p) } + end + else parse(c, out) + end end end + def semx_admitted_term_parse(node, out); end + def admitted_term_parse(node, out) - out.p class: "AltTerms", style: "text-align:left;" do |p| - node.children.each { |c| parse(c, p) } + node.children.each do |c| + if c.name == "p" + out.p class: "AltTerms", style: "text-align:left;" do |p| + c.children.each { |c1| parse(c1, p) } + end + else parse(c, out) + end end end + def semx_term_parse(node, out); end + + def semx_related_parse(node, out); end + def term_parse(node, out) - out.p class: "Terms", style: "text-align:left;" do |p| - node.children.each { |c| parse(c, p) } + node.children.each do |c| + if c.name == "p" + out.p class: "Terms", style: "text-align:left;" do |p| + c.children.each { |c1| parse(c1, p) } + end + else parse(c, out) + end end end @@ -51,16 +74,15 @@ def termnote_parse1(node, para, div) para&.name != "p" and parse(para, div) end + def semx_termref_parse(node, out); end + def termref_parse(node, out) out.p do |p| node.children.each { |n| parse(n, p) } end end - def termdomain_parse(node, out) - node["hidden"] == "true" and return - node.children.each { |n| parse(n, out) } - end + def termdomain_parse(node, out); end def termdef_parse(node, out) name = node.at(ns("./fmt-name"))&.remove diff --git a/lib/isodoc/function/to_word_html.rb b/lib/isodoc/function/to_word_html.rb index c2f63d13..b80d053f 100644 --- a/lib/isodoc/function/to_word_html.rb +++ b/lib/isodoc/function/to_word_html.rb @@ -215,12 +215,18 @@ def parse(node, out) when "pre" then pre_parse(node, out) when "annotation" then annotation_parse(node, out) when "term" then termdef_parse(node, out) - when "preferred" then term_parse(node, out) - when "admitted" then admitted_term_parse(node, out) - when "deprecates" then deprecated_term_parse(node, out) + when "preferred" then semx_term_parse(node, out) + when "fmt-preferred" then term_parse(node, out) + when "admitted" then semx_admitted_term_parse(node, out) + when "fmt-admitted" then admitted_term_parse(node, out) + when "deprecates" then semx_deprecated_term_parse(node, out) + when "fmt-deprecates" then deprecated_term_parse(node, out) when "domain" then termdomain_parse(node, out) - when "definition" then definition_parse(node, out) - when "termsource" then termref_parse(node, out) + when "definition" then semx_definition_parse(node, out) + when "fmt-definition" then definition_parse(node, out) + when "termsource" then semx_termref_parse(node, out) + when "fmt-termsource" then termref_parse(node, out) + when "related" then semx_related_parse(node, out) when "modification" then modification_parse(node, out) when "termnote" then termnote_parse(node, out) when "terms" then terms_parse(node, out) diff --git a/lib/isodoc/presentation_function/autonum.rb b/lib/isodoc/presentation_function/autonum.rb index afdc8032..aeb751e6 100644 --- a/lib/isodoc/presentation_function/autonum.rb +++ b/lib/isodoc/presentation_function/autonum.rb @@ -44,14 +44,23 @@ def transfer_id(old, new) old.delete("id") end + def semx_fmt_dup(elem) + elem["id"] ||= "_#{UUIDTools::UUID.random_create}" + new = Nokogiri::XML(<<~XML).root + #{to_xml(elem.children)} + XML + strip_duplicate_ids(nil, elem, new) + new + end + def gather_all_ids(elem) elem.xpath(".//*[@id]").each_with_object([]) do |i, m| m << i["id"] end end - # remove ids duplicated between title and fmt-title - # index terms are assumed transferred to fmt-title from title + # remove ids duplicated between sem_title and pres_title + # index terms are assumed transferred to pres_title from sem_title def strip_duplicate_ids(_node, sem_title, pres_title) sem_title && pres_title or return ids = gather_all_ids(pres_title) @@ -75,6 +84,11 @@ def autonum(id, num) "#{num}" end + def semx_orig(node, orig = nil) + orig ||= node.parent.parent + orig.at(".//*[@id = '#{node['source']}']") + end + def labelled_autonum(label, id, num) elem = "#{label}" num.blank? and return elem diff --git a/lib/isodoc/presentation_function/concepts.rb b/lib/isodoc/presentation_function/concepts.rb index 8d49a4ed..abfc21b5 100644 --- a/lib/isodoc/presentation_function/concepts.rb +++ b/lib/isodoc/presentation_function/concepts.rb @@ -7,6 +7,7 @@ def concept(docxml) end def concept1(node) + node.ancestors("definition, termsource, related").empty? or return xref = node&.at(ns("./xref/@target"))&.text or return concept_render(node, ital: "true", ref: "true", bold: "false", linkref: "true", linkmention: "false") @@ -71,20 +72,160 @@ def concept1_ref_content(ref) end def related(docxml) - docxml.xpath(ns("//related")).each { |f| related1(f) } + docxml.xpath(ns("//fmt-related/semx")).each { |f| related1(f) } end def related1(node) - p = node.at(ns("./preferred")) - ref = node.at(ns("./xref | ./eref | ./termref")) - label = @i18n.relatedterms[node["type"]].upcase + p, ref, orig = related1_prep(node) + label = @i18n.relatedterms[orig["type"]].upcase if p && ref - node.replace(l10n("

#{label}: " \ + node.children =(l10n("

#{label}: " \ "#{to_xml(p)} (#{Common::to_xml(ref)})

")) else - node.replace(l10n("

#{label}: " \ + node.children = (l10n("

#{label}: " \ "**RELATED TERM NOT FOUND**

")) end end + + def related1_prep(node) + p = node.at(ns("./fmt-preferred"))&.children + ref = node.at(ns("./xref | ./eref | ./termref")) + orig = semx_orig(node) + [p, ref, orig] + end + + def related_designation1(desgn) + out = desgn.parent.at(ns("./fmt-#{desgn.name}")) + d1 = semx_fmt_dup(desgn) + %w(preferred admitted deprecates).each do |w| + d = d1.at(ns("./#{w}[last()]")) and d.after("") + end + out << d1 + end + + def designation(docxml) + docxml.xpath(ns("//related")).each { |p| related_designation1(p) } + docxml.xpath(ns("//preferred | //admitted | //deprecates")) + .each { |p| designation1(p) } + docxml.xpath(ns("//fmt-preferred | //fmt-admitted | //fmt-deprecates")) + .each { |t| merge_second_preferred(t) } + docxml.xpath(ns("//fmt-deprecates")).each { |d| deprecates(d) } + docxml.xpath(ns("//fmt-admitted")).each { |d| admits(d) } + end + + def deprecates(elem) + elem.xpath(ns(".//semx[@element = 'deprecates']")).each do |t| + t.previous = @i18n.l10n("#{@i18n.deprecated}: ") + end + end + + def admits(elem); end + + def merge_second_preferred(term) + pref = nil + out = term.xpath(ns("./semx")).each_with_index + .with_object([]) do |(p, i), m| + if (i.zero? && (pref = p)) || merge_preferred_eligible?(pref, p) + m << p + else + p.wrap("

") + end + end + pref&.replace(merge_second_preferred1(out, term)) + end + + def merge_second_preferred1(desgns, term) + desgns[1..].each(&:remove) + ret = l10n(desgns.map { |x| to_xml(x) }.join("; ")) + term.ancestors("fmt-related").empty? and ret = "

#{ret}

" + ret + end + + def merge_preferred_eligible?(first, second) + orig_first, orig_second, firstex, secondex = + merge_preferred_eligible_prep(first, second) + orig_first["geographic-area"] == orig_second["geographic-area"] && + firstex["language"] == secondex["language"] && + !orig_first.at(ns("./pronunciation | ./grammar | ./graphical-symbol")) && + !orig_second.at(ns("./pronunciation | ./grammar | ./graphical-symbol")) && + orig_first.name == "preferred" && orig_second.name == "preferred" + end + + def merge_preferred_eligible_prep(first, second) + orig_first = semx_orig(first) + orig_second = semx_orig(second) + firstex = orig_first.at(ns("./expression")) || {} + secondex = orig_second.at(ns("./expression")) || {} + [orig_first, orig_second, firstex, secondex] + end + + def designation1(desgn) + desgn.parent.name == "related" and return + out = desgn.parent.at(ns("./fmt-#{desgn.name}")) + d1 = semx_fmt_dup(desgn) + s = d1.at(ns("./termsource")) + name = d1.at(ns("./expression/name | ./letter-symbol/name | " \ + "./graphical-symbol")) or return + designation_annotate(d1, name, desgn) + out << d1 + s and out << s.wrap("").parent + end + + def designation_annotate(desgn, name, orig) + designation_boldface(desgn) + designation_field(desgn, name, orig) + #g = desgn.at(ns("./expression/grammar")) and + #name << ", #{designation_grammar(g).join(', ')}" + designation_grammar(desgn, name) + designation_localization(desgn, name, orig) + designation_pronunciation(desgn, name) + designation_bookmarks(desgn, name) + desgn.children = name.children + end + + def designation_boldface(desgn) + desgn["element"] == "preferred" or return + name = desgn.at(ns("./expression/name | ./letter-symbol/name")) or return + name.children = "#{name.children}" + end + + def designation_field(desgn, name, orig) + f = orig.xpath(ns("./field-of-application | ./usage-info")) + &.map { |u| to_xml(semx_fmt_dup(u)) }&.join(", ") + f&.empty? and return nil + name << ", <#{f}>" + end + + def designation_grammar(desgn, name) + g = desgn.at(ns("./expression/grammar")) or return + ret = [] + g.xpath(ns("./gender | ./number")).each do |x| + ret << @i18n.grammar_abbrevs[x.text] + end + %w(isPreposition isParticiple isAdjective isVerb isAdverb isNoun) + .each do |x| + g.at(ns("./#{x}[text() = 'true']")) and ret << @i18n.grammar_abbrevs[x] + end + name << ", #{ret.join(', ')}" + end + + def designation_localization(desgn, name, orig_desgn) + loc = [desgn.at(ns("./expression/@language"))&.text, + desgn.at(ns("./expression/@script"))&.text, + orig_desgn.at("./@geographic-area")&.text].compact + loc.empty? and return + name << ", #{loc.join(' ')}" + end + + def designation_pronunciation(desgn, name) + f = desgn.at(ns("./expression/pronunciation")) or return + name << ", /#{to_xml(f.children)}/" + end + + def designation_bookmarks(desgn, name) + desgn.xpath(ns(".//bookmark")).each do |b| + name << b.remove + end + end end end diff --git a/lib/isodoc/presentation_function/inline.rb b/lib/isodoc/presentation_function/inline.rb index 022fa39d..36f64508 100644 --- a/lib/isodoc/presentation_function/inline.rb +++ b/lib/isodoc/presentation_function/inline.rb @@ -61,6 +61,8 @@ def quotesource(docxml) end def xref1(node) + # Semantic XML + node.ancestors("related, definition, termsource").empty? or return get_linkend(node) end diff --git a/lib/isodoc/presentation_function/refs.rb b/lib/isodoc/presentation_function/refs.rb index bacd47d8..7c51f98f 100644 --- a/lib/isodoc/presentation_function/refs.rb +++ b/lib/isodoc/presentation_function/refs.rb @@ -107,7 +107,7 @@ def bibliography_bibitem_number_skip(bibitem) def bibliography_bibitem_number(docxml) i = 0 docxml.xpath(ns("//references")).each do |r| - r.xpath(ns(".//bibitem")).each do |b| + r.xpath(ns("./bibitem")).each do |b| i = bibliography_bibitem_number1(b, i, r["normative"] == "true") end end diff --git a/lib/isodoc/presentation_function/terms.rb b/lib/isodoc/presentation_function/terms.rb index 1a439962..6d83d045 100644 --- a/lib/isodoc/presentation_function/terms.rb +++ b/lib/isodoc/presentation_function/terms.rb @@ -1,103 +1,25 @@ module IsoDoc class PresentationXMLConvert < ::IsoDoc::Convert - def designation(docxml) - docxml.xpath(ns("//term")).each { |t| merge_second_preferred(t) } - docxml.xpath(ns("//preferred | //admitted | //deprecates")) - .each { |p| designation1(p) } - docxml.xpath(ns("//deprecates")).each { |d| deprecates(d) } - docxml.xpath(ns("//admitted")).each { |d| admits(d) } - end - - def deprecates(elem) - elem.add_first_child @i18n.l10n("#{@i18n.deprecated}: ") - end - - def admits(elem); end - - def merge_second_preferred(term) - pref = nil - term.xpath(ns("./preferred[expression/name]")).each_with_index do |p, i| - (i.zero? and pref = p) or merge_second_preferred1(pref, p) - end - end - - def merge_second_preferred1(pref, second) - merge_preferred_eligible?(pref, second) or return - n1 = pref.at(ns("./expression/name")) - n2 = second.remove.at(ns("./expression/name")) - n1.children = l10n("#{to_xml(n1.children)}; #{Common::to_xml(n2.children)}") - end - - def merge_preferred_eligible?(first, second) - firstex = first.at(ns("./expression")) || {} - secondex = second.at(ns("./expression")) || {} - first["geographic-area"] == second["geographic-area"] && - firstex["language"] == secondex["language"] && - !first.at(ns("./pronunciation | ./grammar")) && - !second.at(ns("./pronunciation | ./grammar")) - end - - def designation1(desgn) - s = desgn.at(ns("./termsource")) - name = desgn.at(ns("./expression/name | ./letter-symbol/name | " \ - "./graphical-symbol")) or return - designation_annotate(desgn, name) - s and desgn.next = s - end - - def designation_annotate(desgn, name) - designation_boldface(desgn) - designation_field(desgn, name) - g = desgn.at(ns("./expression/grammar")) and - name << ", #{designation_grammar(g).join(', ')}" - designation_localization(desgn, name) - designation_pronunciation(desgn, name) - designation_bookmarks(desgn, name) - desgn.children = name.children - end - - def designation_boldface(desgn) - desgn.name == "preferred" or return - name = desgn.at(ns("./expression/name | ./letter-symbol/name")) or return - name.children = "#{name.children}" - end - - def designation_field(desgn, name) - f = desgn.xpath(ns("./field-of-application | ./usage-info")) - &.map { |u| to_xml(u.children) }&.join(", ") - f&.empty? and return nil - name << ", <#{f}>" - end - - def designation_grammar(grammar) - ret = [] - grammar.xpath(ns("./gender | ./number")).each do |x| - ret << @i18n.grammar_abbrevs[x.text] + 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("") + end end - %w(isPreposition isParticiple isAdjective isVerb isAdverb isNoun) - .each do |x| - grammar.at(ns("./#{x}[text() = 'true']")) and - ret << @i18n.grammar_abbrevs[x] + docxml.xpath(ns("//termsource")).each do |s| + s["id"] ||= "_#{UUIDTools::UUID.random_create}" end - ret end - def designation_localization(desgn, name) - loc = [desgn&.at(ns("./expression/@language"))&.text, - desgn&.at(ns("./expression/@script"))&.text, - desgn&.at(ns("./@geographic-area"))&.text].compact - loc.empty? and return - name << ", #{loc.join(' ')}" - end - - def designation_pronunciation(desgn, name) - f = desgn.at(ns("./expression/pronunciation")) or return - name << ", /#{to_xml(f.children)}/" - end - - def designation_bookmarks(desgn, name) - desgn.xpath(ns(".//bookmark")).each do |b| - name << b.remove + def termcleanup(docxml) + docxml.xpath(ns("//term")).each do |t| + %w(preferred admitted deprecates related definition termsource) + .each do |w| + t.xpath(ns("./#{w}//fmt-name | ./#{w}//fmt-xref-label")).each(&:remove) + f = t.at(ns(".//fmt-#{w}")) + f&.children&.empty? and f.remove + end end end @@ -123,29 +45,32 @@ def termnote_label(elem) end def termdefinition(docxml) - docxml.xpath(ns("//term[definition]")).each do |f| - termdefinition1(f) - end + docxml.xpath(ns("//term[definition]")).each { |f| termdefinition1(f) } end def termdefinition1(elem) - unwrap_definition(elem) - multidef(elem) if elem.xpath(ns("./definition")).size > 1 - termdomain(elem) + d = elem.xpath(ns("./definition")) + d1 = elem.at(ns("./fmt-definition")) + if d.size > 1 then multidef(elem, d, d1) + else singledef(elem, d, d1) + end + unwrap_definition(elem, d1) + termdomain(elem, d1) end - def multidef(elem) - d = elem.at(ns("./definition")) - d = d.replace("
  1. #{to_xml(d.children)}
").first - elem.xpath(ns("./definition")).each do |f| - f = f.replace("
  • #{to_xml(f.children)}
  • ").first - d << f + def multidef(_elem, defn, fmt_defn) + ret = defn.each_with_object([]) do |f, m| + m << "
  • #{to_xml(semx_fmt_dup(f))}
  • " end - d.wrap("") + fmt_defn << "
      #{ret.join("\n")}
    " end - def unwrap_definition(elem) - elem.xpath(ns("./definition")).each do |d| + def singledef(_elem, defn, fmt_defn) + fmt_defn << semx_fmt_dup(defn.first) + end + + def unwrap_definition(_elem, fmt_defn) + fmt_defn.xpath(ns(".//semx[@element = 'definition']")).each do |d| %w(verbal-definition non-verbal-representation).each do |e| v = d&.at(ns("./#{e}")) v&.replace(v.children) @@ -153,26 +78,62 @@ def unwrap_definition(elem) end end - def termdomain(elem) + def termdomain(elem, fmt_defn) d = elem.at(ns(".//domain")) or return - p = elem.at(ns(".//definition//p")) or return - p.add_first_child "<#{d.to_xml}> " - d["hidden"] = true + p = fmt_defn.at(ns(".//p")) or return + d1 = semx_fmt_dup(d) + p.add_first_child "<#{to_xml(d1)}> " end def termsource(docxml) - docxml.xpath(ns("//termsource")).each { |f| termsource_modification(f) } - docxml.xpath(ns("//termsource")).each { |f| termsource1(f) } + copy_baselevel_termsource(docxml) + # TODO should I wrap fmt-definition//termsource in fmt-termsource, in order to preserve termsource attributes? + docxml.xpath(ns("//fmt-termsource/termsource | //fmt-definition//termsource | //fmt-preferred//termsource | //fmt-admitted//termsource | //fmt-deprecates//termsource")) + .each do |f| + termsource_modification(f) + end + docxml.xpath(ns("//fmt-preferred//fmt-termsource | //fmt-admitted//fmt-termsource | //fmt-deprecates//fmt-termsource")) + .each do |f| + termsource_designation(f) + end + docxml.xpath(ns("//fmt-termsource/termsource | //fmt-definition//termsource | //fmt-preferred//termsource | //fmt-admitted//termsource | //fmt-deprecates//termsource")) + .each do |f| + f.parent and termsource1(f) + end + end + + def termsource_designation(fmtsource) + p = fmtsource.previous_element + p&.name == "p" or return + p << " " + p << fmtsource.children + end + + def copy_baselevel_termsource(docxml) + docxml.xpath(ns("//term[termsource]")).each do |x| + s = x.xpath(ns("./termsource")) + s1 = x.at(ns("./fmt-termsource")) + s.each { |ss| s1 << ss.clone } + strip_duplicate_ids(nil, s, s1) + %w(status type).each { |a| s[0][a] and s1[a] = s[0][a] } + end end def termsource1(elem) + ret = [semx_fmt_dup(elem)] while elem&.next_element&.name == "termsource" - elem << "; #{to_xml(elem.next_element.remove.children)}" + ret << semx_fmt_dup(elem.next_element.remove) end - elem.children = l10n("[#{@i18n.source}: #{to_xml(elem.children).strip}]") + s = ret.map { |x| to_xml(x) }.map(&:strip).join("; ") + termsource_label(elem, s) + end + + def termsource_label(elem, sources) + elem.replace(l10n("[#{@i18n.source}: #{sources}]")) end def termsource_modification(elem) + elem.xpath(".//text()[normalize-space() = '']").each(&:remove) origin = elem.at(ns("./origin")) s = termsource_status(elem["status"]) and origin.next = l10n(", #{s}") termsource_add_modification_text(elem.at(ns("./modification"))) @@ -180,10 +141,13 @@ def termsource_modification(elem) def termsource_add_modification_text(mod) mod or return - mod.text.strip.empty? or mod.previous = " — " - mod.elements.size == 1 and - mod.elements[0].replace(mod.elements[0].children) - mod.replace(mod.children) + if mod.text.strip.empty? + mod.remove + return + end + mod.previous = " — " + mod.elements.size == 1 and mod.children = to_xml(mod.elements[0].children) + mod.replace(semx_fmt_dup(mod)) end def termsource_status(status) diff --git a/lib/isodoc/presentation_xml_convert.rb b/lib/isodoc/presentation_xml_convert.rb index 571ebfcb..af9a36c3 100644 --- a/lib/isodoc/presentation_xml_convert.rb +++ b/lib/isodoc/presentation_xml_convert.rb @@ -108,6 +108,7 @@ def inline(docxml) end def terms(docxml) + termcontainers docxml termexample docxml termnote docxml termdefinition docxml @@ -115,6 +116,7 @@ def terms(docxml) termsource docxml concept docxml related docxml + termcleanup docxml end def semantic_xml_insert(xml) diff --git a/spec/isodoc/figures_spec.rb b/spec/isodoc/figures_spec.rb index 7efad136..658fcba5 100644 --- a/spec/isodoc/figures_spec.rb +++ b/spec/isodoc/figures_spec.rb @@ -150,7 +150,7 @@ [SOURCE: ISO 712, Section 1 - — with adjustments ; + — with adjustments; ISO 712, Section 2 ] @@ -275,7 +275,7 @@

    A

    B

    -

    [SOURCE: ISO 712, Section 1 — with adjustments ; ISO 712, Section 2]

    +

    [SOURCE: ISO 712, Section 1 — with adjustments; ISO 712, Section 2]

    Figure 1 — Split-it-right sample divider @@ -361,7 +361,7 @@

    A

    B

    -

    [SOURCE: ISO 712, Section 1 — with adjustments ; ISO 712, Section 2]

    +

    [SOURCE: ISO 712, Section 1 — with adjustments; ISO 712, Section 2]

    Figure 1 — Split-it-right sample divider diff --git a/spec/isodoc/i18n_spec.rb b/spec/isodoc/i18n_spec.rb index 0ef94dc6..d74b8b09 100644 --- a/spec/isodoc/i18n_spec.rb +++ b/spec/isodoc/i18n_spec.rb @@ -76,339 +76,348 @@ INPUT presxml = <<~PRESXML - - - en - - published - withdrawn - - 2 - second edition - - brochure - - - - - Table of contents - - - Foreword - - Foreword - -

    - See - - Clause - 5 - -

    - - - Introduction - - Introduction - - - Introduction Subsection - - Introduction Subsection - - - - - - - Scope - - - 1 - . - - - - - Scope - - - Clause - 1 - -

    Text

    -
    - - Terms, definitions, symbols and abbreviated terms - - - 3 - . - - - - - Terms, definitions, symbols and abbreviated terms - - - Clause - 3 - - - Normal Terms - - - 3 - . - 1 - . - - - - - Normal Terms - - - Clause - 3 - . - 1 - - - - - 3 - . - 1 - . - 1 - . - - - - Clause - 3 - . - 1 - . - 1 - - - Term2 - - - - - Symbols - - - 3 - . - 2 - . - - - - - Symbols - - - Clause - 3 - . - 2 - -
    -
    Symbol
    -
    Definition
    -
    -
    -
    - - Symbols - - - 4 - . - - - - - Symbols - - - Clause - 4 - -
    -
    Symbol
    -
    Definition
    -
    -
    - - Clause 4 - - - 5 - . - - - - - Clause 4 - - - Clause - 5 - - - Introduction - - - 5 - . - 1 - . - - - - - Introduction - - - Clause - 5 - . - 1 - - - - Clause 4.2 - - - 5 - . - 2 - . - - - - - Clause 4.2 - - - Clause - 5 - . - 2 - - - - - Normative References - - - 2 - . - - - - - Normative References - - - Clause - 2 - - -
    - - - <strong>Annex</strong> - - - - - Annex - A - - -
    - (normative) - -
    -
    -
    - - Annex - -
    - - Annex - A - - - Annex A.1 - - - A - . - 1 - . - - - - - Annex A.1 - - - Annex - A - . - 1 - - - Annex A.1a - - - A - . - 1 - . - 1 - . - - - - - Annex A.1a - - - Annex - A - . - 1 - . - 1 - - - -
    - - - Bibliography - - Bibliography - - - Bibliography Subsection - - Bibliography Subsection - - - - - + + + en + + published + withdrawn + + 2 + second edition + + brochure + + + + + Table of contents + + + Foreword + + Foreword + +

    + See + + Clause + 5 + +

    +
    + + Introduction + + Introduction + + + Introduction Subsection + + Introduction Subsection + + + +
    + + + Scope + + + 1 + . + + + + + Scope + + + Clause + 1 + +

    Text

    +
    + + Terms, definitions, symbols and abbreviated terms + + + 3 + . + + + + + Terms, definitions, symbols and abbreviated terms + + + Clause + 3 + + + Normal Terms + + + 3 + . + 1 + . + + + + + Normal Terms + + + Clause + 3 + . + 1 + + + + + 3 + . + 1 + . + 1 + . + + + + Clause + 3 + . + 1 + . + 1 + + + + Term2 + + + +

    + + Term2 + +

    +
    +
    +
    + + Symbols + + + 3 + . + 2 + . + + + + + Symbols + + + Clause + 3 + . + 2 + +
    +
    Symbol
    +
    Definition
    +
    +
    +
    + + Symbols + + + 4 + . + + + + + Symbols + + + Clause + 4 + +
    +
    Symbol
    +
    Definition
    +
    +
    + + Clause 4 + + + 5 + . + + + + + Clause 4 + + + Clause + 5 + + + Introduction + + + 5 + . + 1 + . + + + + + Introduction + + + Clause + 5 + . + 1 + + + + Clause 4.2 + + + 5 + . + 2 + . + + + + + Clause 4.2 + + + Clause + 5 + . + 2 + + + + + Normative References + + + 2 + . + + + + + Normative References + + + Clause + 2 + + +
    + + + <strong>Annex</strong> + + + + + Annex + A + + +
    + (normative) + +
    +
    +
    + + Annex + +
    + + Annex + A + + + Annex A.1 + + + A + . + 1 + . + + + + + Annex A.1 + + + Annex + A + . + 1 + + + Annex A.1a + + + A + . + 1 + . + 1 + . + + + + + Annex A.1a + + + Annex + A + . + 1 + . + 1 + + + +
    + + + Bibliography + + Bibliography + + + Bibliography Subsection + + Bibliography Subsection + + + + +
    PRESXML html = <<~"OUTPUT" @@ -634,339 +643,348 @@ INPUT presxml = <<~PRESXML - - - fr - - published - withdrawn - - 2 - deuxième édition - - brochure - - - - - Sommaire - - - Foreword - - Foreword - -

    - See - - Article - 5 - -

    -
    - - Introduction - - Introduction - - - Introduction Subsection - - Introduction Subsection - - - -
    - - - Scope - - - 1 - . - - - - - Scope - - - Article - 1 - -

    Text

    -
    - - Terms, definitions, symbols and abbreviated terms - - - 3 - . - - - - - Terms, definitions, symbols and abbreviated terms - - - Article - 3 - - - Normal Terms - - - 3 - . - 1 - . - - - - - Normal Terms - - - Article - 3 - . - 1 - - - - - 3 - . - 1 - . - 1 - . - - - - Article - 3 - . - 1 - . - 1 - - - Term2 - - - - - Symboles - - - 3 - . - 2 - . - - - - - Symboles - - - Article - 3 - . - 2 - -
    -
    Symbol
    -
    Definition
    -
    -
    -
    - - Symboles - - - 4 - . - - - - - Symboles - - - Article - 4 - -
    -
    Symbol
    -
    Definition
    -
    -
    - - Clause 4 - - - 5 - . - - - - - Clause 4 - - - Article - 5 - - - Introduction - - - 5 - . - 1 - . - - - - - Introduction - - - Article - 5 - . - 1 - - - - Clause 4.2 - - - 5 - . - 2 - . - - - - - Clause 4.2 - - - Article - 5 - . - 2 - - - - - Normative References - - - 2 - . - - - - - Normative References - - - Article - 2 - - -
    - - - <strong>Annex</strong> - - - - - Annexe - A - - -
    - (normative) - -
    -
    -
    - - Annex - -
    - - Annexe - A - - - Annex A.1 - - - A - . - 1 - . - - - - - Annex A.1 - - - Annexe - A - . - 1 - - - Annex A.1a - - - A - . - 1 - . - 1 - . - - - - - Annex A.1a - - - Annexe - A - . - 1 - . - 1 - - - -
    - - - Bibliographie - - Bibliographie - - - Bibliography Subsection - - Bibliography Subsection - - - - -
    + + + fr + + published + withdrawn + + 2 + deuxième édition + + brochure + + + + + Sommaire + + + Foreword + + Foreword + +

    + See + + Article + 5 + +

    +
    + + Introduction + + Introduction + + + Introduction Subsection + + Introduction Subsection + + + +
    + + + Scope + + + 1 + . + + + + + Scope + + + Article + 1 + +

    Text

    +
    + + Terms, definitions, symbols and abbreviated terms + + + 3 + . + + + + + Terms, definitions, symbols and abbreviated terms + + + Article + 3 + + + Normal Terms + + + 3 + . + 1 + . + + + + + Normal Terms + + + Article + 3 + . + 1 + + + + + 3 + . + 1 + . + 1 + . + + + + Article + 3 + . + 1 + . + 1 + + + + Term2 + + + +

    + + Term2 + +

    +
    +
    +
    + + Symboles + + + 3 + . + 2 + . + + + + + Symboles + + + Article + 3 + . + 2 + +
    +
    Symbol
    +
    Definition
    +
    +
    +
    + + Symboles + + + 4 + . + + + + + Symboles + + + Article + 4 + +
    +
    Symbol
    +
    Definition
    +
    +
    + + Clause 4 + + + 5 + . + + + + + Clause 4 + + + Article + 5 + + + Introduction + + + 5 + . + 1 + . + + + + + Introduction + + + Article + 5 + . + 1 + + + + Clause 4.2 + + + 5 + . + 2 + . + + + + + Clause 4.2 + + + Article + 5 + . + 2 + + + + + Normative References + + + 2 + . + + + + + Normative References + + + Article + 2 + + +
    + + + <strong>Annex</strong> + + + + + Annexe + A + + +
    + (normative) + +
    +
    +
    + + Annex + +
    + + Annexe + A + + + Annex A.1 + + + A + . + 1 + . + + + + + Annex A.1 + + + Annexe + A + . + 1 + + + Annex A.1a + + + A + . + 1 + . + 1 + . + + + + + Annex A.1a + + + Annexe + A + . + 1 + . + 1 + + + +
    + + + Bibliographie + + Bibliographie + + + Bibliography Subsection + + Bibliography Subsection + + + + +
    PRESXML html = <<~"OUTPUT" @@ -1140,350 +1158,359 @@ presxml = <<~PRESXML - - zh - - - published - withdrawn - - 2 - 第第二版 - - brochure - - - - - 目 次 - - - Foreword - - Foreword - -

    - See - - - 5 - -

    -
    - - Introduction - - Introduction - - - Introduction Subsection - - Introduction Subsection - - - -
    - - - Scope - - - 1 - . - - - - - Scope - - - - 1 - -

    - ISO 712,第1~1表 -

    -
    - - Terms, definitions, symbols and abbreviated terms - - - 3 - . - - - - - Terms, definitions, symbols and abbreviated terms - - - - 3 - - - Normal Terms - - - 3 - . - 1 - . - - - - - Normal Terms - - - - 3 - . - 1 - - - - - 3 - . - 1 - . - 1 - . - - - - - 3 - . - 1 - . - 1 - - - Term2 - - - - - 符号 - - - 3 - . - 2 - . - - - - - 符号 - - - - 3 - . - 2 - -
    -
    Symbol
    -
    Definition
    -
    -
    -
    - - 符号 - - - 4 - . - - - - - 符号 - - - - 4 - -
    -
    Symbol
    -
    Definition
    -
    -
    - - Clause 4 - - - 5 - . - - - - - Clause 4 - - - - 5 - - - Introduction - - - 5 - . - 1 - . - - - - - Introduction - - - - 5 - . - 1 - - - - Clause 4.2 - - - 5 - . - 2 - . - - - - - Clause 4.2 - - - - 5 - . - 2 - - - - - Normative References - - - 2 - . - - - - - Normative References - - - - 2 - - - - Cereals and cereal products - . - - ISO 712 - ISO 712 - ISO 712, - - -
    - - - <strong>Annex</strong> - - - - - 附件 - A - - -
    - (规范性附录) - -
    -
    -
    - - Annex - -
    - - 附件 - A - - - Annex A.1 - - - A - . - 1 - . - - - - - Annex A.1 - - - 附件 - A - . - 1 - - - Annex A.1a - - - A - . - 1 - . - 1 - . - - - - - Annex A.1a - - - 附件 - A - . - 1 - . - 1 - - - -
    - - - Bibliography - - Bibliography - - - Bibliography Subsection - - Bibliography Subsection - - - - -
    + + zh + + + published + withdrawn + + 2 + 第第二版 + + brochure + + + + + 目 次 + + + Foreword + + Foreword + +

    + See + + + 5 + +

    +
    + + Introduction + + Introduction + + + Introduction Subsection + + Introduction Subsection + + + +
    + + + Scope + + + 1 + . + + + + + Scope + + + + 1 + +

    + ISO 712,第1~1表 +

    +
    + + Terms, definitions, symbols and abbreviated terms + + + 3 + . + + + + + Terms, definitions, symbols and abbreviated terms + + + + 3 + + + Normal Terms + + + 3 + . + 1 + . + + + + + Normal Terms + + + + 3 + . + 1 + + + + + 3 + . + 1 + . + 1 + . + + + + + 3 + . + 1 + . + 1 + + + + Term2 + + + +

    + + Term2 + +

    +
    +
    +
    + + 符号 + + + 3 + . + 2 + . + + + + + 符号 + + + + 3 + . + 2 + +
    +
    Symbol
    +
    Definition
    +
    +
    +
    + + 符号 + + + 4 + . + + + + + 符号 + + + + 4 + +
    +
    Symbol
    +
    Definition
    +
    +
    + + Clause 4 + + + 5 + . + + + + + Clause 4 + + + + 5 + + + Introduction + + + 5 + . + 1 + . + + + + + Introduction + + + + 5 + . + 1 + + + + Clause 4.2 + + + 5 + . + 2 + . + + + + + Clause 4.2 + + + + 5 + . + 2 + + + + + Normative References + + + 2 + . + + + + + Normative References + + + + 2 + + + + Cereals and cereal products + . + + ISO 712 + ISO 712 + ISO 712, + + +
    + + + <strong>Annex</strong> + + + + + 附件 + A + + +
    + (规范性附录) + +
    +
    +
    + + Annex + +
    + + 附件 + A + + + Annex A.1 + + + A + . + 1 + . + + + + + Annex A.1 + + + 附件 + A + . + 1 + + + Annex A.1a + + + A + . + 1 + . + 1 + . + + + + + Annex A.1a + + + 附件 + A + . + 1 + . + 1 + + + +
    + + + Bibliography + + Bibliography + + + Bibliography Subsection + + Bibliography Subsection + + + + + PRESXML html = <<~"OUTPUT" @@ -1671,404 +1698,413 @@ INPUT presxml = <<~OUTPUT - - - eo - - - published - publikigita - withdrawn - fortirita - - 2 - eldono dua - - brochure - broŝuro - - - - - - - - Foreword - - Foreword - -

    - See - - klaŭzo - 5 - -

    -

    - See - - tabelo - 1 - -

    - - - - Tabelo - 1 - - - - tabelo - 1 - -
    -
    - - Introduction - - Introduction - - - Introduction Subsection - - Introduction Subsection - - - -
    - - - Scope - - - 1 - . - - - - - Scope - - - klaŭzo - 1 - -

    - ISO 712, Tabelo 1–1 -

    -
    - - Terms, definitions, symbols and abbreviated terms - - - 3 - . - - - - - Terms, definitions, symbols and abbreviated terms - - - klaŭzo - 3 - - - Normal Terms - - - 3 - . - 1 - . - - - - - Normal Terms - - - klaŭzo - 3 - . - 1 - - - - - 3 - . - 1 - . - 1 - . - - - - klaŭzo - 3 - . - 1 - . - 1 - - - Term2 - - - - - Simboloj kai mallongigitaj terminoj - - - 3 - . - 2 - . - - - - - Simboloj kai mallongigitaj terminoj - - - klaŭzo - 3 - . - 2 - -
    -
    Symbol
    -
    Definition
    -
    -
    -
    - - Simboloj kai mallongigitaj terminoj - - - 4 - . - - - - - Simboloj kai mallongigitaj terminoj - - - klaŭzo - 4 - -
    -
    Symbol
    -
    Definition
    -
    -
    - - Clause 4 - - - 5 - . - - - - - Clause 4 - - - klaŭzo - 5 - - - Introduction - - - 5 - . - 1 - . - - - - - Introduction - - - klaŭzo - 5 - . - 1 - - - - - NOTO - - - - - - - noto - - - - klaŭzo - 5 - . - 1 - - - noto - - - - - Clause 4.2 - - - 5 - . - 2 - . - - - - - Clause 4.2 - - - klaŭzo - 5 - . - 2 - - - - - Normative References - - - 2 - . - - - - - Normative References - - - klaŭzo - 2 - - - - Cereals and cereal products - . - - ISO 712 - ISO 712 - ISO 712, - - -
    - - - <strong>Annex</strong> - - - - - - Aldono - - A - - -
    - (normative) - -
    -
    -
    - - Annex - -
    - - - aldono - - A - - - Annex A.1 - - - A - . - 1 - . - - - - - Annex A.1 - - - - aldono - - A - . - 1 - - - Annex A.1a - - - A - . - 1 - . - 1 - . - - - - - Annex A.1a - - - - aldono - - A - . - 1 - . - 1 - - - -
    - - - Bibliography - - Bibliography - - - Bibliography Subsection - - Bibliography Subsection - - - - -
    + + + eo + + + published + publikigita + withdrawn + fortirita + + 2 + eldono dua + + brochure + broŝuro + + + + + + + + Foreword + + Foreword + +

    + See + + klaŭzo + 5 + +

    +

    + See + + tabelo + 1 + +

    + + + + Tabelo + 1 + + + + tabelo + 1 + +
    +
    + + Introduction + + Introduction + + + Introduction Subsection + + Introduction Subsection + + + +
    + + + Scope + + + 1 + . + + + + + Scope + + + klaŭzo + 1 + +

    + ISO 712, Tabelo 1–1 +

    +
    + + Terms, definitions, symbols and abbreviated terms + + + 3 + . + + + + + Terms, definitions, symbols and abbreviated terms + + + klaŭzo + 3 + + + Normal Terms + + + 3 + . + 1 + . + + + + + Normal Terms + + + klaŭzo + 3 + . + 1 + + + + + 3 + . + 1 + . + 1 + . + + + + klaŭzo + 3 + . + 1 + . + 1 + + + + Term2 + + + +

    + + Term2 + +

    +
    +
    +
    + + Simboloj kai mallongigitaj terminoj + + + 3 + . + 2 + . + + + + + Simboloj kai mallongigitaj terminoj + + + klaŭzo + 3 + . + 2 + +
    +
    Symbol
    +
    Definition
    +
    +
    +
    + + Simboloj kai mallongigitaj terminoj + + + 4 + . + + + + + Simboloj kai mallongigitaj terminoj + + + klaŭzo + 4 + +
    +
    Symbol
    +
    Definition
    +
    +
    + + Clause 4 + + + 5 + . + + + + + Clause 4 + + + klaŭzo + 5 + + + Introduction + + + 5 + . + 1 + . + + + + + Introduction + + + klaŭzo + 5 + . + 1 + + + + + NOTO + + + + + + + noto + + + + klaŭzo + 5 + . + 1 + + + noto + + + + + Clause 4.2 + + + 5 + . + 2 + . + + + + + Clause 4.2 + + + klaŭzo + 5 + . + 2 + + + + + Normative References + + + 2 + . + + + + + Normative References + + + klaŭzo + 2 + + + + Cereals and cereal products + . + + ISO 712 + ISO 712 + ISO 712, + + +
    + + + <strong>Annex</strong> + + + + + + Aldono + + A + + +
    + (normative) + +
    +
    +
    + + Annex + +
    + + + aldono + + A + + + Annex A.1 + + + A + . + 1 + . + + + + + Annex A.1 + + + + aldono + + A + . + 1 + + + Annex A.1a + + + A + . + 1 + . + 1 + . + + + + + Annex A.1a + + + + aldono + + A + . + 1 + . + 1 + + + +
    + + + Bibliography + + Bibliography + + + Bibliography Subsection + + Bibliography Subsection + + + + +
    OUTPUT html = <<~OUTPUT diff --git a/spec/isodoc/section_spec.rb b/spec/isodoc/section_spec.rb index c9f08e96..a7f63e44 100644 --- a/spec/isodoc/section_spec.rb +++ b/spec/isodoc/section_spec.rb @@ -213,312 +213,357 @@ INPUT presxml = <<~OUTPUT - - - - Table of contents - - - - - <strong>Glossary</strong> - - - - - Annex - A - - -
    - (normative) - -
    -
    -
    - - Glossary - -
    - - Annex - A - - - - - - A - . - 1 - . - - - - Annex - A - . - 1 - - - Glossary - - - -
    - - - <strong>Glossary</strong> - - - - - Annex - B - - -
    - (normative) - -
    -
    -
    - - Glossary - -
    - - Annex - B - - - Term Collection - - - B - . - 1 - . - - - - - Term Collection - - - Annex - B - . - 1 - - - - - B - . - 1 - . - 1 - . - - - - Annex - B - . - 1 - . - 1 - - - Term - - - - - Term Collection 2 - - - B - . - 2 - . - - - - - Term Collection 2 - - - Annex - B - . - 2 - - - - - B - . - 2 - . - 1 - . - - - - Annex - B - . - 2 - . - 1 - - - Term - - - -
    - - - <strong>Glossary</strong> - - - - - Annex - C - - -
    - (normative) - -
    -
    -
    - - Glossary - -
    - - Annex - C - - - Term Collection - - - C - . - 1 - . - - - - - Term Collection - - - Annex - C - . - 1 - - - - - C - . - 1 - . - 1 - . - - - - Annex - C - . - 1 - . - 1 - - - Term - - - - - References - - - C - . - 2 - . - - - - - References - - - Annex - C - . - 2 - - -
    - - - <strong>Term Collection</strong> - - - - - Annex - D - - -
    - (normative) - -
    -
    -
    - - Term Collection - -
    - - Annex - D - - - - - - D - . - 1 - . - - - - Annex - D - . - 1 - - - Term - - - -
    -
    + + + + Table of contents + + + + + <strong>Glossary</strong> + + + + + Annex + A + + +
    + (normative) + +
    +
    +
    + + Glossary + +
    + + Annex + A + + + + + + A + . + 1 + . + + + + Annex + A + . + 1 + + + + Glossary + + + +

    + + Glossary + +

    +
    +
    +
    +
    + + + <strong>Glossary</strong> + + + + + Annex + B + + +
    + (normative) + +
    +
    +
    + + Glossary + +
    + + Annex + B + + + Term Collection + + + B + . + 1 + . + + + + + Term Collection + + + Annex + B + . + 1 + + + + + B + . + 1 + . + 1 + . + + + + Annex + B + . + 1 + . + 1 + + + + Term + + + +

    + + Term + +

    +
    +
    +
    + + Term Collection 2 + + + B + . + 2 + . + + + + + Term Collection 2 + + + Annex + B + . + 2 + + + + + B + . + 2 + . + 1 + . + + + + Annex + B + . + 2 + . + 1 + + + + Term + + + +

    + + Term + +

    +
    +
    +
    +
    + + + <strong>Glossary</strong> + + + + + Annex + C + + +
    + (normative) + +
    +
    +
    + + Glossary + +
    + + Annex + C + + + Term Collection + + + C + . + 1 + . + + + + + Term Collection + + + Annex + C + . + 1 + + + + + C + . + 1 + . + 1 + . + + + + Annex + C + . + 1 + . + 1 + + + + Term + + + +

    + + Term + +

    +
    +
    +
    + + References + + + C + . + 2 + . + + + + + References + + + Annex + C + . + 2 + + +
    + + + <strong>Term Collection</strong> + + + + + Annex + D + + +
    + (normative) + +
    +
    +
    + + Term Collection + +
    + + Annex + D + + + + + + D + . + 1 + . + + + + Annex + D + . + 1 + + + + Term + + + +

    + + Term + +

    +
    +
    +
    +
    +
    OUTPUT expect(Xml::C14n.format(strip_guid(IsoDoc::PresentationXMLConvert .new(presxml_options) diff --git a/spec/isodoc/section_title_spec.rb b/spec/isodoc/section_title_spec.rb index 9ad5e5c0..ccd28138 100644 --- a/spec/isodoc/section_title_spec.rb +++ b/spec/isodoc/section_title_spec.rb @@ -119,467 +119,476 @@ presxml = <<~PRESXML - - - - Copyright - - Copyright - - - - - - License - - License - - - - - - Legal - - Legal - - - - - - Feedback - - Feedback - - - - - - - Table of contents - - - Abstract - - Abstract - - - - Foreword - - Foreword - -

    This is a preamble

    -
    - - Introduction - - Introduction - - - Introduction Subsection - - Introduction Subsection - - - - - Dedication - - Dedication - - - - Note to reader - - Note to reader - - - - Acknowledgements - - Acknowledgements - - -
    - - - - - NOTE - - - - - -

    Initial note

    -
    - - WARNING - - WARNING - -

    Initial admonition

    -
    - - Scope - - - 1 - . - - - - - Scope - - - Clause - 1 - -

    Text

    -
    - - Terms, Definitions, Symbols and Abbreviated Terms - - - 3 - . - - - - - Terms, Definitions, Symbols and Abbreviated Terms - - - Clause - 3 - - - Normal Terms - - - 3 - . - 1 - . - - - - - Normal Terms - - - Clause - 3 - . - 1 - - - - - 3 - . - 1 - . - 1 - . - - - - Clause - 3 - . - 1 - . - 1 - - - Term2 - - - - - Symbols - - - 3 - . - 2 - . - - - - - Symbols - - - Clause - 3 - . - 2 - -
    -
    Symbol
    -
    Definition
    -
    -
    -
    - - Symbols and abbreviated terms - - - 4 - . - - - - - Symbols and abbreviated terms - - - Clause - 4 - -
    -
    Symbol
    -
    Definition
    -
    -
    - - Clause 4 - - - 5 - . - - - - - Clause 4 - - - Clause - 5 - - - Introduction - - - 5 - . - 1 - . - - - - - Introduction - - - Clause - 5 - . - 1 - - - - Clause 4.2 - - - 5 - . - 2 - . - - - - - Clause 4.2 - - - Clause - 5 - . - 2 - - - - - - 5 - . - 3 - . - - - - Clause - 5 - . - 3 - - - - - Normative References - - - 2 - . - - - - - Normative References - - - Clause - 2 - - -
    - - - <strong>Annex</strong> - - - - - Annex - A - - -
    - (normative) - -
    -
    -
    - - Annex - -
    - - Annex - A - - - Annex A.1 - - - A - . - 1 - . - - - - - Annex A.1 - - - Annex - A - . - 1 - - - Annex A.1a - - - A - . - 1 - . - 1 - . - - - - - Annex A.1a - - - Annex - A - . - 1 - . - 1 - - - - Annex Bibliography - - - A - . - 1 - . - 2 - . - - - - - Annex Bibliography - - - Annex - A - . - 1 - . - 2 - - - -
    - - - - - Annex - B - - -
    - (normative) -
    - - Annex - B - -
    - - - Bibliography - - Bibliography - - - Bibliography Subsection - - Bibliography Subsection - - - - - - - Postface 1 - - Postface 1 - - - - Postface 2 - - Postface 2 - - - -
    + + + + Copyright + + Copyright + + + + + + License + + License + + + + + + Legal + + Legal + + + + + + Feedback + + Feedback + + + + + + + Table of contents + + + Abstract + + Abstract + + + + Foreword + + Foreword + +

    This is a preamble

    +
    + + Introduction + + Introduction + + + Introduction Subsection + + Introduction Subsection + + + + + Dedication + + Dedication + + + + Note to reader + + Note to reader + + + + Acknowledgements + + Acknowledgements + + +
    + + + + + NOTE + + + + + +

    Initial note

    +
    + + WARNING + + WARNING + +

    Initial admonition

    +
    + + Scope + + + 1 + . + + + + + Scope + + + Clause + 1 + +

    Text

    +
    + + Terms, Definitions, Symbols and Abbreviated Terms + + + 3 + . + + + + + Terms, Definitions, Symbols and Abbreviated Terms + + + Clause + 3 + + + Normal Terms + + + 3 + . + 1 + . + + + + + Normal Terms + + + Clause + 3 + . + 1 + + + + + 3 + . + 1 + . + 1 + . + + + + Clause + 3 + . + 1 + . + 1 + + + + Term2 + + + +

    + + Term2 + +

    +
    +
    +
    + + Symbols + + + 3 + . + 2 + . + + + + + Symbols + + + Clause + 3 + . + 2 + +
    +
    Symbol
    +
    Definition
    +
    +
    +
    + + Symbols and abbreviated terms + + + 4 + . + + + + + Symbols and abbreviated terms + + + Clause + 4 + +
    +
    Symbol
    +
    Definition
    +
    +
    + + Clause 4 + + + 5 + . + + + + + Clause 4 + + + Clause + 5 + + + Introduction + + + 5 + . + 1 + . + + + + + Introduction + + + Clause + 5 + . + 1 + + + + Clause 4.2 + + + 5 + . + 2 + . + + + + + Clause 4.2 + + + Clause + 5 + . + 2 + + + + + + 5 + . + 3 + . + + + + Clause + 5 + . + 3 + + + + + Normative References + + + 2 + . + + + + + Normative References + + + Clause + 2 + + +
    + + + <strong>Annex</strong> + + + + + Annex + A + + +
    + (normative) + +
    +
    +
    + + Annex + +
    + + Annex + A + + + Annex A.1 + + + A + . + 1 + . + + + + + Annex A.1 + + + Annex + A + . + 1 + + + Annex A.1a + + + A + . + 1 + . + 1 + . + + + + + Annex A.1a + + + Annex + A + . + 1 + . + 1 + + + + Annex Bibliography + + + A + . + 1 + . + 2 + . + + + + + Annex Bibliography + + + Annex + A + . + 1 + . + 2 + + + +
    + + + + + Annex + B + + +
    + (normative) +
    + + Annex + B + +
    + + + Bibliography + + Bibliography + + + Bibliography Subsection + + Bibliography Subsection + + + + + + + Postface 1 + + Postface 1 + + + + Postface 2 + + Postface 2 + + + + PRESXML html = <<~"OUTPUT" @@ -1581,179 +1590,188 @@ - - - Annex - - Annex A.1 - - Annex A.1a - - - - Normative References - - Bibliography - - Bibliography Subsection - - - + + + Annex + + Annex A.1 + + Annex A.1a + + + + Normative References + + Bibliography + + Bibliography Subsection + + + + + INPUT + output = <<~OUTPUT + + + + Table of contents + + + Foreword + + Foreword + +

    This is a preamble

    +
    + + Introduction + + Introduction + + + Introduction Subsection + + Introduction Subsection + + + +
    + + + Scope + + Scope + +

    Text

    +
    + + Terms, Definitions, Symbols and Abbreviated Terms + + Terms, Definitions, Symbols and Abbreviated Terms + + + Normal Terms + + Normal Terms + + + + + 3 + . + 1 + . + 1 + . + + + + Clause + 3 + . + 1 + . + 1 + + + + Term2 + + + +

    + + Term2 + +

    +
    +
    +
    + + Symbols + + Symbols + +
    +
    Symbol
    +
    Definition
    +
    +
    +
    + + Symbols + + Symbols + +
    +
    Symbol
    +
    Definition
    +
    +
    + + Clause 4 + + Clause 4 + + + Introduction + + Introduction + + + + Clause 4.2 + + Clause 4.2 + + + + + + + Normative References + + Normative References + + +
    + + + <strong>Annex</strong> + + + + Annex + + + + Annex A.1 + + Annex A.1 + + + Annex A.1a + + Annex A.1a + + + + + + + Bibliography + + Bibliography + + + Bibliography Subsection + + Bibliography Subsection + + + +
    - INPUT - output = <<~OUTPUT - - - - Table of contents - - - Foreword - - Foreword - -

    This is a preamble

    -
    - - Introduction - - Introduction - - - Introduction Subsection - - Introduction Subsection - - - -
    - - - Scope - - Scope - -

    Text

    -
    - - Terms, Definitions, Symbols and Abbreviated Terms - - Terms, Definitions, Symbols and Abbreviated Terms - - - Normal Terms - - Normal Terms - - - - - 3 - . - 1 - . - 1 - . - - - - Clause - 3 - . - 1 - . - 1 - - - Term2 - - - - - Symbols - - Symbols - -
    -
    Symbol
    -
    Definition
    -
    -
    -
    - - Symbols - - Symbols - -
    -
    Symbol
    -
    Definition
    -
    -
    - - Clause 4 - - Clause 4 - - - Introduction - - Introduction - - - - Clause 4.2 - - Clause 4.2 - - - - - - - Normative References - - Normative References - - -
    - - - <strong>Annex</strong> - - - - Annex - - - - Annex A.1 - - Annex A.1 - - - Annex A.1a - - Annex A.1a - - - - - - - Bibliography - - Bibliography - - - Bibliography Subsection - - Bibliography Subsection - - - - -
    OUTPUT expect(Xml::C14n.format(strip_guid(IsoDoc::PresentationXMLConvert .new({ suppressheadingnumbers: true } @@ -1824,145 +1842,154 @@ INPUT output = <<~OUTPUT - - - - Table of contents - - - - - Scope - - Scope - -

    Text

    -
    - - Terms, Definitions, Symbols and Abbreviated Terms - - Terms, Definitions, Symbols and Abbreviated Terms - - - Normal Terms - - Normal Terms - - - - Term2 - - - - - Symbols - - Symbols - -
    -
    Symbol
    -
    Definition
    -
    -
    -
    - - Symbols - - Symbols - -
    -
    Symbol
    -
    Definition
    -
    -
    - - Clause 4 - - Clause 4 - - - Introduction - - Introduction - - - - Clause 4.2 - - Clause 4.2 - - - - - - - 1 - . - - - - Clause - 1 - - - - - - - - 2 - . - - - - Clause - 2 - - - - Normative References - - Normative References - - -
    - - - <strong>Annex</strong> - - - - Annex - - - - Annex A.1 - - Annex A.1 - - - Annex A.1a - - Annex A.1a - - - - - - - Bibliography - - Bibliography - - - Bibliography Subsection - - Bibliography Subsection - - - - -
    + + + + Table of contents + + + + + Scope + + Scope + +

    Text

    +
    + + Terms, Definitions, Symbols and Abbreviated Terms + + Terms, Definitions, Symbols and Abbreviated Terms + + + Normal Terms + + Normal Terms + + + + + Term2 + + + +

    + + Term2 + +

    +
    +
    +
    + + Symbols + + Symbols + +
    +
    Symbol
    +
    Definition
    +
    +
    +
    + + Symbols + + Symbols + +
    +
    Symbol
    +
    Definition
    +
    +
    + + Clause 4 + + Clause 4 + + + Introduction + + Introduction + + + + Clause 4.2 + + Clause 4.2 + + + + + + + 1 + . + + + + Clause + 1 + + + + + + + + 2 + . + + + + Clause + 2 + + + + Normative References + + Normative References + + +
    + + + <strong>Annex</strong> + + + + Annex + + + + Annex A.1 + + Annex A.1 + + + Annex A.1a + + Annex A.1a + + + + + + + Bibliography + + Bibliography + + + Bibliography Subsection + + Bibliography Subsection + + + + +
    OUTPUT expect(Xml::C14n.format(strip_guid(IsoDoc::PresentationXMLConvert .new(presxml_options) diff --git a/spec/isodoc/table_spec.rb b/spec/isodoc/table_spec.rb index 33fd298e..3c695a12 100644 --- a/spec/isodoc/table_spec.rb +++ b/spec/isodoc/table_spec.rb @@ -228,7 +228,7 @@ [SOURCE: ISO 712, Section 1 - — with adjustments ; + — with adjustments; ISO 712, Section 2 ] @@ -416,7 +416,7 @@

    [SOURCE: ISO 712, Section 1 — - with adjustments ; ISO 712, Section 2]

    + with adjustments; ISO 712, Section 2]

    NOTE  This is a table about rice

    @@ -547,7 +547,7 @@

    [SOURCE: ISO 712, Section 1 - — with adjustments ; ISO 712, Section 2]

    + — with adjustments; ISO 712, Section 2]

    NOTE  This is a table about rice

    diff --git a/spec/isodoc/terms_spec.rb b/spec/isodoc/terms_spec.rb index 6ee78810..f5d67898 100644 --- a/spec/isodoc/terms_spec.rb +++ b/spec/isodoc/terms_spec.rb @@ -15,24 +15,24 @@ INPUT presxml = <<~OUTPUT - - - - Table of contents - - - + + + + Table of contents + + + Terms, Definitions, Symbols and Abbreviated Terms 1 . - - - - - Terms, Definitions, Symbols and Abbreviated Terms + + + + + Terms, Definitions, Symbols and Abbreviated Terms Clause @@ -50,12 +50,21 @@ Clause 1 - . - 1 + . + 1 - - Term2 + + + Term2 + + +

    + + Term2 + +

    +
    @@ -127,6 +136,14 @@

    with adjustments

    + + + t1 + + +

    + + paddy paddy rice @@ -158,305 +175,457 @@ presxml = <<~PRESXML - - - Table of contents - - - - - Terms and Definitions - - - 1 - . - - - - - Terms and Definitions - - - Clause - 1 - -

    For the purposes of this document, the following terms and definitions apply.

    - - - - 1 - . - 1 - . - - - - Clause - 1 - . - 1 - - - paddy - , <in agriculture, dated> - - - [SOURCE: - - - 3.1 - - ISO 7301:2011, Clause 3.1 - - , modified — The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here] - - - -

    - < - rice - > rice retaining its husk after threshing -

    -
    - - - - EXAMPLE - 1 - - - - Example - 1 - - - - Clause - 1 - . - 1 - - , - Example - 1 - -

    Foreign seeds, husks, bran, sand, dust.

    -
      -
    • A
    • -
    -
    - - - - EXAMPLE - 2 - - - - Example - 2 - - - - Clause - 1 - . - 1 - - , - Example - 2 - -
      -
    • A
    • -
    -
    - - [SOURCE: - - t1 - - — comment ; - - - - , modified — with adjustments] - -
    - - - - 1 - . - 2 - . - - - - Clause - 1 - . - 2 - - - paddy - - paddy rice, <in agriculture> - rough rice - DEPRECATED: cargo rice - -

    rice retaining its husk after threshing

    -
    - - - - EXAMPLE - - - - Example - - - - Clause - 1 - . - 2 - - , - Example - -
      -
    • A
    • -
    -
    - - - - Note - 1 - to entry - - : - - - Note - 1 - - - - Clause - 1 - . - 2 - - , - Note - 1 - -

    The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.

    -
    - - - - Note - 2 - to entry - - : - - - Note - 2 - - - - Clause - 1 - . - 2 - - , - Note - 2 - -
      -
    • A
    • -
    -

    The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.

    -
    - - [SOURCE: - - - 3.1 - - ISO 7301:2011, 3.1 - - - - 3.1 - - ISO 7301:2011, clause 3.1 - - ] - -
    - -
    -
    + + + Table of contents + + + + + Terms and Definitions + + + 1 + . + + + + + Terms and Definitions + + + Clause + 1 + +

    For the purposes of this document, the following terms and definitions apply.

    + + + + 1 + . + 1 + . + + + + Clause + 1 + . + 1 + + + + paddy + + in agriculture + dated + + + + 3.1 + + + +

    The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here

    +
    +
    +
    + +

    + + paddy + + , < + in agriculture + , + dated + > + + + [SOURCE: + + + + 3.1 + + ISO 7301:2011, Clause 3.1 + + , modified — The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here + + ] +

    +
    + rice + + +

    rice retaining its husk after threshing

    +
    +
    + + +

    + < + rice + > rice retaining its husk after threshing +

    +
    +
    + + + + EXAMPLE + 1 + + + + Example + 1 + + + + Clause + 1 + . + 1 + + , + Example + 1 + +

    Foreign seeds, husks, bran, sand, dust.

    +
      +
    • A
    • +
    +
    + + + + EXAMPLE + 2 + + + + Example + 2 + + + + Clause + 1 + . + 1 + + , + Example + 2 + +
      +
    • A
    • +
    +
    + + + t1 + + +

    comment

    +
    +
    + + + + + +

    with adjustments

    +
    +
    + + + t1 + + +

    + + + + [SOURCE: + + + t1 + + — comment + + ; + + + + + , modified — with adjustments + + ; + + + t1 + + , adapted + + ] + + + + + + 1 + . + 2 + . + + + + Clause + 1 + . + 2 + + + + paddy + + + +

    + + paddy + +

    + + + + paddy rice + + in agriculture + + + + rough rice + + + +

    + + paddy rice + + , < + in agriculture + > + + +

    +

    + rough rice +

    +
    + + + cargo rice + + + +

    + DEPRECATED: + cargo rice +

    +
    + + +

    rice retaining its husk after threshing

    +
    +
    + + +

    rice retaining its husk after threshing

    +
    +
    + + + + EXAMPLE + + + + Example + + + + Clause + 1 + . + 2 + + , + Example + +
      +
    • A
    • +
    +
    + + + + Note + 1 + to entry + + : + + + Note + 1 + + + + Clause + 1 + . + 2 + + , + Note + 1 + +

    The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.

    +
    + + + + Note + 2 + to entry + + : + + + Note + 2 + + + + Clause + 1 + . + 2 + + , + Note + 2 + +
      +
    • A
    • +
    +

    The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.

    +
    + + + + 3.1 + + + + + 3.1 + + + + + [SOURCE: + + + + 3.1 + + ISO 7301:2011, 3.1 + + + + 3.1 + + ISO 7301:2011, clause 3.1 + + + ] + +
    +
    +
    + PRESXML html = <<~"OUTPUT" #{HTML_HDR} -

    1.  Terms and Definitions

    For the purposes of this document, the following terms and definitions apply.

    1.1.

    paddy, <in agriculture, dated>

    [SOURCE: ISO 7301:2011, Clause 3.1, modified - — - The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here]

    - -

    <rice> rice retaining its husk after threshing

    -

    EXAMPLE 1

    -

    Foreign seeds, husks, bran, sand, dust.

    -
    -
      -
    • A
    • -
    -
    -
    -

    EXAMPLE 2

    -
    -
      -
    • A
    • -
    -
    -
    -

    [SOURCE: t1 - — - comment - - ; - Termbase IEV, term ID xyz, modified - — - with adjustments]

    -

    1.2.

    paddy

    -

    paddy rice, <in agriculture>

    -

    rough rice

    -

    DEPRECATED: cargo rice

    -

    rice retaining its husk after threshing

    -

    EXAMPLE

    -
    -
      -
    • A
    • -
    -
    -
    -

    Note 1 to entry: The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.

    -

    Note 2 to entry:

    -
    • A
    -

    The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.

    -

    [SOURCE: ISO 7301:2011, 3.1 - ISO 7301:2011, clause 3.1]

    -
    - +
    +

    1.  Terms and Definitions

    +

    For the purposes of this document, the following terms and definitions apply.

    +

    1.1.

    +

    + paddy + , <in agriculture, dated> [SOURCE: ISO 7301:2011, Clause 3.1, modified — The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here] +

    +

    <rice> rice retaining its husk after threshing

    +
    +

    EXAMPLE 1

    +

    Foreign seeds, husks, bran, sand, dust.

    +
    +
      +
    • A
    • +
    +
    +
    +
    +

    EXAMPLE 2

    +
    +
      +
    • A
    • +
    +
    +
    +

    [SOURCE: t1 — comment; Termbase IEV, term ID xyz, modified — with adjustments; t1, adapted]

    +

    1.2.

    +

    + paddy +

    +

    paddy rice, <in agriculture>

    +

    rough rice

    +

    DEPRECATED: cargo rice

    +

    rice retaining its husk after threshing

    +
    +

    EXAMPLE

    +
    +
      +
    • A
    • +
    +
    +
    +
    +

    + Note 1 to entry: + The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking. +

    +
    +
    +

    + Note 2 to entry: +

    +
    +
      +
    • A
    • +
    +
    +

    The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.

    +
    +

    [SOURCE: ISO 7301:2011, 3.1ISO 7301:2011, clause 3.1]

    +
    + + OUTPUT @@ -467,55 +636,75 @@


    -
    -

    1.  Terms and Definitions

    For the purposes of this document, the following terms and definitions apply.

    1.1.

    paddy, <in agriculture, dated>

    [SOURCE: ISO 7301:2011, Clause 3.1, modified - — - The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here]

    - -

    <rice> rice retaining its husk after threshing

    -

    EXAMPLE 1

    -

    Foreign seeds, husks, bran, sand, dust.

    -
    -
      -
    • A
    • -
    -
    -
    -

    EXAMPLE 2

    -
    -
      -
    • A
    • -
    -
    -
    -

    [SOURCE: t1 - — - comment - - ; - Termbase IEV, term ID xyz, modified - — - with adjustments]

    -

    1.2.

    paddy

    -

    paddy rice, <in agriculture>

    -

    rough rice

    -

    DEPRECATED: cargo rice

    -

    rice retaining its husk after threshing

    -

    EXAMPLE

    -
    -
      -
    • A
    • -
    -
    -
    -

    Note 1 to entry: The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.

    -

    Note 2 to entry:

    -
    • A
    -

    The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.

    -

    [SOURCE: ISO 7301:2011, 3.1 - ISO 7301:2011, clause 3.1]

    -
    - +
    +
    +

    + 1. +   + Terms and Definitions +

    +

    For the purposes of this document, the following terms and definitions apply.

    +

    1.1.

    +

    + paddy + , <in agriculture, dated> [SOURCE: ISO 7301:2011, Clause 3.1, modified — The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here] +

    +

    <rice> rice retaining its husk after threshing

    +
    +

    EXAMPLE 1

    +

    Foreign seeds, husks, bran, sand, dust.

    +
    +
      +
    • A
    • +
    +
    +
    +
    +

    EXAMPLE 2

    +
    +
      +
    • A
    • +
    +
    +
    +

    [SOURCE: t1 — comment; Termbase IEV, term ID xyz, modified — with adjustments; t1, adapted]

    +

    1.2.

    +

    + paddy +

    +

    paddy rice, <in agriculture>

    +

    rough rice

    +

    DEPRECATED: cargo rice

    +

    rice retaining its husk after threshing

    +
    +

    EXAMPLE

    +
    +
      +
    • A
    • +
    +
    +
    +
    +

    + Note 1 to entry: + The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking. +

    +
    +
    +

    + Note 2 to entry: +

    +
    +
      +
    • A
    • +
    +
    +

    The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.

    +
    +

    [SOURCE: ISO 7301:2011, 3.1ISO 7301:2011, clause 3.1]

    +
    +
    + WORD pres_output = IsoDoc::PresentationXMLConvert @@ -576,132 +765,184 @@ INPUT presxml = <<~PRESXML - - Terms and Definitions - - - 1 - . - - - - - Terms and Definitions - - - Clause - 1 - -

    For the purposes of this document, the following terms and definitions apply.

    - - - - 1 - . - 1 - . - - - - Clause - 1 - . - 1 - - - paddy - - - -
      -
    1. -

      - < - rice - > rice retaining its husk after threshing -

      -
    2. -
    3. -

      rice retaining its husk after threshing, mark 2

      - - [SOURCE: - - - 3.1 - - ISO 7301:2011, Clause 3.1 - - , modified — The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here] - -
    4. -
    -
    - - - - EXAMPLE - 1 - - - - Example - 1 - - - - Clause - 1 - . - 1 - - , - Example - 1 - -

    Foreign seeds, husks, bran, sand, dust.

    -
      -
    • A
    • -
    -
    - - - - EXAMPLE - 2 - - - - Example - 2 - - - - Clause - 1 - . - 1 - - , - Example - 2 - -
      -
    • A
    • -
    -
    - - [SOURCE: - - t1 - - ; - - - - , modified — with adjustments] - -
    -
    + + Terms and Definitions + + + 1 + . + + + + + Terms and Definitions + + + Clause + 1 + +

    For the purposes of this document, the following terms and definitions apply.

    + + + + 1 + . + 1 + . + + + + Clause + 1 + . + 1 + + + + paddy + + + +

    + + paddy + +

    +
    + rice + + +

    rice retaining its husk after threshing

    +
    +
    + + +

    rice retaining its husk after threshing, mark 2

    + + + + 3.1 + + + +

    The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here

    +
    +
    +
    +
    + +
      +
    1. + +

      + < + rice + > rice retaining its husk after threshing +

      +
      +
    2. +
    3. + +

      rice retaining its husk after threshing, mark 2

      + [SOURCE: + + + + 3.1 + + ISO 7301:2011, Clause 3.1 + + , modified — The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here + + ] +
      +
    4. +
    +
    + + + + EXAMPLE + 1 + + + + Example + 1 + + + + Clause + 1 + . + 1 + + , + Example + 1 + +

    Foreign seeds, husks, bran, sand, dust.

    +
      +
    • A
    • +
    +
    + + + + EXAMPLE + 2 + + + + Example + 2 + + + + Clause + 1 + . + 1 + + , + Example + 2 + +
      +
    • A
    • +
    +
    + + + t1 + + + + + + + +

    with adjustments

    +
    +
    + + [SOURCE: + + + t1 + + + ; + + + + + , modified — with adjustments + + ] + +
    +
    PRESXML expect(Xml::C14n.format(strip_guid(Nokogiri::XML(IsoDoc::PresentationXMLConvert .new(presxml_options) @@ -750,11 +991,11 @@ 1 . - - - - - Terms and Definitions + + + + + Terms and Definitions Clause @@ -775,17 +1016,42 @@ . 1 - - paddy; muddy rice + + + paddy + - - -

    - < - rice - > rice retaining its husk after threshing + + + muddy rice + + + +

    + + paddy + + ; + + muddy rice +

    + + rice + + +

    rice retaining its husk after threshing

    +
    + + +

    + < + rice + > rice retaining its husk after threshing +

    +
    +
    @@ -802,17 +1068,42 @@ . 2 - - paddy; muddy rice + + + paddy + - - -

    - < - rice - > rice retaining its husk after threshing + + + muddy rice + + + +

    + + paddy + + ; + + muddy rice +

    + + rice + + +

    rice retaining its husk after threshing

    +
    + + +

    + < + rice + > rice retaining its husk after threshing +

    +
    +
    @@ -829,21 +1120,44 @@ . 3 - - paddy - , US + + + paddy + - - muddy rice + + + muddy rice + - - -

    - < - rice - > rice retaining its husk after threshing + +

    + + paddy + , US + +

    +

    + + muddy rice +

    + + rice + + +

    rice retaining its husk after threshing

    +
    + + +

    + < + rice + > rice retaining its husk after threshing +

    +
    +
    @@ -860,22 +1174,45 @@ . 4 - - paddy - , eng + + + paddy + - - muddy rice - , fra + + + muddy rice + - - -

    - < - rice - > rice retaining its husk after threshing + +

    + + paddy + , eng + +

    +

    + + muddy rice + , fra +

    + + rice + + +

    rice retaining its husk after threshing

    +
    + + +

    + < + rice + > rice retaining its husk after threshing +

    +
    +
    PRESXML @@ -918,17 +1255,17 @@ INPUT presxml = <<~PRESXML - + Terms and Definitions 1 . - - - - - Terms and Definitions + + + + + Terms and Definitions Clause @@ -949,22 +1286,59 @@ . 1 - - paddy - , m, f, sg, noun, en Latn US, /pædiː/ + + + paddy + pædiː + + masculine + feminine + singular + false + true + irregular declension + + - - muddy rice - , n, noun + + + muddy rice + + neuter + true + irregular declension + + - - -

    - < - rice - > rice retaining its husk after threshing -

    + +

    + + paddy + , m, f, sg, noun, en Latn US, /pædiː/ + +

    +

    + + muddy rice + , n, noun + +

    +
    + rice + + +

    rice retaining its husk after threshing

    +
    + + +

    + < + rice + > rice retaining its husk after threshing +

    +
    +
    PRESXML @@ -993,17 +1367,17 @@ INPUT presxml = <<~PRESXML - + Terms and Definitions 1 . - - - - - Terms and Definitions + + + + + Terms and Definitions Clause @@ -1024,32 +1398,56 @@ . 1 - - + + + + - -
    - - + + +
    +
    <LITERAL> FIGURATIVE
    +
    +
    +
    + +

    + + +

    +

    + +

    + + + Figure + 1 + + + Figure 1 - - - - Figure - 1 - -
    <LITERAL> FIGURATIVE
    -
    - - - -

    - < - rice - > rice retaining its husk after threshing + +

    <LITERAL> FIGURATIVE
    +
    +

    + + rice + + +

    rice retaining its husk after threshing

    +
    + + +

    + < + rice + > rice retaining its husk after threshing +

    +
    +
    PRESXML @@ -1150,165 +1548,264 @@ INPUT presxml = <<~PRESXML - - Terms and definitions + + Terms and definitions 1 . - - - - - Terms and definitions + + + + + Terms and definitions Clause 1 -

    For the purposes of this document, the following terms and definitions apply.

    - - - - 1 - . - 1 - . - - - - Clause - 1 - . - 1 - - Term - -

    Definition

    - [SOURCE: - - - - 1 - - - , Section 1 - ] - - - - - Table - 1 - - - - Table - 1 - - - - - - - - - - - - - -
    AB
    CD
    -
    - [SOURCE: - - - - 2 - - - , Section 2 - ] - -
    - - - - 1 - . - 2 - . - - - - Clause +

    For the purposes of this document, the following terms and definitions apply.

    + + + + 1 + . + 1 + . + + + + Clause 1 - . - 2 - - Term 2 - -
    - - - Figure - 1 - - - - Figure - 1 - -
    Literal
    -
    - - - - ( - 1 - ) - - - - Formula - ( - 1 - ) - - - - Clause - 1 - . - 2 - - , - Formula - ( - 1 - ) - - - - x - = - y - - x = y - - - [SOURCE: - - - - 3 - - - , Section 3 - ] + . + 1 +
    + + + Term + + + +

    + + Term + +

    +
    + + +

    Definition

    + + + + + 1 + + + + +
    + + + + + + + + + + + + + + +
    AB
    CD
    +
    +
    + + +

    Definition

    + [SOURCE: + + + + + 1 + + + , Section 1 + + + ] + + + + Table + 1 + + + + Table + 1 + + + + + + + + + + + + + +
    AB
    CD
    +
    +
    + + + + + 2 + + + -
    - + + [SOURCE: + + + + + 2 + + + , Section 2 + + + ] + + + + + + 1 + . + 2 + . + + + + Clause + 1 + . + 2 + + + + Term 2 + + + +

    + + Term 2 + +

    +
    + + +
    +
    Literal
    +
    + + + + x + = + y + + x = y + + + + + + + 3 + + + + +
    +
    + + +
    + + + Figure + 1 + + + + Figure + 1 + +
    Literal
    +
    + + + + ( + 1 + ) + + + + Formula + ( + 1 + ) + + + + Clause + 1 + . + 2 + + , + Formula + ( + 1 + ) + + + + x + = + y + + x = y + + + [SOURCE: + + + + + 3 + + + , Section 3 + + + ] +
    +
    +
    PRESXML expect(Xml::C14n.format(strip_guid(Nokogiri::XML(IsoDoc::PresentationXMLConvert @@ -1370,17 +1867,17 @@ INPUT output = <<~OUTPUT - + Terms and definitions 1 . - - - - - Terms and definitions + + + + + Terms and definitions Clause @@ -1401,11 +1898,33 @@ . 1 - - Second Term - , <Field, Usage Info 1> + + + Second Term + + Field + Usage Info 1 - Definition 1 + +

    + + Second Term + + , < + Field + , + Usage Info 1 + > + + +

    +
    + + Definition 1 + + + Definition 1 + @@ -1422,35 +1941,81 @@ . 2 - - First Designation + + + First Designation + -

    - CONTRAST: - - - Fifth Designation - , n - - - ( - - Clause - 1 - . - 1 - - ) -

    -

    - SEE: - **RELATED TERM NOT FOUND** -

    -

    - SEE ALSO: - **RELATED TERM NOT FOUND** -

    - Definition 2 + +

    + + First Designation + +

    +
    + + + + Fifth Designation + + neuter + + + + + + + + + Fifth Designation + + neuter + + + + + + + + + +

    + CONTRAST: + + + Fifth Designation + , n + + + ( + + Clause + 1 + . + 1 + + ) +

    +
    + +

    + SEE: + **RELATED TERM NOT FOUND** +

    +
    + +

    + SEE ALSO: + **RELATED TERM NOT FOUND** +

    +
    +
    + + Definition 2 + + + Definition 2 +
    OUTPUT @@ -1519,11 +2084,11 @@ 1 . - - - - - Terms and Definitions + + + + + Terms and Definitions Clause @@ -1545,39 +2110,111 @@ . 1 - - paddy + + + paddy + - -

    rice retaining its husk after threshing

    + +

    + + paddy + +

    +
    + + +

    rice retaining its husk after threshing

    +
    - - [SOURCE: + + +

    rice retaining its husk after threshing

    +
    +
    + t1 - — with adjustments ; + +

    with adjustments

    +
    +
    + - , adapted — with adjustments ; + +

    with adjustments

    +
    +
    + - , modified — with adjustments ; + +

    with adjustments

    +
    +
    + t1 - ; + + - , adapted ; + + - , modified] + + [SOURCE: + + + t1 + + — with adjustments + + ; + + + + + , adapted — with adjustments + + ; + + + + + , modified — with adjustments + + ; + + + t1 + + + ; + + + + + , adapted + + ; + + + + + , modified + + ] +
    OUTPUT @@ -1587,17 +2224,17 @@ .at("//xmlns:terms").to_xml))) .to be_equivalent_to Xml::C14n.format(output) output = <<~OUTPUT - + Terms and Definitions 1 . - - - - - Terms and Definitions + + + + + Terms and Definitions Klausel @@ -1619,39 +2256,111 @@ . 1 - - paddy + + + paddy + - -

    rice retaining its husk after threshing

    + +

    + + paddy + +

    +
    + + +

    rice retaining its husk after threshing

    +
    - - [QUELLE: + + +

    rice retaining its husk after threshing

    +
    +
    + t1 - — with adjustments ; + +

    with adjustments

    +
    +
    + - , angepasst — with adjustments ; + +

    with adjustments

    +
    +
    + - , geändert — with adjustments ; + +

    with adjustments

    +
    +
    + t1 - ; + + - , angepasst ; + + - , geändert] + + [QUELLE: + + + t1 + + — with adjustments + + ; + + + + + , angepasst — with adjustments + + ; + + + + + , geändert — with adjustments + + ; + + + t1 + + + ; + + + + + , angepasst + + ; + + + + + , geändert + + ] +
    OUTPUT @@ -1681,17 +2390,17 @@ INPUT output = <<~OUTPUT - + Terms and Definitions 1 . - - - - - Terms and Definitions + + + + + Terms and Definitions Clause @@ -1713,13 +2422,30 @@ . 1 - - paddy - + + + paddy + + - -

    rice retaining its husk after threshing

    + +

    + + paddy + + +

    +
    + + +

    rice retaining its husk after threshing

    +
    + + +

    rice retaining its husk after threshing

    +
    +
    @@ -1736,13 +2462,32 @@ . 2 - - muddy - + + + + muddy + + + - -

    rice not retaining its husk after threshing

    + +

    + + muddy + + +

    +
    + + +

    rice not retaining its husk after threshing

    +
    + + +

    rice not retaining its husk after threshing

    +
    +
    OUTPUT @@ -1752,4 +2497,116 @@ .at("//xmlns:terms").to_xml))) .to be_equivalent_to Xml::C14n.format(output) end + + it "do not process concept markup in Semantic XML" do + input = <<~INPUT + + en + + Terms and Definitions + paddy + +
      + term1 + term + + +
    • term1 + term + +
    • +
    +
    +
    +
    +
    + INPUT + output = <<~OUTPUT + + Terms and Definitions + + + 1 + . + + + + + Terms and Definitions + + + Clause + 1 + + + + + 1 + . + 1 + . + + + + Clause + 1 + . + 1 + + + + paddy + + + +

    + + paddy + +

    +
    + + +
      + + term1 + term + + +
    +
  • + + term1 + term + + +
  • +
    +
    + + +
      + term + ( + [clause1] + ) +
    +
  • + term + ( + [clause1] + ) +
  • +
    +
    +
    +
    + OUTPUT + expect(Xml::C14n.format(strip_guid(Nokogiri::XML(IsoDoc::PresentationXMLConvert + .new(presxml_options) + .convert("test", input, true)) + .at("//xmlns:terms").to_xml))) + .to be_equivalent_to Xml::C14n.format(output) + end + end