metanorma-iec 1.1.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/Rakefile +2 -0
 - data/lib/asciidoctor/iec/converter.rb +6 -15
 - data/lib/asciidoctor/iec/front.rb +4 -4
 - data/lib/asciidoctor/iec/isodoc.rng +12 -6
 - data/lib/isodoc/iec/base_convert.rb +9 -41
 - data/lib/isodoc/iec/html/htmlstyle.css +962 -0
 - data/lib/isodoc/iec/html/htmlstyle.scss +0 -3
 - data/lib/isodoc/iec/html/isodoc.css +845 -0
 - data/lib/isodoc/iec/html/isodoc.scss +0 -1
 - data/lib/isodoc/iec/html/wordstyle.css +2013 -0
 - data/lib/isodoc/iec/html/wordstyle.scss +0 -1
 - data/lib/isodoc/iec/html_convert.rb +2 -0
 - data/lib/isodoc/iec/i18n-en.yaml +13 -0
 - data/lib/isodoc/iec/i18n-fr.yaml +13 -0
 - data/lib/isodoc/iec/i18n-zh-Hans.yaml +11 -0
 - data/lib/isodoc/iec/i18n.rb +19 -0
 - data/lib/isodoc/iec/iec.international-standard.xsl +1460 -1247
 - data/lib/isodoc/iec/init.rb +29 -0
 - data/lib/isodoc/iec/presentation_xml_convert.rb +26 -1
 - data/lib/isodoc/iec/word_convert.rb +3 -1
 - data/lib/isodoc/iec/xref.rb +1 -1
 - data/lib/metanorma/iec/version.rb +1 -1
 - data/metanorma-iec.gemspec +3 -2
 - data/spec/asciidoctor-iec/blocks_spec.rb +1 -1
 - data/spec/asciidoctor-iec/cleanup_spec.rb +2 -2
 - data/spec/asciidoctor-iec/iev_spec.rb +74 -1
 - data/spec/asciidoctor-iec/inline_spec.rb +1 -1
 - data/spec/asciidoctor-iec/section_spec.rb +17 -15
 - data/spec/isodoc/blocks_spec.rb +66 -1
 - data/spec/isodoc/i18n_spec.rb +296 -244
 - data/spec/isodoc/iev_spec.rb +221 -14
 - data/spec/isodoc/inline_spec.rb +97 -73
 - data/spec/isodoc/iso_spec.rb +6 -0
 - data/spec/isodoc/postproc_spec.rb +15 -29
 - data/spec/isodoc/ref_spec.rb +129 -2
 - data/spec/isodoc/section_spec.rb +112 -102
 - data/spec/isodoc/terms_spec.rb +67 -53
 - data/spec/metanorma/processor_spec.rb +2 -1
 - metadata +25 -9
 - data/lib/asciidoctor/iec/i18n-en.yaml +0 -12
 - data/lib/asciidoctor/iec/i18n-fr.yaml +0 -11
 - data/lib/asciidoctor/iec/i18n-zh-Hans.yaml +0 -9
 
| 
         @@ -0,0 +1,29 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require "isodoc"
         
     | 
| 
      
 2 
     | 
    
         
            +
            require_relative "metadata"
         
     | 
| 
      
 3 
     | 
    
         
            +
            require_relative "xref"
         
     | 
| 
      
 4 
     | 
    
         
            +
            require_relative "i18n"
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            module IsoDoc
         
     | 
| 
      
 7 
     | 
    
         
            +
              module Iec
         
     | 
| 
      
 8 
     | 
    
         
            +
                module Init
         
     | 
| 
      
 9 
     | 
    
         
            +
                  def metadata_init(lang, script, labels)
         
     | 
| 
      
 10 
     | 
    
         
            +
                    @meta = Metadata.new(lang, script, labels)
         
     | 
| 
      
 11 
     | 
    
         
            +
                  end
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
                  def xref_init(lang, script, klass, labels, options)
         
     | 
| 
      
 14 
     | 
    
         
            +
                    @xrefs = Xref.new(lang, script, HtmlConvert.new(language: lang, script: script), labels, options)
         
     | 
| 
      
 15 
     | 
    
         
            +
                  end
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
                   def i18n_init(lang, script, i18nyaml = nil)
         
     | 
| 
      
 18 
     | 
    
         
            +
                    @i18n = I18n.new(lang, script, i18nyaml || @i18nyaml)
         
     | 
| 
      
 19 
     | 
    
         
            +
                  end
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
                  def convert1(docxml, filename, dir)
         
     | 
| 
      
 22 
     | 
    
         
            +
                    id = docxml&.at(ns("//bibdata/docnumber"))&.text
         
     | 
| 
      
 23 
     | 
    
         
            +
                    @is_iev = id == "60050"
         
     | 
| 
      
 24 
     | 
    
         
            +
                    super
         
     | 
| 
      
 25 
     | 
    
         
            +
                  end
         
     | 
| 
      
 26 
     | 
    
         
            +
                end
         
     | 
| 
      
 27 
     | 
    
         
            +
              end
         
     | 
| 
      
 28 
     | 
    
         
            +
            end
         
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
         @@ -1,9 +1,34 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            require_relative " 
     | 
| 
      
 1 
     | 
    
         
            +
            require_relative "init"
         
     | 
| 
       2 
2 
     | 
    
         
             
            require "isodoc"
         
     | 
| 
       3 
3 
     | 
    
         | 
| 
       4 
4 
     | 
    
         
             
            module IsoDoc
         
     | 
| 
       5 
5 
     | 
    
         
             
              module Iec
         
     | 
| 
       6 
6 
     | 
    
         
             
                class PresentationXMLConvert < IsoDoc::Iso::PresentationXMLConvert
         
     | 
| 
      
 7 
     | 
    
         
            +
                  def clause(docxml)
         
     | 
| 
      
 8 
     | 
    
         
            +
                    docxml.xpath(ns("//clause[not(ancestor::annex)] | "\
         
     | 
| 
      
 9 
     | 
    
         
            +
                                    "//definitions | //references | "\
         
     | 
| 
      
 10 
     | 
    
         
            +
                                    "//preface/introduction[clause]")).
         
     | 
| 
      
 11 
     | 
    
         
            +
                    each do |f|
         
     | 
| 
      
 12 
     | 
    
         
            +
                      clause1(f)
         
     | 
| 
      
 13 
     | 
    
         
            +
                    end
         
     | 
| 
      
 14 
     | 
    
         
            +
                    docxml.xpath(ns("//terms")).each do |f|
         
     | 
| 
      
 15 
     | 
    
         
            +
                      termclause1(f)
         
     | 
| 
      
 16 
     | 
    
         
            +
                    end
         
     | 
| 
      
 17 
     | 
    
         
            +
                  end
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
                  def termclause1(f)
         
     | 
| 
      
 20 
     | 
    
         
            +
                    return clause1(f) unless @is_iev
         
     | 
| 
      
 21 
     | 
    
         
            +
                    return if @suppressheadingnumbers || f["unnumbered"]
         
     | 
| 
      
 22 
     | 
    
         
            +
                    lbl = @xrefs.anchor(f['id'], :label, true) or return
         
     | 
| 
      
 23 
     | 
    
         
            +
                    prefix_name(f, " ", "#{lbl}#{clausedelim}", "title")
         
     | 
| 
      
 24 
     | 
    
         
            +
                  end
         
     | 
| 
      
 25 
     | 
    
         
            +
             
     | 
| 
      
 26 
     | 
    
         
            +
                  def clause1(f)
         
     | 
| 
      
 27 
     | 
    
         
            +
                    IsoDoc::PresentationXMLConvert.instance_method(:clause1).bind(self).
         
     | 
| 
      
 28 
     | 
    
         
            +
                      call(f)
         
     | 
| 
      
 29 
     | 
    
         
            +
                  end
         
     | 
| 
      
 30 
     | 
    
         
            +
             
     | 
| 
      
 31 
     | 
    
         
            +
                  include Init
         
     | 
| 
       7 
32 
     | 
    
         
             
                end
         
     | 
| 
       8 
33 
     | 
    
         
             
              end
         
     | 
| 
       9 
34 
     | 
    
         
             
            end
         
     | 
| 
         @@ -1,6 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            require "isodoc"
         
     | 
| 
       2 
2 
     | 
    
         
             
            require "metanorma-iso"
         
     | 
| 
       3 
3 
     | 
    
         
             
            require_relative "base_convert"
         
     | 
| 
      
 4 
     | 
    
         
            +
            require_relative "init"
         
     | 
| 
       4 
5 
     | 
    
         | 
| 
       5 
6 
     | 
    
         
             
            module IsoDoc
         
     | 
| 
       6 
7 
     | 
    
         
             
              module Iec
         
     | 
| 
         @@ -171,7 +172,7 @@ module IsoDoc 
     | 
|
| 
       171 
172 
     | 
    
         
             
                      div.p **attr_code(class: "formula") do |p|
         
     | 
| 
       172 
173 
     | 
    
         
             
                        insert_tab(div, 1)
         
     | 
| 
       173 
174 
     | 
    
         
             
                        parse(node.at(ns("./stem")), div)
         
     | 
| 
       174 
     | 
    
         
            -
                        lbl =  
     | 
| 
      
 175 
     | 
    
         
            +
                        lbl = node&.at(ns("./name"))&.text
         
     | 
| 
       175 
176 
     | 
    
         
             
                        unless lbl.nil?
         
     | 
| 
       176 
177 
     | 
    
         
             
                          insert_tab(div, 1)
         
     | 
| 
       177 
178 
     | 
    
         
             
                          div << "(#{lbl})"
         
     | 
| 
         @@ -181,6 +182,7 @@ module IsoDoc 
     | 
|
| 
       181 
182 
     | 
    
         
             
                  end
         
     | 
| 
       182 
183 
     | 
    
         | 
| 
       183 
184 
     | 
    
         
             
                  include BaseConvert
         
     | 
| 
      
 185 
     | 
    
         
            +
                  include Init
         
     | 
| 
       184 
186 
     | 
    
         
             
                end
         
     | 
| 
       185 
187 
     | 
    
         
             
              end
         
     | 
| 
       186 
188 
     | 
    
         
             
            end
         
     | 
    
        data/lib/isodoc/iec/xref.rb
    CHANGED
    
    | 
         @@ -38,7 +38,7 @@ module IsoDoc 
     | 
|
| 
       38 
38 
     | 
    
         
             
                  def annex_name_lbl(clause, num)
         
     | 
| 
       39 
39 
     | 
    
         
             
                    obl = l10n("(#{@labels["inform_annex"]})")
         
     | 
| 
       40 
40 
     | 
    
         
             
                    obl = l10n("(#{@labels["norm_annex"]})") if clause["obligation"] == "normative"
         
     | 
