metanorma-iso 1.6.1 → 1.7.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +11 -41
  3. data/.gitignore +2 -0
  4. data/.rubocop.yml +6 -2
  5. data/lib/asciidoctor/iso/base.rb +13 -13
  6. data/lib/asciidoctor/iso/basicdoc.rng +5 -3
  7. data/lib/asciidoctor/iso/biblio.rng +4 -6
  8. data/lib/asciidoctor/iso/cleanup.rb +1 -1
  9. data/lib/asciidoctor/iso/front.rb +6 -6
  10. data/lib/asciidoctor/iso/front_id.rb +30 -25
  11. data/lib/asciidoctor/iso/isodoc.rng +108 -2
  12. data/lib/asciidoctor/iso/isostandard-amd.rng +3 -0
  13. data/lib/asciidoctor/iso/isostandard.rng +17 -97
  14. data/lib/asciidoctor/iso/validate.rb +68 -1
  15. data/lib/asciidoctor/iso/validate_title.rb +21 -13
  16. data/lib/isodoc/iso/base_convert.rb +11 -0
  17. data/lib/isodoc/iso/html/header.html +12 -12
  18. data/lib/isodoc/iso/html/html_iso_intro.html +1 -1
  19. data/lib/isodoc/iso/html/html_iso_titlepage.html +1 -1
  20. data/lib/isodoc/iso/html/word_iso_intro.html +1 -1
  21. data/lib/isodoc/iso/html/word_iso_titlepage.html +1 -1
  22. data/lib/isodoc/iso/html_convert.rb +2 -2
  23. data/lib/isodoc/iso/i18n-en.yaml +6 -0
  24. data/lib/isodoc/iso/i18n-fr.yaml +4 -0
  25. data/lib/isodoc/iso/i18n-zh-Hans.yaml +4 -0
  26. data/lib/isodoc/iso/index.rb +140 -0
  27. data/lib/isodoc/iso/iso.amendment.xsl +1009 -321
  28. data/lib/isodoc/iso/iso.international-standard.xsl +1009 -321
  29. data/lib/isodoc/iso/presentation_xml_convert.rb +1 -4
  30. data/lib/isodoc/iso/word_convert.rb +2 -2
  31. data/lib/isodoc/iso/xref.rb +5 -0
  32. data/lib/metanorma/iso/version.rb +1 -1
  33. data/metanorma-iso.gemspec +4 -4
  34. data/spec/asciidoctor/amd_spec.rb +696 -0
  35. data/spec/asciidoctor/base_spec.rb +704 -0
  36. data/spec/asciidoctor/blocks_spec.rb +527 -0
  37. data/spec/asciidoctor/cleanup_spec.rb +1134 -0
  38. data/spec/asciidoctor/inline_spec.rb +195 -0
  39. data/spec/asciidoctor/lists_spec.rb +197 -0
  40. data/spec/asciidoctor/refs_spec.rb +375 -0
  41. data/spec/asciidoctor/section_spec.rb +393 -0
  42. data/spec/asciidoctor/table_spec.rb +329 -0
  43. data/spec/asciidoctor/validate_spec.rb +1572 -0
  44. data/spec/isodoc/amd_spec.rb +967 -946
  45. data/spec/isodoc/blocks_spec.rb +530 -507
  46. data/spec/isodoc/i18n_spec.rb +953 -911
  47. data/spec/isodoc/inline_spec.rb +355 -293
  48. data/spec/isodoc/iso_spec.rb +340 -316
  49. data/spec/isodoc/metadata_spec.rb +392 -382
  50. data/spec/isodoc/postproc_spec.rb +834 -656
  51. data/spec/isodoc/ref_spec.rb +374 -331
  52. data/spec/isodoc/section_spec.rb +821 -519
  53. data/spec/isodoc/table_spec.rb +472 -411
  54. data/spec/isodoc/terms_spec.rb +209 -185
  55. data/spec/isodoc/xref_spec.rb +1370 -1236
  56. data/spec/metanorma/processor_spec.rb +28 -26
  57. data/spec/spec_helper.rb +186 -189
  58. metadata +26 -27
  59. data/.rubocop.ribose.yml +0 -66
  60. data/spec/asciidoctor-iso/amd_spec.rb +0 -694
  61. data/spec/asciidoctor-iso/base_spec.rb +0 -713
  62. data/spec/asciidoctor-iso/blocks_spec.rb +0 -482
  63. data/spec/asciidoctor-iso/cleanup_spec.rb +0 -1025
  64. data/spec/asciidoctor-iso/inline_spec.rb +0 -170
  65. data/spec/asciidoctor-iso/lists_spec.rb +0 -190
  66. data/spec/asciidoctor-iso/refs_spec.rb +0 -317
  67. data/spec/asciidoctor-iso/section_spec.rb +0 -362
  68. data/spec/asciidoctor-iso/table_spec.rb +0 -313
  69. data/spec/asciidoctor-iso/validate_spec.rb +0 -1550
  70. data/spec/assets/xref_error.adoc +0 -7
