isodoc 1.7.2 → 1.7.5

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.
@@ -1,3 +1,5 @@
1
+ require "metanorma-utils"
2
+
1
3
  module IsoDoc
2
4
  class PresentationXMLConvert < ::IsoDoc::Convert
3
5
  def prefix_container(container, linkend, _target)
@@ -130,7 +132,7 @@ module IsoDoc
130
132
  loc = @i18n.locality[type] || type.sub(/^locality:/, "")
131
133
  loc = case node["case"]
132
134
  when "lowercase" then loc.downcase
133
- else loc.capitalize
135
+ else Metanorma::Utils.strict_capitalize_first(loc)
134
136
  end
135
137
  " #{loc}"
136
138
  end
@@ -161,32 +163,62 @@ module IsoDoc
161
163
 
162
164
  def concept1(node)
163
165
  xref = node&.at(ns("./xref/@target"))&.text or
164
- return concept_render(node, node["ital"] || "true",
165
- node["ref"] || "true")
166
+ return concept_render(node, ital: node["ital"] || "true",
167
+ ref: node["ref"] || "true",
168
+ linkref: node["linkref"] || "true",
169
+ linkmention: node["linkmention"] || "false")
166
170
  if node.at(ns("//definitions//dt[@id = '#{xref}']"))
167
- concept_render(node, node["ital"] || "false", node["ref"] || "false")
168
- else concept_render(node, node["ital"] || "true", node["ref"] || "true")
171
+ concept_render(node, ital: node["ital"] || "false",
172
+ ref: node["ref"] || "false",
173
+ linkref: node["linkref"] || "true",
174
+ linkmention: node["linkmention"] || "false")
175
+ else concept_render(node, ital: node["ital"] || "true",
176
+ ref: node["ref"] || "true",
177
+ linkref: node["linkref"] || "true",
178
+ linkmention: node["linkmention"] || "false")
169
179
  end
170
180
  end
171
181
 
172
- def concept_render(node, ital, ref)
182
+ def concept_render(node, opts)
173
183
  node&.at(ns("./refterm"))&.remove
174
184
  r = node.at(ns("./renderterm"))
175
- r&.next = " "
176
- if ital == "true" then r&.name = "em"
177
- else r&.replace(r&.children)
185
+ ref = node.at(ns("./xref | ./eref | ./termref"))
186
+ ref && opts[:ref] != "false" and r&.next = " "
187
+ opts[:ital] == "true" and r&.name = "em"
188
+ if opts[:linkmention] == "true" && !r.nil? && !ref.nil?
189
+ ref2 = ref.clone
190
+ r2 = r.clone
191
+ r.replace(ref2).children = r2
192
+ end
193
+ concept1_ref(node, ref, opts)
194
+ if opts[:ital] == "false"
195
+ r = node.at(ns(".//renderterm"))
196
+ r&.replace(r&.children)
178
197
  end
179
- concept1_ref(node, ref)
180
198
  node.replace(node.children)
181
199
  end
182
200
 
183
- def concept1_ref(node, ref)
184
- r = node.at(ns("./xref | ./eref | ./termref")) or return
185
- return r.remove if ref == "false"
201
+ def concept1_ref(_node, ref, opts)
202
+ ref.nil? and return
203
+ return ref.remove if opts[:ref] == "false"
204
+
205
+ r = concept1_ref_content(ref)
206
+ ref = r.at("./descendant-or-self::xmlns:xref | "\
207
+ "./descendant-or-self::xmlns:eref | "\
208
+ "./descendant-or-self::xmlns:termref")
209
+ %w(xref eref).include? ref&.name and get_linkend(ref)
210
+ if opts[:linkref] == "false" && %w(xref eref).include?(ref&.name)
211
+ ref.replace(ref.children)
212
+ end
213
+ end
186
214
 
187
- if non_locality_elems(r).select { |c| !c.text? || /\S/.match(c) }.empty?
188
- r.replace(@i18n.term_defined_in.sub(/%/, r.to_xml))
189
- else r.replace("[#{r.to_xml}]")
215
+ def concept1_ref_content(ref)
216
+ if non_locality_elems(ref).select do |c|
217
+ !c.text? || /\S/.match(c)
218
+ end.empty?
219
+ ref.replace(@i18n.term_defined_in.sub(/%/,
220
+ ref.to_xml))
221
+ else ref.replace("[#{ref.to_xml}]")
190
222
  end
