metanorma-itu 2.2.8 → 2.2.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -2763,11 +2763,17 @@
2763
2763
  <!-- ========================== -->
2764
2764
  <!-- Definition's list styles -->
2765
2765
  <!-- ========================== -->
2766
+
2767
+ <xsl:attribute-set name="dl-block-style">
2768
+
2769
+ </xsl:attribute-set>
2770
+
2766
2771
  <xsl:attribute-set name="dt-row-style">
2767
2772
 
2768
2773
  </xsl:attribute-set>
2769
2774
 
2770
2775
  <xsl:attribute-set name="dt-cell-style">
2776
+
2771
2777
  </xsl:attribute-set>
2772
2778
 
2773
2779
  <xsl:attribute-set name="dt-block-style">
@@ -2787,6 +2793,7 @@
2787
2793
 
2788
2794
  <xsl:attribute-set name="dd-cell-style">
2789
2795
  <xsl:attribute name="padding-left">2mm</xsl:attribute>
2796
+
2790
2797
  </xsl:attribute-set>
2791
2798
 
2792
2799
  <!-- ========================== -->
@@ -2910,6 +2917,10 @@
2910
2917
 
2911
2918
  </xsl:attribute-set>
2912
2919
 
2920
+ <xsl:attribute-set name="figure-source-style">
2921
+
2922
+ </xsl:attribute-set>
2923
+
2913
2924
  <!-- Formula's styles -->
2914
2925
  <xsl:attribute-set name="formula-style">
2915
2926
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
@@ -3457,7 +3468,7 @@
3457
3468
 
3458
3469
  <xsl:template name="processTables_Contents">
3459
3470
  <tables>
3460
- <xsl:for-each select="//*[local-name() = 'table'][@id and *[local-name() = 'name'] and normalize-space(@id) != '']">
3471
+ <xsl:for-each select="//*[local-name() = 'table'][not(ancestor::*[local-name() = 'metanorma-extension'])][@id and *[local-name() = 'name'] and normalize-space(@id) != '']">
3461
3472
  <table id="{@id}" alt-text="{*[local-name() = 'name']}">
3462
3473
  <xsl:copy-of select="*[local-name() = 'name']"/>
3463
3474
  </table>
@@ -3822,7 +3833,7 @@
3822
3833
  </xsl:attribute>
3823
3834
  </xsl:for-each>
3824
3835
 
3825
- <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
3836
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name'] or ./*[local-name()='source']"/>
3826
3837
  <xsl:if test="$isNoteOrFnExist = 'true'">
3827
3838
  <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
3828
3839
  </xsl:if>
@@ -3866,7 +3877,7 @@
3866
3877
  <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
3867
3878
  </xsl:when>
3868
3879
  <xsl:otherwise>
3869
- <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 -->
3880
+ <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 -->
3870
3881
  </xsl:otherwise>
3871
3882
  </xsl:choose>
3872
3883
 
@@ -3970,6 +3981,11 @@
3970
3981
  </xsl:if>
3971
3982
  </xsl:template> <!-- table/name -->
3972
3983
 
3984
+ <!-- SOURCE: ... -->
3985
+ <xsl:template match="*[local-name()='table']/*[local-name() = 'source']" priority="2">
3986
+ <xsl:call-template name="termsource"/>
3987
+ </xsl:template>
3988
+
3973
3989
  <xsl:template name="calculate-columns-numbers">
3974
3990
  <xsl:param name="table-row"/>
3975
3991
  <xsl:variable name="columns-count" select="count($table-row/*)"/>
@@ -4326,7 +4342,7 @@
4326
4342
  </fo:table-header>
4327
4343
  </xsl:template> <!-- thead -->
4328
4344
 
4329
- <!-- template is using for iso, jcgm, bsi only -->
4345
+ <!-- template is using for iec, iso, jcgm, bsi only -->
4330
4346
  <xsl:template name="table-header-title">
4331
4347
  <xsl:param name="cols-count"/>
4332
4348
  <!-- row for title -->
@@ -4369,7 +4385,7 @@
4369
4385
  <xsl:param name="colwidths"/>
4370
4386
  <xsl:param name="colgroup"/>
4371
4387
 
4372
- <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
4388
+ <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name'] or ../*[local-name()='source']"/>
4373
4389
 
4374
4390
  <xsl:variable name="isNoteOrFnExistShowAfterTable">
4375
4391
 
@@ -4458,6 +4474,7 @@
4458
4474
 
4459
4475
  <xsl:apply-templates select="../*[local-name()='dl']"/>
4460
4476
  <xsl:apply-templates select="../*[local-name()='note']"/>
4477
+ <xsl:apply-templates select="../*[local-name()='source']"/>
4461
4478
 
4462
4479
  <xsl:variable name="isDisplayRowSeparator">
4463
4480
 
@@ -5127,7 +5144,7 @@
5127
5144
  <xsl:variable name="isAdded" select="@added"/>
5128
5145
  <xsl:variable name="isDeleted" select="@deleted"/>
5129
5146
  <!-- <dl><xsl:copy-of select="."/></dl> -->
5130
- <fo:block-container>
5147
+ <fo:block-container xsl:use-attribute-sets="dl-block-style">
5131
5148
 
5132
5149
  <xsl:call-template name="setBlockSpanAll"/>
5133
5150
 
@@ -5135,6 +5152,18 @@
5135
5152
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
5136
5153
  </xsl:if>
5137
5154
 
5155
+ <xsl:if test="ancestor::*[local-name() = 'sourcecode']">
5156
+ <!-- set font-size as sourcecode font-size -->
5157
+ <xsl:variable name="sourcecode_attributes">
5158
+ <xsl:call-template name="get_sourcecode_attributes"/>
5159
+ </xsl:variable>
5160
+ <xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@font-size">
5161
+ <xsl:attribute name="{local-name()}">
5162
+ <xsl:value-of select="."/>
5163
+ </xsl:attribute>
5164
+ </xsl:for-each>
5165
+ </xsl:if>
5166
+
5138
5167
  <xsl:if test="parent::*[local-name() = 'note']">
5139
5168
  <xsl:attribute name="margin-left">
5140
5169
  <xsl:choose>
@@ -5574,6 +5603,7 @@
5574
5603
  <xsl:param name="split_keep-within-line"/>
5575
5604
 
5576
5605
  <fo:table-row xsl:use-attribute-sets="dt-row-style">
5606
+
5577
5607
  <xsl:call-template name="insert_dt_cell">
5578
5608
  <xsl:with-param name="key_iso" select="$key_iso"/>
5579
5609
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
@@ -5595,6 +5625,7 @@
5595
5625
  <!-- border is mandatory, to calculate real width -->
5596
5626
  <xsl:attribute name="border">0.1pt solid black</xsl:attribute>
5597
5627
  <xsl:attribute name="text-align">left</xsl:attribute>
5628
+
5598
5629
  </xsl:if>
5599
5630
 
5600
5631
  <xsl:if test="ancestor::*[1][local-name() = 'dl']/preceding-sibling::*[1][local-name() = 'formula']">
@@ -6047,6 +6078,7 @@
6047
6078
  <fo:inline>
6048
6079
  <xsl:for-each select="$styles/style">
6049
6080
  <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
6081
+
6050
6082
  </xsl:for-each>
6051
6083
  <xsl:apply-templates/>
6052
6084
  </fo:inline>
@@ -7552,6 +7584,13 @@
7552
7584
  </fo:block>
7553
7585
  </xsl:template>
7554
7586
 
7587
+ <!-- SOURCE: ... -->
7588
+ <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'source']" priority="2">
7589
+
7590
+ <xsl:call-template name="termsource"/>
7591
+
7592
+ </xsl:template>
7593
+
7555
7594
  <xsl:template match="*[local-name() = 'image']">
7556
7595
  <xsl:variable name="isAdded" select="../@added"/>
7557
7596
  <xsl:variable name="isDeleted" select="../@deleted"/>
@@ -8683,9 +8722,11 @@
8683
8722
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
8684
8723
  </xsl:if>
8685
8724
 
8686
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
8725
+ <xsl:apply-templates select="node()[not(local-name() = 'name' or local-name() = 'dl')]"/>
8687
8726
  </fo:block>
8688
8727
 
8728
+ <xsl:apply-templates select="*[local-name() = 'dl']"/> <!-- Key table -->
8729
+
8689
8730
  <xsl:apply-templates select="*[local-name()='name']"/> <!-- show sourcecode's name AFTER content -->
8690
8731
 
8691
8732
  </fo:block-container>
@@ -8717,11 +8758,22 @@
8717
8758
  <!-- add sourcecode highlighting -->
8718
8759
  <xsl:template match="*[local-name()='sourcecode']//*[local-name()='span'][@class]" priority="2">
8719
8760
  <xsl:variable name="class" select="@class"/>
8761
+
8762
+ <!-- Example: <1> -->
8763
+ <xsl:variable name="is_callout">
8764
+ <xsl:if test="parent::*[local-name() = 'dt']">
8765
+ <xsl:variable name="dt_id" select="../@id"/>
8766
+ <xsl:if test="ancestor::*[local-name() = 'sourcecode']//*[local-name() = 'callout'][@target = $dt_id]">true</xsl:if>
8767
+ </xsl:if>
8768
+ </xsl:variable>
8769
+
8720
8770
  <xsl:choose>
8721
8771
  <xsl:when test="$sourcecode_css//class[@name = $class]">
8722
8772
  <fo:inline>
8723
8773
  <xsl:apply-templates select="$sourcecode_css//class[@name = $class]" mode="css"/>
8774
+ <xsl:if test="$is_callout = 'true'">&lt;</xsl:if>
8724
8775
  <xsl:apply-templates/>
8776
+ <xsl:if test="$is_callout = 'true'">&gt;</xsl:if>
8725
8777
  </fo:inline>
8726
8778
  </xsl:when>
8727
8779
  <xsl:otherwise>
@@ -9145,6 +9197,10 @@
9145
9197
  </fo:block>
9146
9198
  </xsl:template>
9147
9199
 
9200
+ <xsl:template match="*[local-name() = 'div']">
9201
+ <fo:block><xsl:apply-templates/></fo:block>
9202
+ </xsl:template>
9203
+
9148
9204
  <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']">
9149
9205
  <fo:block xsl:use-attribute-sets="inherit-style">
9150
9206
  <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
@@ -9839,13 +9895,8 @@
9839
9895
  </xsl:template>
9840
9896
 
9841
9897
  <xsl:template match="*[local-name() = 'deprecates']">
9842
- <xsl:variable name="title-deprecated">
9843
- <xsl:call-template name="getLocalizedString">
9844
- <xsl:with-param name="key">deprecated</xsl:with-param>
9845
- </xsl:call-template>
9846
- </xsl:variable>
9847
9898
  <fo:block xsl:use-attribute-sets="deprecates-style">
9848
- <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
9899
+ <xsl:apply-templates/>
9849
9900
  </fo:block>
9850
9901
  </xsl:template>
9851
9902
 
@@ -11104,6 +11155,23 @@
11104
11155
  <xsl:template match="*[local-name() = 'stem'] | *[local-name() = 'image']" mode="update_xml_step1">
11105
11156
  <xsl:copy-of select="."/>
11106
11157
  </xsl:template>
11158
+
11159
+ <!-- add @id, redundant for table auto-layout algorithm -->
11160
+ <xsl:template match="*[local-name() = 'dl' or local-name() = 'table'][not(@id)]" mode="update_xml_step1">
11161
+ <xsl:copy>
11162
+ <xsl:copy-of select="@*"/>
11163
+ <xsl:call-template name="add_id"/>
11164
+ <xsl:apply-templates mode="update_xml_step1"/>
11165
+ </xsl:copy>
11166
+ </xsl:template>
11167
+
11168
+ <xsl:template name="add_id">
11169
+ <xsl:if test="not(@id)">
11170
+ <!-- add @id - first element with @id plus '_element_name' -->
11171
+ <xsl:attribute name="id"><xsl:value-of select="(.//*[@id])[1]/@id"/>_<xsl:value-of select="local-name()"/></xsl:attribute>
11172
+ </xsl:if>
11173
+ </xsl:template>
11174
+
11107
11175
  <!-- =========================================================================== -->
11108
11176
  <!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
11109
11177
  <!-- =========================================================================== -->
@@ -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 ITU
3
- VERSION = "2.2.8".freeze
3
+ VERSION = "2.2.9".freeze
4
4
  end
5
5
  end
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
26
26
  spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
27
27
 
28
28
  spec.add_dependency "htmlentities", "~> 4.3.4"
29
- spec.add_dependency "metanorma-standoc", "~> 2.4.0"
29
+ spec.add_dependency "metanorma-standoc", "~> 2.4.2"
30
30
  spec.add_dependency "ruby-jing"
31
31
  spec.add_dependency "twitter_cldr", ">= 3.0.0"
32
32
  spec.add_dependency "tzinfo-data" # we need this for windows only
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-itu
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.8
4
+ version: 2.2.9
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: htmlentities
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 2.4.0
33
+ version: 2.4.2
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.4.0
40
+ version: 2.4.2
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: ruby-jing
43
43
  requirement: !ruby/object:Gem::Requirement