metanorma-bipm 1.1.10 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -10,6 +10,8 @@
10
10
  <!-- param for second pass -->
11
11
  <xsl:param name="external_index"/><!-- path to index xml, generated on 1st pass, based on FOP Intermediate Format -->
12
12
 
13
+ <xsl:param name="align-cross-elements"/>
14
+
13
15
 
14
16
 
15
17
  <xsl:key name="kfn" match="*[local-name()='p']/*[local-name()='fn']" use="@reference"/>
@@ -17,7 +19,14 @@
17
19
 
18
20
 
19
21
  <xsl:variable name="align_cross_elements_default">clause</xsl:variable>
20
- <xsl:variable name="align_cross_elements_doc" select="normalize-space((//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:ext/jcgm:parallel-align-element)"/>
22
+ <xsl:variable name="align_cross_elements_doc">
23
+ <xsl:choose>
24
+ <xsl:when test="normalize-space($align-cross-elements) != ''"><xsl:value-of select="$align-cross-elements"/></xsl:when>
25
+ <xsl:otherwise>
26
+ <xsl:value-of select="normalize-space((//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:ext/jcgm:parallel-align-element)"/>
27
+ </xsl:otherwise>
28
+ </xsl:choose>
29
+ </xsl:variable>
21
30
  <xsl:variable name="align_cross_elements_">
22
31
  <xsl:choose>
23
32
  <xsl:when test="$align_cross_elements_doc != ''">
@@ -918,7 +927,7 @@
918
927
  </xsl:variable>
919
928
  <fo:block line-height="1.1" role="H{$level}">
920
929
  <fo:block font-weight="bold" keep-with-next="always">
921
- <xsl:apply-templates select="ancestor::*[local-name()='term']/*[local-name()='name']" mode="presentation"/>
930
+ <xsl:apply-templates select="ancestor::*[local-name()='term'][1]/*[local-name()='name']" mode="presentation"/>
922
931
  </fo:block>
923
932
  <fo:block font-weight="bold" keep-with-next="always">
924
933
  <xsl:apply-templates/>
@@ -2107,6 +2116,8 @@
2107
2116
 
2108
2117
  <title-list-figures lang="en">List of Figures</title-list-figures>
2109
2118
 
2119
+ <title-table-figures lang="en">Table of Figures</title-table-figures>
2120
+
2110
2121
  <title-list-recommendations lang="en">List of Recommendations</title-list-recommendations>
2111
2122
 
2112
2123
  <title-acknowledgements lang="en">Acknowledgements</title-acknowledgements>
@@ -2406,6 +2417,11 @@
2406
2417
 
2407
2418
 
2408
2419
 
2420
+ </xsl:attribute-set><xsl:attribute-set name="table-note-name-style">
2421
+
2422
+
2423
+
2424
+
2409
2425
  </xsl:attribute-set><xsl:attribute-set name="note-p-style">
2410
2426
 
2411
2427
 
@@ -3606,9 +3622,8 @@
3606
3622
 
3607
3623
  <!-- Table's note name (NOTE, for example) -->
3608
3624
 
3609
- <fo:inline padding-right="2mm">
3625
+ <fo:inline padding-right="2mm" xsl:use-attribute-sets="table-note-name-style">
3610
3626
 
3611
-
3612
3627
 
3613
3628
 
3614
3629
 
@@ -4138,6 +4153,7 @@
4138
4153
  <fo:table-cell>
4139
4154
 
4140
4155
  <fo:block margin-top="6pt">
4156
+ <xsl:copy-of select="@id"/>
4141
4157
 
4142
4158
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
4143
4159
 
@@ -4243,6 +4259,8 @@
4243
4259
  <xsl:if test="$font-size != ''">
4244
4260
  <xsl:attribute name="font-size">
4245
4261
  <xsl:choose>
4262
+ <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
4263
+ <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
4246
4264
  <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
4247
4265
  <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
4248
4266
  </xsl:choose>
@@ -4975,14 +4993,18 @@
4975
4993
  </xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'p']">
4976
4994
  <fo:inline><xsl:apply-templates/></fo:inline>
4977
4995
  </xsl:template><xsl:template match="*[local-name() = 'terms']">
4996
+ <!-- <xsl:message>'terms' <xsl:number/> processing...</xsl:message> -->
4978
4997
  <fo:block id="{@id}">
4979
4998
  <xsl:apply-templates/>
4980
4999
  </fo:block>
4981
5000
  </xsl:template><xsl:template match="*[local-name() = 'term']">
5001
+ <!-- <xsl:message>'term' <xsl:number/> processing, name=<xsl:value-of select="iso:name"/>, preferred=<xsl:value-of select="iso:preferred"/>...</xsl:message> -->
4982
5002
  <fo:block id="{@id}" xsl:use-attribute-sets="term-style">
4983
5003
 
4984
5004
 
4985
-
5005
+ <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'term'])">
5006
+
5007
+ </xsl:if>
4986
5008
  <xsl:apply-templates/>
4987
5009
  </fo:block>
4988
5010
  </xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']" mode="presentation">
@@ -5044,6 +5066,7 @@
5044
5066
  <xsl:otherwise>
5045
5067
  <fo:block xsl:use-attribute-sets="image-style">
5046
5068
 
5069
+
5047
5070
  <xsl:variable name="src">
5048
5071
  <xsl:call-template name="image_src"/>
5049
5072
  </xsl:variable>
@@ -5410,7 +5433,7 @@
5410
5433
  <xsl:text> </xsl:text>
5411
5434
  </xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']/text()" mode="contents" priority="2">
5412
5435
  <xsl:value-of select="."/>
5413
- </xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
5436
+ </xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']//text()" mode="bookmarks" priority="2">
5414
5437
  <xsl:value-of select="."/>
5415
5438
  </xsl:template><xsl:template match="node()" mode="contents">
5416
5439
  <xsl:apply-templates mode="contents"/>
@@ -5508,6 +5531,8 @@
5508
5531
 
5509
5532
 
5510
5533
 
5534
+
5535
+
5511
5536
  </fo:bookmark-tree>
5512
5537
  </xsl:if>
5513
5538
  </xsl:template><xsl:template name="insertFigureBookmarks">
@@ -5701,12 +5726,16 @@
5701
5726
  <xsl:if test="$font-size != ''">
5702
5727
  <xsl:attribute name="font-size">
5703
5728
  <xsl:choose>
5729
+ <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
5730
+ <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
5704
5731
  <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
5705
5732
  <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
5706
5733
  </xsl:choose>
5707
5734
  </xsl:attribute>
5708
5735
  </xsl:if>
5709
5736
 
5737
+
5738
+
5710
5739
  <xsl:apply-templates/>
5711
5740
  </fo:block>
5712
5741
 
@@ -5949,7 +5978,8 @@
5949
5978
  </fo:block>
5950
5979
  </fo:table-cell>
5951
5980
  </xsl:template><xsl:template match="*[local-name() = 'p'][@class='RecommendationTitle' or @class = 'RecommendationTestTitle']" priority="2">
5952
- <fo:block font-size="11pt" color="rgb(237, 193, 35)"> <!-- font-weight="bold" margin-bottom="4pt" text-align="center" -->
5981
+ <fo:block font-size="11pt">
5982
+
5953
5983
  <xsl:apply-templates/>
5954
5984
  </fo:block>
5955
5985
  </xsl:template><xsl:template match="*[local-name() = 'p2'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]">
@@ -6059,6 +6089,7 @@
6059
6089
  </xsl:choose>
6060
6090
  </xsl:template><xsl:template match="*[local-name() = 'termsource']" name="termsource">
6061
6091
  <fo:block xsl:use-attribute-sets="termsource-style">
6092
+
6062
6093
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
6063
6094
  <xsl:variable name="termsource_text">
6064
6095
  <xsl:apply-templates/>
@@ -6069,13 +6100,15 @@
6069
6100
  <!-- <xsl:apply-templates /> -->
6070
6101
  <xsl:copy-of select="$termsource_text"/>
6071
6102
  </xsl:when>
6072
- <xsl:otherwise>
6103
+ <xsl:otherwise>
6104
+
6073
6105
 
6074
6106
  <xsl:text>[</xsl:text>
6075
6107
 
6076
6108
  <!-- <xsl:apply-templates /> -->
6077
6109
  <xsl:copy-of select="$termsource_text"/>
6078
6110
 
6111
+
6079
6112
  <xsl:text>]</xsl:text>
6080
6113
 
6081
6114
  </xsl:otherwise>
@@ -6167,12 +6200,20 @@
6167
6200
  </xsl:template><xsl:template match="*[local-name() = 'author']">
6168
6201
  <xsl:text>— </xsl:text>
6169
6202
  <xsl:apply-templates/>
6170
- </xsl:template><xsl:template match="*[local-name() = 'eref']">
6203
+ </xsl:template><xsl:variable name="bibitem_hidden_">
6204
+ <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden='true']">
6205
+ <xsl:copy-of select="."/>
6206
+ </xsl:for-each>
6207
+ <xsl:for-each select="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem']">
6208
+ <xsl:copy-of select="."/>
6209
+ </xsl:for-each>
6210
+ </xsl:variable><xsl:variable name="bibitem_hidden" select="xalan:nodeset($bibitem_hidden_)"/><xsl:template match="*[local-name() = 'eref']">
6171
6211
 
6172
6212
  <xsl:variable name="bibitemid">
6173
6213
  <xsl:choose>
6174
- <xsl:when test="//*[local-name() = 'bibitem'][@hidden='true' and @id = current()/@bibitemid]"/>
6175
- <xsl:when test="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"/>
6214
+ <!-- <xsl:when test="//*[local-name() = 'bibitem'][@hidden='true' and @id = current()/@bibitemid]"></xsl:when>
6215
+ <xsl:when test="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"></xsl:when> -->
6216
+ <xsl:when test="$bibitem_hidden/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"/>
6176
6217
  <xsl:otherwise><xsl:value-of select="@bibitemid"/></xsl:otherwise>
6177
6218
  </xsl:choose>
6178
6219
  </xsl:variable>
@@ -6261,10 +6302,10 @@
6261
6302
  </xsl:choose>
6262
6303
  </xsl:variable>
6263
6304
 
6264
- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
6305
+ <!-- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/> -->
6265
6306
 
6266
6307
  <xsl:choose>
6267
- <xsl:when test="$language = 'zh'">
6308
+ <xsl:when test="$lang = 'zh'">
6268
6309
  <fo:inline><xsl:value-of select="$tab_zh"/></fo:inline>
6269
6310
  </xsl:when>
6270
6311
  <xsl:when test="../../@inline-header = 'true'">
@@ -7250,12 +7291,15 @@
7250
7291
  <xsl:param name="default">left</xsl:param>
7251
7292
  <xsl:attribute name="text-align">
7252
7293
  <xsl:choose>
7253
- <xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
7294
+ <xsl:when test="@align and not(@align = 'indent')"><xsl:value-of select="@align"/></xsl:when>
7254
7295
  <xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
7255
7296
  <xsl:when test="ancestor::*[local-name() = 'th']/@align"><xsl:value-of select="ancestor::*[local-name() = 'th']/@align"/></xsl:when>
7256
7297
  <xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
7257
7298
  </xsl:choose>
7258
7299
  </xsl:attribute>
7300
+ <xsl:if test="@align = 'indent'">
7301
+ <xsl:attribute name="margin-left">7mm</xsl:attribute>
7302
+ </xsl:if>
7259
7303
  </xsl:template><xsl:template name="number-to-words">
7260
7304
  <xsl:param name="number"/>
7261
7305
  <xsl:param name="first"/>
@@ -59,8 +59,8 @@ module IsoDoc
59
59
  end
60
60
 
61
61
  def clause1(elem)
62
- return if elem["unnumbered"] == "true"
63
- return if elem.at(("./ancestor::*[@unnumbered = 'true']"))
62
+ elem.at(("./ancestor::*[@unnumbered = 'true']")) and
63
+ elem["unnumbered"] = "true"
64
64
 
65
65
  super
66
66
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module BIPM
3
- VERSION = "1.1.10".freeze
3
+ VERSION = "1.2.2".freeze
4
4
  end
5
5
  end
@@ -26,8 +26,8 @@ Gem::Specification.new do |spec|
26
26
  spec.require_paths = ["lib"]
27
27
  spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
28
28
 
29
- spec.add_dependency "metanorma-generic", "~> 1.10.2"
30
- spec.add_dependency "metanorma-iso", "~> 1.9.0"
29
+ spec.add_dependency "metanorma-generic", "~> 1.11.0"
30
+ spec.add_dependency "metanorma-iso", "~> 1.10.0"
31
31
 
32
32
  spec.add_development_dependency "byebug", "~> 9.1"
33
33
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-bipm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.10
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-09-27 00:00:00.000000000 Z
11
+ date: 2021-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.10.2
19
+ version: 1.11.0
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: 1.10.2
26
+ version: 1.11.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: metanorma-iso
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.9.0
33
+ version: 1.10.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: 1.9.0
40
+ version: 1.10.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: byebug
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -271,7 +271,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
271
271
  - !ruby/object:Gem::Version
272
272
  version: '0'
273
273
  requirements: []
274
- rubygems_version: 3.1.4
274
+ rubygems_version: 3.2.22
275
275
  signing_key:
276
276
  specification_version: 4
277
277
  summary: metanorma-bipm lets you write BIPM standards in Metanorma.