metanorma-csa 2.2.6 → 2.2.7

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: 2184d97c9a8c1557149239d93b3f6494a55f36d96ced20809e050bd86a735eaa
4
- data.tar.gz: d0125b0fbb112f4912a4e4cb6e88d23a78dfc31c6a9185f88445a5064948b664
3
+ metadata.gz: cb85b906d7415059437f5917d7a6819d014559424878cccabbbfadf3ffe9eb7e
4
+ data.tar.gz: 914dce6c827dedb30a4e0d8f1ec4ba2d21284200b31df8a29279032e354035b3
5
5
  SHA512:
6
- metadata.gz: bf66ecb04c727773f03abab6381fe68d5fd95f632acc8d61e418c50fe53449e02dc4feea1a733b37433499d9bdd9d2fa52d39e0c3babbc211a5ebd8f22818935
7
- data.tar.gz: 7efa80a1016c8491366ce957533b188ed3aa8677b3d716d66a5622a8f9dc0656eb97e1f3532a1312452d62266add79c6ba36a9f8e67c710a0794e260e0632f43
6
+ metadata.gz: ddd10adc9ec06af2d72bd0408f313d102c2264e52ef28d7f2d2f649f05c2e0b30c19b130c3d13368a3e52a6405652936cdc19486f49ae0440005f6b5ab6839e0
7
+ data.tar.gz: ffece799b10883d9b98e221e2f069897b1429541f6f7397adf5eb65d407f6f94bac59e5a3b1b40a8bdcdfb13f9af42634ecd50a9c0172c78f2f3827487c32fe7
@@ -1209,11 +1209,17 @@
1209
1209
  <!-- ========================== -->
1210
1210
  <!-- Definition's list styles -->
1211
1211
  <!-- ========================== -->
1212
+
1213
+ <xsl:attribute-set name="dl-block-style">
1214
+
1215
+ </xsl:attribute-set>
1216
+
1212
1217
  <xsl:attribute-set name="dt-row-style">
1213
1218
 
1214
1219
  </xsl:attribute-set>
1215
1220
 
1216
1221
  <xsl:attribute-set name="dt-cell-style">
1222
+
1217
1223
  </xsl:attribute-set>
1218
1224
 
1219
1225
  <xsl:attribute-set name="dt-block-style">
@@ -1229,6 +1235,7 @@
1229
1235
 
1230
1236
  <xsl:attribute-set name="dd-cell-style">
1231
1237
  <xsl:attribute name="padding-left">2mm</xsl:attribute>
1238
+
1232
1239
  </xsl:attribute-set>
1233
1240
 
1234
1241
  <!-- ========================== -->
@@ -1366,6 +1373,10 @@
1366
1373
 
1367
1374
  </xsl:attribute-set>
1368
1375
 
1376
+ <xsl:attribute-set name="figure-source-style">
1377
+
1378
+ </xsl:attribute-set>
1379
+
1369
1380
  <!-- Formula's styles -->
1370
1381
  <xsl:attribute-set name="formula-style">
1371
1382
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
@@ -1912,7 +1923,7 @@
1912
1923
 
1913
1924
  <xsl:template name="processTables_Contents">
1914
1925
  <tables>
1915
- <xsl:for-each select="//*[local-name() = 'table'][@id and *[local-name() = 'name'] and normalize-space(@id) != '']">
1926
+ <xsl:for-each select="//*[local-name() = 'table'][not(ancestor::*[local-name() = 'metanorma-extension'])][@id and *[local-name() = 'name'] and normalize-space(@id) != '']">
1916
1927
  <table id="{@id}" alt-text="{*[local-name() = 'name']}">
1917
1928
  <xsl:copy-of select="*[local-name() = 'name']"/>
1918
1929
  </table>
@@ -2262,7 +2273,7 @@
2262
2273
  </xsl:attribute>
2263
2274
  </xsl:for-each>
2264
2275
 
2265
- <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
2276
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name'] or ./*[local-name()='source']"/>
2266
2277
  <xsl:if test="$isNoteOrFnExist = 'true'">
2267
2278
  <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
2268
2279
  </xsl:if>
@@ -2306,7 +2317,7 @@
2306
2317
  <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
2307
2318
  </xsl:when>
2308
2319
  <xsl:otherwise>
