metanorma-cc 2.4.4 → 2.4.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 02500ebd02ebe65c4c1a840c9a57022da0f064f3da738a801811746d04b18cbd
4
- data.tar.gz: 52ecdef573a1d9e59d3a4ee98bb5de87149badb22e2836e9397b43e2ebdcaea4
3
+ metadata.gz: cd1570c8a37a6ec0bcd7e15acd14836d3541d7688eef69fb191b9bc0deb3c8b5
4
+ data.tar.gz: ffd05f720ddb23f881a45a42f8a61cf5ee1337e7d5025c10160adc4cf395b084
5
5
  SHA512:
6
- metadata.gz: 0ec7d7f403145d1306fa3865c59fdaf8e1314b2e0d6abc1060b2a326b03b4703f05ad0aaa9cd0eba7528496c6e70d96f04065bf577f95d08e3272cee54cc431e
7
- data.tar.gz: a7e0ee3a1dc9bf6ee378ad5ef6e3ebd372e2834f65c4a3ec3526c1fc569b8cc2015a78326f0bac59428247d18ee983a5652fe5818ba09bddeb8a460b51d7873c
6
+ metadata.gz: 12d79a97ae2a07b027eb5ad2c628676ca5fd6b652bea3dfe2bd7798d0b8fadece4b8e42a73a7c0ab6f915d2c894e16993547c949dbffee6b434cbc0e14ad01dd
7
+ data.tar.gz: 42406628678a495a575224b602072bfa564325aeb3150241323f7d611690073c540f6a8b499e8a6e43693f792e69864128b17cdcf957cb17a99e311f945722fb
@@ -822,6 +822,7 @@
822
822
  <xsl:variable name="zero_width_space">​</xsl:variable>
823
823
  <xsl:variable name="hair_space"> </xsl:variable>
824
824
  <xsl:variable name="en_dash">–</xsl:variable>
825
+ <xsl:variable name="em_dash">—</xsl:variable>
825
826
 
826
827
  <xsl:template name="getTitle">
827
828
  <xsl:param name="name"/>
@@ -1138,6 +1139,10 @@
1138
1139
 
1139
1140
  </xsl:attribute-set> <!-- example-name-style -->
1140
1141
 
1142
+ <xsl:template name="refine_example-name-style">
1143
+
1144
+ </xsl:template>
1145
+
1141
1146
  <xsl:attribute-set name="example-p-style">
1142
1147
 
1143
1148
  <xsl:attribute name="margin-bottom">14pt</xsl:attribute>
@@ -1154,6 +1159,10 @@
1154
1159
 
1155
1160
  </xsl:attribute-set> <!-- termexample-name-style -->
1156
1161
 
1162
+ <xsl:template name="refine_termexample-name-style">
1163
+
1164
+ </xsl:template>
1165
+
1157
1166
  <!-- ========================== -->
1158
1167
  <!-- Table styles -->
1159
1168
  <!-- ========================== -->
@@ -1316,6 +1325,10 @@
1316
1325
 
1317
1326
  </xsl:attribute-set> <!-- table-fn-style -->
1318
1327
 
1328
+ <xsl:template name="refine_table-fn-style">
1329
+
1330
+ </xsl:template>
1331
+
1319
1332
  <xsl:attribute-set name="table-fn-number-style">
1320
1333
  <xsl:attribute name="font-size">80%</xsl:attribute>
1321
1334
  <xsl:attribute name="padding-right">5mm</xsl:attribute>
@@ -1324,6 +1337,10 @@
1324
1337
 
1325
1338
  </xsl:attribute-set> <!-- table-fn-number-style -->
1326
1339
 
1340
+ <xsl:template name="refine_table-fn-number-style">
1341
+
1342
+ </xsl:template>
1343
+
1327
1344
  <xsl:attribute-set name="fn-container-body-style">
1328
1345
  <xsl:attribute name="text-indent">0</xsl:attribute>
1329
1346
  <xsl:attribute name="start-indent">0</xsl:attribute>