191
223
  end
192
224
 
@@ -1,5 +1,6 @@
1
1
  require "twitter_cldr"
2
2
  require "bigdecimal"
3
+ require "mathml2asciimath"
3
4
 
4
5
  module IsoDoc
5
6
  class PresentationXMLConvert < ::IsoDoc::Convert
@@ -70,7 +71,15 @@ module IsoDoc
70
71
  locale
71
72
  end
72
73
 
74
+ def asciimath_dup(node)
75
+ return if @suppressasciimathdup
76
+
77
+ a = MathML2AsciiMath.m2a(node.to_xml)
78
+ node.next = "<!-- #{a} -->"
79
+ end
80
+
73
81
  def mathml1(node, locale)
82
+ asciimath_dup(node)
74
83
  localize_maths(node, locale)
75
84
  return unless node.elements.size == 1 && node.elements.first.name == "mn"
76
85
 
@@ -78,12 +78,23 @@ module IsoDoc
78
78
  i = display_order_at(docxml, "//clause[@type = 'scope']", i)
79
79
  i = display_order_at(docxml, @xrefs.klass.norm_ref_xpath, i)
80
80
  i = display_order_at(docxml, "//sections/terms | "\
81
- "//sections/clause[descendant::terms]", i)
81
+ "//sections/clause[descendant::terms]", i)
82
82
  i = display_order_at(docxml, "//sections/definitions", i)
83
83
  i = display_order_xpath(docxml, @xrefs.klass.middle_clause(docxml), i)
84
84
  i = display_order_xpath(docxml, "//annex", i)
85
85
  i = display_order_xpath(docxml, @xrefs.klass.bibliography_xpath, i)
86
86
  display_order_xpath(docxml, "//indexsect", i)
87
87
  end
88
+
89
+ def clausetitle(docxml)
90
+ docxml.xpath(ns("//variant-title[@type = 'toc']")).each(&:remove)
91
+ end
92
+
93
+ def toc(docxml)
94
+ docxml.xpath(ns("//toc//xref[text()]")).each do |x|
95
+ lbl = @xrefs.get[x["target"]][:label] or next
96
+ x.children.first.previous = "#{lbl}<tab/>"
97
+ end
98
+ end
88
99
  end
89
100
  end
@@ -34,6 +34,8 @@ module IsoDoc
34
34
  term docxml
35
35
  references docxml
36
36
  index docxml
37
+ clausetitle docxml
38
+ toc docxml
37
39
  display_order docxml
38
40
  end
39
41
 
@@ -47,6 +49,7 @@ module IsoDoc
47
49
  termexample docxml
48
50
  note docxml
49
51
  termnote docxml
52
+ termdefinition docxml
50
53
  permission docxml
51
54
  requirement docxml
52
55
  recommendation docxml
@@ -1,3 +1,3 @@
1
1
  module IsoDoc
2
- VERSION = "1.7.2".freeze
2
+ VERSION = "1.7.5".freeze
3
3
  end
@@ -46,9 +46,9 @@ module IsoDoc::WordFunction
46
46
  end
47
47
  end
48
48
 
49
- def insert_tab(out, n)
50
- out.span **attr_code(style: "mso-tab-count:#{n}") do |span|
51
- [1..n].each { span << "&#xA0; " }
49
+ def insert_tab(out, count)
50
+ out.span **attr_code(style: "mso-tab-count:#{count}") do |span|
51
+ [1..count].each { span << "&#xA0; " }
52
52
  end
53
53
  end
54
54
 
@@ -137,7 +137,7 @@ module IsoDoc::WordFunction
137
137
  name = node&.at(ns("./name"))&.remove
138
138
  div.p **{ class: "Note" } do |p|
139
139
  p.span **{ class: "note_label" } do |s|
140
- name and name.children.each { |n| parse(n, s) }
140
+ name&.children&.each { |n| parse(n, s) }
141
141
  end
142
142
  insert_tab(p, 1)
143
143
  node.first_element_child.children.each { |n| parse(n, p) }