2309
- <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note') and not(local-name() = 'dl') and not(local-name() = 'thead') and not(local-name() = 'tfoot')]"/> <!-- process all table' elements, except name, header, footer, note and dl which render separaterely -->
2320
+ <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note') and not(local-name() = 'dl') and not(local-name() = 'source') and not(local-name() = 'thead') and not(local-name() = 'tfoot')]"/> <!-- process all table' elements, except name, header, footer, note, source and dl which render separaterely -->
2310
2321
  </xsl:otherwise>
2311
2322
  </xsl:choose>
2312
2323
 
@@ -2410,6 +2421,11 @@
2410
2421
  </xsl:if>
2411
2422
  </xsl:template> <!-- table/name -->
2412
2423
 
2424
+ <!-- SOURCE: ... -->
2425
+ <xsl:template match="*[local-name()='table']/*[local-name() = 'source']" priority="2">
2426
+ <xsl:call-template name="termsource"/>
2427
+ </xsl:template>
2428
+
2413
2429
  <xsl:template name="calculate-columns-numbers">
2414
2430
  <xsl:param name="table-row"/>
2415
2431
  <xsl:variable name="columns-count" select="count($table-row/*)"/>
@@ -2766,7 +2782,7 @@
2766
2782
  </fo:table-header>
2767
2783
  </xsl:template> <!-- thead -->
2768
2784
 
2769
- <!-- template is using for iso, jcgm, bsi only -->
2785
+ <!-- template is using for iec, iso, jcgm, bsi only -->
2770
2786
  <xsl:template name="table-header-title">
2771
2787
  <xsl:param name="cols-count"/>
2772
2788
  <!-- row for title -->
@@ -2809,7 +2825,7 @@
2809
2825
  <xsl:param name="colwidths"/>
2810
2826
  <xsl:param name="colgroup"/>
2811
2827
 
2812
- <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
2828
+ <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name'] or ../*[local-name()='source']"/>
2813
2829
 
2814
2830
  <xsl:variable name="isNoteOrFnExistShowAfterTable">
2815
2831
 
@@ -2879,6 +2895,7 @@
2879
2895
 
2880
2896
  <xsl:apply-templates select="../*[local-name()='dl']"/>
2881
2897
  <xsl:apply-templates select="../*[local-name()='note']"/>
2898
+ <xsl:apply-templates select="../*[local-name()='source']"/>
2882
2899
 
2883
2900
  <xsl:variable name="isDisplayRowSeparator">
2884
2901
 
@@ -3511,7 +3528,7 @@
3511
3528
  <xsl:variable name="isAdded" select="@added"/>
3512
3529
  <xsl:variable name="isDeleted" select="@deleted"/>
3513
3530
  <!-- <dl><xsl:copy-of select="."/></dl> -->
3514
- <fo:block-container>
3531
+ <fo:block-container xsl:use-attribute-sets="dl-block-style">
3515
3532
 
3516
3533
  <xsl:call-template name="setBlockSpanAll"/>
3517
3534
 
@@ -3519,6 +3536,18 @@
3519
3536
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
3520
3537
  </xsl:if>
3521
3538
 
3539
+ <xsl:if test="ancestor::*[local-name() = 'sourcecode']">
3540
+ <!-- set font-size as sourcecode font-size -->
3541
+ <xsl:variable name="sourcecode_attributes">
3542
+ <xsl:call-template name="get_sourcecode_attributes"/>
3543
+ </xsl:variable>
3544
+ <xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@font-size">
3545
+ <xsl:attribute name="{local-name()}">
3546
+ <xsl:value-of select="."/>
3547
+ </xsl:attribute>
3548
+ </xsl:for-each>
3549
+ </xsl:if>
3550
+
3522
3551
  <xsl:if test="parent::*[local-name() = 'note']">
3523
3552
  <xsl:attribute name="margin-left">
3524
3553
  <xsl:choose>
@@ -3952,6 +3981,7 @@
3952
3981
  <xsl:param name="split_keep-within-line"/>
3953
3982
 
3954
3983
  <fo:table-row xsl:use-attribute-sets="dt-row-style">
3984
+
3955
3985
  <xsl:call-template name="insert_dt_cell">
3956
3986
  <xsl:with-param name="key_iso" select="$key_iso"/>
3957
3987
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
@@ -3973,6 +4003,7 @@
3973
4003
  <!-- border is mandatory, to calculate real width -->
3974
4004
  <xsl:attribute name="border">0.1pt solid black</xsl:attribute>
3975
4005
  <xsl:attribute name="text-align">left</xsl:attribute>
4006
+
3976
4007
  </xsl:if>
3977
4008
 
3978
4009
  <fo:block xsl:use-attribute-sets="dt-block-style">
@@ -4417,6 +4448,7 @@
4417
4448
  <fo:inline>
4418
4449
  <xsl:for-each select="$styles/style">
4419
4450
  <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
4451
+
4420
4452
  </xsl:for-each>
4421
4453
  <xsl:apply-templates/>
4422
4454
  </fo:inline>
@@ -5918,6 +5950,13 @@
5918
5950
  </fo:block>
5919
5951
  </xsl:template>
5920
5952
 
5953
+ <!-- SOURCE: ... -->
5954
+ <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'source']" priority="2">
5955
+
5956
+ <xsl:call-template name="termsource"/>
5957
+
5958
+ </xsl:template>
5959
+
5921
5960
  <xsl:template match="*[local-name() = 'image']">
5922
5961
  <xsl:variable name="isAdded" select="../@added"/>
5923
5962
  <xsl:variable name="isDeleted" select="../@deleted"/>
@@ -7049,9 +7088,11 @@
7049
7088
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
7050
7089
  </xsl:if>
7051
7090
 
7052
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
7091
+ <xsl:apply-templates select="node()[not(local-name() = 'name' or local-name() = 'dl')]"/>
7053
7092
  </fo:block>
7054
7093
 
7094
+ <xsl:apply-templates select="*[local-name() = 'dl']"/> <!-- Key table -->
7095
+
7055
7096
  <xsl:apply-templates select="*[local-name()='name']"/> <!-- show sourcecode's name AFTER content -->
7056
7097
 
7057
7098
  </fo:block-container>
@@ -7083,11 +7124,22 @@
7083
7124
  <!-- add sourcecode highlighting -->
7084
7125
  <xsl:template match="*[local-name()='sourcecode']//*[local-name()='span'][@class]" priority="2">
7085
7126
  <xsl:variable name="class" select="@class"/>
7127
+
7128
+ <!-- Example: <1> -->
7129
+ <xsl:variable name="is_callout">
7130
+ <xsl:if test="parent::*[local-name() = 'dt']">
7131
+ <xsl:variable name="dt_id" select="../@id"/>
7132
+ <xsl:if test="ancestor::*[local-name() = 'sourcecode']//*[local-name() = 'callout'][@target = $dt_id]">true</xsl:if>
7133
+ </xsl:if>
7134
+ </xsl:variable>
7135
+
7086
7136
  <xsl:choose>
7087
7137
  <xsl:when test="$sourcecode_css//class[@name = $class]">
7088
7138
  <fo:inline>
7089
7139
  <xsl:apply-templates select="$sourcecode_css//class[@name = $class]" mode="css"/>
7140
+ <xsl:if test="$is_callout = 'true'">&lt;</xsl:if>
7090
7141
  <xsl:apply-templates/>
7142
+ <xsl:if test="$is_callout = 'true'">&gt;</xsl:if>
7091
7143
  </fo:inline>
7092
7144
  </xsl:when>
7093
7145
  <xsl:otherwise>
@@ -7511,6 +7563,10 @@
7511
7563
  </fo:block>
7512
7564
  </xsl:template>
7513
7565
 
7566
+ <xsl:template match="*[local-name() = 'div']">
7567
+ <fo:block><xsl:apply-templates/></fo:block>
7568
+ </xsl:template>
7569
+
7514
7570
  <xsl:template match="*[local-name() = 'inherit'] | *[local-name() = 'component'][@class = 'inherit'] | *[local-name() = 'div'][@type = 'requirement-inherit'] | *[local-name() = 'div'][@type = 'recommendation-inherit'] | *[local-name() = 'div'][@type = 'permission-inherit']">
7515
7571
  <fo:block xsl:use-attribute-sets="inherit-style">
7516
7572
  <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
@@ -8204,13 +8260,8 @@
8204
8260
  </xsl:template>
8205
8261
 
8206
8262
  <xsl:template match="*[local-name() = 'deprecates']">
8207
- <xsl:variable name="title-deprecated">
8208
- <xsl:call-template name="getLocalizedString">
8209
- <xsl:with-param name="key">deprecated</xsl:with-param>
8210
- </xsl:call-template>
8211
- </xsl:variable>
8212
8263
  <fo:block xsl:use-attribute-sets="deprecates-style">
8213
- <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
8264
+ <xsl:apply-templates/>
8214
8265
  </fo:block>
8215
8266
  </xsl:template>
