metanorma-jis 0.1.7 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7b71b1b65b6b087e5dd836fd09c79edf376791e5611ff0128fe00fb70db2a3a7
4
- data.tar.gz: a237948040d108d1753d270b73b38f6ff28d233d3756ff9146bcc308ce46755f
3
+ metadata.gz: b56f3b88aec817a7080654fe444dd0095357bff6cff8e87c2c1070cc76fbfe5d
4
+ data.tar.gz: 9118aa499de45316f061c65ed9119fc58db446c8053d088ab938554b0bbf7b3a
5
5
  SHA512:
6
- metadata.gz: f3b21634058781599347ebfe3dfc97c490f244a99d275c6193e5f7bbaaa427eb8c5c8e25b22a8ce7cd62a2ee497463085e47a9e0a33e2d84c9499a7f70d9756e
7
- data.tar.gz: 3f9b6ab9ec5d19ab995ac9d734a9a96d0b09dcab67a062fd599d08205763610dd5ca2b5a32d2b9cb998395853cf913594f17e200efb48b17c298d4c38865328c
6
+ metadata.gz: 0b27df1700c813a49720e826ee77e6d58e62ca22b8afff0bbe6561d1a51a3403629490edfc254320bd98bae2399ba97197d90c3b590568b8c5d9e243c1ce8732
7
+ data.tar.gz: deeaef221cc6143155580d346cc16e62c1dd86190d523f907bfc5d5dd0216968323a04053fe147e34fae1be29dd6c87cac00471c5cebb9f2894a0c9dd24f669b
@@ -277,6 +277,10 @@
277
277
  <xsl:with-param name="num" select="$num"/>
278
278
  </xsl:apply-templates>
279
279
 
280
+ <xsl:if test="not(/*/*[local-name()='preface']/*[local-name() = 'clause'][@type = 'toc'])">
281
+ <fo:block><!-- prevent fop error for empty document --></fo:block>
282
+ </xsl:if>
283
+
280
284
  </fo:flow>
281
285
 
282
286
  </fo:page-sequence>
@@ -515,6 +519,10 @@
515
519
 
516
520
  <xsl:apply-templates select="*" mode="page"/>
517
521
 
522
+ <xsl:if test="not(*)">
523
+ <fo:block><!-- prevent fop error for empty document --></fo:block>
524
+ </xsl:if>
525
+
518
526
  </fo:flow>
519
527
  </fo:page-sequence>
520
528
  </xsl:for-each>
@@ -701,7 +709,8 @@
701
709
  <fo:inline/>
702
710
  <fo:footnote-body>
703
711
  <fo:block font-size="8.5pt">
704
- <xsl:apply-templates select="/*/*[local-name() = 'preface']/*[local-name() = 'clause'][@type = 'inner-cover-note']"/> <!-- /*[not(local-name() = 'title')] -->
712
+ <!-- <xsl:apply-templates select="/*/*[local-name() = 'preface']/*[local-name() = 'clause'][@type = 'inner-cover-note']" /> -->
713
+ <xsl:apply-templates select="/*/*[local-name() = 'boilerplate']"/>
705
714
  </fo:block>
706
715
  </fo:footnote-body>
707
716
  </fo:footnote>
@@ -1153,7 +1162,7 @@
1153
1162
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
1154
1163
  </xsl:if>
1155
1164
 
1156
- <xsl:if test="parent::jis:clause[@type = 'inner-cover-note']">
1165
+ <xsl:if test="parent::jis:clause[@type = 'inner-cover-note'] or ancestor::jis:boilerplate">
1157
1166
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
1158
1167
  </xsl:if>
1159
1168
 
@@ -10022,14 +10031,16 @@
10022
10031
 
10023
10032
  <xsl:template match="*[local-name() = 'annex']">
10024
10033
  <fo:block break-after="page"/>
10025
- <fo:block id="{@id}">
10034
+ <fo:block>
10026
10035
 
10027
10036
  <xsl:call-template name="setBlockSpanAll"/>
10028
10037
 
10029
10038
  <xsl:call-template name="refine_annex_style"/>