@@ -149,7 +149,7 @@ module IsoDoc::WordFunction
149
149
  name = node&.at(ns("./name"))&.remove
150
150
  div.p **{ class: "Note" } do |p|
151
151
  p.span **{ class: "note_label" } do |s|
152
- name and name.children.each { |n| parse(n, s) }
152
+ name&.children&.each { |n| parse(n, s) }
153
153
  end
154
154
  insert_tab(p, 1)
155
155
  end
@@ -37,12 +37,12 @@ module IsoDoc
37
37
  input_filename,
38
38
  output_filename || "#{filename}.#{@suffix}",
39
39
  File.join(@libdir, pdf_stylesheet(docxml)),
40
- pdf_options(docxml)
40
+ pdf_options(docxml),
41
41
  )
42
42
  end
43
43
 
44
44
  def xref_parse(node, out)
45
- out.a(**{ "href": target_pdf(node) }) { |l| l << get_linkend(node) }
45
+ out.a(**{ href: target_pdf(node) }) { |l| l << get_linkend(node) }
46
46
  end
47
47
 
48
48
  def input_xml_path(input_filename, xml_file, debug)
data/lib/isodoc.rb CHANGED
@@ -17,8 +17,8 @@ require "isodoc/convert"
17
17
  require "isodoc/metadata"
18
18
  require "isodoc/html_convert"
19
19
  require "isodoc/word_convert"
20
- require "isodoc/pdf_convert"
21
20
  require "isodoc/xslfo_convert"
21
+ require "isodoc/pdf_convert"
22
22
  require "isodoc/headlesshtml_convert"
23
23
  require "isodoc/presentation_xml_convert"
24
24
  require "isodoc/xref"
@@ -1436,7 +1436,7 @@
1436
1436
  </xsl:template>
1437
1437
 
1438
1438
  <xsl:template match="iso:sourcecode">
1439
- <fo:block font-family="Courier" font-size="9pt" margin-bottom="12pt">
1439
+ <fo:block font-family="Courier New" font-size="9pt" margin-bottom="12pt">
1440
1440
  <xsl:choose>
1441
1441
  <xsl:when test="@lang = 'en'"/>
1442
1442
  <xsl:otherwise>
@@ -2760,7 +2760,7 @@
2760
2760
  <xsl:apply-templates/>
2761
2761
  </fo:inline>
2762
2762
  </xsl:template><xsl:template xmlns:iec="http://riboseinc.com/isoxml" xmlns:itu="https://open.ribose.com/standards/itu" xmlns:nist="http://www.nist.gov/metanorma" xmlns:un="https://open.ribose.com/standards/unece" xmlns:csd="https://www.calconnect.org/standards/csd" match="*[local-name()='tt']">
2763
- <fo:inline font-family="Courier" font-size="10pt">
2763
+ <fo:inline font-family="Courier New" font-size="10pt">
2764
2764
  <xsl:apply-templates/>
2765
2765
  </fo:inline>
2766
2766
  </xsl:template><xsl:template xmlns:iec="http://riboseinc.com/isoxml" xmlns:itu="https://open.ribose.com/standards/itu" xmlns:nist="http://www.nist.gov/metanorma" xmlns:un="https://open.ribose.com/standards/unece" xmlns:csd="https://www.calconnect.org/standards/csd" match="*[local-name()='del']">
@@ -1572,6 +1572,7 @@ RSpec.describe IsoDoc do
1572
1572
  <inherit>/ss/584/2015/level/1</inherit>
1573
1573
  <inherit><eref type="inline" bibitemid="rfc2616" citeas="RFC 2616">RFC 2616 (HTTP/1.1)</eref></inherit>
1574
1574
  <subject>user</subject>
1575
+ <subject>non-user</subject>
1575
1576
  <classification> <tag>control-class</tag> <value>Technical</value> </classification><classification> <tag>priority</tag> <value>P0</value> </classification><classification> <tag>family</tag> <value>System and Communications Protection</value> </classification><classification> <tag>family</tag> <value>System and Communications Protocols</value> </classification>
1576
1577
  <description>
1577
1578
  <p id="_">I recommend <em>this</em>.</p>