@@ -1,170 +0,0 @@
1
- require "spec_helper"
2
-
3
- RSpec.describe Asciidoctor::ISO do
4
- it "processes inline_quoted formatting" do
5
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
6
- #{ASCIIDOC_BLANK_HDR}
7
- _emphasis_
8
- *strong*
9
- `monospace`
10
- "double quote"
11
- 'single quote'
12
- super^script^
13
- sub~script~
14
- stem:[a_90]
15
- stem:[<mml:math><mml:msub xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"> <mml:mrow> <mml:mrow> <mml:mi mathvariant="bold-italic">F</mml:mi> </mml:mrow> </mml:mrow> <mml:mrow> <mml:mrow> <mml:mi mathvariant="bold-italic">&#x391;</mml:mi> </mml:mrow> </mml:mrow> </mml:msub> </mml:math>]
16
- [alt]#alt#
17
- [deprecated]#deprecated#
18
- [domain]#domain#
19
- [strike]#strike#
20
- [smallcap]#smallcap#
21
- INPUT
22
- #{BLANK_HDR}
23
- <sections>
24
- <em>emphasis</em>
25
- <strong>strong</strong>
26
- <tt>monospace</tt>
27
- “double quote”
28
- ‘single quote’
29
- super<sup>script</sup>
30
- sub<sub>script</sub>
31
- <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mrow>
32
- <mi>a</mi>
33
- </mrow>
34
- <mrow>
35
- <mn>90</mn>
36
- </mrow>
37
- </msub></math></stem>
38
- <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub> <mrow> <mrow> <mi mathvariant="bold-italic">F</mi> </mrow> </mrow> <mrow> <mrow> <mi mathvariant="bold-italic">Α</mi> </mrow> </mrow> </msub> </math></stem>
39
- <admitted>alt</admitted>
40
- <deprecates>deprecated</deprecates>
41
- <domain>domain</domain>
42
- <strike>strike</strike>
43
- <smallcap>smallcap</smallcap>
44
- </sections>
45
- </iso-standard>
46
- OUTPUT
47
- end
48
-
49
- it "processes breaks" do
50
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
51
- #{ASCIIDOC_BLANK_HDR}
52
- Line break +
53
- line break
54
-
55
- '''
56
-
57
- <<<
58
- INPUT
59
- #{BLANK_HDR}
60
- <sections><p id="_">Line break<br/>
61
- line break</p>
62
- <hr/>
63
- <pagebreak/></sections>
64
- </iso-standard>
65
- OUTPUT
66
- end
67
-
68
- it "processes links" do
69
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
70
- #{ASCIIDOC_BLANK_HDR}
71
- mailto:fred@example.com
72
- http://example.com[]
73
- http://example.com[Link]
74
- INPUT
75
- #{BLANK_HDR}
76
- <sections>
77
- <p id="_">mailto:fred@example.com
78
- <link target="http://example.com"/>
79
- <link target="http://example.com">Link</link></p>
80
- </sections>
81
- </iso-standard>
82
- OUTPUT
83
- end
84
-
85
- it "processes bookmarks" do
86
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
87
- #{ASCIIDOC_BLANK_HDR}
88
- Text [[bookmark]] Text
89
- INPUT
90
- #{BLANK_HDR}
91
- <sections>
92
- <p id="_">Text <bookmark id="bookmark"/> Text</p>
93
- </sections>
94
- </iso-standard>
95
- OUTPUT
96
- end
97
-
98
- it "processes crossreferences" do
99
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
100
- #{ASCIIDOC_BLANK_HDR}
101
- [[reference]]
102
- == Section
103
-
104
- Inline Reference to <<reference>>
105
- Footnoted Reference to <<reference,fn>>
106
- Inline Reference with Text to <<reference,text>>
107
- Footnoted Reference with Text to <<reference,fn: text>>
108
- INPUT
109
- #{BLANK_HDR}
110
- <sections>
111
- <clause id="reference" inline-header="false" obligation="normative">
112
- <title>Section</title>
113
- <p id="_">Inline Reference to <xref target="reference"/>
114
- Footnoted Reference to <xref target="reference"/>
115
- Inline Reference with Text to <xref target="reference">text</xref>
116
- Footnoted Reference with Text to <xref target="reference">text</xref></p>
117
- </clause>
118
- </sections>
119
- </iso-standard>
120
- OUTPUT
121
- end
122
-
123
- it "processes bibliographic anchors" do
124
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
125
- #{ASCIIDOC_BLANK_HDR}
126
- [bibliography]
127
- == Normative References
128
-
129
- * [[[ISO712,x]]] Reference
130
- * [[[ISO713]]] Reference
131
-
132
- INPUT
133
- #{BLANK_HDR}
134
- <sections>
135
-
136
- </sections><bibliography><references id="_" obligation="informative" normative="true">
137
- <title>Normative references</title>
138
- <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>
139
- <bibitem id="ISO712">
140
- <formattedref format="application/x-isodoc+xml">Reference</formattedref>
141
- <docidentifier>x</docidentifier>
142
- </bibitem>
143
- <bibitem id="ISO713">
144
- <formattedref format="application/x-isodoc+xml">Reference</formattedref>
145
- <docidentifier>ISO713</docidentifier>
146
- <docnumber>713</docnumber>
147
- </bibitem>
148
- </references>
149
- </bibliography>
150
- </iso-standard>
151
- OUTPUT
152
- end
153
-
154
- it "processes footnotes" do
155
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
156
- #{ASCIIDOC_BLANK_HDR}
157
- Hello!footnote:[Footnote text]
158
- INPUT
159
- #{BLANK_HDR}
160
- <sections>
161
- <p id="_">Hello!<fn reference="1">
162
- <p id="_">Footnote text</p>
163
- </fn></p>
164
- </sections>
165
- </iso-standard>
166
- OUTPUT
167
- end
168
-
169
-
170
- end
@@ -1,190 +0,0 @@
1
- require "spec_helper"
2
-
3
- RSpec.describe Asciidoctor::ISO do
4
- it "processes simple lists" do
5
- output = Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)
6
- #{ASCIIDOC_BLANK_HDR}
7
- * List 1
8
- * List 2
9
- * List 3
10
-
11
- . List A
12
- . List B
13
- . List C
14
-
15
- List D:: List E
16
- List F:: List G
17
-
18
- INPUT
19
- expect(xmlpp(strip_guid(output))).to be_equivalent_to xmlpp(<<~"OUTPUT")
20
- #{BLANK_HDR}
21
- <sections>
22
- <ul id="_">
23
- <li>
24
- <p id="_">List 1</p>
25
- </li>
26
- <li>
27
- <p id="_">List 2</p>
28
- </li>
29
- <li>
30
- <p id="_">List 3</p>
31
- <ol id="_">
32
- <li>
33
- <p id="_">List A</p>
34
- </li>
35
- <li>
36
- <p id="_">List B</p>
37
- </li>
38
- <li>
39
- <p id="_">List C</p>
40
- <dl id="_">
41
- <dt>List D</dt>
42
- <dd>
43
- <p id="_">List E</p>
44
- </dd>
45
- <dt>List F</dt>
46
- <dd>
47
- <p id="_">List G</p>
48
- </dd>
49
- </dl>
50
- </li>
51
- </ol>
52
- </li>
53
- </ul>
54
- </sections>
55
- </iso-standard>
56
- OUTPUT
57
- end
58
-
59
- it "processes complex lists" do
60
- output = Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)
61
- #{ASCIIDOC_BLANK_HDR}
62
- [[id]]
63
- * First
64
- * Second
65
- +
66
- --
67
- entry1
68
-
69
- entry2
70
- --
71
-
72
- [[id1]]
73
- [loweralpha]
74
- . First
75
- . Second
76
- [upperalpha]
77
- .. Third
78
- .. Fourth
79
- . Fifth
80
- . Sixth
81
-
82
- [lowerroman]
83
- . A
84
- . B
85
- [upperroman]
86
- .. C
87
- .. D
88
- [arabic]
89
- ... E
90
- ... F
91
-
92
-
93
- Notes1::
94
- Notes:: Note 1.
95
- +
96
- Note 2.
97
- +
98
- Note 3.
99
-
100
- INPUT
101
- expect(xmlpp(strip_guid(output))).to be_equivalent_to xmlpp(<<~"OUTPUT")
102
- #{BLANK_HDR}
103
- <sections><ul id="id">
104
- <li>
105
- <p id="_">First</p>
106
- </li>
107
- <li><p id="_">Second</p><p id="_">entry1</p>
108
- <p id="_">entry2</p></li>
109
- </ul>
110
- <ol id="id1">
111
- <li>
112
- <p id="_">First</p>
113
- </li>
114
- <li>
115
- <p id="_">Second</p>
116
- <ol id="_">
117
- <li>
118
- <p id="_">Third</p>
119
- </li>
120
- <li>
121
- <p id="_">Fourth</p>
122
- </li>
123
- </ol>
124
- </li>
125
- <li>
126
- <p id="_">Fifth</p>
127
- </li>
128
- <li>
129
- <p id="_">Sixth</p>
130
- </li>
131
- </ol>
132
- <ol id="_">
133
- <li>
134
- <p id="_">A</p>
135
- </li>
136
- <li>
137
- <p id="_">B</p>
138
- <ol id="_">
139
- <li>
140
- <p id="_">C</p>
141
- </li>
142
- <li>
143
- <p id="_">D</p>
144
- <ol id="_">
145
- <li>
146
- <p id="_">E</p>
147
- </li>
148
- <li>
149
- <p id="_">F</p>
150
- <dl id="_">
151
- <dt>Notes1</dt>
152
- <dd/>
153
- <dt>Notes</dt>
154
- <dd><p id="_">Note 1.</p><p id="_">Note 2.</p>
155
- <p id="_">Note 3.</p></dd>
156
- </dl>
157
- </li>
158
- </ol>
159
- </li>
160
- </ol>
161
- </li>
162
- </ol></sections>
163
- </iso-standard>
164
- OUTPUT
165
- end
166
-
167
- it "anchors lists and list items" do
168
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
169
- #{ASCIIDOC_BLANK_HDR}
170
- [[id1]]
171
- * [[id2]] List item
172
- * Hello [[id3]] List item
173
-
174
- INPUT
175
- #{BLANK_HDR}
176
- <sections>
177
- <ul id="id1">
178
- <li id="id2">
179
- <p id="_">List item</p>
180
- </li>
181
- <li>
182
- <p id="_">Hello <bookmark id="id3"/> List item</p>
183
- </li>
184
- </ul>
185
- </sections>
186
- </iso-standard>
187
- OUTPUT
188
- end
189
-
190
- end
@@ -1,317 +0,0 @@
1
- require "spec_helper"
2
- require "relaton_iso"
3
- require "relaton_ietf"
4
-
5
- RSpec.describe Asciidoctor::ISO do
6
- it "processes draft ISO reference" do
7
- mock_fdis
8
- #mock_isobib_get_123
9
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
10
- #{ISOBIB_BLANK_HDR}
11
- == Clause
12
- <<iso123>>
13
- <<iso123>>
14
- A.footnote:[a footnote]
15
- <<fdis>>
16
- <<fdis>>
17
-
18
- [bibliography]
19
- == Normative References
20
-
21
- * [[[iso123,ISO 123:--]]] footnote:[The standard is in press] _Standard_
22
- * [[[fdis,ISO/FDIS 17664-1]]] Title
23
- INPUT
24
- #{BLANK_HDR}
25
- <sections>
26
- <clause id='_' inline-header='false' obligation='normative'>
27
- <title>Clause</title>
28
- <p id='_'>
29
- <eref type='inline' bibitemid='iso123' citeas='ISO 123:--'/>
30
- <fn reference='1'>The standard is in press</fn>
31
- <eref type='inline' bibitemid='iso123' citeas='ISO 123:--'/>
32
- A.
33
- <fn reference='2'>
34
- <p id='_'>a footnote</p>
35
- </fn>
36
- <eref type='inline' bibitemid='fdis' citeas='ISO/FDIS 17664-1'/>
37
- <fn reference='3'>
38
- <p id='_'>Under preparation. (Stage at the time of publication ISO/FDIS 17664-1).</p>
39
- </fn>
40
- <eref type='inline' bibitemid='fdis' citeas='ISO/FDIS 17664-1'/>
41
- </p>
42
- </clause>
43
- </sections>
44
- <bibliography>
45
- <references id='_' normative='true' obligation='informative'>
46
- <title>Normative references</title>
47
- <p id='_'>
48
- The following documents are referred to in the text in such a way that
49
- some or all of their content constitutes requirements of this document.
50
- For dated references, only the edition cited applies. For undated
51
- references, the latest edition of the referenced document (including any
52
- amendments) applies.
53
- </p>
54
- <bibitem id='iso123' type='standard'>
55
- <title format='text/plain'>Standard</title>
56
- <docidentifier type='ISO'>ISO 123:—</docidentifier>
57
- <docnumber>123</docnumber>
58
- <date type='published'>
59
- <on>–</on>
60
- </date>
61
- <contributor>
62
- <role type='publisher'/>
63
- <organization>
64
- <name>International Organization for Standardization</name>
65
- <abbreviation>ISO</abbreviation>
66
- </organization>
67
- </contributor>
68
- <note format='text/plain' type='Unpublished-Status'>The standard is in press</note>
69
- </bibitem>
70
- <bibitem id='fdis' type='standard'>
71
- <fetched>#{Date.today}</fetched>
72
- <title type='title-intro' format='text/plain' language='fr' script='Latn'>Traitement de produits de soins de santé</title>
73
- <title type='title-main' format='text/plain' language='fr' script='Latn'>
74
- Informations relatives au traitement des dispositifs médicaux à
75
- fournir par le fabricant du dispositif
76
- </title>
77
- <title type='title-part' format='text/plain' language='fr' script='Latn'>Partie 1: Titre manque</title>
78
- <title type='main' format='text/plain' language='fr' script='Latn'>
79
- Traitement de produits de soins de santé — Informations relatives au
80
- traitement des dispositifs médicaux à fournir par le fabricant du
81
- dispositif — Partie 1: Titre manque
82
- </title>
83
- <uri type='src'>https://www.iso.org/standard/81720.html</uri>
84
- <uri type='rss'>https://www.iso.org/contents/data/standard/08/17/81720.detail.rss</uri>
85
- <docidentifier type='ISO'>ISO/FDIS 17664-1</docidentifier>
86
- <docidentifier type='URN'>urn:iso:std:iso-fdis:17664:-1:stage-50.00:ed-1:fr</docidentifier>
87
- <docnumber>17664</docnumber>
88
- <contributor>
89
- <role type='publisher'/>
90
- <organization>
91
- <name>International Organization for Standardization</name>
92
- <abbreviation>ISO</abbreviation>
93
- <uri>www.iso.org</uri>
94
- </organization>
95
- </contributor>
96
- <edition>1</edition>
97
- <note type='Unpublished-Status'>
98
- <p id='_'>Under preparation. (Stage at the time of publication ISO/FDIS 17664-1).</p>
99
- </note>
100
- <language>en</language>
101
- <language>fr</language>
102
- <script>Latn</script>
103
- <status>
104
- <stage>50</stage>
105
- <substage>00</substage>
106
- </status>
107
- <copyright>
108
- <from>unknown</from>
109
- <owner>
110
- <organization>
111
- <name>ISO/FDIS</name>
112
- </organization>
113
- </owner>
114
- </copyright>
115
- <relation type='obsoletes'>
116
- <bibitem type='standard'>
117
- <formattedref format='text/plain'>ISO 17664:2017</formattedref>
118
- </bibitem>
119
- </relation>
120
- <relation type='instance'>
121
- <bibitem type='standard'>
122
- <fetched>2020-11-03</fetched>
123
- <title type='title-intro' format='text/plain' language='fr' script='Latn'>Traitement de produits de soins de santé</title>
124
- <title type='title-main' format='text/plain' language='fr' script='Latn'>
125
- Informations relatives au traitement des dispositifs médicaux à
126
- fournir par le fabricant du dispositif
127
- </title>
128
- <title type='title-part' format='text/plain' language='fr' script='Latn'>Partie 1: Titre manque</title>
129
- <title type='main' format='text/plain' language='fr' script='Latn'>
130
- Traitement de produits de soins de santé — Informations relatives
131
- au traitement des dispositifs médicaux à fournir par le fabricant
132
- du dispositif — Partie 1: Titre manque
133
- </title>
134
- <uri type='src'>https://www.iso.org/standard/81720.html</uri>
135
- <uri type='rss'>https://www.iso.org/contents/data/standard/08/17/81720.detail.rss</uri>
136
- <docidentifier type='ISO'>ISO/FDIS 17664-1</docidentifier>
137
- <docidentifier type='URN'>urn:iso:std:iso-fdis:17664:-1:stage-50.00:ed-1:fr</docidentifier>
138
- <docnumber>17664</docnumber>
139
- <contributor>
140
- <role type='publisher'/>
141
- <organization>
142
- <name>International Organization for Standardization</name>
143
- <abbreviation>ISO</abbreviation>
144
- <uri>www.iso.org</uri>
145
- </organization>
146
- </contributor>
147
- <edition>1</edition>
148
- <note type='Unpublished-Status'>
149
- <p id='_'>Under preparation. (Stage at the time of publication ISO/FDIS 17664-1).</p>
150
- </note>
151
- <language>en</language>
152
- <language>fr</language>
153
- <script>Latn</script>
154
- <status>
155
- <stage>50</stage>
156
- <substage>00</substage>
157
- </status>
158
- <copyright>
159
- <from>unknown</from>
160
- <owner>
161
- <organization>
162
- <name>ISO/FDIS</name>
163
- </organization>
164
- </owner>
165
- </copyright>
166
- <relation type='obsoletes'>
167
- <bibitem type='standard'>
168
- <formattedref format='text/plain'>ISO 17664:2017</formattedref>
169
- </bibitem>
170
- </relation>
171
- <place>Geneva</place>
172
- </bibitem>
173
- </relation>
174
- <place>Geneva</place>
175
- </bibitem>
176
- </references>
177
- </bibliography>
178
- </iso-standard>
179
- OUTPUT
180
- end
181
-
182
- it "processes all-parts ISO reference" do
183
- #stub_fetch_ref(all_parts: true)
184
-
185
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
186
- #{ASCIIDOC_BLANK_HDR}
187
-
188
- == Clause
189
-
190
- <<iso123>>
191
-
192
- [bibliography]
193
- == Normative References
194
-
195
- * [[[iso123,ISO 123:1066 (all parts)]]] _Standard_
196
- INPUT
197
- #{BLANK_HDR}
198
- <sections>
199
- <clause id='_' inline-header='false' obligation='normative'>
200
- <title>Clause</title>
201
- <p id='_'>
202
- <eref type='inline' bibitemid='iso123' citeas='ISO 123:1066'/>
203
- </p>
204
- </clause>
205
- </sections>
206
- <bibliography><references id="_" obligation="informative" normative="true">
207
- <title>Normative references</title>
208
- <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>
209
- <bibitem id="iso123" type="standard">
210
- <title format="text/plain">Standard</title>
211
- <docidentifier>ISO 123:1066 (all parts)</docidentifier>
212
- <docnumber>123</docnumber>
213
- <date type="published">
214
- <on>1066</on>
215
- </date>
216
- <contributor>
217
- <role type="publisher"/>
218
- <organization>
219
- <name>International Organization for Standardization</name>
220
- <abbreviation>ISO</abbreviation>
221
- </organization>
222
- </contributor>
223
- <extent type="part"><referenceFrom>all</referenceFrom></extent>
224
- </bibitem>
225
- </references>
226
- </bibliography>
227
- </iso-standard>
228
- OUTPUT
229
- end
230
-
231
- it "processes non-ISO reference in Normative References" do
232
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
233
- #{ASCIIDOC_BLANK_HDR}
234
- [bibliography]
235
- == Normative References
236
-
237
- * [[[iso123,XYZ 123:1066 (all parts)]]] _Standard_
238
- INPUT
239
- #{BLANK_HDR}
240
- <sections>
241
-
242
- </sections><bibliography><references id="_" obligation="informative" normative="true">
243
- <title>Normative references</title>
244
- <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>
245
- <bibitem id="iso123">
246
- <formattedref format="application/x-isodoc+xml">
247
- <em>Standard</em>
248
- </formattedref>
249
- <docidentifier>XYZ 123:1066 (all parts)</docidentifier>
250
- <docnumber>123:1066 (all parts)</docnumber>
251
- </bibitem>
252
- </references>
253
- </bibliography>
254
- </iso-standard>
255
- OUTPUT
256
- end
257
-
258
- it "processes non-ISO reference in Bibliography" do
259
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
260
- #{ASCIIDOC_BLANK_HDR}
261
- [bibliography]
262
- == Bibliography
263
-
264
- * [[[iso123,1]]] _Standard_
265
- INPUT
266
- #{BLANK_HDR}
267
- <sections>
268
-
269
- </sections><bibliography><references id="_" obligation="informative" normative="false">
270
- <title>Bibliography</title>
271
- <bibitem id="iso123">
272
- <formattedref format="application/x-isodoc+xml">
273
- <em>Standard</em>
274
- </formattedref>
275
- <docidentifier type="metanorma">[1]</docidentifier>
276
- </bibitem>
277
- </references>
278
- </bibliography>
279
- </iso-standard>
280
- OUTPUT
281
- end
282
-
283
- private
284
-
285
- def mock_isobib_get_123
286
- expect(RelatonIso::IsoBibliography).to receive(:get).with("ISO 123", nil, {:lang=>"en", :title=>"Title", :usrlbl=>nil}) do
287
- RelatonIsoBib::XMLParser.from_xml(<<~"OUTPUT")
288
- <bibitem type=\"international-standard\" id=\"ISO123\">\n <fetched>#{Date.today}</fetched>\n<title format=\"text/plain\" language=\"en\" script=\"Latn\">Rubber latex -- Sampling</title>\n <title format=\"text/plain\" language=\"fr\" script=\"Latn\">Latex de caoutchouc -- ?chantillonnage</title>\n <uri type=\"src\">https://www.iso.org/standard/23281.html</uri>\n <uri type=\"obp\">https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>\n <uri type=\"rss\">https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>\n <docidentifier type="ISO">ISO 123:2001</docidentifier>\n <date type=\"published\">\n <on>2001</on>\n </date>\n <contributor>\n <role type=\"publisher\"/>\n <organization>\n <name>International Organization for Standardization</name>\n <abbreviation>ISO</abbreviation>\n <uri>www.iso.org</uri>\n </organization>\n </contributor>\n <edition>3</edition>\n <language>en</language>\n <language>fr</language>\n <script>Latn</script>\n <status>Published</status>\n <copyright>\n <from>2001</from>\n <owner>\n <organization>\n <name>ISO</name>\n <abbreviation></abbreviation>\n </organization>\n </owner>\n </copyright>\n <relation type=\"obsoletes\">\n <bibitem>\n <formattedref>ISO 123:1985</formattedref>\n </bibitem>\n </relation>\n <relation type=\"updates\">\n <bibitem>\n <formattedref>ISO 123:2001</formattedref>\n </bibitem>\n </relation>\n</bibitem>
289
- OUTPUT
290
- end
291
- end
292
-
293
- def mock_rfcbib_get_rfc8341
294
- expect(IETFBib::RfcBibliography).to receive(:get).with("RFC 8341", nil, {}) do
295
- IETFBib::XMLParser.from_xml(<<~"OUTPUT")
296
- <bibitem id="RFC8341">
297
- <fetched>#{Date.today}</fetched>
298
- <title format="text/plain" language="en" script="Latn">Network Configuration Access Control Model</title>
299
- <docidentifier type="IETF">RFC 8341</docidentifier>
300
- <date type="published">
301
- <on>2018</on>
302
- </date>
303
- <status>published</status>
304
- </bibitem>
305
- OUTPUT
306
- end
307
- end
308
-
309
- def mock_fdis
310
- expect(RelatonIso::IsoBibliography).to receive(:get).with("ISO/FDIS 17664-1", nil, {:lang=>"en", :title=>"Title", :usrlbl=>nil}) do
311
- RelatonIsoBib::XMLParser.from_xml(<<~"OUTPUT")
312
- <bibitem id="x" type="standard"> <fetched>#{Date.today}</fetched> <title type="title-intro" format="text/plain" language="fr" script="Latn">Traitement de produits de soins de santé</title> <title type="title-main" format="text/plain" language="fr" script="Latn">Informations relatives au traitement des dispositifs médicaux à fournir par le fabricant du dispositif</title> <title type="title-part" format="text/plain" language="fr" script="Latn">Partie 1: Titre manque</title> <title type="main" format="text/plain" language="fr" script="Latn">Traitement de produits de soins de santé — Informations relatives au traitement des dispositifs médicaux à fournir par le fabricant du dispositif — Partie 1: Titre manque</title> <uri type="src">https://www.iso.org/standard/81720.html</uri> <uri type="rss">https://www.iso.org/contents/data/standard/08/17/81720.detail.rss</uri> <docidentifier type="ISO">ISO/FDIS 17664-1</docidentifier> <docidentifier type="URN">urn:iso:std:iso-fdis:17664:-1:stage-50.00:ed-1:fr</docidentifier> <docnumber>17664</docnumber> <contributor> <role type="publisher"/> <organization> <name>International Organization for Standardization</name> <abbreviation>ISO</abbreviation> <uri>www.iso.org</uri> </organization> </contributor> <edition>1</edition> <language>en</language> <language>fr</language> <script>Latn</script> <status> <stage>50</stage> <substage>00</substage> </status> <copyright> <from>unknown</from> <owner> <organization> <name>ISO/FDIS</name> </organization> </owner> </copyright> <relation type="obsoletes"> <bibitem type="standard"> <formattedref format="text/plain">ISO 17664:2017</formattedref> </bibitem> </relation> <relation type="instance"> <bibitem type="standard"> <fetched>2020-11-03</fetched> <title type="title-intro" format="text/plain" language="fr" script="Latn">Traitement de produits de soins de santé</title> <title type="title-main" format="text/plain" language="fr" script="Latn">Informations relatives au traitement des dispositifs médicaux à fournir par le fabricant du dispositif</title> <title type="title-part" format="text/plain" language="fr" script="Latn">Partie 1: Titre manque</title> <title type="main" format="text/plain" language="fr" script="Latn">Traitement de produits de soins de santé — Informations relatives au traitement des dispositifs médicaux à fournir par le fabricant du dispositif — Partie 1: Titre manque</title> <uri type="src">https://www.iso.org/standard/81720.html</uri> <uri type="rss">https://www.iso.org/contents/data/standard/08/17/81720.detail.rss</uri> <docidentifier type="ISO">ISO/FDIS 17664-1</docidentifier> <docidentifier type="URN">urn:iso:std:iso-fdis:17664:-1:stage-50.00:ed-1:fr</docidentifier> <docnumber>17664</docnumber> <contributor> <role type="publisher"/> <organization> <name>International Organization for Standardization</name> <abbreviation>ISO</abbreviation> <uri>www.iso.org</uri> </organization> </contributor> <edition>1</edition> <language>en</language> <language>fr</language> <script>Latn</script> <status> <stage>50</stage> <substage>00</substage> </status> <copyright> <from>unknown</from> <owner> <organization> <name>ISO/FDIS</name> </organization> </owner> </copyright> <relation type="obsoletes"> <bibitem type="standard"> <formattedref format="text/plain">ISO 17664:2017</formattedref> </bibitem> </relation> <place>Geneva</place> </bibitem> </relation> <place>Geneva</place></bibitem>
313
- OUTPUT
314
- end
315
- end
316
-
317
- end