| 
       41 
     | 
    
         
            -
                    l10n("< 
     | 
| 
      
 41 
     | 
    
         
            +
                    l10n("<strong>#{@labels["annex"]} #{num}</strong><br/>#{obl}")
         
     | 
| 
       42 
42 
     | 
    
         
             
                  end
         
     | 
| 
       43 
43 
     | 
    
         
             
                end
         
     | 
| 
       44 
44 
     | 
    
         
             
              end
         
     | 
    
        data/metanorma-iec.gemspec
    CHANGED
    
    | 
         @@ -28,10 +28,11 @@ Gem::Specification.new do |spec| 
     | 
|
| 
       28 
28 
     | 
    
         
             
              spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
         
     | 
| 
       29 
29 
     | 
    
         | 
| 
       30 
30 
     | 
    
         
             
              spec.add_dependency "ruby-jing"
         
     | 
| 
       31 
     | 
    
         
            -
              spec.add_dependency "isodoc", "~> 1. 
     | 
| 
       32 
     | 
    
         
            -
              spec.add_dependency "metanorma-iso", "~> 1. 
     | 
| 
      
 31 
     | 
    
         
            +
              spec.add_dependency "isodoc", "~> 1.2.0"
         
     | 
| 
      
 32 
     | 
    
         
            +
              spec.add_dependency "metanorma-iso", "~> 1.5.0"
         
     | 
| 
       33 
33 
     | 
    
         | 
| 
       34 
34 
     | 
    
         
             
              spec.add_development_dependency "byebug"
         
     | 
| 
      
 35 
     | 
    
         
            +
              spec.add_development_dependency "sassc", "2.4.0"
         
     | 
| 
       35 
36 
     | 
    
         
             
              spec.add_development_dependency "equivalent-xml", "~> 0.6"
         
     | 
| 
       36 
37 
     | 
    
         
             
              spec.add_development_dependency "guard", "~> 2.14"
         
     | 
| 
       37 
38 
     | 
    
         
             
              spec.add_development_dependency "guard-rspec", "~> 4.7"
         
     | 
| 
         @@ -265,7 +265,7 @@ RSpec.describe Asciidoctor::Iec do 
     | 
|
| 
       265 
265 
     | 
    
         
             
                  INPUT
         
     | 
| 
       266 
266 
     | 
    
         
             
                  #{BLANK_HDR}
         
     | 
| 
       267 
267 
     | 
    
         
             
                         <preface><foreword id="_" obligation="informative">
         
     | 
| 
       268 
     | 
    
         
            -
                     <title> 
     | 
| 
      
 268 
     | 
    
         
            +
                     <title>FOREWORD</title>
         
     | 
| 
       269 
269 
     | 
    
         
             
                     <p id="_">This is a preamble</p>
         
     | 
| 
       270 
270 
     | 
    
         
             
                   </foreword></preface><sections>
         
     | 
| 
       271 
271 
     | 
    
         
             
                   <clause id="_" inline-header="false" obligation="normative">
         
     | 
| 
         @@ -121,7 +121,7 @@ RSpec.describe Asciidoctor::Iec do 
     | 
|
| 
       121 
121 
     | 
    
         
             
                   #{BLANK_HDR}
         
     | 
| 
       122 
122 
     | 
    
         
             
                   <preface>
         
     | 
| 
       123 
123 
     | 
    
         
             
                   <foreword id="_" obligation="informative">
         
     | 
| 
       124 
     | 
    
         
            -
                     <title> 
     | 
| 
      
 124 
     | 
    
         
            +
                     <title>FOREWORD</title>
         
     | 
| 
       125 
125 
     | 
    
         
             
                     <p id="_">
         
     | 
| 
       126 
126 
     | 
    
         
             
                     <eref type="inline" bibitemid="iso216" citeas="ISO 216"/>
         
     | 
| 
       127 
127 
     | 
    
         
             
                   </p>
         
     | 
| 
         @@ -189,7 +189,7 @@ RSpec.describe Asciidoctor::Iec do 
     | 
|
| 
       189 
189 
     | 
    
         
             
                INPUT
         
     | 
| 
       190 
190 
     | 
    
         
             
                  #{BLANK_HDR}
         
     | 
| 
       191 
191 
     | 
    
         
             
                  <sections></sections>
         
     | 
| 
       192 
     | 
    
         
            -
                  <bibliography><references id="_" obligation="informative" normative="true"><title>Normative  
     | 
| 
      
 192 
     | 
    
         
            +
                  <bibliography><references id="_" obligation="informative" normative="true"><title>Normative references</title>
         
     | 
| 
       193 
193 
     | 
    
         
             
                  <p id="_">The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
         
     | 
| 
       194 
194 
     | 
    
         
             
                         <bibitem id="iso216" type="standard">
         
     | 
| 
       195 
195 
     | 
    
         
             
                     <title format="text/plain">Reference</title>
         
     | 
| 
         @@ -68,7 +68,7 @@ RSpec.describe Asciidoctor::Iec do 
     | 
|
| 
       68 
68 
     | 
    
         
             
                     <sections> </sections>
         
     | 
| 
       69 
69 
     | 
    
         
             
                     <bibliography>
         
     | 
| 
       70 
70 
     | 
    
         
             
                       <references id='_' obligation='informative' normative="true">
         
     | 
| 
       71 
     | 
    
         
            -
                         <title>Normative  
     | 
| 
      
 71 
     | 
    
         
            +
                         <title>Normative references</title>
         
     | 
| 
       72 
72 
     | 
    
         
             
                         <p id='_'>There are no normative references in this document.</p>
         
     | 
| 
       73 
73 
     | 
    
         
             
                         <bibitem id='A'>
         
     | 
| 
       74 
74 
     | 
    
         
             
                           <formattedref format='application/x-isodoc+xml'>
         
     | 
| 
         @@ -158,4 +158,77 @@ INPUT 
     | 
|
| 
       158 
158 
     | 
    
         | 
| 
       159 
159 
     | 
    
         
             
            OUTPUT
         
     | 
| 
       160 
160 
     | 
    
         
             
              end
         
     | 
| 
      
 161 
     | 
    
         
            +
             
     | 
| 
      
 162 
     | 
    
         
            +
                  it "uses IEV introduction title" do
         
     | 
| 
      
 163 
     | 
    
         
            +
                 expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
         
     | 
| 
      
 164 
     | 
    
         
            +
                  = Document title
         
     | 
| 
      
 165 
     | 
    
         
            +
                  Author
         
     | 
| 
      
 166 
     | 
    
         
            +
                  :docfile: test.adoc
         
     | 
| 
      
 167 
     | 
    
         
            +
                  :nodoc:
         
     | 
| 
      
 168 
     | 
    
         
            +
                  :novalid:
         
     | 
| 
      
 169 
     | 
    
         
            +
                  :no-isobib:
         
     | 
| 
      
 170 
     | 
    
         
            +
                  :docnumber: 60050
         
     | 
| 
      
 171 
     | 
    
         
            +
             
     | 
| 
      
 172 
     | 
    
         
            +
                  == Introduction
         
     | 
| 
      
 173 
     | 
    
         
            +
             
     | 
| 
      
 174 
     | 
    
         
            +
                  Text
         
     | 
| 
      
 175 
     | 
    
         
            +
                INPUT
         
     | 
| 
      
 176 
     | 
    
         
            +
                <?xml version='1.0' encoding='UTF-8'?>
         
     | 
| 
      
 177 
     | 
    
         
            +
                <iec-standard xmlns='https://www.metanorma.org/ns/iec'>
         
     | 
| 
      
 178 
     | 
    
         
            +
                     <bibdata type='standard'>
         
     | 
| 
      
 179 
     | 
    
         
            +
                       <docidentifier type='ISO'>IEC 60050 ED 1</docidentifier>
         
     | 
| 
      
 180 
     | 
    
         
            +
                       <docnumber>60050</docnumber>
         
     | 
| 
      
 181 
     | 
    
         
            +
                       <contributor>
         
     | 
| 
      
 182 
     | 
    
         
            +
                         <role type='author'/>
         
     | 
| 
      
 183 
     | 
    
         
            +
                         <organization>
         
     | 
| 
      
 184 
     | 
    
         
            +
                           <name>International Electrotechnical Commission</name>
         
     | 
| 
      
 185 
     | 
    
         
            +
                           <abbreviation>IEC</abbreviation>
         
     | 
| 
      
 186 
     | 
    
         
            +
                         </organization>
         
     | 
| 
      
 187 
     | 
    
         
            +
                       </contributor>
         
     | 
| 
      
 188 
     | 
    
         
            +
                       <contributor>
         
     | 
| 
      
 189 
     | 
    
         
            +
                         <role type='publisher'/>
         
     | 
| 
      
 190 
     | 
    
         
            +
                         <organization>
         
     | 
| 
      
 191 
     | 
    
         
            +
                           <name>International Electrotechnical Commission</name>
         
     | 
| 
      
 192 
     | 
    
         
            +
                           <abbreviation>IEC</abbreviation>
         
     | 
| 
      
 193 
     | 
    
         
            +
                         </organization>
         
     | 
| 
      
 194 
     | 
    
         
            +
                       </contributor>
         
     | 
| 
      
 195 
     | 
    
         
            +
                       <language>en</language>
         
     | 
| 
      
 196 
     | 
    
         
            +
                       <script>Latn</script>
         
     | 
| 
      
 197 
     | 
    
         
            +
                       <status>
         
     | 
| 
      
 198 
     | 
    
         
            +
                         <stage abbreviation='PPUB'>60</stage>
         
     | 
| 
      
 199 
     | 
    
         
            +
                         <substage abbreviation='PPUB'>60</substage>
         
     | 
| 
      
 200 
     | 
    
         
            +
                       </status>
         
     | 
| 
      
 201 
     | 
    
         
            +
                       <copyright>
         
     | 
| 
      
 202 
     | 
    
         
            +
                         <from>2020</from>
         
     | 
| 
      
 203 
     | 
    
         
            +
                         <owner>
         
     | 
| 
      
 204 
     | 
    
         
            +
                           <organization>
         
     | 
| 
      
 205 
     | 
    
         
            +
                             <name>International Electrotechnical Commission</name>
         
     | 
| 
      
 206 
     | 
    
         
            +
                             <abbreviation>IEC</abbreviation>
         
     | 
| 
      
 207 
     | 
    
         
            +
                           </organization>
         
     | 
| 
      
 208 
     | 
    
         
            +
                         </owner>
         
     | 
| 
      
 209 
     | 
    
         
            +
                       </copyright>
         
     | 
| 
      
 210 
     | 
    
         
            +
                       <ext>
         
     | 
| 
      
 211 
     | 
    
         
            +
                         <doctype>article</doctype>
         
     | 
| 
      
 212 
     | 
    
         
            +
                         <editorialgroup>
         
     | 
| 
      
 213 
     | 
    
         
            +
                           <technical-committee/>
         
     | 
| 
      
 214 
     | 
    
         
            +
                           <subcommittee/>
         
     | 
| 
      
 215 
     | 
    
         
            +
                           <workgroup/>
         
     | 
| 
      
 216 
     | 
    
         
            +
                         </editorialgroup>
         
     | 
| 
      
 217 
     | 
    
         
            +
                         <structuredidentifier>
         
     | 
| 
      
 218 
     | 
    
         
            +
                           <project-number>IEC 60050</project-number>
         
     | 
| 
      
 219 
     | 
    
         
            +
                         </structuredidentifier>
         
     | 
| 
      
 220 
     | 
    
         
            +
                         <stagename>International standard</stagename>
         
     | 
| 
      
 221 
     | 
    
         
            +
                       </ext>
         
     | 
| 
      
 222 
     | 
    
         
            +
                     </bibdata>
         
     | 
| 
      
 223 
     | 
    
         
            +
                     #{BOILERPLATE}
         
     | 
| 
      
 224 
     | 
    
         
            +
                     <preface>
         
     | 
| 
      
 225 
     | 
    
         
            +
                       <introduction id='_' obligation='informative'>
         
     | 
| 
      
 226 
     | 
    
         
            +
                         <title>INTRODUCTION<br/>Principles and rules followed</title>
         
     | 
| 
      
 227 
     | 
    
         
            +
                         <p id='_'>Text</p>
         
     | 
| 
      
 228 
     | 
    
         
            +
                       </introduction>
         
     | 
| 
      
 229 
     | 
    
         
            +
                     </preface>
         
     | 
| 
      
 230 
     | 
    
         
            +
                     <sections> </sections>
         
     | 
| 
      
 231 
     | 
    
         
            +
                   </iec-standard>
         
     | 
| 
      
 232 
     | 
    
         
            +
            OUTPUT
         
     | 
| 
      
 233 
     | 
    
         
            +
                  end
         
     | 
| 
       161 
234 
     | 
    
         
             
            end
         
     | 
| 
         @@ -128,7 +128,7 @@ RSpec.describe Asciidoctor::Iec do 
     | 
|
| 
       128 
128 
     | 
    
         
             
                   <sections>
         
     | 
| 
       129 
129 
     | 
    
         | 
| 
       130 
130 
     | 
    
         
             
                   </sections><bibliography><references id="_" obligation="informative" normative="true">
         
     | 
| 
       131 
     | 
    
         
            -
                     <title>Normative  
     | 
| 
      
 131 
     | 
    
         
            +
                     <title>Normative references</title>
         
     | 
| 
       132 
132 
     | 
    
         
             
                     <p id="_">The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
         
     | 
| 
       133 
133 
     | 
    
         
             
                     <bibitem id="ISO712">
         
     | 
| 
       134 
134 
     | 
    
         
             
                     <formattedref format="application/x-isodoc+xml">Reference</formattedref>
         
     | 
| 
         @@ -54,13 +54,14 @@ RSpec.describe Asciidoctor::Iec do 
     | 
|
| 
       54 
54 
     | 
    
         
             
                INPUT
         
     | 
| 
       55 
55 
     | 
    
         
             
                        #{BLANK_HDR}
         
     | 
| 
       56 
56 
     | 
    
         
             
                   <preface><foreword id="_" obligation="informative">
         
     | 
| 
       57 
     | 
    
         
            -
                     <title> 
     | 
| 
      
 57 
     | 
    
         
            +
                     <title>FOREWORD</title>
         
     | 
| 
       58 
58 
     | 
    
         
             
                     <p id="_">Text</p>
         
     | 
| 
       59 
     | 
    
         
            -
                   </foreword><introduction id="_" obligation="informative" 
     | 
| 
      
 59 
     | 
    
         
            +
                   </foreword><introduction id="_" obligation="informative">
         
     | 
| 
      
 60 
     | 
    
         
            +
            <title>INTRODUCTION</title><clause id="_" inline-header="false" obligation="informative">
         
     | 
| 
       60 
61 
     | 
    
         
             
                     <title>Introduction Subsection</title>
         
     | 
| 
       61 
62 
     | 
    
         
             
                   </clause>
         
     | 
| 
       62 
63 
     | 
    
         
             
                   </introduction></preface><sections>
         
     | 
| 
       63 
     | 
    
         
            -
                   <clause id="_" obligation="normative">
         
     | 
| 
      
 64 
     | 
    
         
            +
                   <clause id="_" obligation="normative" type="scope" inline-header='false'>
         
     | 
| 
       64 
65 
     | 
    
         
             
                     <title>Scope</title>
         
     | 
| 
       65 
66 
     | 
    
         
             
                     <p id="_">Text</p>
         
     | 
| 
       66 
67 
     | 
    
         
             
                   </clause>
         
     | 
| 
         @@ -98,8 +99,8 @@ RSpec.describe Asciidoctor::Iec do 
     | 
|
| 
       98 
99 
     | 
    
         
             
                     <preferred>Term2</preferred>
         
     | 
| 
       99 
100 
     | 
    
         
             
                   </term>
         
     | 
| 
       100 
101 
     | 
    
         
             
                   </terms>
         
     | 
| 
       101 
     | 
    
         
            -
                   <definitions id="_"><title>Symbols and  
     | 
| 
       102 
     | 
    
         
            -
                   <definitions id="_"><title>Symbols and  
     | 
| 
      
 102 
     | 
    
         
            +
                   <definitions id="_" obligation="normative"><title>Symbols and abbreviated terms</title></definitions></clause>
         
     | 
| 
      
 103 
     | 
    
         
            +
                   <definitions id="_" obligation="normative"><title>Symbols and abbreviated terms</title></definitions>
         
     | 
| 
       103 
104 
     | 
    
         
             
                   <clause id="_" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="_" inline-header="false" obligation="normative">
         
     | 
| 
       104 
105 
     | 
    
         
             
                     <title>Introduction</title>
         
     | 
| 
       105 
106 
     | 
    
         
             
                   </clause>
         
     | 
| 
         @@ -119,7 +120,7 @@ RSpec.describe Asciidoctor::Iec do 
     | 
|
| 
       119 
120 
     | 
    
         
             
                   <appendix id="_" inline-header="false" obligation="normative">
         
     | 
| 
       120 
121 
     | 
    
         
             
                      <title>Appendix 1</title>
         
     | 
| 
       121 
122 
     | 
    
         
             
                   </appendix></annex><bibliography><references id="_" obligation="informative" normative="true">
         
     | 
| 
       122 
     | 
    
         
            -
                     <title>Normative  
     | 
| 
      
 123 
     | 
    
         
            +
                     <title>Normative references</title><p id="_">There are no normative references in this document.</p>
         
     | 
| 
       123 
124 
     | 
    
         
             
                   </references><clause id="_" obligation="informative">
         
     | 
| 
       124 
125 
     | 
    
         
             
                     <title>Bibliography</title>
         
     | 
| 
       125 
126 
     | 
    
         
             
                     <references id="_" obligation="informative" normative="false">
         
     | 
| 
         @@ -191,16 +192,17 @@ RSpec.describe Asciidoctor::Iec do 
     | 
|
| 
       191 
192 
     | 
    
         
             
                        #{BLANK_HDR}
         
     | 
| 
       192 
193 
     | 
    
         
             
                   <preface>     
         
     | 
| 
       193 
194 
     | 
    
         
             
                   <foreword id="_" obligation="informative">
         
     | 
| 
       194 
     | 
    
         
            -
                     <title> 
     | 
| 
      
 195 
     | 
    
         
            +
                     <title>FOREWORD</title>
         
     | 
| 
       195 
196 
     | 
    
         
             
                     <p id="_">Text</p>
         
     | 
| 
       196 
197 
     | 
    
         
             
                   </foreword>
         
     | 
| 
       197 
     | 
    
         
            -
                   <introduction id="_" obligation="informative" 
     | 
| 
      
 198 
     | 
    
         
            +
                   <introduction id="_" obligation="informative">
         
     | 
| 
      
 199 
     | 
    
         
            +
            <title>INTRODUCTION</title><clause id="_" inline-header="false" obligation="informative">
         
     | 
| 
       198 
200 
     | 
    
         
             
                     <title>Introduction Subsection</title>
         
     | 
| 
       199 
201 
     | 
    
         
             
                   </clause>
         
     | 
| 
       200 
202 
     | 
    
         
             
                   </introduction>
         
     | 
| 
       201 
203 
     | 
    
         
             
                   </preface>
         
     | 
| 
       202 
204 
     | 
    
         
             
                   <sections>
         
     | 
| 
       203 
     | 
    
         
            -
                   <clause id="_" obligation="normative">
         
     | 
| 
      
 205 
     | 
    
         
            +
                   <clause id="_" obligation="normative" type="scope" inline-header='false'>
         
     | 
| 
       204 
206 
     | 
    
         
             
                     <title>Scope</title>
         
     | 
| 
       205 
207 
     | 
    
         
             
                     <p id="_">Text</p>
         
     | 
| 
       206 
208 
     | 
    
         
             
                   </clause>
         
     | 
| 
         @@ -214,7 +216,7 @@ RSpec.describe Asciidoctor::Iec do 
     | 
|
| 
       214 
216 
     | 
    
         
             
                   </term>
         
     | 
| 
       215 
217 
     | 
    
         
             
                   </terms>
         
     | 
| 
       216 
218 
     | 
    
         
             
                   <clause id='_' obligation='normative'>
         
     | 
| 
       217 
     | 
    
         
            -
                         <title>Terms and  
     | 
| 
      
 219 
     | 
    
         
            +
                         <title>Terms, definitions, symbols and abbreviated terms</title>
         
     | 
| 
       218 
220 
     | 
    
         
             
                         <terms id='_' obligation='normative'>
         
     | 
| 
       219 
221 
     | 
    
         
             
                           <title>Normal Terms</title>
         
     | 
| 
       220 
222 
     | 
    
         
             
                            <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
         
     | 
| 
         @@ -240,12 +242,12 @@ RSpec.describe Asciidoctor::Iec do 
     | 
|
| 
       240 
242 
     | 
    
         
             
                             <preferred>Term2</preferred>
         
     | 
| 
       241 
243 
     | 
    
         
             
                           </term>
         
     | 
| 
       242 
244 
     | 
    
         
             
                         </terms>
         
     | 
| 
       243 
     | 
    
         
            -
                         <definitions id='_'>
         
     | 
| 
       244 
     | 
    
         
            -
                           <title 
     | 
| 
      
 245 
     | 
    
         
            +
                         <definitions id='_' obligation="normative">
         
     | 
| 
      
 246 
     | 
    
         
            +
                           <title>Symbols and abbreviated terms</title>
         
     | 
| 
       245 
247 
     | 
    
         
             
                         </definitions>
         
     | 
| 
       246 
248 
     | 
    
         
             
                       </clause>
         
     | 
| 
       247 
     | 
    
         
            -
                       <definitions id='_'>
         
     | 
| 
       248 
     | 
    
         
            -
                         <title 
     | 
| 
      
 249 
     | 
    
         
            +
                       <definitions id='_' obligation="normative">
         
     | 
| 
      
 250 
     | 
    
         
            +
                         <title>Symbols and abbreviated terms</title>
         
     | 
| 
       249 
251 
     | 
    
         
             
                       </definitions>
         
     | 
| 
       250 
252 
     | 
    
         
             
                       <clause id='_' inline-header='false' obligation='normative'>
         
     | 
| 
       251 
253 
     | 
    
         
             
                         <title>Clause 4</title>
         
     | 
| 
         @@ -268,7 +270,7 @@ RSpec.describe Asciidoctor::Iec do 
     | 
|
| 
       268 
270 
     | 
    
         
             
                     </annex>
         
     | 
| 
       269 
271 
     | 
    
         
             
                     <bibliography>
         
     | 
| 
       270 
272 
     | 
    
         
             
                       <references id='_' obligation='informative' normative="true">
         
     | 
| 
       271 
     | 
    
         
            -
                         <title>Normative  
     | 
| 
      
 273 
     | 
    
         
            +
                         <title>Normative references</title>
         
     | 
| 
       272 
274 
     | 
    
         
             
                         <p id="_">There are no normative references in this document.</p>
         
     | 
| 
       273 
275 
     | 
    
         
             
                       </references>
         
     | 
| 
       274 
276 
     | 
    
         
             
                       <clause id='_' obligation='informative'>
         
     | 
    
        data/spec/isodoc/blocks_spec.rb
    CHANGED
    
    | 
         @@ -80,10 +80,11 @@ RSpec.describe IsoDoc::Iec do 
     | 
|
| 
       80 
80 
     | 
    
         
             
              </dd>
         
     | 
| 
       81 
81 
     | 
    
         
             
            </dl>
         
     | 
| 
       82 
82 
     | 
    
         
             
                <note id="_83083c7a-6c85-43db-a9fa-4d8edd0c9fc0">
         
     | 
| 
      
 83 
     | 
    
         
            +
                <name>NOTE</name>
         
     | 
| 
       83 
84 
     | 
    
         
             
              <p id="_511aaa98-4116-42af-8e5b-c87cdf5bfdc8">[durationUnits] is essentially a duration statement without the "P" prefix. "P" is unnecessary because between "G" and "U" duration is always expressed.</p>
         
     | 
| 
       84 
85 
     | 
    
         
             
            </note>
         
     | 
| 
       85 
86 
     | 
    
         
             
                </formula>
         
     | 
| 
       86 
     | 
    
         
            -
                <formula id="_be9158af-7e93-4ee2-90c5-26d31c181935">
         
     | 
| 
      
 87 
     | 
    
         
            +
                <formula id="_be9158af-7e93-4ee2-90c5-26d31c181935"><name>1</name>
         
     | 
| 
       87 
88 
     | 
    
         
             
              <stem type="AsciiMath">r = 1 %</stem>
         
     | 
| 
       88 
89 
     | 
    
         
             
              </formula>
         
     | 
| 
       89 
90 
     | 
    
         
             
                </foreword></preface>
         
     | 
| 
         @@ -151,4 +152,68 @@ RSpec.describe IsoDoc::Iec do 
     | 
|
| 
       151 
152 
     | 
    
         
             
                OUTPUT
         
     | 
| 
       152 
153 
     | 
    
         
             
              end
         
     | 
| 
       153 
154 
     | 
    
         | 
| 
      
 155 
     | 
    
         
            +
                 it "cross-references formulae" do
         
     | 
| 
      
 156 
     | 
    
         
            +
                expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true).gsub(%r{^.*<body}m, "<body").gsub(%r{</body>.*}m, "</body>"))).to be_equivalent_to xmlpp(<<~"OUTPUT")
         
     | 