@@ -1611,6 +1612,9 @@ RSpec.describe IsoDoc do
1611
1612
  <import exclude="true">
1612
1613
  <sourcecode id="_">success-response()</sourcecode>
1613
1614
  </import>
1615
+ <component exclude='false' class='component1'>
1616
+ <p id='_'>Hello</p>
1617
+ </component>
1614
1618
  </permission>
1615
1619
  </foreword></preface>
1616
1620
  <bibliography><references id="_bibliography" obligation="informative" normative="false" displayorder="2">
@@ -1628,6 +1632,7 @@ RSpec.describe IsoDoc do
1628
1632
  <inherit>/ss/584/2015/level/1</inherit>
1629
1633
  <inherit><eref type="inline" bibitemid="rfc2616" citeas="RFC 2616">RFC 2616 (HTTP/1.1)</eref></inherit>
1630
1634
  <subject>user</subject>
1635
+ <subject>non-user</subject>
1631
1636
  <classification> <tag>control-class</tag> <value>Technical</value> </classification><classification> <tag>priority</tag> <value>P0</value> </classification><classification> <tag>family</tag> <value>System and Communications Protection</value> </classification><classification> <tag>family</tag> <value>System and Communications Protocols</value> </classification>
1632
1637
  <description>
1633
1638
  <p id="_">I recommend <em>this</em>.</p>
@@ -1668,6 +1673,9 @@ RSpec.describe IsoDoc do
1668
1673
  <import exclude="true">
1669
1674
  <sourcecode id="_">success-response()</sourcecode>
1670
1675
  </import>
1676
+ <component exclude='false' class='component1'>
1677
+ <p id='_'>Hello</p>
1678
+ </component>
1671
1679
  </permission>
1672
1680
  </foreword></preface>
1673
1681
  <bibliography><references id="_bibliography" obligation="informative" normative="false" displayorder='2'>
@@ -1684,6 +1692,7 @@ RSpec.describe IsoDoc do
1684
1692
  <div class="permission" id='_' style='page-break-after: avoid;page-break-inside: avoid;'>
1685
1693
  <p class="RecommendationTitle">Permission 1:<br/>/ogc/recommendation/wfs/2</p>
1686
1694
  <p><i>Subject: user<br/>
1695
+ Subject: non-user<br/>
1687
1696
  Inherits: /ss/584/2015/level/1
1688
1697
  <br/>
1689
1698
  Inherits: <a href='#rfc2616'>RFC 2616 (HTTP/1.1)</a>
@@ -1702,6 +1711,7 @@ RSpec.describe IsoDoc do
1702
1711
  <p id="_">The following code will be run for verification:</p>
1703
1712
  <pre id="_" class="prettyprint ">CoreRoot(success): HttpResponse<br/>&#160;&#160;&#160;&#160;&#160; if (success)<br/>&#160;&#160;&#160;&#160;&#160; recommendation(label: success-response)<br/>&#160;&#160;&#160;&#160;&#160; end<br/>&#160;&#160;&#160; </pre>
1704
1713
  </div>
1714
+ <div class='requirement-component1'> <p id='_'>Hello</p> </div>
1705
1715
  </div>
1706
1716
  </div>
1707
1717
  <p class="zzSTDTitle1"/>
@@ -1770,6 +1780,9 @@ RSpec.describe IsoDoc do
1770
1780
  <import exclude="true">
1771
1781
  <sourcecode id="_">success-response()</sourcecode>
1772
1782
  </import>
1783
+ <component exclude='false' class='component1'>
1784
+ <p id='_'>Hello</p>
1785
+ </component>
1773
1786
  </requirement>
1774
1787
  </foreword></preface>
1775
1788
  </iso-standard>
@@ -1824,6 +1837,9 @@ RSpec.describe IsoDoc do
1824
1837
  <import exclude='true'>
1825
1838
  <sourcecode id='_'>success-response()</sourcecode>
1826
1839
  </import>
1840
+ <component exclude='false' class='component1'>
1841
+ <p id='_'>Hello</p>
1842
+ </component>
1827
1843
  </requirement>
1828
1844
  </foreword>
1829
1845
  </preface>
@@ -1851,6 +1867,7 @@ RSpec.describe IsoDoc do
1851
1867
  <p id="_">The following code will be run for verification:</p>