@@ -2617,6 +2634,7 @@
2617
2634
  <!-- centered table when table name is centered (see table-name-style) -->
2618
2635
 
2619
2636
  <fo:table table-layout="fixed" width="100%" xsl:use-attribute-sets="table-container-style">
2637
+
2620
2638
  <fo:table-column column-width="proportional-column-width(1)"/>
2621
2639
  <fo:table-column column-width="{@width}"/>
2622
2640
  <fo:table-column column-width="proportional-column-width(1)"/>
@@ -3658,8 +3676,9 @@
3658
3676
  <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
3659
3677
 
3660
3678
  <fo:block xsl:use-attribute-sets="table-fn-style">
3661
-
3679
+ <xsl:call-template name="refine_table-fn-style"/>
3662
3680
  <fo:inline id="{@id}" xsl:use-attribute-sets="table-fn-number-style">
3681
+ <xsl:call-template name="refine_table-fn-number-style"/>
3663
3682
 
3664
3683
  <xsl:value-of select="@reference"/>
3665
3684
 
@@ -4800,11 +4819,16 @@
4800
4819
  <xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
4801
4820
  <!-- <xsl:variable name="text" select="normalize-space(.)"/> --> <!-- https://github.com/metanorma/metanorma-iso/issues/1115 -->
4802
4821
  <xsl:variable name="text" select="."/>
4803
- <fo:inline font-size="75%" role="SKIP">
4822
+ <xsl:variable name="ratio_">
4823
+ 0.75
4824
+ </xsl:variable>
4825
+ <xsl:variable name="ratio" select="number(normalize-space($ratio_))"/>
4826
+ <fo:inline font-size="{$ratio * 100}%" role="SKIP">
4804
4827
  <xsl:if test="string-length($text) &gt; 0">
4805
4828
  <xsl:variable name="smallCapsText">
4806
4829
  <xsl:call-template name="recursiveSmallCaps">
4807
4830
  <xsl:with-param name="text" select="$text"/>
4831
+ <xsl:with-param name="ratio" select="$ratio"/>
4808
4832
  </xsl:call-template>
4809
4833
  </xsl:variable>
4810
4834
  <!-- merge neighboring fo:inline -->
@@ -4841,12 +4865,13 @@
4841
4865
 
4842
4866
  <xsl:template name="recursiveSmallCaps">
4843
4867
  <xsl:param name="text"/>
4868
+ <xsl:param name="ratio"/>
4844
4869
  <xsl:variable name="char" select="substring($text,1,1)"/>
4845
4870
  <!-- <xsl:variable name="upperCase" select="translate($char, $lower, $upper)"/> -->
4846
4871
  <xsl:variable name="upperCase" select="java:toUpperCase(java:java.lang.String.new($char))"/>
4847
4872
  <xsl:choose>
4848
4873
  <xsl:when test="$char=$upperCase">
4849
- <fo:inline font-size="{100 div 0.75}%" role="SKIP">
4874
+ <fo:inline font-size="{100 div $ratio}%" role="SKIP">
4850
4875
  <xsl:value-of select="$upperCase"/>
4851
4876
  </fo:inline>
4852
4877
  </xsl:when>
@@ -4857,6 +4882,7 @@
4857
4882
  <xsl:if test="string-length($text) &gt; 1">
4858
4883
  <xsl:call-template name="recursiveSmallCaps">
4859
4884
  <xsl:with-param name="text" select="substring($text,2)"/>
4885
+ <xsl:with-param name="ratio" select="$ratio"/>
4860
4886
  </xsl:call-template>
4861
4887
  </xsl:if>
4862
4888
  </xsl:template>
@@ -4893,6 +4919,9 @@
4893
4919
  <xsl:if test="$key = 'font-family' or $key = 'font-size' or $key = 'color'">
4894
4920
  <style name="{$key}"><xsl:value-of select="$value"/></style>
4895
4921
  </xsl:if>