| 
      
 157 
     | 
    
         
            +
                        <iso-standard xmlns="http://riboseinc.com/isoxml">
         
     | 
| 
      
 158 
     | 
    
         
            +
                        <preface>
         
     | 
| 
      
 159 
     | 
    
         
            +
                <foreword>
         
     | 
| 
      
 160 
     | 
    
         
            +
                <p>
         
     | 
| 
      
 161 
     | 
    
         
            +
                <xref target="N1"/>
         
     | 
| 
      
 162 
     | 
    
         
            +
                <xref target="N2"/>
         
     | 
| 
      
 163 
     | 
    
         
            +
                </p>
         
     | 
| 
      
 164 
     | 
    
         
            +
                </foreword>
         
     | 
| 
      
 165 
     | 
    
         
            +
                </preface>
         
     | 
| 
      
 166 
     | 
    
         
            +
                <sections>
         
     | 
| 
      
 167 
     | 
    
         
            +
                <clause id="intro"><title>First</title>
         
     | 
| 
      
 168 
     | 
    
         
            +
                <formula id="N1">
         
     | 
| 
      
 169 
     | 
    
         
            +
              <stem type="AsciiMath">r = 1 %</stem>
         
     | 
| 
      
 170 
     | 
    
         
            +
              </formula>
         
     | 
| 
      
 171 
     | 
    
         
            +
              <clause id="xyz"><title>Preparatory</title>
         
     | 
| 
      
 172 
     | 
    
         
            +
                <formula id="N2" inequality="true">
         
     | 
| 
      
 173 
     | 
    
         
            +
              <stem type="AsciiMath">r = 1 %</stem>
         
     | 
| 
      
 174 
     | 
    
         
            +
              </formula>
         
     | 
| 
      
 175 
     | 
    
         
            +
                <xref target="N2"/>
         
     | 
| 
      
 176 
     | 
    
         
            +
            </clause>
         
     | 
| 
      
 177 
     | 
    
         
            +
            </sections>
         
     | 
| 
      
 178 
     | 
    
         
            +
                </iso-standard>
         
     | 
| 
      
 179 
     | 
    
         
            +
                INPUT
         
     | 
| 
      
 180 
     | 
    
         
            +
                <iso-standard xmlns='http://riboseinc.com/isoxml'>
         
     | 
| 
      
 181 
     | 
    
         
            +
                     <preface>
         
     | 
| 
      
 182 
     | 
    
         
            +
                       <foreword>
         
     | 
| 
      
 183 
     | 
    
         
            +
                         <p>
         
     | 
| 
      
 184 
     | 
    
         
            +
                           <xref target='N1'>Clause 1, Equation (1)</xref>
         
     | 
| 
      
 185 
     | 
    
         
            +
                           <xref target='N2'>1.1, Inequality (2)</xref>
         
     | 
| 
      
 186 
     | 
    
         
            +
                         </p>
         
     | 
| 
      
 187 
     | 
    
         
            +
                       </foreword>
         
     | 
| 
      
 188 
     | 
    
         
            +
                     </preface>
         
     | 
| 
      
 189 
     | 
    
         
            +
                     <sections>
         
     | 
| 
      
 190 
     | 
    
         
            +
                       <clause id='intro'>
         
     | 
| 
      
 191 
     | 
    
         
            +
                         <title depth='1'>
         
     | 
| 
      
 192 
     | 
    
         
            +
                           1
         
     | 