1852
1868
  <pre id="_" class="prettyprint ">CoreRoot(success): HttpResponse<br/>&#160;&#160;&#160;&#160;&#160; if (success)<br/>&#160;&#160;&#160;&#160;&#160; recommendation(label: success-response)<br/>&#160;&#160;&#160;&#160;&#160; end<br/>&#160;&#160;&#160; </pre>
1853
1869
  </div>
1870
+ <div class='requirement-component1'> <p id='_'>Hello</p> </div>
1854
1871
  </div>
1855
1872
  </div>
1856
1873
  <p class="zzSTDTitle1"/>
@@ -1915,6 +1932,9 @@ RSpec.describe IsoDoc do
1915
1932
  <import exclude="true">
1916
1933
  <sourcecode id="_">success-response()</sourcecode>
1917
1934
  </import>
1935
+ <component exclude='false' class='component1'>
1936
+ <p id='_'>Hello</p>
1937
+ </component>
1918
1938
  </requirement>
1919
1939
  </foreword></preface>
1920
1940
  </iso-standard>
@@ -1970,6 +1990,9 @@ RSpec.describe IsoDoc do
1970
1990
  <import exclude="true">
1971
1991
  <sourcecode id="_">success-response()</sourcecode>
1972
1992
  </import>
1993
+ <component exclude='false' class='component1'>
1994
+ <p id='_'>Hello</p>
1995
+ </component>
1973
1996
  </requirement>
1974
1997
  </foreword></preface>
1975
1998
  </iso-standard>
@@ -2026,6 +2049,7 @@ RSpec.describe IsoDoc do
2026
2049
  <br/>
2027
2050
  </pre>
2028
2051
  </div>
2052
+ <div class='requirement-component1'> <p id='_'>Hello</p> </div>
2029
2053
  </div>
2030
2054
  </div>
2031
2055
  <p class='zzSTDTitle1'/>
@@ -2089,6 +2113,9 @@ RSpec.describe IsoDoc do
2089
2113
  <import exclude="true">
2090
2114
  <sourcecode id="_">success-response()</sourcecode>
2091
2115
  </import>
2116
+ <component exclude='false' class='component1'>
2117
+ <p id='_'>Hello</p>
2118
+ </component>
2092
2119
  </recommendation>
2093
2120
  </foreword></preface>
2094
2121
  </iso-standard>
@@ -2151,6 +2178,9 @@ RSpec.describe IsoDoc do
2151
2178
  <import exclude='true'>
2152
2179
  <sourcecode id='_'>success-response()</sourcecode>
2153
2180
  </import>
2181
+ <component exclude='false' class='component1'>
2182
+ <p id='_'>Hello</p>
2183
+ </component>
2154
2184
  </recommendation>
2155
2185
  </foreword>
2156
2186
  </preface>
@@ -2178,6 +2208,7 @@ RSpec.describe IsoDoc do
2178
2208
  <p id="_">The following code will be run for verification:</p>
2179
2209
  <pre id="_" class="prettyprint ">CoreRoot(success): HttpResponse<br/>&#160;&#160;&#160;&#160;&#160; if (success)<br/>&#160;&#160;&#160;&#160;&#160; recommendation(label: success-response)<br/>&#160;&#160;&#160;&#160;&#160; end<br/>&#160;&#160;&#160; </pre>
2180
2210
  </div>
2211
+ <div class='requirement-component1'> <p id='_'>Hello</p> </div>
2181
2212
  </div>
2182
2213
  </div>
2183
2214
  <p class="zzSTDTitle1"/>
@@ -2503,73 +2534,156 @@ RSpec.describe IsoDoc do
2503
2534
  </sections>
2504
2535
  </standard-document>
2505
2536
  INPUT