4922
+ <xsl:if test="$key = 'text-indent'">
4923
+ <style name="padding-left"><xsl:value-of select="$value"/></style>
4924
+ </xsl:if>
4896
4925
  </xsl:for-each>
4897
4926
  </xsl:variable>
4898
4927
  <xsl:variable name="styles" select="xalan:nodeset($styles_)"/>
@@ -6295,6 +6324,11 @@
6295
6324
  </xsl:call-template>
6296
6325
  </xsl:template>
6297
6326
 
6327
+ <!-- command between two xref points to non-standard bibitem -->
6328
+ <xsl:template match="text()[. = ','][preceding-sibling::node()[1][local-name() = 'sup'][*[local-name() = 'xref'][@type = 'footnote']] and following-sibling::node()[1][local-name() = 'sup'][*[local-name() = 'xref'][@type = 'footnote']]]">
6329
+ <xsl:value-of select="."/>
6330
+ </xsl:template>
6331
+
6298
6332
  <!-- ====== -->
6299
6333
  <!-- formula -->
6300
6334
  <!-- ====== -->
@@ -6996,6 +7030,8 @@
6996
7030
  </xsl:attribute>
6997
7031
  </xsl:template>
6998
7032
 
7033
+ <xsl:variable name="regex_starts_with_digit">^[0-9].*</xsl:variable>
7034
+
6999
7035
  <xsl:template match="*[local-name() = 'svg'][not(@width and @height)]" mode="svg_update">
7000
7036
  <xsl:copy>
7001
7037
  <xsl:apply-templates select="@*" mode="svg_update"/>
@@ -7014,7 +7050,8 @@
7014
7050
 
7015
7051
  <xsl:attribute name="width">
7016
7052
  <xsl:choose>
7017
- <xsl:when test="$parent_image_width != '' and $parent_image_width != 'auto'"><xsl:value-of select="$parent_image_width"/></xsl:when>
7053
+ <!-- width is non 'auto', 'text-width', 'full-page-width' or 'narrow' -->
7054
+ <xsl:when test="$parent_image_width != '' and normalize-space(java:matches(java:java.lang.String.new($parent_image_width), $regex_starts_with_digit)) = 'true'"><xsl:value-of select="$parent_image_width"/></xsl:when>
7018
7055
  <xsl:when test="$width != ''">
7019
7056
  <xsl:value-of select="round($width)"/>
7020
7057
  </xsl:when>
@@ -7023,7 +7060,8 @@
7023
7060
  </xsl:attribute>
7024
7061
  <xsl:attribute name="height">
7025
7062
  <xsl:choose>
7026
- <xsl:when test="$parent_image_height != '' and $parent_image_height != 'auto'"><xsl:value-of select="$parent_image_height"/></xsl:when>
7063
+ <!-- height non 'auto', 'text-width', 'full-page-width' or 'narrow' -->
7064
+ <xsl:when test="$parent_image_height != '' and normalize-space(java:matches(java:java.lang.String.new($parent_image_height), $regex_starts_with_digit)) = 'true'"><xsl:value-of select="$parent_image_height"/></xsl:when>
7027
7065
  <xsl:when test="$height != ''">
7028
7066
  <xsl:value-of select="round($height)"/>
7029
7067
  </xsl:when>
@@ -7040,7 +7078,7 @@
7040
7078
  <xsl:variable name="parent_image_width" select="normalize-space(ancestor::*[2][local-name() = 'image']/@width)"/>
7041
7079
  <xsl:attribute name="width">
7042
7080
  <xsl:choose>
7043
- <xsl:when test="$parent_image_width != '' and $parent_image_width != 'auto'"><xsl:value-of select="$parent_image_width"/></xsl:when>
7081
+ <xsl:when test="$parent_image_width != '' and normalize-space(java:matches(java:java.lang.String.new($parent_image_width), $regex_starts_with_digit)) = 'true'"><xsl:value-of select="$parent_image_width"/></xsl:when>
7044
7082
  <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
7045
7083
  </xsl:choose>
7046
7084
  </xsl:attribute>