| 
      
 193 
     | 
    
         
            +
                           <tab/>
         
     | 
| 
      
 194 
     | 
    
         
            +
                           First
         
     | 
| 
      
 195 
     | 
    
         
            +
                         </title>
         
     | 
| 
      
 196 
     | 
    
         
            +
                         <formula id='N1'>
         
     | 
| 
      
 197 
     | 
    
         
            +
                           <name>1</name>
         
     | 
| 
      
 198 
     | 
    
         
            +
                           <stem type='AsciiMath'>r = 1 %</stem>
         
     | 
| 
      
 199 
     | 
    
         
            +
                         </formula>
         
     | 
| 
      
 200 
     | 
    
         
            +
                         <clause id='xyz'>
         
     | 
| 
      
 201 
     | 
    
         
            +
                           <title depth='2'>
         
     | 
| 
      
 202 
     | 
    
         
            +
                             1.1
         
     | 
| 
      
 203 
     | 
    
         
            +
                             <tab/>
         
     | 
| 
      
 204 
     | 
    
         
            +
                             Preparatory
         
     | 
| 
      
 205 
     | 
    
         
            +
                           </title>
         
     | 
| 
      
 206 
     | 
    
         
            +
                           <formula id='N2' inequality='true'>
         
     | 
| 
      
 207 
     | 
    
         
            +
                             <name>2</name>
         
     | 
| 
      
 208 
     | 
    
         
            +
                             <stem type='AsciiMath'>r = 1 %</stem>
         
     | 
| 
      
 209 
     | 
    
         
            +
                           </formula>
         
     | 
| 
      
 210 
     | 
    
         
            +
                           <xref target='N2'>Inequality (2)</xref>
         
     | 
| 
      
 211 
     | 
    
         
            +
                         </clause>
         
     | 
| 
      
 212 
     | 
    
         
            +
                       </clause>
         
     | 
| 
      
 213 
     | 
    
         
            +
                     </sections>
         
     | 
| 
      
 214 
     | 
    
         
            +
                   </iso-standard>
         
     | 
| 
      
 215 
     | 
    
         
            +
                OUTPUT
         
     | 
| 
      
 216 
     | 
    
         
            +
                   end
         
     | 
| 
      
 217 
     | 
    
         
            +
             
     | 
| 
      
 218 
     | 
    
         
            +
             
     | 
| 
       154 
219 
     | 
    
         
             
            end
         
     | 
    
        data/spec/isodoc/i18n_spec.rb
    CHANGED
    
    | 
         @@ -2,7 +2,7 @@ require "spec_helper" 
     | 
|
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            RSpec.describe IsoDoc do
         
     | 
| 
       4 
4 
     | 
    
         
             
              it "processes English" do
         
     | 
| 
       5 
     | 
    
         
            -
                 
     | 
| 
      
 5 
     | 
    
         
            +
                input = <<~INPUT
         
     | 
| 
       6 
6 
     | 
    
         
             
                  <iso-standard xmlns="http://riboseinc.com/isoxml">
         
     | 
| 
       7 
7 
     | 
    
         
             
                  <bibdata>
         
     | 
| 
       8 
8 
     | 
    
         
             
                  <docnumber>1</docnumber>
         
     | 
| 
         @@ -18,7 +18,7 @@ RSpec.describe IsoDoc do 
     | 
|
| 
       18 
18 
     | 
    
         
             
                   </clause>
         
     | 
| 
       19 
19 
     | 
    
         
             
                   <p>This is patent boilerplate</p>
         
     | 
| 
       20 
20 
     | 
    
         
             
                   </introduction></preface><sections>
         
     | 
| 
       21 
     | 
    
         
            -
                   <clause id="D" obligation="normative">
         
     | 
| 
      
 21 
     | 
    
         
            +
                   <clause id="D" obligation="normative" type="scope">
         
     | 
| 
       22 
22 
     | 
    
         
             
                     <title>Scope</title>
         
     | 
| 
       23 
23 
     | 
    
         
             
                     <p id="E">Text</p>
         
     | 
| 
       24 
24 
     | 
    
         
             
                   </clause>
         
     | 
| 
         @@ -71,6 +71,78 @@ RSpec.describe IsoDoc do 
     | 
|
| 
       71 
71 
     | 
    
         
             
                   </bibliography>
         
     | 
| 
       72 
72 
     | 
    
         
             
                   </iso-standard>
         
     | 
| 
       73 
73 
     | 
    
         
             
                    INPUT
         
     | 
| 
      
 74 
     | 
    
         
            +
             
     | 
| 
      
 75 
     | 
    
         
            +
                    presxml = <<~OUTPUT
         
     | 
| 
      
 76 
     | 
    
         
            +
                    <iso-standard xmlns="http://riboseinc.com/isoxml">
         
     | 
| 
      
 77 
     | 
    
         
            +
                   <bibdata>
         
     | 
| 
      
 78 
     | 
    
         
            +
                   <docnumber>1</docnumber>
         
     | 
| 
      
 79 
     | 
    
         
            +
                   <language>en</language>
         
     | 
| 
      
 80 
     | 
    
         
            +
                   </bibdata>
         
     | 
| 
      
 81 
     | 
    
         
            +
                   <preface>
         
     | 
| 
      
 82 
     | 
    
         
            +
                   <foreword obligation="informative">
         
     | 
| 
      
 83 
     | 
    
         
            +
                      <title>Foreword</title>
         
     | 
| 
      
 84 
     | 
    
         
            +
                      <p id="A">This is a preamble</p>
         
     | 
| 
      
 85 
     | 
    
         
            +
                    </foreword>
         
     | 
| 
      
 86 
     | 
    
         
            +
                     <introduction id="B" obligation="informative"><title depth="1">0<tab/>Introduction</title><clause id="C" inline-header="false" obligation="informative">
         
     | 
| 
      
 87 
     | 
    
         
            +
                      <title depth="2">0.1<tab/>Introduction Subsection</title>
         
     | 
| 
      
 88 
     | 
    
         
            +
                    </clause>
         
     | 
| 
      
 89 
     | 
    
         
            +
                    <p>This is patent boilerplate</p>
         
     | 
| 
      
 90 
     | 
    
         
            +
                    </introduction></preface><sections>
         
     | 
| 
      
 91 
     | 
    
         
            +
                    <clause id="D" obligation="normative" type="scope">
         
     | 
| 
      
 92 
     | 
    
         
            +
                      <title depth="1">1<tab/>Scope</title>
         
     | 
| 
      
 93 
     | 
    
         
            +
                      <p id="E">Text</p>
         
     | 
| 
      
 94 
     | 
    
         
            +
                    </clause>
         
     | 
| 
      
 95 
     | 
    
         
            +
             
     | 
| 
      
 96 
     | 
    
         
            +
                    <clause id="H" obligation="normative"><title depth="1">3<tab/>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
         
     | 
| 
      
 97 
     | 
    
         
            +
                      <title depth="2">3.1<tab/>Normal Terms</title>
         
     | 
| 
      
 98 
     | 
    
         
            +
                      <term id="J"><name>3.1.1</name>
         
     | 
| 
      
 99 
     | 
    
         
            +
                      <preferred>Term2</preferred>
         
     | 
| 
      
 100 
     | 
    
         
            +
                    </term>
         
     | 
| 
      
 101 
     | 
    
         
            +
                    </terms>
         
     | 
| 
      
 102 
     | 
    
         
            +
                    <definitions id="K"><title>3.2</title>
         
     | 
| 
      
 103 
     | 
    
         
            +
                      <dl>
         
     | 
| 
      
 104 
     | 
    
         
            +
                      <dt>Symbol</dt>
         
     | 
| 
      
 105 
     | 
    
         
            +
                      <dd>Definition</dd>
         
     | 
| 
      
 106 
     | 
    
         
            +
                      </dl>
         
     | 
| 
      
 107 
     | 
    
         
            +
                    </definitions>
         
     | 
| 
      
 108 
     | 
    
         
            +
                    </clause>
         
     | 
| 
      
 109 
     | 
    
         
            +
                    <definitions id="L"><title>4</title>
         
     | 
| 
      
 110 
     | 
    
         
            +
                      <dl>
         
     | 
| 
      
 111 
     | 
    
         
            +
                      <dt>Symbol</dt>
         
     | 
| 
      
 112 
     | 
    
         
            +
                      <dd>Definition</dd>
         
     | 
| 
      
 113 
     | 
    
         
            +
                      </dl>
         
     | 
| 
      
 114 
     | 
    
         
            +
                    </definitions>
         
     | 
| 
      
 115 
     | 
    
         
            +
                    <clause id="M" inline-header="false" obligation="normative"><title depth="1">5<tab/>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
         
     | 
| 
      
 116 
     | 
    
         
            +
                      <title depth="2">5.1<tab/>Introduction</title>
         
     | 
| 
      
 117 
     | 
    
         
            +
                    </clause>
         
     | 
| 
      
 118 
     | 
    
         
            +
                    <clause id="O" inline-header="false" obligation="normative">
         
     | 
| 
      
 119 
     | 
    
         
            +
                      <title depth="2">5.2<tab/>Clause 4.2</title>
         
     | 
| 
      
 120 
     | 
    
         
            +
                    </clause></clause>
         
     | 
| 
      
 121 
     | 
    
         
            +
             
     | 
| 
      
 122 
     | 
    
         
            +
                    </sections><annex id="P" inline-header="false" obligation="normative">
         
     | 
| 
      
 123 
     | 
    
         
            +
                      <title><strong>Annex A</strong><br/>(normative)<br/><br/><strong>Annex</strong></title>
         
     | 
| 
      
 124 
     | 
    
         
            +
                      <clause id="Q" inline-header="false" obligation="normative">
         
     | 
| 
      
 125 
     | 
    
         
            +
                      <title depth="2">A.1<tab/>Annex A.1</title>
         
     | 
| 
      
 126 
     | 
    
         
            +
                      <clause id="Q1" inline-header="false" obligation="normative">
         
     | 
| 
      
 127 
     | 
    
         
            +
                      <title depth="3">A.1.1<tab/>Annex A.1a</title>
         
     | 
| 
      
 128 
     | 
    
         
            +
                      </clause>
         
     | 
| 
      
 129 
     | 
    
         
            +
                    </clause>
         
     | 
| 
      
 130 
     | 
    
         
            +
                    <appendix id="Q2" inline-header="false" obligation="normative">
         
     | 
| 
      
 131 
     | 
    
         
            +
                      <title depth="2">Appendix 1<tab/>An Appendix</title>
         
     | 
| 
      
 132 
     | 
    
         
            +
                    </appendix>
         
     | 
| 
      
 133 
     | 
    
         
            +
                    </annex><bibliography><references id="R" obligation="informative" normative="true">
         
     | 
| 
      
 134 
     | 
    
         
            +
                      <title depth="1">2<tab/>Normative References</title>
         
     | 
| 
      
 135 
     | 
    
         
            +
                    </references><clause id="S" obligation="informative">
         
     | 
| 
      
 136 
     | 
    
         
            +
                      <title depth="1">Bibliography</title>
         
     | 
| 
      
 137 
     | 
    
         
            +
                      <references id="T" obligation="informative" normative="false">
         
     | 
| 
      
 138 
     | 
    
         
            +
                      <title depth="2">Bibliography Subsection</title>
         
     | 
| 
      
 139 
     | 
    
         
            +
                    </references>
         
     | 
| 
      
 140 
     | 
    
         
            +
                    </clause>
         
     | 
| 
      
 141 
     | 
    
         
            +
                    </bibliography>
         
     | 
| 
      
 142 
     | 
    
         
            +
                    </iso-standard>
         
     | 
| 
      
 143 
     | 
    
         
            +
                    OUTPUT
         
     | 
| 
      
 144 
     | 
    
         
            +
             
     | 
| 
      
 145 
     | 
    
         
            +
                    html = <<~OUTPUT
         
     | 
| 
       74 
146 
     | 
    
         
             
                    #{HTML_HDR}
         
     | 
| 
       75 
147 
     | 
    
         
             
                         <div>
         
     | 
| 
       76 
148 
     | 
    
         
             
                           <h1 class="ForewordTitle">FOREWORD</h1>
         
     | 
| 
         @@ -79,7 +151,7 @@ RSpec.describe IsoDoc do 
     | 
|
| 
       79 
151 
     | 
    
         
             
                         </div>
         
     | 
| 
       80 
152 
     | 
    
         
             
                         <br/>
         
     | 
| 
       81 
153 
     | 
    
         
             
                         <div class="Section3" id="B">
         
     | 
| 
       82 
     | 
    
         
            -
                           <h1 class="IntroTitle">0   
     | 
| 
      
 154 
     | 
    
         
            +
                           <h1 class="IntroTitle">0  Introduction</h1>
         
     | 
| 
       83 
155 
     | 
    
         
             
                           <div id="C"><h2>0.1  Introduction Subsection</h2>
         
     | 
| 
       84 
156 
     | 
    
         | 
| 
       85 
157 
     | 
    
         
             
                    </div>
         
     | 
| 
         @@ -91,7 +163,7 @@ RSpec.describe IsoDoc do 
     | 
|
| 
       91 
163 
     | 
    
         
             
                           <p id="E">Text</p>
         
     | 