10030
10039
 
10031
10040
  </fo:block>
10032
- <xsl:apply-templates/>
10041
+ <fo:block id="{@id}">
10042
+ <xsl:apply-templates/>
10043
+ </fo:block>
10033
10044
  </xsl:template>
10034
10045
 
10035
10046
  <xsl:template name="refine_annex_style">
@@ -95,8 +95,89 @@
95
95
  <ref name="pagebreak"/>
96
96
  <ref name="hr"/>
97
97
  <ref name="bookmark"/>
98
+ <ref name="amend"/>
98
99
  </choice>
99
100
  </define>
101
+ <define name="amend">
102
+ <element name="amend">
103
+ <ref name="AmendType"/>
104
+ </element>
105
+ </define>
106
+ <define name="AmendType">
107
+ <optional>
108
+ <attribute name="id">
109
+ <data type="ID"/>
110
+ </attribute>
111
+ </optional>
112
+ <attribute name="change">
113
+ <choice>
114
+ <value>add</value>
115
+ <value>modify</value>
116
+ <value>delete</value>
117
+ <value>replace</value>
118
+ </choice>
119
+ </attribute>
120
+ <optional>
121
+ <attribute name="path"/>
122
+ </optional>
123
+ <optional>
124
+ <attribute name="path_end"/>
125
+ </optional>
126
+ <optional>
127
+ <attribute name="title"/>
128
+ </optional>
129
+ <optional>
130
+ <element name="location">
131
+ <zeroOrMore>
132
+ <choice>
133
+ <ref name="locality"/>
134
+ <ref name="localityStack"/>
135
+ </choice>
136
+ </zeroOrMore>
137
+ </element>
138
+ </optional>
139
+ <optional>
140
+ <element name="description">
141
+ <zeroOrMore>
142
+ <ref name="BasicBlock"/>
143
+ </zeroOrMore>
144
+ </element>
145
+ </optional>
146
+ <optional>
147
+ <element name="newcontent">
148
+ <optional>
149
+ <attribute name="id">
150
+ <data type="ID"/>
151
+ </attribute>
152
+ </optional>
153
+ <zeroOrMore>
154
+ <ref name="BasicBlock"/>
155
+ </zeroOrMore>
156
+ </element>
157
+ </optional>
158
+ <zeroOrMore>
159
+ <ref name="classification"/>
160
+ </zeroOrMore>
161
+ <zeroOrMore>
162
+ <ref name="contributor"/>
163
+ </zeroOrMore>
164
+ </define>
165
+ <define name="classification">
166
+ <element name="classification">
167
+ <ref name="classification_tag"/>
168
+ <ref name="classification_value"/>
169
+ </element>
170
+ </define>
171
+ <define name="classification_tag">
172
+ <element name="tag">
173
+ <text/>
174
+ </element>
175
+ </define>
176
+ <define name="classification_value">
177
+ <element name="value">
178
+ <text/>
179
+ </element>
180
+ </define>
100
181
  <define name="paragraph">
101
182
  <element name="p">
102
183
  <ref name="ParagraphType"/>
@@ -939,18 +1020,12 @@
939
1020
  </optional>
940
1021
  <optional>
941
1022
  <attribute name="width">
942
- <choice>
943
- <data type="int"/>
944
- <value>auto</value>
945
- </choice>
1023
+ <ref name="ImageSize"/>
946
1024
  </attribute>
947
1025
  </optional>
948
1026
  <optional>
949
1027
  <attribute name="height">
950
- <choice>
951
- <data type="int"/>
952
- <value>auto</value>
953
- </choice>
1028
+ <ref name="ImageSize"/>
954
1029
  </attribute>
955
1030
  </optional>
956
1031
  <optional>
@@ -965,6 +1040,14 @@
965
1040
  </attribute>
966
1041
  </optional>
967
1042
  </define>
1043
+ <define name="ImageSize">
1044
+ <choice>
1045
+ <data type="string">
1046
+ <param name="pattern">\d+([.]\d+)?(%?)</param>
1047
+ </data>
1048
+ <value>auto</value>
1049
+ </choice>
1050
+ </define>
968
1051
  <define name="video">