@@ -7051,7 +7089,7 @@
7051
7089
  <xsl:variable name="parent_image_height" select="normalize-space(ancestor::*[2][local-name() = 'image']/@height)"/>
7052
7090
  <xsl:attribute name="height">
7053
7091
  <xsl:choose>
7054
- <xsl:when test="$parent_image_height != '' and $parent_image_height != 'auto'"><xsl:value-of select="$parent_image_height"/></xsl:when>
7092
+ <xsl:when test="$parent_image_height != '' and normalize-space(java:matches(java:java.lang.String.new($parent_image_height), $regex_starts_with_digit)) = 'true'"><xsl:value-of select="$parent_image_height"/></xsl:when>
7055
7093
  <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
7056
7094
  </xsl:choose>
7057
7095
  </xsl:attribute>
@@ -8515,6 +8553,7 @@
8515
8553
  <xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'name']">
8516
8554
  <xsl:if test="normalize-space() != ''">
8517
8555
  <fo:inline xsl:use-attribute-sets="termexample-name-style">
8556
+ <xsl:call-template name="refine_termexample-name-style"/>
8518
8557
  <xsl:apply-templates/>
8519
8558
  </fo:inline>
8520
8559
  </xsl:if>
@@ -8665,6 +8704,7 @@
8665
8704
  </xsl:when>
8666
8705
  <xsl:otherwise>
8667
8706
  <fo:inline xsl:use-attribute-sets="example-name-style">
8707
+ <xsl:call-template name="refine_example-name-style"/>
8668
8708
  <xsl:apply-templates/>
8669
8709
  </fo:inline>
8670
8710
  </xsl:otherwise>
@@ -9876,6 +9916,7 @@
9876
9916
  <xsl:template match="*[local-name() = 'references'][@normative='true']/*[local-name() = 'bibitem']" name="bibitem" priority="2">
9877
9917
 
9878
9918
  <fo:block id="{@id}" xsl:use-attribute-sets="bibitem-normative-style">
9919
+
9879
9920
  <xsl:call-template name="processBibitem"/>
9880
9921
  </fo:block>
9881
9922
 
@@ -9917,6 +9958,7 @@
9917
9958
  <xsl:when test="@hidden = 'true'"><!-- skip --></xsl:when>
9918
9959
  <xsl:otherwise>
9919
9960
  <fo:list-item id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-item-style">
9961
+
9920
9962
  <fo:list-item-label end-indent="label-end()">
9921
9963
  <fo:block role="SKIP">
9922
9964
  <fo:inline role="SKIP">
@@ -11686,4 +11728,6 @@
11686
11728
  </xsl:if>
11687
11729
  </xsl:template>
11688
11730
 
11731
+ <!-- update -->
11732
+
11689
11733
  </xsl:stylesheet>
@@ -208,7 +208,9 @@
208
208
  </define>
209
209
  <define name="roledescription">
210
210
  <element name="description">
211
- <ref name="FormattedString"/>
211
+ <oneOrMore>
212
+ <ref name="TextElement"/>
213
+ </oneOrMore>
212
214
  </element>
213
215
  </define>
214
216
  <define name="person">
@@ -333,7 +335,9 @@
333
335
  </define>
334
336
  <define name="affiliationdescription">
335
337
  <element name="description">
336
- <ref name="FormattedString"/>
338
+ <oneOrMore>
339
+ <ref name="TextElement"/>
340
+ </oneOrMore>
337
341
  </element>
338
342
  </define>
339
343
  <define name="organization">
@@ -897,7 +901,9 @@
897
901
  </define>
898
902
  <define name="formattedref">
899
903
  <element name="formattedref">
900
- <ref name="FormattedString"/>
904
+ <oneOrMore>
905
+ <ref name="TextElement"/>
906
+ </oneOrMore>
901
907
  </element>
902
908
  </define>
903
909
  <define name="license">
@@ -942,7 +948,9 @@
942
948
  <optional>
943
949
  <attribute name="type"/>
944
950
  </optional>