8216
8267
 
@@ -9413,6 +9464,23 @@
9413
9464
  <xsl:template match="*[local-name() = 'stem'] | *[local-name() = 'image']" mode="update_xml_step1">
9414
9465
  <xsl:copy-of select="."/>
9415
9466
  </xsl:template>
9467
+
9468
+ <!-- add @id, redundant for table auto-layout algorithm -->
9469
+ <xsl:template match="*[local-name() = 'dl' or local-name() = 'table'][not(@id)]" mode="update_xml_step1">
9470
+ <xsl:copy>
9471
+ <xsl:copy-of select="@*"/>
9472
+ <xsl:call-template name="add_id"/>
9473
+ <xsl:apply-templates mode="update_xml_step1"/>
9474
+ </xsl:copy>
9475
+ </xsl:template>
9476
+
9477
+ <xsl:template name="add_id">
9478
+ <xsl:if test="not(@id)">
9479
+ <!-- add @id - first element with @id plus '_element_name' -->
9480
+ <xsl:attribute name="id"><xsl:value-of select="(.//*[@id])[1]/@id"/>_<xsl:value-of select="local-name()"/></xsl:attribute>
9481
+ </xsl:if>
9482
+ </xsl:template>
9483
+
9416
9484
  <!-- =========================================================================== -->
9417
9485
  <!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
9418
9486
  <!-- =========================================================================== -->
@@ -382,6 +382,9 @@
382
382
  <optional>
383
383
  <ref name="dl"/>
384
384
  </optional>
385
+ <optional>
386
+ <ref name="source"/>
387
+ </optional>
385
388
  </element>
386
389
  </define>
387
390
  <define name="figure">
@@ -404,9 +407,6 @@
404
407
  <attribute name="class"/>
405
408
  </optional>
406
409
  <ref name="BlockAttributes"/>
407
- <optional>
408
- <ref name="source"/>
409
- </optional>
410
410
  <optional>
411
411
  <ref name="tname"/>
412
412
  </optional>
@@ -431,6 +431,20 @@
431
431
  <zeroOrMore>
432
432
  <ref name="note"/>
433
433
  </zeroOrMore>
434
+ <optional>
435
+ <ref name="source"/>
436
+ </optional>
437
+ </element>
438
+ </define>
439
+ <define name="source">
440
+ <element name="source">
441
+ <attribute name="status">
442
+ <ref name="SourceStatusType"/>
443
+ </attribute>
444
+ <ref name="origin"/>
445
+ <optional>
446
+ <ref name="modification"/>
447
+ </optional>
434
448
  </element>
435
449
  </define>
436
450
  <define name="sourcecode">
@@ -2099,10 +2113,7 @@
2099
2113
  <define name="termsource">
2100
2114
  <element name="termsource">
2101
2115
  <attribute name="status">
2102
- <choice>
2103
- <value>identical</value>
2104
- <value>modified</value>
2105
- </choice>
2116
+ <ref name="SourceStatusType"/>
2106
2117
  </attribute>
2107
2118
  <attribute name="type">
2108
2119
  <choice>
@@ -2116,6 +2127,17 @@
2116
2127
  </optional>
2117
2128
  </element>
2118
2129
  </define>
2130
+ <define name="SourceStatusType">
2131
+ <choice>
2132
+ <value>identical</value>
2133
+ <value>modified</value>
2134
+ <value>restyled</value>
2135
+ <value>context-added</value>
2136
+ <value>generalisation</value>
2137
+ <value>specialisation</value>
2138
+ <value>unspecified</value>
2139
+ </choice>
2140
+ </define>
2119
2141
  <define name="origin">
2120
2142
  <element name="origin">
2121
2143
  <choice>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Csa
3
- VERSION = "2.2.6".freeze
3
+ VERSION = "2.2.7".freeze
4
4
  end
5
5
  end
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
29
29
  spec.require_paths = ["lib"]
30
30
  spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
31
31
 
32
- spec.add_dependency "metanorma-generic", "~> 2.4.0"
32
+ spec.add_dependency "metanorma-generic", "~> 2.4.1"
33
33
 
34
34
  spec.add_development_dependency "debug"
35
35
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-csa
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.6
4
+ version: 2.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-03-27 00:00:00.000000000 Z
11
+ date: 2023-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 2.4.0
19
+ version: 2.4.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 2.4.0
26
+ version: 2.4.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: debug
29
29
  requirement: !ruby/object:Gem::Requirement