| 
       92 
164 
     | 
    
         
             
                         </div>
         
     | 
| 
       93 
165 
     | 
    
         
             
                         <div>
         
     | 
| 
       94 
     | 
    
         
            -
                           <h1>2  Normative  
     | 
| 
      
 166 
     | 
    
         
            +
                           <h1>2  Normative References</h1>
         
     | 
| 
       95 
167 
     | 
    
         
             
                         </div>
         
     | 
| 
       96 
168 
     | 
    
         
             
                         <div id="H"><h1>3  Terms, definitions, symbols and abbreviated terms</h1>
         
     | 
| 
       97 
169 
     | 
    
         
             
                   <div id="I"><h2>3.1  Normal Terms</h2>
         
     | 
| 
         @@ -99,11 +171,11 @@ RSpec.describe IsoDoc do 
     | 
|
| 
       99 
171 
     | 
    
         
             
                      <p class="TermNum" id="J">3.1.1</p>
         
     | 
| 
       100 
172 
     | 
    
         
             
                      <p class="Terms" style="text-align:left;">Term2</p>
         
     | 
| 
       101 
173 
     | 
    
         | 
| 
       102 
     | 
    
         
            -
                    </div><div id="K"><h2>3.2 
     | 
| 
      
 174 
     | 
    
         
            +
                    </div><div id="K"><h2>3.2</h2>
         
     | 
| 
       103 
175 
     | 
    
         
             
                      <dl><dt><p>Symbol</p></dt><dd>Definition</dd></dl>
         
     | 
| 
       104 
176 
     | 
    
         
             
                    </div></div>
         
     | 
| 
       105 
177 
     | 
    
         
             
                         <div id="L" class="Symbols">
         
     | 
| 
       106 
     | 
    
         
            -
                           <h1>4 
     | 
| 
      
 178 
     | 
    
         
            +
                           <h1>4</h1>
         
     | 
| 
       107 
179 
     | 
    
         
             
                           <dl>
         
     | 
| 
       108 
180 
     | 
    
         
             
                             <dt>
         
     | 
| 
       109 
181 
     | 
    
         
             
                               <p>Symbol</p>
         
     | 
| 
         @@ -122,7 +194,7 @@ RSpec.describe IsoDoc do 
     | 
|
| 
       122 
194 
     | 
    
         
             
                         </div>
         
     | 
| 
       123 
195 
     | 
    
         
             
                         <br/>
         
     | 
| 
       124 
196 
     | 
    
         
             
                         <div id="P" class="Section3">
         
     | 
| 
       125 
     | 
    
         
            -
                           <h1 class="Annex"><b>Annex A</b><br 
     | 
| 
      
 197 
     | 
    
         
            +
                           <h1 class="Annex"><b>Annex A</b><br/>(normative)<br/><br/><b>Annex</b></h1>
         
     | 
| 
       126 
198 
     | 
    
         
             
                           <div id="Q"><h2>A.1  Annex A.1</h2>
         
     | 
| 
       127 
199 
     | 
    
         | 
| 
       128 
200 
     | 
    
         
             
                      <div id="Q1"><h3>A.1.1  Annex A.1a</h3>
         
     | 
| 
         @@ -144,10 +216,12 @@ RSpec.describe IsoDoc do 
     | 
|
| 
       144 
216 
     | 
    
         
             
                     </body>
         
     | 
| 
       145 
217 
     | 
    
         
             
                   </html>
         
     | 
| 
       146 
218 
     | 
    
         
             
                OUTPUT
         
     | 
| 
      
 219 
     | 
    
         
            +
                expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
         
     | 
| 
      
 220 
     | 
    
         
            +
                expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
         
     | 
| 
       147 
221 
     | 
    
         
             
              end
         
     | 
| 
       148 
222 
     | 
    
         | 
| 
       149 
223 
     | 
    
         
             
              it "defaults to English" do
         
     | 
| 
       150 
     | 
    
         
            -
                expect(xmlpp(IsoDoc::Iec:: 
     | 
| 
      
 224 
     | 
    
         
            +
                expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
         
     | 
| 
       151 
225 
     | 
    
         
             
                  <iso-standard xmlns="http://riboseinc.com/isoxml">
         
     | 
| 
       152 
226 
     | 
    
         
             
                  <bibdata>
         
     | 
| 
       153 
227 
     | 
    
         
             
                  <language>tlh</language>
         
     | 
| 
         @@ -162,7 +236,7 @@ RSpec.describe IsoDoc do 
     | 
|
| 
       162 
236 
     | 
    
         
             
                   </clause>
         
     | 
| 
       163 
237 
     | 
    
         
             
                   <p>This is patent boilerplate</p>
         
     | 
| 
       164 
238 
     | 
    
         
             
                   </introduction></preface><sections>
         
     | 
| 
       165 
     | 
    
         
            -
                   <clause id="D" obligation="normative">
         
     | 
| 
      
 239 
     | 
    
         
            +
                   <clause id="D" obligation="normative" type="scope">
         
     | 
| 
       166 
240 
     | 
    
         
             
                     <title>Scope</title>
         
     | 
| 
       167 
241 
     | 
    
         
             
                     <p id="E">Text</p>
         
     | 
| 
       168 
242 
     | 
    
         
             
                   </clause>
         
     | 
| 
         @@ -215,83 +289,146 @@ RSpec.describe IsoDoc do 
     | 
|
| 
       215 
289 
     | 
    
         
             
                   </bibliography>
         
     | 
| 
       216 
290 
     | 
    
         
             
                   </iso-standard>
         
     | 
| 
       217 
291 
     | 
    
         
             
                    INPUT
         
     | 
| 
       218 
     | 
    
         
            -
             
     | 
| 
       219 
     | 
    
         
            -
             
     | 
| 
       220 
     | 
    
         
            -
             
     | 
| 
       221 
     | 
    
         
            -
             
     | 
| 
       222 
     | 
    
         
            -
             
     | 
| 
       223 
     | 
    
         
            -
             
     | 
| 
       224 
     | 
    
         
            -
                         < 
     | 
| 
       225 
     | 
    
         
            -
                         < 
     | 
| 
       226 
     | 
    
         
            -
             
     | 
| 
       227 
     | 
    
         
            -
             
     | 
| 
       228 
     | 
    
         
            -
             
     | 
| 
       229 
     | 
    
         
            -
             
     | 
| 
       230 
     | 
    
         
            -
                           < 
     | 
| 
       231 
     | 
    
         
            -
             
     | 
| 
       232 
     | 
    
         
            -
                          
     | 
| 
       233 
     | 
    
         
            -
                         < 
     | 
| 
       234 
     | 
    
         
            -
                           < 
     | 
| 
       235 
     | 
    
         
            -
             
     | 
| 
       236 
     | 
    
         
            -
             
     | 
| 
       237 
     | 
    
         
            -
             
     | 
| 
       238 
     | 
    
         
            -
                            
     | 
| 
       239 
     | 
    
         
            -
                         </ 
     | 
| 
       240 
     | 
    
         
            -
                         < 
     | 
| 
       241 
     | 
    
         
            -
             
     | 
| 
       242 
     | 
    
         
            -
             
     | 
| 
       243 
     | 
    
         
            -
             
     | 
| 
       244 
     | 
    
         
            -
             
     | 
| 
       245 
     | 
    
         
            -
             
     | 
| 
       246 
     | 
    
         
            -
             
     | 
| 
       247 
     | 
    
         
            -
             
     | 
| 
       248 
     | 
    
         
            -
             
     | 
| 
       249 
     | 
    
         
            -
                          
     | 
| 
       250 
     | 
    
         
            -
             
     | 
| 
      
 292 
     | 
    
         
            +
                    <iso-standard xmlns='http://riboseinc.com/isoxml'>
         
     | 
| 
      
 293 
     | 
    
         
            +
                     <bibdata>
         
     | 
| 
      
 294 
     | 
    
         
            +
                       <language>tlh</language>
         
     | 
| 
      
 295 
     | 
    
         
            +
                     </bibdata>
         
     | 
| 
      
 296 
     | 
    
         
            +
                     <preface>
         
     | 
| 
      
 297 
     | 
    
         
            +
                       <foreword obligation='informative'>
         
     | 
| 
      
 298 
     | 
    
         
            +
                         <title>Foreword</title>
         
     | 
| 
      
 299 
     | 
    
         
            +
                         <p id='A'>This is a preamble</p>
         
     | 
| 
      
 300 
     | 
    
         
            +
                       </foreword>
         
     | 
| 
      
 301 
     | 
    
         
            +
                       <introduction id='B' obligation='informative'>
         
     | 
| 
      
 302 
     | 
    
         
            +
                         <title depth='1'>
         
     | 
| 
      
 303 
     | 
    
         
            +
                           0
         
     | 
| 
      
 304 
     | 
    
         
            +
                           <tab/>
         
     | 
| 
      
 305 
     | 
    
         
            +
                           Introduction
         
     | 
| 
      
 306 
     | 
    
         
            +
                         </title>
         
     | 
| 
      
 307 
     | 
    
         
            +
                         <clause id='C' inline-header='false' obligation='informative'>
         
     | 
| 
      
 308 
     | 
    
         
            +
                           <title depth='2'>
         
     | 
| 
      
 309 
     | 
    
         
            +
                             0.1
         
     | 
| 
      
 310 
     | 
    
         
            +
                             <tab/>
         
     | 
| 
      
 311 
     | 
    
         
            +
                             Introduction Subsection
         
     | 
| 
      
 312 
     | 
    
         
            +
                           </title>
         
     | 
| 
      
 313 
     | 
    
         
            +
                         </clause>
         
     | 
| 
      
 314 
     | 
    
         
            +
                         <p>This is patent boilerplate</p>
         
     | 
| 
      
 315 
     | 
    
         
            +
                       </introduction>
         
     | 
| 
      
 316 
     | 
    
         
            +
                     </preface>
         
     | 
| 
      
 317 
     | 
    
         
            +
                     <sections>
         
     | 
| 
      
 318 
     | 
    
         
            +
                       <clause id='D' obligation='normative' type="scope">
         
     | 
| 
      
 319 
     | 
    
         
            +
                         <title depth='1'>
         
     | 
| 
      
 320 
     | 
    
         
            +
                           1
         
     | 
| 
      
 321 
     | 
    
         
            +
                           <tab/>
         
     | 
| 
      
 322 
     | 
    
         
            +
                           Scope
         
     | 
| 
      
 323 
     | 
    
         
            +
                         </title>
         
     | 
| 
      
 324 
     | 
    
         
            +
                         <p id='E'>Text</p>
         
     | 
| 
      
 325 
     | 
    
         
            +
                       </clause>
         
     | 
| 
      
 326 
     | 
    
         
            +
                       <clause id='H' obligation='normative'>
         
     | 
| 
      
 327 
     | 
    
         
            +
                         <title depth='1'>
         
     | 
| 
      
 328 
     | 
    
         
            +
                           3
         
     | 
| 
      
 329 
     | 
    
         
            +
                           <tab/>
         
     | 
| 
      
 330 
     | 
    
         
            +
                           Terms, definitions, symbols and abbreviated terms
         
     | 
| 
      
 331 
     | 
    
         
            +
                         </title>
         
     | 
| 
      
 332 
     | 
    
         
            +
                         <terms id='I' obligation='normative'>
         
     | 
| 
      
 333 
     | 
    
         
            +
                           <title depth='2'>
         
     | 
| 
      
 334 
     | 
    
         
            +
                             3.1
         
     | 
| 
      
 335 
     | 
    
         
            +
                             <tab/>
         
     | 
| 
      
 336 
     | 
    
         
            +
                             Normal Terms
         
     | 
| 
      
 337 
     | 
    
         
            +
                           </title>
         
     | 
| 
      
 338 
     | 
    
         
            +
                           <term id='J'>
         
     | 
| 
      
 339 
     | 
    
         
            +
                             <name>3.1.1</name>
         
     | 
| 
      
 340 
     | 
    
         
            +
                             <preferred>Term2</preferred>
         
     | 
| 
      
 341 
     | 
    
         
            +
                           </term>
         
     | 
| 
      
 342 
     | 
    
         
            +
                         </terms>
         
     | 
| 
      
 343 
     | 
    
         
            +
                         <definitions id='K'>
         
     | 
| 
      
 344 
     | 
    
         
            +
                           <title>3.2</title>
         
     | 
| 
       251 
345 
     | 
    
         
             
                           <dl>
         
     | 
| 
       252 
     | 
    
         
            -
                             <dt>
         
     | 
| 
       253 
     | 
    
         
            -
                               <p>Symbol</p>
         
     | 
| 
       254 
     | 
    
         
            -
                             </dt>
         
     | 
| 
      
 346 
     | 
    
         
            +
                             <dt>Symbol</dt>
         
     | 
| 
       255 
347 
     | 
    
         
             
                             <dd>Definition</dd>
         
     | 
| 
       256 
348 
     | 
    
         
             
                           </dl>
         
     | 
| 
       257 
     | 
    
         
            -
                         </ 
     | 
| 
       258 
     | 
    
         
            -
             
     | 
| 
       259 
     | 
    
         
            -
             
     | 
| 
       260 
     | 
    
         
            -
             
     | 
| 
       261 
     | 
    
         
            -
             
     | 
| 
       262 
     | 
    
         
            -
             
     | 
| 
       263 
     | 
    
         
            -
                           < 
     | 
| 
       264 
     | 
    
         
            -
             
     | 
| 
       265 
     | 
    
         
            -
             
     | 
| 
       266 
     | 
    
         
            -
             
     | 
| 
      
 349 
     | 
    
         
            +
                         </definitions>
         
     | 
| 
      
 350 
     | 
    
         
            +
                       </clause>
         
     | 
| 
      
 351 
     | 
    
         
            +
                       <definitions id='L'>
         
     | 
| 
      
 352 
     | 
    
         
            +
                         <title>4</title>
         
     | 
| 
      
 353 
     | 
    
         
            +
                         <dl>
         
     | 
| 
      
 354 
     | 
    
         
            +
                           <dt>Symbol</dt>
         
     | 
| 
      
 355 
     | 
    
         
            +
                           <dd>Definition</dd>
         
     | 
| 
      
 356 
     | 
    
         
            +
                         </dl>
         
     | 
| 
      
 357 
     | 
    
         
            +
                       </definitions>
         
     | 
| 
      
 358 
     | 
    
         
            +
                       <clause id='M' inline-header='false' obligation='normative'>
         
     | 
| 
      
 359 
     | 
    
         
            +
                         <title depth='1'>
         
     | 
| 
      
 360 
     | 
    
         
            +
                           5
         
     | 
| 
      
 361 
     | 
    
         
            +
                           <tab/>
         
     | 
| 
      
 362 
     | 
    
         
            +
                           Clause 4
         
     | 
| 
      
 363 
     | 
    
         
            +
                         </title>
         
     | 
| 
      
 364 
     | 
    
         
            +
                         <clause id='N' inline-header='false' obligation='normative'>
         
     | 
| 
      
 365 
     | 
    
         
            +
                           <title depth='2'>
         
     | 
| 
      
 366 
     | 
    
         
            +
                             5.1
         
     | 
| 
      
 367 
     | 
    
         
            +
                             <tab/>
         
     | 
| 
      
 368 
     | 
    
         
            +
                             Introduction
         
     | 
| 
      
 369 
     | 
    
         
            +
                           </title>
         
     | 
| 
      
 370 
     | 
    
         
            +
                         </clause>
         
     | 
| 
      
 371 
     | 
    
         
            +
                         <clause id='O' inline-header='false' obligation='normative'>
         
     | 
| 
      
 372 
     | 
    
         
            +
                           <title depth='2'>
         
     | 
| 
      
 373 
     | 
    
         
            +
                             5.2
         
     | 
| 
      
 374 
     | 
    
         
            +
                             <tab/>
         
     | 
| 
      
 375 
     | 
    
         
            +
                             Clause 4.2
         
     | 
| 
      
 376 
     | 
    
         
            +
                           </title>
         
     | 
| 
      
 377 
     | 
    
         
            +
                         </clause>
         
     | 
| 
      
 378 
     | 
    
         
            +
                       </clause>
         
     | 
| 
      
 379 
     | 
    
         
            +
                     </sections>
         
     | 
| 
      
 380 
     | 
    
         
            +
                     <annex id='P' inline-header='false' obligation='normative'>
         
     | 
| 
      
 381 
     | 
    
         
            +
                       <title>
         
     | 
| 
      
 382 
     | 
    
         
            +
                         <strong>Annex A</strong>
         
     | 
| 
       267 
383 
     | 
    
         
             
                         <br/>
         
     | 
| 
       268 
     | 
    
         
            -
                          
     | 
| 
       269 
     | 
    
         
            -
                           <h1 class="Annex"><b>Annex A</b><br/><br/>(normative)<br/><br/><b>Annex</b></h1>
         
     | 
| 
       270 
     | 
    
         
            -
                           <div id="Q"><h2>A.1  Annex A.1</h2>
         
     | 
| 
       271 
     | 
    
         
            -
             
     | 
| 
       272 
     | 
    
         
            -
                      <div id="Q1"><h3>A.1.1  Annex A.1a</h3>
         
     | 
| 
       273 
     | 
    
         
            -
             
     | 
| 
       274 
     | 
    
         
            -
                      </div>
         
     | 
| 
       275 
     | 
    
         
            -
                    </div>
         
     | 
| 
       276 
     | 
    
         
            -
                           <div id="Q2"><h2>Appendix 1  An Appendix</h2>
         
     | 
| 
       277 
     | 
    
         
            -
             
     | 
| 
       278 
     | 
    
         
            -
                    </div>
         
     | 
| 
       279 
     | 
    
         
            -
                         </div>
         
     | 
| 
      
 384 
     | 
    
         
            +
                         (normative)
         
     | 
| 
       280 
385 
     | 
    
         
             
                         <br/>
         
     | 
| 
       281 
     | 
    
         
            -
                         < 
     | 
| 
       282 
     | 
    
         
            -
             
     | 
| 
       283 
     | 
    
         
            -
             
     | 
| 
       284 
     | 
    
         
            -
             
     | 
| 
       285 
     | 
    
         
            -
             
     | 
| 
       286 
     | 
    
         
            -
             
     | 
| 
       287 
     | 
    
         
            -
             
     | 
| 
       288 
     | 
    
         
            -
             
     | 
| 
       289 
     | 
    
         
            -
             
     | 
| 
      
 386 
     | 
    
         
            +
                         <br/>
         
     | 
| 
      
 387 
     | 
    
         
            +
                         <strong>Annex</strong>
         
     | 
| 
      
 388 
     | 
    
         
            +
                       </title>
         
     | 
| 
      
 389 
     | 
    
         
            +
                       <clause id='Q' inline-header='false' obligation='normative'>
         
     | 
| 
      
 390 
     | 
    
         
            +
                         <title depth='2'>
         
     | 
| 
      
 391 
     | 
    
         
            +
                           A.1
         
     | 
| 
      
 392 
     | 
    
         
            +
                           <tab/>
         
     | 
| 
      
 393 
     | 
    
         
            +
                           Annex A.1
         
     | 
| 
      
 394 
     | 
    
         
            +
                         </title>
         
     | 
| 
      
 395 
     | 
    
         
            +
                         <clause id='Q1' inline-header='false' obligation='normative'>
         
     | 
| 
      
 396 
     | 
    
         
            +
                           <title depth='3'>
         
     | 
| 
      
 397 
     | 
    
         
            +
                             A.1.1
         
     | 
| 
      
 398 
     | 
    
         
            +
                             <tab/>
         
     | 
| 
      
 399 
     | 
    
         
            +
                             Annex A.1a
         
     | 
| 
      
 400 
     | 
    
         
            +
                           </title>
         
     | 
| 
      
 401 
     | 
    
         
            +
                         </clause>
         
     | 
| 
      
 402 
     | 
    
         
            +
                       </clause>
         
     | 
| 
      
 403 
     | 
    
         
            +
                       <appendix id='Q2' inline-header='false' obligation='normative'>
         
     | 
| 
      
 404 
     | 
    
         
            +
                         <title depth='2'>
         
     | 
| 
      
 405 
     | 
    
         
            +
                           Appendix 1
         
     | 
| 
      
 406 
     | 
    
         
            +
                           <tab/>
         
     | 
| 
      
 407 
     | 
    
         
            +
                           An Appendix
         
     | 
| 
      
 408 
     | 
    
         
            +
                         </title>
         
     | 
| 
      
 409 
     | 
    
         
            +
                       </appendix>
         
     | 
| 
      
 410 
     | 
    
         
            +
                     </annex>
         
     | 
| 
      
 411 
     | 
    
         
            +
                     <bibliography>
         
     | 
| 
      
 412 
     | 
    
         
            +
                       <references id='R' obligation='informative' normative='true'>
         
     | 
| 
      
 413 
     | 
    
         
            +
                         <title depth='1'>
         
     | 
| 
      
 414 
     | 
    
         
            +
                           2
         
     | 
| 
      
 415 
     | 
    
         
            +
                           <tab/>
         
     | 
| 
      
 416 
     | 
    
         
            +
                           Normative References
         
     | 
| 
      
 417 
     | 
    
         
            +
                         </title>
         
     | 
| 
      
 418 
     | 
    
         
            +
                       </references>
         
     | 
| 
      
 419 
     | 
    
         
            +
                       <clause id='S' obligation='informative'>
         
     | 
| 
      
 420 
     | 
    
         
            +
                         <title depth='1'>Bibliography</title>
         
     | 
| 
      
 421 
     | 
    
         
            +
                         <references id='T' obligation='informative' normative='false'>
         
     | 
| 
      
 422 
     | 
    
         
            +
                           <title depth='2'>Bibliography Subsection</title>
         
     | 
| 
      
 423 
     | 
    
         
            +
                         </references>
         
     | 
| 
      
 424 
     | 
    
         
            +
                       </clause>
         
     | 
| 
      
 425 
     | 
    
         
            +
                     </bibliography>
         
     | 
| 
      
 426 
     | 
    
         
            +
                   </iso-standard>
         
     | 
| 
       290 
427 
     | 
    
         
             
                OUTPUT
         
     | 
| 
       291 
428 
     | 
    
         
             
              end
         
     | 
| 
       292 
429 
     | 
    
         | 
| 
       293 
430 
     | 
    
         
             
              it "processes French" do
         
     | 
| 
       294 
     | 
    
         
            -
                 
     | 
| 
      
 431 
     | 
    
         
            +
                input = <<~INPUT
         
     | 
| 
       295 
432 
     | 
    
         
             
                  <iso-standard xmlns="http://riboseinc.com/isoxml">
         
     | 
| 
       296 
433 
     | 
    
         
             
                  <bibdata>
         
     | 
| 
       297 
434 
     | 
    
         
             
                  <language>fr</language>
         
     | 
| 
         @@ -306,7 +443,7 @@ RSpec.describe IsoDoc do 
     | 
|
| 
       306 
443 
     | 
    
         
             
                   </clause>
         
     | 
| 
       307 
444 
     | 
    
         
             
                   <p>This is patent boilerplate</p>
         
     | 
| 
       308 
445 
     | 
    
         
             
                   </introduction></preface><sections>
         
     | 
| 
       309 
     | 
    
         
            -
                   <clause id="D" obligation="normative">
         
     | 
| 
      
 446 
     | 
    
         
            +
                   <clause id="D" obligation="normative" type="scope">
         
     | 
| 
       310 
447 
     | 
    
         
             
                     <title>Scope</title>
         
     | 
| 
       311 
448 
     | 
    
         
             
                     <p id="E">Text</p>
         
     | 
| 
       312 
449 
     | 
    
         
             
                   </clause>
         
     | 
| 
         @@ -359,6 +496,77 @@ RSpec.describe IsoDoc do 
     | 
|
| 
       359 
496 
     | 
    
         
             
                   </bibliography>
         
     | 
| 
       360 
497 
     | 
    
         
             
                   </iso-standard>
         
     | 
| 
       361 
498 
     | 
    
         
             
                    INPUT
         
     | 
| 
      
 499 
     | 
    
         
            +
             
     | 
| 
      
 500 
     | 
    
         
            +
                    presxml = <<~OUTPUT
         
     | 
| 
      
 501 
     | 
    
         
            +
            <iso-standard xmlns="http://riboseinc.com/isoxml">
         
     | 
| 
      
 502 
     | 
    
         
            +
                   <bibdata>
         
     | 
| 
      
 503 
     | 
    
         
            +
                   <language>fr</language>
         
     | 
| 
      
 504 
     | 
    
         
            +
                   </bibdata>
         
     | 
| 
      
 505 
     | 
    
         
            +
                   <preface>
         
     | 
| 
      
 506 
     | 
    
         
            +
                   <foreword obligation="informative">
         
     | 
| 
      
 507 
     | 
    
         
            +
                      <title>Foreword</title>
         
     | 
| 
      
 508 
     | 
    
         
            +
                      <p id="A">This is a preamble</p>
         
     | 
| 
      
 509 
     | 
    
         
            +
                    </foreword>
         
     | 
| 
      
 510 
     | 
    
         
            +
                     <introduction id="B" obligation="informative"><title depth="1">0<tab/>Introduction</title><clause id="C" inline-header="false" obligation="informative">
         
     | 
| 
      
 511 
     | 
    
         
            +
                      <title depth="2">0.1<tab/>Introduction Subsection</title>
         
     | 
| 
      
 512 
     | 
    
         
            +
                    </clause>
         
     | 
| 
      
 513 
     | 
    
         
            +
                    <p>This is patent boilerplate</p>
         
     | 
| 
      
 514 
     | 
    
         
            +
                    </introduction></preface><sections>
         
     | 
| 
      
 515 
     | 
    
         
            +
                    <clause id="D" obligation="normative" type="scope">
         
     | 
| 
      
 516 
     | 
    
         
            +
                      <title depth="1">1<tab/>Scope</title>
         
     | 
| 
      
 517 
     | 
    
         
            +
                      <p id="E">Text</p>
         
     | 
| 
      
 518 
     | 
    
         
            +
                    </clause>
         
     | 
| 
      
 519 
     | 
    
         
            +
                 
         
     | 
| 
      
 520 
     | 
    
         
            +
                    <clause id="H" obligation="normative"><title depth="1">3<tab/>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
         
     | 
| 
      
 521 
     | 
    
         
            +
                      <title depth="2">3.1<tab/>Normal Terms</title>
         
     | 
| 
      
 522 
     | 
    
         
            +
                      <term id="J"><name>3.1.1</name>
         
     | 
| 
      
 523 
     | 
    
         
            +
                      <preferred>Term2</preferred>
         
     | 
| 
      
 524 
     | 
    
         
            +
                    </term>
         
     | 
| 
      
 525 
     | 
    
         
            +
                    </terms>
         
     | 
| 
      
 526 
     | 
    
         
            +
                    <definitions id="K"><title>3.2</title>
         
     | 
| 
      
 527 
     | 
    
         
            +
                      <dl>
         
     | 
| 
      
 528 
     | 
    
         
            +
                      <dt>Symbol</dt>
         
     | 
| 
      
 529 
     | 
    
         
            +
                      <dd>Definition</dd>
         
     | 
| 
      
 530 
     | 
    
         
            +
                      </dl>
         
     | 
| 
      
 531 
     | 
    
         
            +
                    </definitions>
         
     | 
| 
      
 532 
     | 
    
         
            +
                    </clause>
         
     | 
| 
      
 533 
     | 
    
         
            +
                    <definitions id="L"><title>4</title>
         
     | 
| 
      
 534 
     | 
    
         
            +
                      <dl>
         
     | 
| 
      
 535 
     | 
    
         
            +
                      <dt>Symbol</dt>
         
     | 
| 
      
 536 
     | 
    
         
            +
                      <dd>Definition</dd>
         
     | 
| 
      
 537 
     | 
    
         
            +
                      </dl>
         
     | 
| 
      
 538 
     | 
    
         
            +
                    </definitions>
         
     | 
| 
      
 539 
     | 
    
         
            +
                    <clause id="M" inline-header="false" obligation="normative"><title depth="1">5<tab/>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
         
     | 
| 
      
 540 
     | 
    
         
            +
                      <title depth="2">5.1<tab/>Introduction</title>
         
     | 
| 
      
 541 
     | 
    
         
            +
                    </clause>
         
     | 
| 
      
 542 
     | 
    
         
            +
                    <clause id="O" inline-header="false" obligation="normative">
         
     | 
| 
      
 543 
     | 
    
         
            +
                      <title depth="2">5.2<tab/>Clause 4.2</title>
         
     | 
| 
      
 544 
     | 
    
         
            +
                    </clause></clause>
         
     | 
| 
      
 545 
     | 
    
         
            +
                 
         
     | 
| 
      
 546 
     | 
    
         
            +
                    </sections><annex id="P" inline-header="false" obligation="normative">
         
     | 
| 
      
 547 
     | 
    
         
            +
                      <title><strong>Annexe A</strong><br/>(normative)<br/><br/><strong>Annex</strong></title>
         
     | 
| 
      
 548 
     | 
    
         
            +
                      <clause id="Q" inline-header="false" obligation="normative">
         
     | 
| 
      
 549 
     | 
    
         
            +
                      <title depth="2">A.1<tab/>Annex A.1</title>
         
     | 
| 
      
 550 
     | 
    
         
            +
                      <clause id="Q1" inline-header="false" obligation="normative">
         
     | 
| 
      
 551 
     | 
    
         
            +
                      <title depth="3">A.1.1<tab/>Annex A.1a</title>
         
     | 
| 
      
 552 
     | 
    
         
            +
                      </clause>
         
     | 
| 
      
 553 
     | 
    
         
            +
                    </clause>
         
     | 
| 
      
 554 
     | 
    
         
            +
                           <appendix id="Q2" inline-header="false" obligation="normative">
         
     | 
| 
      
 555 
     | 
    
         
            +
                      <title depth="2">Appendice 1<tab/>An Appendix</title>
         
     | 
| 
      
 556 
     | 
    
         
            +
                    </appendix>
         
     | 
| 
      
 557 
     | 
    
         
            +
                    </annex><bibliography><references id="R" obligation="informative" normative="true">
         
     | 
| 
      
 558 
     | 
    
         
            +
                      <title depth="1">2<tab/>Normative References</title>
         
     | 
| 
      
 559 
     | 
    
         
            +
                    </references><clause id="S" obligation="informative">
         
     | 
| 
      
 560 
     | 
    
         
            +
                      <title depth="1">Bibliography</title>
         
     | 
| 
      
 561 
     | 
    
         
            +
                      <references id="T" obligation="informative" normative="false">
         
     | 
| 
      
 562 
     | 
    
         
            +
                      <title depth="2">Bibliography Subsection</title>
         
     | 
| 
      
 563 
     | 
    
         
            +
                    </references>
         
     | 
| 
      
 564 
     | 
    
         
            +
                    </clause>
         
     | 
| 
      
 565 
     | 
    
         
            +
                    </bibliography>
         
     | 
| 
      
 566 
     | 
    
         
            +
                    </iso-standard>
         
     | 
| 
      
 567 
     | 
    
         
            +
                    OUTPUT
         
     | 
| 
      
 568 
     | 
    
         
            +
             
     | 
| 
      
 569 
     | 
    
         
            +
                    html = <<~OUTPUT
         
     | 
| 
       362 
570 
     | 
    
         
             
                #{HTML_HDR.sub(/INTERNATIONAL ELECTROTECHNICAL COMMISSION/, "COMMISSION ELECTROTECHNIQUE INTERNATIONALE").
         
     | 
| 
       363 
571 
     | 
    
         
             
                gsub(/"en"/, '"fr"')}
         
     | 
| 
       364 
572 
     | 
    
         
             
                         <div>
         
     | 
| 
         @@ -368,7 +576,7 @@ RSpec.describe IsoDoc do 
     | 
|
| 
       368 
576 
     | 
    
         
             
                         </div>
         
     | 
| 
       369 
577 
     | 
    
         
             
                         <br/>
         
     | 
| 
       370 
578 
     | 
    
         
             
                         <div class="Section3" id="B">
         
     | 
| 
       371 
     | 
    
         
            -
                           <h1 class="IntroTitle">0   
     | 
| 
      
 579 
     | 
    
         
            +
                           <h1 class="IntroTitle">0  Introduction</h1>
         
     | 
| 
       372 
580 
     | 
    
         
             
                           <div id="C"><h2>0.1  Introduction Subsection</h2>
         
     | 
| 
       373 
581 
     | 
    
         | 
| 
       374 
582 
     | 
    
         
             
                    </div>
         
     | 
| 
         @@ -376,23 +584,23 @@ RSpec.describe IsoDoc do 
     | 
|
| 
       376 
584 
     | 
    
         
             
                         </div>
         
     | 
| 
       377 
585 
     | 
    
         
             
                         #{IEC_TITLE1}
         
     | 
| 
       378 
586 
     | 
    
         
             
                         <div id="D">
         
     | 
| 
       379 
     | 
    
         
            -
                           <h1>1   
     | 
| 
      
 587 
     | 
    
         
            +
                           <h1>1  Scope</h1>
         
     | 
| 
       380 
588 
     | 
    
         
             
                           <p id="E">Text</p>
         
     | 
| 
       381 
589 
     | 
    
         
             
                         </div>
         
     | 
| 
       382 
590 
     | 
    
         
             
                         <div>
         
     | 
| 
       383 
     | 
    
         
            -
                           <h1>2   
     | 
| 
      
 591 
     | 
    
         
            +
                           <h1>2  Normative References</h1>
         
     | 
| 
       384 
592 
     | 
    
         
             
                         </div>
         
     | 
| 
       385 
     | 
    
         
            -
                         <div id="H"><h1>3  Terms,  
     | 
| 
      
 593 
     | 
    
         
            +
                         <div id="H"><h1>3  Terms, definitions, symbols and abbreviated terms</h1>
         
     | 
| 
       386 
594 
     | 
    
         
             
                   <div id="I"><h2>3.1  Normal Terms</h2>
         
     | 
| 
       387 
595 
     | 
    
         | 
| 
       388 
596 
     | 
    
         
             
                      <p class="TermNum" id="J">3.1.1</p>
         
     | 
| 
       389 
597 
     | 
    
         
             
                      <p class="Terms" style="text-align:left;">Term2</p>
         
     | 
| 
       390 
598 
     | 
    
         | 
| 
       391 
     | 
    
         
            -
                    </div><div id="K"><h2>3.2 
     | 
| 
      
 599 
     | 
    
         
            +
                    </div><div id="K"><h2>3.2</h2>
         
     | 
| 
       392 
600 
     | 
    
         
             
                      <dl><dt><p>Symbol</p></dt><dd>Definition</dd></dl>
         
     | 
| 
       393 
601 
     | 
    
         
             
                    </div></div>
         
     | 
| 
       394 
602 
     | 
    
         
             
                         <div id="L" class="Symbols">
         
     | 
| 
       395 
     | 
    
         
            -
                           <h1>4 
     | 
| 
      
 603 
     | 
    
         
            +
                           <h1>4</h1>
         
     | 
| 
       396 
604 
     | 
    
         
             
                           <dl>
         
     | 
| 
       397 
605 
     | 
    
         
             
                             <dt>
         
     | 
| 
       398 
606 
     | 
    
         
             
                               <p>Symbol</p>
         
     | 
| 
         @@ -411,7 +619,7 @@ RSpec.describe IsoDoc do 
     | 
|
| 
       411 
619 
     | 
    
         
             
                         </div>
         
     | 
| 
       412 
620 
     | 
    
         
             
                         <br/>
         
     | 
| 
       413 
621 
     | 
    
         
             
                         <div id="P" class="Section3">
         
     | 
| 
       414 
     | 
    
         
            -
                           <h1 class="Annex"><b>Annexe A</b><br 
     | 
| 
      
 622 
     | 
    
         
            +
                           <h1 class="Annex"><b>Annexe A</b><br/>(normative)<br/><br/><b>Annex</b></h1>
         
     | 
| 
       415 
623 
     | 
    
         
             
                           <div id="Q"><h2>A.1  Annex A.1</h2>
         
     | 
| 
       416 
624 
     | 
    
         | 
| 
       417 
625 
     | 
    
         
             
                      <div id="Q1"><h3>A.1.1  Annex A.1a</h3>
         
     | 
| 
         @@ -424,165 +632,7 @@ RSpec.describe IsoDoc do 
     | 
|
| 
       424 
632 
     | 
    
         
             
                         </div>
         
     | 
| 
       425 
633 
     | 
    
         
             
                         <br/>
         
     | 
| 
       426 
634 
     | 
    
         
             
                         <div>
         
     | 
| 
       427 
     | 
    
         
            -
                           <h1 class="Section3"> 
     | 
| 
       428 
     | 
    
         
            -
                           <div>
         
     | 
| 
       429 
     | 
    
         
            -
                             <h2 class="Section3">Bibliography Subsection</h2>
         
     | 
| 
       430 
     | 
    
         
            -
                           </div>
         
     | 
| 
       431 
     | 
    
         
            -
                         </div>
         
     | 
| 
       432 
     | 
    
         
            -
                       </div>
         
     | 
| 
       433 
     | 
    
         
            -
                     </body>
         
     | 
| 
       434 
     | 
    
         
            -
                   </html>
         
     | 
| 
       435 
     | 
    
         
            -
                OUTPUT
         
     | 
| 
       436 
     | 
    
         
            -
              end
         
     | 
| 
       437 
     | 
    
         
            -
             
     | 
| 
       438 
     | 
    
         
            -
              it "processes Simplified Chinese" do
         
     | 
| 
       439 
     | 
    
         
            -
                expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
         
     | 
| 
       440 
     | 
    
         
            -
                  <iso-standard xmlns="http://riboseinc.com/isoxml">
         
     | 
| 
       441 
     | 
    
         
            -
                  <bibdata>
         
     | 
| 
       442 
     | 
    
         
            -
                  <language>zh</language>
         
     | 
| 
       443 
     | 
    
         
            -
                  <script>Hans</script>
         
     | 
| 
       444 
     | 
    
         
            -
                  </bibdata>
         
     | 
| 
       445 
     | 
    
         
            -
                  <preface>
         
     | 
| 
       446 
     | 
    
         
            -
                  <foreword obligation="informative">
         
     | 
| 
       447 
     | 
    
         
            -
                     <title>Foreword</title>
         
     | 
| 
       448 
     | 
    
         
            -
                     <p id="A">This is a preamble</p>
         
     | 
| 
       449 
     | 
    
         
            -
                   </foreword>
         
     | 
| 
       450 
     | 
    
         
            -
                    <introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
         
     | 
| 
       451 
     | 
    
         
            -
                     <title>Introduction Subsection</title>
         
     | 
| 
       452 
     | 
    
         
            -
                   </clause>
         
     | 
| 
       453 
     | 
    
         
            -
                   <p>This is patent boilerplate</p>
         
     | 
| 
       454 
     | 
    
         
            -
                   </introduction></preface><sections>
         
     | 
| 
       455 
     | 
    
         
            -
                   <clause id="D" obligation="normative">
         
     | 
| 
       456 
     | 
    
         
            -
                     <title>Scope</title>
         
     | 
| 
       457 
     | 
    
         
            -
                     <p id="E"><eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom><referenceTo>1</referenceTo></locality></eref></p>
         
     | 
| 
       458 
     | 
    
         
            -
                   </clause>
         
     | 
| 
       459 
     | 
    
         
            -
             
     | 
| 
       460 
     | 
    
         
            -
                   <clause id="H" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
         
     | 
| 
       461 
     | 
    
         
            -
                     <title>Normal Terms</title>
         
     | 
| 
       462 
     | 
    
         
            -
                     <term id="J">
         
     | 
| 
       463 
     | 
    
         
            -
                     <preferred>Term2</preferred>
         
     | 
| 
       464 
     | 
    
         
            -
                   </term>
         
     | 
| 
       465 
     | 
    
         
            -
                   </terms>
         
     | 
| 
       466 
     | 
    
         
            -
                   <definitions id="K">
         
     | 
| 
       467 
     | 
    
         
            -
                     <dl>
         
     | 
| 
       468 
     | 
    
         
            -
                     <dt>Symbol</dt>
         
     | 
| 
       469 
     | 
    
         
            -
                     <dd>Definition</dd>
         
     | 
| 
       470 
     | 
    
         
            -
                     </dl>
         
     | 
| 
       471 
     | 
    
         
            -
                   </definitions>
         
     | 
| 
       472 
     | 
    
         
            -
                   </clause>
         
     | 
| 
       473 
     | 
    
         
            -
                   <definitions id="L">
         
     | 
| 
       474 
     | 
    
         
            -
                     <dl>
         
     | 
| 
       475 
     | 
    
         
            -
                     <dt>Symbol</dt>
         
     | 
| 
       476 
     | 
    
         
            -
                     <dd>Definition</dd>
         
     | 
| 
       477 
     | 
    
         
            -
                     </dl>
         
     | 
| 
       478 
     | 
    
         
            -
                   </definitions>
         
     | 
| 
       479 
     | 
    
         
            -
                   <clause id="M" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
         
     | 
| 
       480 
     | 
    
         
            -
                     <title>Introduction</title>
         
     | 
| 
       481 
     | 
    
         
            -
                   </clause>
         
     | 
| 
       482 
     | 
    
         
            -
                   <clause id="O" inline-header="false" obligation="normative">
         
     | 
| 
       483 
     | 
    
         
            -
                     <title>Clause 4.2</title>
         
     | 
| 
       484 
     | 
    
         
            -
                   </clause></clause>
         
     | 
| 
       485 
     | 
    
         
            -
             
     | 
| 
       486 
     | 
    
         
            -
                   </sections><annex id="P" inline-header="false" obligation="normative">
         
     | 
| 
       487 
     | 
    
         
            -
                     <title>Annex</title>
         
     | 
| 
       488 
     | 
    
         
            -
                     <clause id="Q" inline-header="false" obligation="normative">
         
     | 
| 
       489 
     | 
    
         
            -
                     <title>Annex A.1</title>
         
     | 
| 
       490 
     | 
    
         
            -
                     <clause id="Q1" inline-header="false" obligation="normative">
         
     | 
| 
       491 
     | 
    
         
            -
                     <title>Annex A.1a</title>
         
     | 
| 
       492 
     | 
    
         
            -
                     </clause>
         
     | 
| 
       493 
     | 
    
         
            -
                   </clause>
         
     | 
| 
       494 
     | 
    
         
            -
                          <appendix id="Q2" inline-header="false" obligation="normative">
         
     | 
| 
       495 
     | 
    
         
            -
                     <title>An Appendix</title>
         
     | 
| 
       496 
     | 
    
         
            -
                   </appendix>
         
     | 
| 
       497 
     | 
    
         
            -
                   </annex><bibliography><references id="R" obligation="informative" normative="true">
         
     | 
| 
       498 
     | 
    
         
            -
                     <title>Normative References</title>
         
     | 
| 
       499 
     | 
    
         
            -
                     <bibitem id="ISO712" type="standard">
         
     | 
| 
       500 
     | 
    
         
            -
              <title format="text/plain">Cereals and cereal products</title>
         
     | 
| 
       501 
     | 
    
         
            -
              <docidentifier>ISO 712</docidentifier>
         
     | 
| 
       502 
     | 
    
         
            -
              <contributor>
         
     | 
| 
       503 
     | 
    
         
            -
                <role type="publisher"/>
         
     | 
| 
       504 
     | 
    
         
            -
                <organization>
         
     | 
| 
       505 
     | 
    
         
            -
                  <abbreviation>ISO</abbreviation>
         
     | 
| 
       506 
     | 
    
         
            -
                </organization>
         
     | 
| 
       507 
     | 
    
         
            -
              </contributor>
         
     | 
| 
       508 
     | 
    
         
            -
            </bibitem>
         
     | 
| 
       509 
     | 
    
         
            -
                   </references><clause id="S" obligation="informative">
         
     | 
| 
       510 
     | 
    
         
            -
                     <title>Bibliography</title>
         
     | 
| 
       511 
     | 
    
         
            -
                     <references id="T" obligation="informative"  normative="false">
         
     | 
| 
       512 
     | 
    
         
            -
                     <title>Bibliography Subsection</title>
         
     | 
| 
       513 
     | 
    
         
            -
                   </references>
         
     | 
| 
       514 
     | 
    
         
            -
                   </clause>
         
     | 
| 
       515 
     | 
    
         
            -
                   </bibliography>
         
     | 
| 
       516 
     | 
    
         
            -
                   </iso-standard>
         
     | 
| 
       517 
     | 
    
         
            -
                    INPUT
         
     | 
| 
       518 
     | 
    
         
            -
                #{HTML_HDR.gsub(/"en"/, '"zh"').sub(/INTERNATIONAL ELECTROTECHNICAL COMMISSION/, "国际电工委员会")}
         
     | 
| 
       519 
     | 
    
         
            -
                         <div>
         
     | 
| 
       520 
     | 
    
         
            -
                           <h1 class="ForewordTitle">前言</h1>
         
     | 
| 
       521 
     | 
    
         
            -
                           <div class="boilerplate_legal"/>
         
     | 
| 
       522 
     | 
    
         
            -
                           <p id="A">This is a preamble</p>
         
     | 
| 
       523 
     | 
    
         
            -
                         </div>
         
     | 
| 
       524 
     | 
    
         
            -
                         <br/>
         
     | 
| 
       525 
     | 
    
         
            -
                         <div class="Section3" id="B">
         
     | 
| 
       526 
     | 
    
         
            -
                           <h1 class="IntroTitle">0  引言</h1>
         
     | 
| 
       527 
     | 
    
         
            -
                           <div id="C"><h2>0.1  Introduction Subsection</h2>
         
     | 
| 
       528 
     | 
    
         
            -
                 
         
     | 
| 
       529 
     | 
    
         
            -
                          </div>
         
     | 
| 
       530 
     | 
    
         
            -
                           <p>This is patent boilerplate</p>
         
     | 
| 
       531 
     | 
    
         
            -
                         </div>
         
     | 
| 
       532 
     | 
    
         
            -
                #{IEC_TITLE1}
         
     | 
| 
       533 
     | 
    
         
            -
                         <div id="D">
         
     | 
| 
       534 
     | 
    
         
            -
                           <h1>1  范围</h1>
         
     | 
| 
       535 
     | 
    
         
            -
                           <p id="E">
         
     | 
| 
       536 
     | 
    
         
            -
                             <a href="#ISO712">ISO 712、第1–<referenceto>1</referenceto>表</a>
         
     | 
| 
       537 
     | 
    
         
            -
                           </p>
         
     | 
| 
       538 
     | 
    
         
            -
                         </div>
         
     | 
| 
       539 
     | 
    
         
            -
                         <div>
         
     | 
| 
       540 
     | 
    
         
            -
                           <h1>2  规范性引用文件</h1>
         
     | 
| 
       541 
     | 
    
         
            -
                           <p id="ISO712" class="NormRef">ISO 712, <i> Cereals and cereal products</i></p>
         
     | 
| 
       542 
     | 
    
         
            -
                         </div>
         
     | 
| 
       543 
     | 
    
         
            -
                         <div id="H"><h1>3  术语、定义、符号、代号和缩略语</h1>
         
     | 
| 
       544 
     | 
    
         
            -
                   <div id="I"><h2>3.1  Normal Terms</h2>
         
     | 
| 
       545 
     | 
    
         
            -
                 
         
     | 
| 
       546 
     | 
    
         
            -
                            <p class="TermNum" id="J">3.1.1</p>
         
     | 
| 
       547 
     | 
    
         
            -
                            <p class="Terms" style="text-align:left;">Term2</p>
         
     | 
| 
       548 
     | 
    
         
            -
                 
         
     | 
| 
       549 
     | 
    
         
            -
                          </div><div id="K"><h2>3.2  符号、代号和缩略语</h2>
         
     | 
| 
       550 
     | 
    
         
            -
                            <dl><dt><p>Symbol</p></dt><dd>Definition</dd></dl>
         
     | 
| 
       551 
     | 
    
         
            -
                          </div></div>
         
     | 
| 
       552 
     | 
    
         
            -
                         <div id="L" class="Symbols">
         
     | 
| 
       553 
     | 
    
         
            -
                           <h1>4  符号、代号和缩略语</h1>
         
     | 
| 
       554 
     | 
    
         
            -
                           <dl>
         
     | 
| 
       555 
     | 
    
         
            -
                             <dt>
         
     | 
| 
       556 
     | 
    
         
            -
                               <p>Symbol</p>
         
     | 
| 
       557 
     | 
    
         
            -
                             </dt>
         
     | 
| 
       558 
     | 
    
         
            -
                             <dd>Definition</dd>
         
     | 
| 
       559 
     | 
    
         
            -
                           </dl>
         
     | 
| 
       560 
     | 
    
         
            -
                         </div>
         
     | 
| 
       561 
     | 
    
         
            -
                         <div id="M">
         
     | 
| 
       562 
     | 
    
         
            -
                           <h1>5  Clause 4</h1>
         
     | 
| 
       563 
     | 
    
         
            -
                           <div id="N"><h2>5.1  Introduction</h2>
         
     | 
| 
       564 
     | 
    
         
            -
                 
         
     | 
| 
       565 
     | 
    
         
            -
                          </div>
         
     | 
| 
       566 
     | 
    
         
            -
                           <div id="O"><h2>5.2  Clause 4.2</h2>
         
     | 
| 
       567 
     | 
    
         
            -
                 
         
     | 
| 
       568 
     | 
    
         
            -
                          </div>
         
     | 
| 
       569 
     | 
    
         
            -
                         </div>
         
     | 
| 
       570 
     | 
    
         
            -
                         <br/>
         
     | 
| 
       571 
     | 
    
         
            -
                         <div id="P" class="Section3">
         
     | 
| 
       572 
     | 
    
         
            -
                           <h1 class="Annex">附件A<br/><br/>(规范性附录)<br/><br/><b>Annex</b></h1>
         
     | 
| 
       573 
     | 
    
         
            -
                           <div id="Q"><h2>A.1  Annex A.1</h2>
         
     | 
| 
       574 
     | 
    
         
            -
                 
         
     | 
| 
       575 
     | 
    
         
            -
                            <div id="Q1"><h3>A.1.1  Annex A.1a</h3>
         
     | 
| 
       576 
     | 
    
         
            -
                 
         
     | 
| 
       577 
     | 
    
         
            -
                            </div>
         
     | 
| 
       578 
     | 
    
         
            -
                          </div>
         
     | 
| 
       579 
     | 
    
         
            -
                           <div id="Q2"><h2>附录1  An Appendix</h2>
         
     | 
| 
       580 
     | 
    
         
            -
                 
         
     | 
| 
       581 
     | 
    
         
            -
                          </div>
         
     | 
| 
       582 
     | 
    
         
            -
                         </div>
         
     | 
| 
       583 
     | 
    
         
            -
                         <br/>
         
     | 
| 
       584 
     | 
    
         
            -
                         <div>
         
     | 
| 
       585 
     | 
    
         
            -
                           <h1 class="Section3">参考文献</h1>
         
     | 
| 
      
 635 
     | 
    
         
            +
                           <h1 class="Section3">Bibliography</h1>
         
     | 
| 
       586 
636 
     | 
    
         
             
                           <div>
         
     | 
| 
       587 
637 
     | 
    
         
             
                             <h2 class="Section3">Bibliography Subsection</h2>
         
     | 
| 
       588 
638 
     | 
    
         
             
                           </div>
         
     | 
| 
         @@ -591,6 +641,8 @@ RSpec.describe IsoDoc do 
     | 
|
| 
       591 
641 
     | 
    
         
             
                     </body>
         
     | 
| 
       592 
642 
     | 
    
         
             
                   </html>
         
     | 
| 
       593 
643 
     | 
    
         
             
                OUTPUT
         
     | 
| 
      
 644 
     | 
    
         
            +
                expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
         
     | 
| 
      
 645 
     | 
    
         
            +
                expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
         
     | 
| 
       594 
646 
     | 
    
         
             
              end
         
     | 
| 
       595 
647 
     | 
    
         | 
| 
       596 
648 
     | 
    
         
             
            end
         
     |