945
- <ref name="FormattedString"/>
951
+ <zeroOrMore>
952
+ <ref name="TextElement"/>
953
+ </zeroOrMore>
946
954
  </define>
947
955
  <!-- TitleType = ( "alternative" | "original" | "unofficial" | "subtitle" | "main" ) -->
948
956
  <define name="TypedUri">
@@ -1042,7 +1050,9 @@
1042
1050
  <optional>
1043
1051
  <attribute name="script"/>
1044
1052
  </optional>
1045
- <text/>
1053
+ <oneOrMore>
1054
+ <ref name="TextElement"/>
1055
+ </oneOrMore>
1046
1056
  </element>
1047
1057
  </define>
1048
1058
  <define name="docnumber">
@@ -1267,12 +1277,16 @@
1267
1277
  <optional>
1268
1278
  <attribute name="type"/>
1269
1279
  </optional>
1270
- <ref name="FormattedString"/>
1280
+ <oneOrMore>
1281
+ <ref name="TextElement"/>
1282
+ </oneOrMore>
1271
1283
  </element>
1272
1284
  </define>
1273
1285
  <define name="bibabstract">
1274
1286
  <element name="abstract">
1275
- <ref name="FormattedString"/>
1287
+ <oneOrMore>
1288
+ <ref name="TextElement"/>
1289
+ </oneOrMore>
1276
1290
  </element>
1277
1291
  </define>
1278
1292
  <define name="copyright">
@@ -1377,7 +1391,9 @@
1377
1391
  </attribute>
1378
1392
  <optional>
1379
1393
  <element name="description">
1380
- <ref name="FormattedString"/>
1394
+ <oneOrMore>
1395
+ <ref name="TextElement"/>
1396
+ </oneOrMore>
1381
1397
  </element>
1382
1398
  </optional>
1383
1399
  <element name="bibitem">
@@ -1,5 +1,5 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <grammar ns='https://www.metanorma.org/ns/cc' xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
2
+ <grammar ns='https://www.metanorma.org/ns/cc' xmlns="http://relaxng.org/ns/structure/1.0">
3
3
  <!--
4
4
  VERSION v1.2.1
5
5
  default namespace = "http://riboseinc.com/csd"
@@ -14,23 +14,8 @@
14
14
  </start>
15
15
  <define name="figure">
16
16
  <element name="figure">
17
- <attribute name="id">
18
- <data type="ID"/>
19
- </attribute>
20
- <optional>
21
- <attribute name="unnumbered">
22
- <data type="boolean"/>
23
- </attribute>
24
- </optional>
25
- <optional>
26
- <attribute name="number"/>
27
- </optional>
28
- <optional>
29
- <attribute name="subsequence"/>
30
- </optional>
31
- <optional>
32
- <attribute name="class"/>
33
- </optional>
17
+ <ref name="FigureAttributes"/>
18
+ <ref name="BlockAttributes"/>
34
19
  <optional>
35
20
  <ref name="source"/>
36
21
  </optional>
@@ -156,44 +156,7 @@
156
156
  </define>
157
157
  <define name="xref">
158
158
  <element name="xref">
159
- <attribute name="target">
160
- <data type="string">
161
- <param name="pattern">\i\c*|\c+#\c+</param>
162
- </data>
163
- </attribute>
164
- <optional>
165
- <attribute name="to">
166
- <data type="string">
167
- <param name="pattern">\i\c*|\c+#\c+</param>
168
- </data>
169
- </attribute>
170
- </optional>
171
- <optional>
172
- <attribute name="type">
173
- <ref name="ReferenceFormat"/>
174
- </attribute>
175
- </optional>
176
- <optional>
177
- <attribute name="alt"/>
178
- </optional>
179
- <optional>
180
- <attribute name="case">
181
- <choice>
182
- <value>capital</value>
183
- <value>lowercase</value>
184
- </choice>
185
- </attribute>
186
- </optional>
187
- <optional>
188
- <attribute name="droploc">
189
- <data type="boolean"/>
190
- </attribute>
191
- </optional>
192
- <optional>
193
- <attribute name="style">
194
- <ref name="XrefStyleType"/>
195
- </attribute>
196
- </optional>
159
+ <ref name="XrefAttributes"/>
197
160
  <ref name="XrefBody"/>