2537
+ presxml = <<~INPUT
2538
+ <standard-document xmlns="https://www.metanorma.org/ns/standoc" type="presentation" version="1.10.2">
2539
+ <bibdata type="standard">
2540
+ <title language="en" format="text/plain">Document title</title>
2541
+ <language current="true">en</language>
2542
+ <script current="true">Latn</script>
2543
+ <status>
2544
+ <stage language="">published</stage>
2545
+ </status>
2546
+ <copyright>
2547
+ <from>2021</from>
2548
+ </copyright>
2549
+ <ext>
2550
+ <doctype language="">article</doctype>
2551
+ </ext>
2552
+ </bibdata>
2553
+ <sections>
2554
+ <clause id="clause1" inline-header="false" obligation="normative" displayorder="1">
2555
+ <title depth="1">1.<tab/>Clause 1</title>
2556
+ <clause id="clause1A" inline-header="false" obligation="normative">
2557
+ <title depth="2">1.1.<tab/>Clause 1A</title>
2558
+ <clause id="clause1Aa" inline-header="false" obligation="normative">
2559
+ <title depth="3">1.1.1.<tab/>Clause 1Aa</title>
2560
+ </clause>
2561
+ <clause id="clause1Ab" inline-header="false" obligation="normative">
2562
+ <title depth="3">1.1.2.<tab/>Clause 1Ab</title>
2563
+ </clause>
2564
+ </clause>
2565
+ <clause id="clause1B" inline-header="false" obligation="normative">
2566
+ <title depth="2">1.2.<tab/>Clause 1B</title>
2567
+ <clause id="clause1Ba" inline-header="false" obligation="normative">
2568
+ <title depth="3">1.2.1.<tab/>Clause 1Ba</title>
2569
+ </clause>
2570
+ </clause>
2571
+ </clause>
2572
+ <clause id="clause2" inline-header="false" obligation="normative" displayorder="2">
2573
+ <title depth="1">2.<tab/>Clause 2</title>
2574
+ <p id="A">And introducing: </p>
2575
+ <toc>
2576
+ <ul id="B">
2577
+ <li>
2578
+ <xref target="clause1A">1.1<tab/>Clause 1A</xref>
2579
+ </li>
2580
+ <li>
2581
+ <ul id="C">
2582
+ <li>
2583
+ <xref target="clause1Aa">1.1.1<tab/>Clause 1Aa</xref>
2584
+ </li>
2585
+ <li>
2586
+ <xref target="clause1Ab">1.1.2<tab/>Clause 1Ab</xref>
2587
+ </li>
2588
+ </ul>
2589
+ </li>
2590
+ <li>
2591
+ <xref target="clause1B">1.2<tab/>Clause 1B</xref>
2592
+ </li>
2593
+ <li>
2594
+ <ul id="D">
2595
+ <li>
2596
+ <xref target="clause1Ba">1.2.1<tab/>Clause 1Ba</xref>
2597
+ </li>
2598
+ </ul>
2599
+ </li>
2600
+ </ul>
2601
+ </toc>
2602
+ <toc>
2603
+ <ul id="E">
2604
+ <li>
2605
+ <xref target="clause1A">1.1<tab/>Clause 1A</xref>
2606
+ </li>
2607
+ <li>
2608
+ <xref target="clause1B">1.2<tab/>Clause 1B</xref>
2609
+ </li>
2610
+ </ul>
2611
+ </toc>
2612
+ </clause>
2613
+ </sections>
2614
+ </standard-document>
2615
+ INPUT
2506
2616
  output = <<~OUTPUT
2507
2617
  #{HTML_HDR}
2508
- <p class='zzSTDTitle1'>Document title</p>
2509
- <div id='clause1'>
2510
- <h1>Clause 1</h1>
2511
- <div id='clause1A'>
2512
- <h2>Clause 1A</h2>
2513
- <div id='clause1Aa'>
2514
- <h3>Clause 1Aa</h3>
2515
- </div>
2516
- <div id='clause1Ab'>
2517
- <h3>Clause 1Ab</h3>
2518
- </div>
2519
- </div>
2520
- <div id='clause1B'>
2521
- <h2>Clause 1B</h2>
2522
- <div id='clause1Ba'>
2523
- <h3>Clause 1Ba</h3>
2524
- </div>
2525
- </div>
2526
- </div>
2527
- <div id='clause2'>
2528
- <h1>Clause 2</h1>
2529
- <p id='A'>And introducing: </p>
2530
- <div class='toc'>
2531
- <ul id='B'>
2532
- <li>
2533
- <a href='#clause1A'>Clause 1A</a>
2534
- </li>
2535
- <li>
2536
- <ul id='C'>
2537
- <li>
2538
- <a href='#clause1Aa'>Clause 1Aa</a>
2539
- </li>
2540
- <li>
2541
- <a href='#clause1Ab'>Clause 1Ab</a>
2542
- </li>
2543
- </ul>
2544
- </li>
2545
- <li>
2546
- <a href='#clause1B'>Clause 1B</a>
2547
- </li>
2548
- <li>
2549
- <ul id='D'>
2550
- <li>
2551
- <a href='#clause1Ba'>Clause 1Ba</a>
2552
- </li>
2553
- </ul>
2554
- </li>
2555
- </ul>
2556
- </div>
2557
- <div class='toc'>
2558
- <ul id='E'>
2559
- <li>
2560
- <a href='#clause1A'>Clause 1A</a>
2561
- </li>
2562
- <li>
2563
- <a href='#clause1B'>Clause 1B</a>
2564
- </li>
2565
- </ul>
2566
- </div>
2567
- </div>
2568
- </div>
2569
- </body>
2570
- </html>
2618
+ <p class='zzSTDTitle1'>Document title</p>
2619
+ <div id='clause1'>
2620
+ <h1>1.&#160; Clause 1</h1>
2621
+ <div id='clause1A'>
2622
+ <h2>1.1.&#160; Clause 1A</h2>
2623
+ <div id='clause1Aa'>
2624
+ <h3>1.1.1.&#160; Clause 1Aa</h3>
2625
+ </div>
2626
+ <div id='clause1Ab'>
2627
+ <h3>1.1.2.&#160; Clause 1Ab</h3>
2628
+ </div>
2629
+ </div>
2630
+ <div id='clause1B'>
2631
+ <h2>1.2.&#160; Clause 1B</h2>
2632
+ <div id='clause1Ba'>
2633
+ <h3>1.2.1.&#160; Clause 1Ba</h3>
2634
+ </div>
2635
+ </div>
2636
+ </div>
2637
+ <div id='clause2'>
2638
+ <h1>2.&#160; Clause 2</h1>
2639
+ <p id='A'>And introducing: </p>
2640
+ <div class='toc'>
2641
+ <ul id='B'>
2642
+ <li>
2643
+ <a href='#clause1A'>1.1&#160; Clause 1A</a>
2644
+ </li>
2645
+ <li>
2646
+ <ul id='C'>
2647
+ <li>
2648
+ <a href='#clause1Aa'>1.1.1&#160; Clause 1Aa</a>
2649
+ </li>
2650
+ <li>
2651
+ <a href='#clause1Ab'>1.1.2&#160; Clause 1Ab</a>
2652
+ </li>
2653
+ </ul>
2654
+ </li>
2655
+ <li>
2656
+ <a href='#clause1B'>1.2&#160; Clause 1B</a>
2657
+ </li>
2658
+ <li>
2659
+ <ul id='D'>
2660
+ <li>
2661
+ <a href='#clause1Ba'>1.2.1&#160; Clause 1Ba</a>
2662
+ </li>
2663
+ </ul>
2664
+ </li>
2665
+ </ul>
2666
+ </div>
2667
+ <div class='toc'>
2668
+ <ul id='E'>
2669
+ <li>
2670
+ <a href='#clause1A'>1.1&#160; Clause 1A</a>
2671
+ </li>
2672
+ <li>
2673
+ <a href='#clause1B'>1.2&#160; Clause 1B</a>
2674
+ </li>
2675
+ </ul>
2676
+ </div>
2677
+ </div>
2678
+ </div>
2679
+ </body>
2680
+ </html>
2571
2681
  OUTPUT
2682
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
2683
+ .convert("test", input, true)
2684
+ .sub(%r{<localized-strings>.*</localized-strings>}m, "")))
2685
+ .to be_equivalent_to xmlpp(presxml)
2572
2686
  expect(xmlpp(IsoDoc::HtmlConvert.new({})
2573
- .convert("test", input, true))).to be_equivalent_to xmlpp(output)
2687
+ .convert("test", presxml, true))).to be_equivalent_to xmlpp(output)
2574
2688
  end
2575
2689
  end