969
1052
  <element name="video">
970
1053
  <attribute name="id">
@@ -9,11 +9,42 @@
9
9
  -->
10
10
  <include href="biblio.rng">
11
11
  <define name="BibData">
12
- <ref name="BibliographicItem"/>
12
+ <ref name="StandardBibliographicItem"/>
13
13
  <optional>
14
14
  <ref name="ext"/>
15
15
  </optional>
16
16
  </define>
17
+ <define name="docrelation">
18
+ <element name="relation">
19
+ <attribute name="type">
20
+ <ref name="DocRelationType"/>
21
+ </attribute>
22
+ <optional>
23
+ <element name="description">
24
+ <ref name="FormattedString"/>
25
+ </element>
26
+ </optional>
27
+ <element name="bibitem">
28
+ <ref name="StandardReducedBibliographicItem"/>
29
+ </element>
30
+ <choice>
31
+ <zeroOrMore>
32
+ <ref name="locality"/>
33
+ </zeroOrMore>
34
+ <zeroOrMore>
35
+ <ref name="localityStack"/>
36
+ </zeroOrMore>
37
+ </choice>
38
+ <choice>
39
+ <zeroOrMore>
40
+ <ref name="sourceLocality"/>
41
+ </zeroOrMore>
42
+ <zeroOrMore>
43
+ <ref name="sourceLocalityStack"/>
44
+ </zeroOrMore>
45
+ </choice>
46
+ </element>
47
+ </define>
17
48
  </include>
18
49
  <define name="ext">
19
50
  <element name="ext">
@@ -161,4 +192,16 @@
161
192
  </optional>
162
193
  </element>
163
194
  </define>
195
+ <define name="StandardBibliographicItem">
196
+ <ref name="BibliographicItem"/>
197
+ <zeroOrMore>
198
+ <ref name="amend"/>
199
+ </zeroOrMore>
200
+ </define>
201
+ <define name="StandardReducedBibliographicItem">
202
+ <ref name="ReducedBibliographicItem"/>
203
+ <zeroOrMore>
204
+ <ref name="amend"/>
205
+ </zeroOrMore>
206
+ </define>
164
207
  </grammar>
@@ -241,6 +241,9 @@
241
241
  </element>
242
242
  </define>
243
243
  <define name="FullNameType">
244
+ <optional>
245
+ <ref name="name_abbreviation"/>
246
+ </optional>
244
247
  <choice>
245
248
  <group>
246
249
  <zeroOrMore>
@@ -266,6 +269,11 @@
266
269
  <ref name="variantname"/>
267
270
  </zeroOrMore>
268
271
  </define>
272
+ <define name="name_abbreviation">
273
+ <element name="abbreviation">
274
+ <ref name="LocalizedString"/>
275
+ </element>
276
+ </define>
269
277
  <define name="prefix">
270
278
  <element name="prefix">
271
279
  <ref name="LocalizedString"/>
@@ -870,6 +878,9 @@
870
878
  <optional>
871
879
  <ref name="validity"/>
872
880
  </optional>
881
+ <optional>
882
+ <ref name="depiction"/>
883
+ </optional>
873
884
  </define>
874
885
  <define name="btitle">
875
886
  <element name="title">
@@ -159,7 +159,7 @@ module Metanorma
159
159
  end
160
160
 
161
161
  def iso_id_params_core(node)
162
- pub = (node.attr("publisher") || "JIS").split(/[;,]/)
162
+ pub = iso_id_pub(node)
163
163
  ret = { number: node.attr("docnumber") || "0",
164
164
  part: node.attr("partnumber"),
165
165
  series: node.attr("docseries"),
@@ -17,10 +17,19 @@
17
17
  these elements; we just want one namespace for any child grammars
18
18
  of this.
19
19
  -->
20
- <!-- VERSION v1.2.9 -->
20
+ <!-- VERSION v1.2.12 -->
21
21
  <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
22
22
  <include href="reqt.rng"/>
23
23
  <include href="basicdoc.rng">
24
+ <define name="amend">
25
+ <element name="amend">
26
+ <ref name="BlockAttributes"/>
27
+ <ref name="AmendType"/>
28
+ <zeroOrMore>
29
+ <ref name="autonumber"/>
30
+ </zeroOrMore>
31
+ </element>
32
+ </define>
24
33
  <define name="admonition">
25
34
  <element name="admonition">
26
35
  <attribute name="type">
@@ -2319,69 +2328,6 @@
2319
2328
  <ref name="CitationType"/>
2320
2329
  </element>
2321
2330
  </define>
2322
- <define name="amend">
2323
- <element name="amend">
2324
- <optional>
2325
- <attribute name="id">
2326
- <data type="ID"/>
2327
- </attribute>
2328
- </optional>
2329
- <attribute name="change">
2330
- <choice>
2331
- <value>add</value>
2332
- <value>modify</value>
2333
- <value>delete</value>
2334
- <value>replace</value>
2335
- </choice>
2336
- </attribute>
2337
- <optional>
2338
- <attribute name="path"/>
2339
- </optional>
2340
- <optional>
2341
- <attribute name="path_end"/>
2342
- </optional>
2343
- <optional>
2344
- <attribute name="title"/>
2345
- </optional>
2346
- <ref name="BlockAttributes"/>
2347
- <optional>
2348
- <element name="location">
2349
- <zeroOrMore>
2350
- <ref name="locality"/>
2351
- </zeroOrMore>
2352
- </element>
2353
- </optional>
2354
- <zeroOrMore>
2355
- <ref name="autonumber"/>
2356
- </zeroOrMore>
2357
- <optional>
2358
- <element name="description">
2359
- <zeroOrMore>
2360
- <ref name="BasicBlock"/>
2361
- </zeroOrMore>
2362
- </element>
2363
- </optional>
2364
- <optional>
2365
- <element name="newcontent">
2366
- <optional>
2367
- <attribute name="id">
2368
- <data type="ID"/>
2369
- </attribute>
2370
- </optional>
2371
- <zeroOrMore>
2372
- <ref name="BasicBlock"/>
2373
- </zeroOrMore>
2374
- </element>
2375
- </optional>
2376
- <optional>
2377
- <element name="description">
2378
- <zeroOrMore>
2379
- <ref name="BasicBlock"/>
2380
- </zeroOrMore>
2381
- </element>
2382
- </optional>
2383
- </element>
2384
- </define>
2385
2331
  <define name="autonumber">
2386
2332
  <element name="autonumber">
2387
2333
  <attribute name="type">
@@ -207,20 +207,4 @@
207
207
  <value>permission</value>
208
208
  </choice>
209
209
  </define>
210
- <define name="classification">
211
- <element name="classification">
212
- <ref name="classification_tag"/>
213
- <ref name="classification_value"/>
214
- </element>
215
- </define>
216
- <define name="classification_tag">
217
- <element name="tag">
218
- <text/>
219
- </element>
220
- </define>
221
- <define name="classification_value">
222
- <element name="value">
223
- <text/>
224
- </element>
225
- </define>
226
210
  </grammar>
@@ -1,6 +1,6 @@
1
1
  module Metanorma
2
2
  module JIS
3
- VERSION = "0.1.7".freeze
3
+ VERSION = "0.2.0".freeze
4
4
  end
5
5
  end
6
6
 
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
31
31
  spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
32
32
 
33
33
  spec.add_dependency "japanese_calendar", "~> 0"
34
- spec.add_dependency "metanorma-iso", "~> 2.6.0"
34
+ spec.add_dependency "metanorma-iso", "~> 2.7.0"
35
35
  spec.add_dependency "pubid-jis"
36
36
 
37
37
  spec.add_development_dependency "debug"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-jis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-22 00:00:00.000000000 Z
11
+ date: 2024-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: japanese_calendar
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 2.6.0
33
+ version: 2.7.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 2.6.0
40
+ version: 2.7.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: pubid-jis
43
43
  requirement: !ruby/object:Gem::Requirement