198
161
  </element>
199
162
  </define>
@@ -407,23 +370,7 @@
407
370
  </define>
408
371
  <define name="figure">
409
372
  <element name="figure">
410
- <attribute name="id">
411
- <data type="ID"/>
412
- </attribute>
413
- <optional>
414
- <attribute name="unnumbered">
415
- <data type="boolean"/>
416
- </attribute>
417
- </optional>
418
- <optional>
419
- <attribute name="number"/>
420
- </optional>
421
- <optional>
422
- <attribute name="subsequence"/>
423
- </optional>
424
- <optional>
425
- <attribute name="class"/>
426
- </optional>
373
+ <ref name="FigureAttributes"/>
427
374
  <ref name="BlockAttributes"/>
428
375
  <optional>
429
376
  <ref name="tname"/>
@@ -2450,6 +2397,49 @@
2450
2397
  </zeroOrMore>
2451
2398
  </element>
2452
2399
  </define>
2400
+ <define name="XrefAttributes">
2401
+ <attribute name="target">
2402
+ <data type="string">
2403
+ <param name="pattern">\i\c*|\c+#\c+</param>
2404
+ </data>
2405
+ </attribute>
2406
+ <optional>
2407
+ <attribute name="to">
2408
+ <data type="string">
2409
+ <param name="pattern">\i\c*|\c+#\c+</param>
2410
+ </data>
2411
+ </attribute>
2412
+ </optional>
2413
+ <optional>
2414
+ <attribute name="type">
2415
+ <ref name="ReferenceFormat"/>
2416
+ </attribute>
2417
+ </optional>
2418
+ <optional>
2419
+ <attribute name="alt"/>
2420
+ </optional>
2421
+ <optional>
2422
+ <attribute name="case">
2423
+ <choice>
2424
+ <value>capital</value>
2425
+ <value>lowercase</value>
2426
+ </choice>
2427
+ </attribute>
2428
+ </optional>
2429
+ <optional>
2430
+ <attribute name="droploc">
2431
+ <data type="boolean"/>
2432
+ </attribute>
2433
+ </optional>
2434
+ <optional>
2435
+ <attribute name="style">
2436
+ <ref name="XrefStyleType"/>
2437
+ </attribute>
2438
+ </optional>
2439
+ <optional>
2440
+ <attribute name="label"/>
2441
+ </optional>
2442
+ </define>
2453
2443
  <define name="XrefBody">
2454
2444
  <zeroOrMore>
2455
2445
  <ref name="XrefTarget"/>
@@ -2528,6 +2518,28 @@
2528
2518
  <attribute name="columns"/>
2529
2519
  </optional>
2530
2520
  </define>
2521
+ <define name="FigureAttributes">
2522
+ <attribute name="id">
2523
+ <data type="ID"/>
2524
+ </attribute>
2525
+ <optional>
2526
+ <attribute name="unnumbered">
2527
+ <data type="boolean"/>
2528
+ </attribute>
2529
+ </optional>
2530
+ <optional>
2531
+ <attribute name="number"/>
2532
+ </optional>
2533
+ <optional>
2534
+ <attribute name="subsequence"/>
2535
+ </optional>
2536
+ <optional>
2537
+ <attribute name="class"/>
2538
+ </optional>
2539
+ <optional>
2540
+ <attribute name="width"/>
2541
+ </optional>
2542
+ </define>
2531
2543
  <start>
2532
2544
  <ref name="standard-document"/>
2533
2545
  </start>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module CC
3
- VERSION = "2.4.4".freeze
3
+ VERSION = "2.4.5".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-cc
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.4
4
+ version: 2.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-03-10 00:00:00.000000000 Z
11
+ date: 2024-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic