metanorma-iso 1.5.9 → 1.5.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +66 -0
  3. data/README.adoc +5 -6
  4. data/lib/asciidoctor/iso/base.rb +5 -5
  5. data/lib/asciidoctor/iso/basicdoc.rng +32 -0
  6. data/lib/asciidoctor/iso/boilerplate-fr.xml +40 -0
  7. data/lib/asciidoctor/iso/boilerplate.xml +1 -0
  8. data/lib/asciidoctor/iso/cleanup.rb +38 -6
  9. data/lib/asciidoctor/iso/front.rb +11 -3
  10. data/lib/asciidoctor/iso/isodoc.rng +29 -44
  11. data/lib/asciidoctor/iso/isostandard.rng +11 -0
  12. data/lib/asciidoctor/iso/validate.rb +1 -1
  13. data/lib/asciidoctor/iso/validate_section.rb +9 -0
  14. data/lib/isodoc/iso/base_convert.rb +2 -1
  15. data/lib/isodoc/iso/html/header.html +12 -24
  16. data/lib/isodoc/iso/html/htmlstyle.css +1 -1
  17. data/lib/isodoc/iso/html/htmlstyle.scss +1 -1
  18. data/lib/isodoc/iso/html/isodoc.css +42 -42
  19. data/lib/isodoc/iso/html/isodoc.scss +42 -42
  20. data/lib/isodoc/iso/html/style-human.css +14 -10
  21. data/lib/isodoc/iso/html/style-human.scss +7 -7
  22. data/lib/isodoc/iso/html/style-iso.css +12 -8
  23. data/lib/isodoc/iso/html/style-iso.scss +5 -5
  24. data/lib/isodoc/iso/html/wordstyle.css +67 -67
  25. data/lib/isodoc/iso/html/wordstyle.scss +67 -67
  26. data/lib/isodoc/iso/html_convert.rb +4 -0
  27. data/lib/isodoc/iso/i18n-en.yaml +4 -0
  28. data/lib/isodoc/iso/i18n-fr.yaml +5 -0
  29. data/lib/isodoc/iso/i18n-zh-Hans.yaml +5 -0
  30. data/lib/isodoc/iso/i18n.rb +10 -11
  31. data/lib/isodoc/iso/iso.amendment.xsl +562 -120
  32. data/lib/isodoc/iso/iso.international-standard.xsl +562 -120
  33. data/lib/isodoc/iso/metadata.rb +20 -19
  34. data/lib/isodoc/iso/word_convert.rb +4 -0
  35. data/lib/isodoc/iso/xref.rb +10 -0
  36. data/lib/metanorma/iso/fonts_manifest.yaml +6 -0
  37. data/lib/metanorma/iso/processor.rb +0 -9
  38. data/lib/metanorma/iso/version.rb +1 -1
  39. data/metanorma-iso.gemspec +1 -1
  40. data/spec/asciidoctor-iso/base_spec.rb +140 -12
  41. data/spec/asciidoctor-iso/blocks_spec.rb +1 -1
  42. data/spec/asciidoctor-iso/cleanup_spec.rb +4 -4
  43. data/spec/asciidoctor-iso/lists_spec.rb +6 -6
  44. data/spec/asciidoctor-iso/refs_spec.rb +174 -143
  45. data/spec/asciidoctor-iso/section_spec.rb +5 -0
  46. data/spec/asciidoctor-iso/validate_spec.rb +52 -15
  47. data/spec/assets/xref_error.adoc +7 -0
  48. data/spec/isodoc/amd_spec.rb +188 -29
  49. data/spec/isodoc/blocks_spec.rb +1 -0
  50. data/spec/isodoc/i18n_spec.rb +9 -22
  51. data/spec/isodoc/inline_spec.rb +1 -1
  52. data/spec/isodoc/metadata_spec.rb +172 -19
  53. data/spec/isodoc/postproc_spec.rb +2 -5
  54. data/spec/isodoc/ref_spec.rb +4 -7
  55. data/spec/isodoc/section_spec.rb +20 -0
  56. data/spec/isodoc/xref_spec.rb +12 -0
  57. data/spec/spec_helper.rb +21 -1
  58. metadata +8 -10
  59. data/.github/workflows/macos.yml +0 -41
  60. data/.github/workflows/ubuntu.yml +0 -45
  61. data/.github/workflows/windows.yml +0 -43
  62. data/lib/asciidoctor/iso/macros.rb +0 -21
  63. data/lib/asciidoctor/iso/term_lookup_cleanup.rb +0 -86
  64. data/spec/asciidoctor-iso/macros_spec.rb +0 -310
@@ -1,17 +1,16 @@
1
1
  module IsoDoc
2
2
  module Iso
3
3
  class I18n < IsoDoc::I18n
4
- def load_yaml(lang, script, i18nyaml = nil)
5
- y = if i18nyaml then YAML.load_file(i18nyaml)
6
- elsif lang == "en"
7
- YAML.load_file(File.join(File.dirname(__FILE__), "i18n-en.yaml"))
8
- elsif lang == "fr"
9
- YAML.load_file(File.join(File.dirname(__FILE__), "i18n-fr.yaml"))
10
- elsif lang == "zh" && script == "Hans"
11
- YAML.load_file(File.join(File.dirname(__FILE__), "i18n-zh-Hans.yaml"))
12
- else
13
- YAML.load_file(File.join(File.dirname(__FILE__), "i18n-en.yaml"))
14
- end
4
+ def load_yaml1(lang, script)
5
+ y = if lang == "en"
6
+ YAML.load_file(File.join(File.dirname(__FILE__), "i18n-en.yaml"))
7
+ elsif lang == "fr"
8
+ YAML.load_file(File.join(File.dirname(__FILE__), "i18n-fr.yaml"))
9
+ elsif lang == "zh" && script == "Hans"
10
+ YAML.load_file(File.join(File.dirname(__FILE__), "i18n-zh-Hans.yaml"))
11
+ else
12
+ YAML.load_file(File.join(File.dirname(__FILE__), "i18n-en.yaml"))
13
+ end
15
14
  super.merge(y)
16
15
  end
17
16
  end
@@ -17,7 +17,12 @@
17
17
 
18
18
  <xsl:variable name="docidentifierISO" select="/iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'iso'] | /iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'ISO']"/>
19
19
 
20
- <xsl:variable name="copyrightText" select="concat('© ISO ', iso:iso-standard/iso:bibdata/iso:copyright/iso:from ,' – All rights reserved')"/>
20
+ <xsl:variable name="all_rights_reserved">
21
+ <xsl:call-template name="getLocalizedString">
22
+ <xsl:with-param name="key">all_rights_reserved</xsl:with-param>
23
+ </xsl:call-template>
24
+ </xsl:variable>
25
+ <xsl:variable name="copyrightText" select="concat('© ISO ', /iso:iso-standard/iso:bibdata/iso:copyright/iso:from ,' – ', $all_rights_reserved)"/>
21
26
 
22
27
  <xsl:variable name="lang-1st-letter_tmp" select="substring-before(substring-after(/iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'iso-with-lang'], '('), ')')"/>
23
28
  <xsl:variable name="lang-1st-letter" select="concat('(', $lang-1st-letter_tmp , ')')"/>
@@ -161,7 +166,10 @@
161
166
 
162
167
  <xsl:template match="/">
163
168
  <xsl:call-template name="namespaceCheck"/>
164
- <fo:root font-family="Cambria, Times New Roman, Cambria Math, HanSans" font-size="11pt" xml:lang="{$lang}"> <!-- -->
169
+ <fo:root font-family="Cambria, Times New Roman, Cambria Math, Source Han Sans" font-size="11pt" xml:lang="{$lang}"> <!-- -->
170
+ <xsl:if test="$lang = 'zh'">
171
+ <xsl:attribute name="font-family">Source Han Sans, Times New Roman, Cambria Math</xsl:attribute>
172
+ </xsl:if>
165
173
  <fo:layout-master-set>
166
174
 
167
175
  <!-- cover page -->
@@ -376,8 +384,13 @@
376
384
  </fo:block>
377
385
  </fo:table-cell>
378
386
  <fo:table-cell display-align="center">
379
- <fo:block text-align="right">
380
- <fo:block>Reference number</fo:block>
387
+ <fo:block text-align="right">
388
+ <!-- Reference number -->
389
+ <fo:block>
390
+ <xsl:call-template name="getLocalizedString">
391
+ <xsl:with-param name="key">reference_number</xsl:with-param>
392
+ </xsl:call-template>
393
+ </fo:block>
381
394
  <fo:block>
382
395
  <xsl:value-of select="$ISOname"/>
383
396
  </fo:block>
@@ -402,7 +415,15 @@
402
415
  <fo:flow flow-name="xsl-region-body">
403
416
  <fo:block-container>
404
417
  <fo:block margin-top="-1mm" font-size="20pt" text-align="right">
405
- <xsl:value-of select="$stage-fullname-uppercased"/>
418
+ <xsl:value-of select="$stage-fullname-uppercased"/>
419
+ <!-- <xsl:if test="$doctype = 'amendment'">
420
+ <xsl:variable name="title-amendment">
421
+ <xsl:call-template name="getTitle">
422
+ <xsl:with-param name="name" select="'title-amendment'"/>
423
+ </xsl:call-template>
424
+ </xsl:variable>
425
+ <xsl:text> </xsl:text><xsl:value-of select="$title-amendment"/>
426
+ </xsl:if> -->
406
427
  </fo:block>
407
428
  <fo:block font-size="20pt" font-weight="bold" text-align="right">
408
429
  <xsl:value-of select="$docidentifierISO"/>
@@ -477,16 +498,13 @@
477
498
 
478
499
  <xsl:call-template name="printTitlePartEn"/>
479
500
 
480
- <!-- <xsl:if test="normalize-space($title-part) != ''">
481
- <xsl:if test="$part != ''">
482
- <xsl:text> — </xsl:text>
483
- <fo:block font-weight="normal" margin-top="6pt">
484
- <xsl:text>Part </xsl:text><xsl:value-of select="$part"/>
485
- <xsl:text>:</xsl:text>
486
- </fo:block>
487
- </xsl:if>
488
- <xsl:value-of select="$title-part"/>
489
- </xsl:if> -->
501
+ <xsl:variable name="title-amd" select="/iso:iso-standard/iso:bibdata/iso:title[@language = 'en' and @type = 'title-amd']"/>
502
+ <xsl:if test="$doctype = 'amendment' and normalize-space($title-amd) != ''">
503
+ <fo:block margin-top="12pt">
504
+ <xsl:call-template name="printAmendmentTitle"/>
505
+ </fo:block>
506
+ </xsl:if>
507
+
490
508
  </fo:block>
491
509
 
492
510
  <fo:block font-size="9pt"><xsl:value-of select="$linebreak"/></fo:block>
@@ -501,6 +519,15 @@
501
519
 
502
520
  <xsl:call-template name="printTitlePartFr"/>
503
521
 
522
+ <xsl:variable name="title-amd" select="/iso:iso-standard/iso:bibdata/iso:title[@language = 'fr' and @type = 'title-amd']"/>
523
+ <xsl:if test="$doctype = 'amendment' and normalize-space($title-amd) != ''">
524
+ <fo:block margin-top="6pt">
525
+ <xsl:call-template name="printAmendmentTitle">
526
+ <xsl:with-param name="lang" select="'fr'"/>
527
+ </xsl:call-template>
528
+ </fo:block>
529
+ </xsl:if>
530
+
504
531
  </fo:block>
505
532
  </fo:block>
506
533
  <fo:block margin-top="10mm">
@@ -742,8 +769,12 @@
742
769
  </fo:block>
743
770
  </fo:table-cell>
744
771
  <fo:table-cell display-align="center">
745
- <fo:block text-align="right">
746
- <fo:block>Reference number</fo:block>
772
+ <fo:block text-align="right">
773
+ <fo:block>
774
+ <xsl:call-template name="getLocalizedString">
775
+ <xsl:with-param name="key">reference_number</xsl:with-param>
776
+ </xsl:call-template>
777
+ </fo:block>
747
778
  <fo:block><xsl:value-of select="$ISOname"/></fo:block>
748
779
  <fo:block> </fo:block>
749
780
  <fo:block> </fo:block>
@@ -970,10 +1001,10 @@
970
1001
  <xsl:if test="/iso:iso-standard/iso:boilerplate/iso:copyright-statement">
971
1002
 
972
1003
  <fo:block-container height="252mm" display-align="after">
973
- <fo:block margin-bottom="3mm">
974
- <fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Attention))}" width="14mm" content-height="13mm" content-width="scale-to-fit" scaling="uniform" fox:alt-text="Image {@alt}"/>
975
- <fo:inline padding-left="6mm" font-size="12pt" font-weight="bold">COPYRIGHT PROTECTED DOCUMENT</fo:inline>
976
- </fo:block>
1004
+ <!-- <fo:block margin-bottom="3mm">
1005
+ <fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Attention))}" width="14mm" content-height="13mm" content-width="scale-to-fit" scaling="uniform" fox:alt-text="Image {@alt}"/>
1006
+ <fo:inline padding-left="6mm" font-size="12pt" font-weight="bold"></fo:inline>
1007
+ </fo:block> -->
977
1008
  <fo:block line-height="90%">
978
1009
  <fo:block font-size="9pt" text-align="justify">
979
1010
  <xsl:apply-templates select="/iso:iso-standard/iso:boilerplate/iso:copyright-statement"/>
@@ -1092,20 +1123,26 @@
1092
1123
  </fo:block>
1093
1124
  -->
1094
1125
  <fo:block font-size="18pt" font-weight="bold" margin-top="40pt" margin-bottom="20pt" line-height="1.1">
1095
- <xsl:variable name="part-en" select="/iso:iso-standard/iso:bibdata/iso:title[@language = 'en' and @type = 'title-part']"/>
1126
+
1127
+ <xsl:variable name="title-part-doc-lang" select="/iso:iso-standard/iso:bibdata/iso:title[@language = $lang and @type = 'title-part']"/>
1128
+
1129
+ <xsl:variable name="title-intro-doc-lang" select="/iso:iso-standard/iso:bibdata/iso:title[@language = $lang and @type = 'title-intro']"/>
1130
+
1096
1131
  <fo:block>
1097
- <xsl:if test="normalize-space($title-intro) != ''">
1098
- <xsl:value-of select="$title-intro"/>
1132
+ <xsl:if test="normalize-space($title-intro-doc-lang) != ''">
1133
+ <xsl:value-of select="$title-intro-doc-lang"/>
1099
1134
  <xsl:text> — </xsl:text>
1100
1135
  </xsl:if>
1101
1136
 
1102
- <xsl:value-of select="$title-main"/>
1137
+ <xsl:variable name="title-main-doc-lang" select="/iso:iso-standard/iso:bibdata/iso:title[@language = $lang and @type = 'title-main']"/>
1103
1138
 
1104
- <xsl:if test="normalize-space($part-en) != ''">
1139
+ <xsl:value-of select="$title-main-doc-lang"/>
1140
+
1141
+ <xsl:if test="normalize-space($title-part-doc-lang) != ''">
1105
1142
  <xsl:if test="$part != ''">
1106
1143
  <xsl:text> — </xsl:text>
1107
- <fo:block font-weight="normal" margin-top="12pt" line-height="1.1">
1108
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-part[@lang='en']),'#',$part)"/>
1144
+ <fo:block font-weight="normal" margin-top="12pt" line-height="1.1">
1145
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-part[@lang=$lang]),'#',$part)"/>
1109
1146
  <!-- <xsl:value-of select="$title-part-en"/>
1110
1147
  <xsl:value-of select="$part"/>
1111
1148
  <xsl:text>:</xsl:text> -->
@@ -1114,10 +1151,10 @@
1114
1151
  </xsl:if>
1115
1152
  </fo:block>
1116
1153
  <fo:block>
1117
- <xsl:value-of select="$part-en"/>
1154
+ <xsl:value-of select="$title-part-doc-lang"/>
1118
1155
  </fo:block>
1119
1156
 
1120
- <xsl:variable name="title-amd" select="/iso:iso-standard/iso:bibdata/iso:title[@language = 'en' and @type = 'title-amd']"/>
1157
+ <xsl:variable name="title-amd" select="/iso:iso-standard/iso:bibdata/iso:title[@language = $lang and @type = 'title-amd']"/>
1121
1158
  <xsl:if test="$doctype = 'amendment' and normalize-space($title-amd) != ''">
1122
1159
  <fo:block margin-top="12pt">
1123
1160
  <xsl:call-template name="printAmendmentTitle"/>
@@ -1201,7 +1238,28 @@
1201
1238
  </xsl:call-template>
1202
1239
  </fo:block>
1203
1240
  </xsl:if>
1204
- <fo:block font-size="9pt">Price based on <fo:page-number-citation ref-id="lastBlock"/> pages</fo:block>
1241
+ <xsl:variable name="countPages"/>
1242
+ <xsl:variable name="price_based_on">
1243
+ <xsl:call-template name="getLocalizedString">
1244
+ <xsl:with-param name="key">price_based_on</xsl:with-param>
1245
+ </xsl:call-template>
1246
+ </xsl:variable>
1247
+ <xsl:variable name="price_based_on_items">
1248
+ <xsl:call-template name="split">
1249
+ <xsl:with-param name="pText" select="$price_based_on"/>
1250
+ <xsl:with-param name="sep" select="'%'"/>
1251
+ <xsl:with-param name="normalize-space">false</xsl:with-param>
1252
+ </xsl:call-template>
1253
+ </xsl:variable>
1254
+ <!-- Price based on ... pages -->
1255
+ <fo:block font-size="9pt">
1256
+ <xsl:for-each select="xalan:nodeset($price_based_on_items)/item">
1257
+ <xsl:value-of select="."/>
1258
+ <xsl:if test="position() != last()">
1259
+ <fo:page-number-citation ref-id="lastBlock"/>
1260
+ </xsl:if>
1261
+ </xsl:for-each>
1262
+ </fo:block>
1205
1263
  </fo:block-container>
1206
1264
  </fo:block-container>
1207
1265
  </fo:flow>
@@ -1305,10 +1363,10 @@
1305
1363
  <xsl:otherwise> <!-- for ordered lists -->
1306
1364
  <xsl:choose>
1307
1365
  <xsl:when test="../@type = 'arabic'">
1308
- <xsl:number format="a)"/>
1366
+ <xsl:number format="a)" lang="en"/>
1309
1367
  </xsl:when>
1310
1368
  <xsl:when test="../@type = 'alphabet'">
1311
- <xsl:number format="a)"/>
1369
+ <xsl:number format="a)" lang="en"/>
1312
1370
  </xsl:when>
1313
1371
  <xsl:otherwise>
1314
1372
  <xsl:number format="1."/>
@@ -1351,6 +1409,14 @@
1351
1409
  <fo:block>www.iso.org</fo:block>
1352
1410
  </fo:block> -->
1353
1411
 
1412
+ <xsl:template match="iso:copyright-statement/iso:clause[1]/iso:title">
1413
+ <fo:block margin-bottom="3mm">
1414
+ <fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Attention))}" width="14mm" content-height="13mm" content-width="scale-to-fit" scaling="uniform" fox:alt-text="Image {@alt}"/>
1415
+ <!-- <fo:inline padding-left="6mm" font-size="12pt" font-weight="bold">COPYRIGHT PROTECTED DOCUMENT</fo:inline> -->
1416
+ <fo:inline padding-left="6mm" font-size="12pt" font-weight="bold"><xsl:apply-templates/></fo:inline>
1417
+ </fo:block>
1418
+ </xsl:template>
1419
+
1354
1420
  <xsl:template match="iso:copyright-statement//iso:p">
1355
1421
  <fo:block>
1356
1422
  <xsl:if test="preceding-sibling::iso:p">
@@ -1615,6 +1681,9 @@
1615
1681
  <xsl:if test="normalize-space($docidentifier) != ''">, </xsl:if>
1616
1682
  <fo:inline font-style="italic">
1617
1683
  <xsl:choose>
1684
+ <xsl:when test="iso:title[@type = 'main' and @language = $lang]">
1685
+ <xsl:value-of select="iso:title[@type = 'main' and @language = $lang]"/>
1686
+ </xsl:when>
1618
1687
  <xsl:when test="iso:title[@type = 'main' and @language = 'en']">
1619
1688
  <xsl:value-of select="iso:title[@type = 'main' and @language = 'en']"/>
1620
1689
  </xsl:when>
@@ -1734,6 +1803,9 @@
1734
1803
  <xsl:apply-templates select="iso:note"/>
1735
1804
  <xsl:if test="normalize-space($docidentifier) != ''">, </xsl:if>
1736
1805
  <xsl:choose>
1806
+ <xsl:when test="iso:title[@type = 'main' and @language = $lang]">
1807
+ <xsl:apply-templates select="iso:title[@type = 'main' and @language = $lang]"/>
1808
+ </xsl:when>
1737
1809
  <xsl:when test="iso:title[@type = 'main' and @language = 'en']">
1738
1810
  <xsl:apply-templates select="iso:title[@type = 'main' and @language = 'en']"/>
1739
1811
  </xsl:when>
@@ -1775,7 +1847,12 @@
1775
1847
 
1776
1848
  <xsl:template match="iso:admonition">
1777
1849
  <fo:block margin-bottom="12pt" font-weight="bold"> <!-- text-align="center" -->
1778
- <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(@type))"/>
1850
+ <xsl:variable name="type">
1851
+ <xsl:call-template name="getLocalizedString">
1852
+ <xsl:with-param name="key">admonition.<xsl:value-of select="@type"/></xsl:with-param>
1853
+ </xsl:call-template>
1854
+ </xsl:variable>
1855
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new($type))"/>
1779
1856
  <xsl:text> — </xsl:text>
1780
1857
  <xsl:apply-templates/>
1781
1858
  </fo:block>
@@ -2070,7 +2147,12 @@
2070
2147
 
2071
2148
 
2072
2149
  </title-toc>
2073
- <title-toc lang="fr">Sommaire</title-toc>
2150
+ <title-toc lang="fr">
2151
+
2152
+ <xsl:text>Sommaire</xsl:text>
2153
+
2154
+
2155
+ </title-toc>
2074
2156
 
2075
2157
  <title-toc lang="zh">Contents</title-toc>
2076
2158
 
@@ -2092,15 +2174,24 @@
2092
2174
  <xsl:text>Part #:</xsl:text>
2093
2175
 
2094
2176
 
2177
+
2095
2178
  </title-part>
2096
2179
  <title-part lang="fr">
2097
2180
 
2098
2181
  <xsl:text>Partie #:</xsl:text>
2099
2182
 
2100
2183
 
2184
+
2101
2185
  </title-part>
2102
2186
  <title-part lang="zh">第 # 部分:</title-part>
2103
2187
 
2188
+ <title-subpart lang="en">
2189
+
2190
+ </title-subpart>
2191
+ <title-subpart lang="fr">
2192
+
2193
+ </title-subpart>
2194
+
2104
2195
  <title-modified lang="en">modified</title-modified>
2105
2196
  <title-modified lang="fr">modifiée</title-modified>
2106
2197
 
@@ -2162,10 +2253,19 @@
2162
2253
 
2163
2254
  </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
2164
2255
  <xsl:param name="name"/>
2165
- <xsl:variable name="lang">
2166
- <xsl:call-template name="getLang"/>
2256
+ <xsl:param name="lang"/>
2257
+ <xsl:variable name="lang_">
2258
+ <xsl:choose>
2259
+ <xsl:when test="$lang != ''">
2260
+ <xsl:value-of select="$lang"/>
2261
+ </xsl:when>
2262
+ <xsl:otherwise>
2263
+ <xsl:call-template name="getLang"/>
2264
+ </xsl:otherwise>
2265
+ </xsl:choose>
2167
2266
  </xsl:variable>
2168
- <xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $lang]"/>
2267
+ <xsl:variable name="language" select="normalize-space($lang_)"/>
2268
+ <xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $language]"/>
2169
2269
  <xsl:choose>
2170
2270
  <xsl:when test="normalize-space($title_) != ''">
2171
2271
  <xsl:value-of select="$title_"/>
@@ -2318,6 +2418,7 @@
2318
2418
 
2319
2419
 
2320
2420
 
2421
+
2321
2422
  </xsl:attribute-set><xsl:attribute-set name="appendix-style">
2322
2423
 
2323
2424
  <xsl:attribute name="font-size">12pt</xsl:attribute>
@@ -2366,6 +2467,7 @@
2366
2467
 
2367
2468
 
2368
2469
 
2470
+
2369
2471
  </xsl:attribute-set><xsl:variable name="note-body-indent">10mm</xsl:variable><xsl:variable name="note-body-indent-table">5mm</xsl:variable><xsl:attribute-set name="note-name-style">
2370
2472
 
2371
2473
 
@@ -2445,6 +2547,7 @@
2445
2547
  <xsl:attribute name="margin-bottom">10pt</xsl:attribute>
2446
2548
 
2447
2549
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
2550
+
2448
2551
 
2449
2552
 
2450
2553
 
@@ -2567,6 +2670,10 @@
2567
2670
 
2568
2671
 
2569
2672
 
2673
+ <!-- <xsl:if test="$namespace = 'bipm'">
2674
+ <fo:block>&#xA0;</fo:block>
2675
+ </xsl:if> -->
2676
+
2570
2677
  <!-- $namespace = 'iso' or -->
2571
2678
 
2572
2679
 
@@ -2595,11 +2702,14 @@
2595
2702
 
2596
2703
 
2597
2704
  <xsl:variable name="colwidths">
2598
- <xsl:call-template name="calculate-column-widths">
2599
- <xsl:with-param name="cols-count" select="$cols-count"/>
2600
- <xsl:with-param name="table" select="$simple-table"/>
2601
- </xsl:call-template>
2705
+ <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
2706
+ <xsl:call-template name="calculate-column-widths">
2707
+ <xsl:with-param name="cols-count" select="$cols-count"/>
2708
+ <xsl:with-param name="table" select="$simple-table"/>
2709
+ </xsl:call-template>
2710
+ </xsl:if>
2602
2711
  </xsl:variable>
2712
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
2603
2713
 
2604
2714
  <!-- <xsl:variable name="colwidths2">
2605
2715
  <xsl:call-template name="calculate-column-widths">
@@ -2620,11 +2730,16 @@
2620
2730
 
2621
2731
  <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
2622
2732
 
2733
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
2623
2734
 
2624
2735
 
2736
+
2737
+
2738
+
2625
2739
 
2626
2740
 
2627
-
2741
+
2742
+
2628
2743
 
2629
2744
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
2630
2745
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
@@ -2633,30 +2748,95 @@
2633
2748
 
2634
2749
 
2635
2750
 
2636
- <fo:table id="{@id}" table-layout="fixed" width="100%" margin-left="{$margin-left}mm" margin-right="{$margin-left}mm" table-omit-footer-at-break="true">
2751
+
2752
+
2753
+
2754
+ <xsl:variable name="table_attributes">
2755
+ <attribute name="table-layout">fixed</attribute>
2756
+ <attribute name="width">100%</attribute>
2757
+ <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
2758
+ <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
2637
2759
 
2638
- <xsl:attribute name="border">1.5pt solid black</xsl:attribute>
2760
+ <attribute name="border">1.5pt solid black</attribute>
2639
2761
  <xsl:if test="*[local-name()='thead']">
2640
- <xsl:attribute name="border-top">1pt solid black</xsl:attribute>
2762
+ <attribute name="border-top">1pt solid black</attribute>
2641
2763
  </xsl:if>
2642
2764
 
2643
2765
 
2644
2766
 
2645
2767
 
2646
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
2647
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
2648
-
2649
-
2650
-
2768
+ <attribute name="margin-left">0mm</attribute>
2769
+ <attribute name="margin-right">0mm</attribute>
2651
2770
 
2771
+
2772
+
2773
+
2652
2774
 
2775
+
2653
2776
 
2654
- <xsl:attribute name="font-size">10pt</xsl:attribute>
2777
+ </xsl:variable>
2778
+
2779
+
2780
+ <fo:table id="{@id}" table-omit-footer-at-break="true">
2655
2781
 
2782
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
2783
+ <xsl:attribute name="{@name}">
2784
+ <xsl:value-of select="."/>
2785
+ </xsl:attribute>
2786
+ </xsl:for-each>
2656
2787
 
2788
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
2789
+ <xsl:if test="$isNoteOrFnExist = 'true'">
2790
+ <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
2791
+ </xsl:if>
2657
2792
 
2793
+ <xsl:choose>
2794
+ <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
2795
+ <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
2796
+ <fo:table-column column-width="{@width}"/>
2797
+ </xsl:for-each>
2798
+ </xsl:when>
2799
+ <xsl:otherwise>
2800
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
2801
+ <xsl:choose>
2802
+ <xsl:when test=". = 1 or . = 0">
2803
+ <fo:table-column column-width="proportional-column-width(2)"/>
2804
+ </xsl:when>
2805
+ <xsl:otherwise>
2806
+ <fo:table-column column-width="proportional-column-width({.})"/>
2807
+ </xsl:otherwise>
2808
+ </xsl:choose>
2809
+ </xsl:for-each>
2810
+ </xsl:otherwise>
2811
+ </xsl:choose>
2658
2812
 
2813
+ <xsl:choose>
2814
+ <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
2815
+ <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
2816
+ </xsl:when>
2817
+ <xsl:otherwise>
2818
+ <xsl:apply-templates/>
2819
+ </xsl:otherwise>
2820
+ </xsl:choose>
2659
2821
 
2822
+ </fo:table>
2823
+
2824
+ <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
2825
+ <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
2826
+ <xsl:call-template name="insertTableFooterInSeparateTable">
2827
+ <xsl:with-param name="table_attributes" select="$table_attributes"/>
2828
+ <xsl:with-param name="colwidths" select="$colwidths"/>
2829
+ <xsl:with-param name="colgroup" select="$colgroup"/>
2830
+ </xsl:call-template>
2831
+ </xsl:for-each>
2832
+
2833
+ <!-- insert footer as table -->
2834
+ <!-- <fo:table>
2835
+ <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
2836
+ <xsl:attribute name="{@name}">
2837
+ <xsl:value-of select="."/>
2838
+ </xsl:attribute>
2839
+ </xsl:for-each>
2660
2840
 
2661
2841
  <xsl:for-each select="xalan:nodeset($colwidths)//column">
2662
2842
  <xsl:choose>
@@ -2668,17 +2848,7 @@
2668
2848
  </xsl:otherwise>
2669
2849
  </xsl:choose>
2670
2850
  </xsl:for-each>
2671
-
2672
- <xsl:choose>
2673
- <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
2674
- <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
2675
- </xsl:when>
2676
- <xsl:otherwise>
2677
- <xsl:apply-templates/>
2678
- </xsl:otherwise>
2679
- </xsl:choose>
2680
-
2681
- </fo:table>
2851
+ </fo:table>-->
2682
2852
 
2683
2853
 
2684
2854
 
@@ -2691,6 +2861,7 @@
2691
2861
 
2692
2862
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
2693
2863
 
2864
+
2694
2865
  <xsl:apply-templates/>
2695
2866
  </fo:block>
2696
2867
  </xsl:if>
@@ -2746,6 +2917,13 @@
2746
2917
  <xsl:for-each select="xalan:nodeset($table)//tr">
2747
2918
  <xsl:variable name="td_text">
2748
2919
  <xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
2920
+
2921
+ <!-- <xsl:if test="$namespace = 'bipm'">
2922
+ <xsl:for-each select="*[local-name()='td'][$curr-col]//*[local-name()='math']">
2923
+ <word><xsl:value-of select="normalize-space(.)"/></word>
2924
+ </xsl:for-each>
2925
+ </xsl:if> -->
2926
+
2749
2927
  </xsl:variable>
2750
2928
  <xsl:variable name="words">
2751
2929
  <xsl:variable name="string_with_added_zerospaces">
@@ -2805,6 +2983,9 @@
2805
2983
  <xsl:value-of select="*[local-name()='origin']/@citeas"/>
2806
2984
  </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
2807
2985
  <xsl:value-of select="@target"/>
2986
+ </xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
2987
+ <xsl:variable name="math_text" select="normalize-space(.)"/>
2988
+ <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
2808
2989
  </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
2809
2990
  <xsl:param name="cols-count"/>
2810
2991
  <!-- font-weight="bold" -->
@@ -2813,7 +2994,7 @@
2813
2994
  <xsl:call-template name="table-header-title">
2814
2995
  <xsl:with-param name="cols-count" select="$cols-count"/>
2815
2996
  </xsl:call-template>
2816
-
2997
+
2817
2998
  <xsl:apply-templates/>
2818
2999
  </fo:table-header>
2819
3000
  </xsl:template><xsl:template name="table-header-title">
@@ -2838,6 +3019,13 @@
2838
3019
  </xsl:template><xsl:template match="*[local-name()='tfoot']"/><xsl:template match="*[local-name()='tfoot']" mode="process">
2839
3020
  <xsl:apply-templates/>
2840
3021
  </xsl:template><xsl:template name="insertTableFooter">
3022
+ <xsl:param name="cols-count"/>
3023
+ <xsl:if test="../*[local-name()='tfoot']">
3024
+ <fo:table-footer>
3025
+ <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/>
3026
+ </fo:table-footer>
3027
+ </xsl:if>
3028
+ </xsl:template><xsl:template name="insertTableFooter2">
2841
3029
  <xsl:param name="cols-count"/>
2842
3030
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
2843
3031
  <xsl:if test="../*[local-name()='tfoot'] or $isNoteOrFnExist = 'true'">
@@ -2861,11 +3049,29 @@
2861
3049
  <!-- fn will be processed inside 'note' processing -->
2862
3050
 
2863
3051
 
3052
+
3053
+
3054
+
3055
+
2864
3056
  <!-- except gb -->
2865
3057
 
2866
3058
  <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
2867
3059
 
2868
3060
 
3061
+ <!-- show Note under table in preface (ex. abstract) sections -->
3062
+ <!-- empty, because notes show at page side in main sections -->
3063
+ <!-- <xsl:if test="$namespace = 'bipm'">
3064
+ <xsl:choose>
3065
+ <xsl:when test="ancestor::*[local-name()='preface']">
3066
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
3067
+ </xsl:when>
3068
+ <xsl:otherwise>
3069
+ <fo:block/>
3070
+ </xsl:otherwise>
3071
+ </xsl:choose>
3072
+ </xsl:if> -->
3073
+
3074
+
2869
3075
  <!-- horizontal row separator -->
2870
3076
 
2871
3077
 
@@ -2879,6 +3085,109 @@
2879
3085
  </fo:table-footer>
2880
3086
 
2881
3087
  </xsl:if>
3088
+ </xsl:template><xsl:template name="insertTableFooterInSeparateTable">
3089
+ <xsl:param name="table_attributes"/>
3090
+ <xsl:param name="colwidths"/>
3091
+ <xsl:param name="colgroup"/>
3092
+
3093
+ <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
3094
+
3095
+ <xsl:if test="$isNoteOrFnExist = 'true'">
3096
+
3097
+ <xsl:variable name="cols-count">
3098
+ <xsl:choose>
3099
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
3100
+ <xsl:value-of select="count(xalan:nodeset($colgroup)//*[local-name()='col'])"/>
3101
+ </xsl:when>
3102
+ <xsl:otherwise>
3103
+ <xsl:value-of select="count(xalan:nodeset($colwidths)//column)"/>
3104
+ </xsl:otherwise>
3105
+ </xsl:choose>
3106
+ </xsl:variable>
3107
+
3108
+ <fo:table keep-with-previous="always">
3109
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
3110
+ <xsl:choose>
3111
+ <xsl:when test="@name = 'border-top'">
3112
+ <xsl:attribute name="{@name}">0pt solid black</xsl:attribute>
3113
+ </xsl:when>
3114
+ <xsl:when test="@name = 'border'">
3115
+ <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
3116
+ <xsl:attribute name="border-top">0pt solid black</xsl:attribute>
3117
+ </xsl:when>
3118
+ <xsl:otherwise>
3119
+ <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
3120
+ </xsl:otherwise>
3121
+ </xsl:choose>
3122
+ </xsl:for-each>
3123
+
3124
+ <xsl:choose>
3125
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
3126
+ <xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
3127
+ <fo:table-column column-width="{@width}"/>
3128
+ </xsl:for-each>
3129
+ </xsl:when>
3130
+ <xsl:otherwise>
3131
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
3132
+ <xsl:choose>
3133
+ <xsl:when test=". = 1 or . = 0">
3134
+ <fo:table-column column-width="proportional-column-width(2)"/>
3135
+ </xsl:when>
3136
+ <xsl:otherwise>
3137
+ <fo:table-column column-width="proportional-column-width({.})"/>
3138
+ </xsl:otherwise>
3139
+ </xsl:choose>
3140
+ </xsl:for-each>
3141
+ </xsl:otherwise>
3142
+ </xsl:choose>
3143
+
3144
+ <fo:table-body>
3145
+ <fo:table-row>
3146
+ <fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
3147
+
3148
+ <xsl:attribute name="border-top">solid black 0pt</xsl:attribute>
3149
+
3150
+
3151
+
3152
+ <!-- fn will be processed inside 'note' processing -->
3153
+
3154
+
3155
+
3156
+
3157
+
3158
+
3159
+
3160
+ <!-- except gb -->
3161
+
3162
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
3163
+
3164
+
3165
+ <!-- <xsl:if test="$namespace = 'bipm'">
3166
+ <xsl:choose>
3167
+ <xsl:when test="ancestor::*[local-name()='preface']">
3168
+ show Note under table in preface (ex. abstract) sections
3169
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
3170
+ </xsl:when>
3171
+ <xsl:otherwise>
3172
+ empty, because notes show at page side in main sections
3173
+ <fo:block/>
3174
+ </xsl:otherwise>
3175
+ </xsl:choose>
3176
+ </xsl:if> -->
3177
+
3178
+
3179
+ <!-- horizontal row separator -->
3180
+
3181
+
3182
+ <!-- fn processing -->
3183
+ <xsl:call-template name="fn_display"/>
3184
+
3185
+ </fo:table-cell>
3186
+ </fo:table-row>
3187
+ </fo:table-body>
3188
+
3189
+ </fo:table>
3190
+ </xsl:if>
2882
3191
  </xsl:template><xsl:template match="*[local-name()='tbody']">
2883
3192
 
2884
3193
  <xsl:variable name="cols-count">
@@ -2981,8 +3290,12 @@
2981
3290
 
2982
3291
  </xsl:if>
2983
3292
 
2984
-
2985
-
3293
+
3294
+
3295
+
3296
+ <!-- <xsl:if test="$namespace = 'bipm'">
3297
+ <xsl:attribute name="height">8mm</xsl:attribute>
3298
+ </xsl:if> -->
2986
3299
 
2987
3300
  <xsl:apply-templates/>
2988
3301
  </fo:table-row>
@@ -3008,6 +3321,7 @@
3008
3321
 
3009
3322
 
3010
3323
 
3324
+
3011
3325
  <xsl:if test="@colspan">
3012
3326
  <xsl:attribute name="number-columns-spanned">
3013
3327
  <xsl:value-of select="@colspan"/>
@@ -3053,7 +3367,8 @@
3053
3367
  <xsl:attribute name="border">solid black 0</xsl:attribute>
3054
3368
  </xsl:if>
3055
3369
 
3056
-
3370
+
3371
+
3057
3372
 
3058
3373
 
3059
3374
 
@@ -3071,7 +3386,8 @@
3071
3386
  </xsl:attribute>
3072
3387
  </xsl:if>
3073
3388
  <xsl:call-template name="display-align"/>
3074
- <fo:block>
3389
+ <fo:block>
3390
+
3075
3391
  <xsl:apply-templates/>
3076
3392
  </fo:block>
3077
3393
  </fo:table-cell>
@@ -3086,14 +3402,17 @@
3086
3402
 
3087
3403
 
3088
3404
 
3405
+
3406
+
3089
3407
  <fo:inline padding-right="2mm">
3090
3408
 
3091
3409
 
3092
3410
 
3093
-
3411
+
3094
3412
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3095
3413
 
3096
3414
  </fo:inline>
3415
+
3097
3416
  <xsl:apply-templates mode="process"/>
3098
3417
  </fo:block>
3099
3418
 
@@ -3120,6 +3439,7 @@
3120
3439
 
3121
3440
 
3122
3441
 
3442
+
3123
3443
  <fo:inline font-size="80%" padding-right="5mm" id="{@id}">
3124
3444
 
3125
3445
 
@@ -3129,12 +3449,15 @@
3129
3449
 
3130
3450
 
3131
3451
 
3452
+
3132
3453
  <xsl:value-of select="@reference"/>
3133
3454
 
3455
+
3134
3456
  </fo:inline>
3135
3457
  <fo:inline>
3136
3458
 
3137
- <xsl:apply-templates/>
3459
+ <!-- <xsl:apply-templates /> -->
3460
+ <xsl:copy-of select="./node()"/>
3138
3461
  </fo:inline>
3139
3462
  </fo:block>
3140
3463
  </xsl:if>
@@ -3171,7 +3494,20 @@
3171
3494
  <xsl:variable name="following_dl_colwidths">
3172
3495
  <xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
3173
3496
  <xsl:variable name="html-table">
3174
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
3497
+ <xsl:variable name="doc_ns">
3498
+
3499
+ </xsl:variable>
3500
+ <xsl:variable name="ns">
3501
+ <xsl:choose>
3502
+ <xsl:when test="normalize-space($doc_ns) != ''">
3503
+ <xsl:value-of select="normalize-space($doc_ns)"/>
3504
+ </xsl:when>
3505
+ <xsl:otherwise>
3506
+ <xsl:value-of select="substring-before(name(/*), '-')"/>
3507
+ </xsl:otherwise>
3508
+ </xsl:choose>
3509
+ </xsl:variable>
3510
+ <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
3175
3511
  <xsl:element name="{$ns}:table">
3176
3512
  <xsl:for-each select="*[local-name() = 'dl'][1]">
3177
3513
  <tbody>
@@ -3236,7 +3572,8 @@
3236
3572
  <xsl:attribute name="margin-bottom">0</xsl:attribute>
3237
3573
  </xsl:if>
3238
3574
 
3239
- <xsl:apply-templates/>
3575
+ <!-- <xsl:apply-templates /> -->
3576
+ <xsl:copy-of select="./node()"/>
3240
3577
  </fo:block>
3241
3578
  </fo:table-cell>
3242
3579
  </fo:table-row>
@@ -3261,9 +3598,12 @@
3261
3598
 
3262
3599
 
3263
3600
 
3601
+
3264
3602
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
3265
3603
 
3604
+
3266
3605
  <xsl:value-of select="@reference"/>
3606
+
3267
3607
  </fo:basic-link>
3268
3608
  </fo:inline>
3269
3609
  </xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
@@ -3271,7 +3611,11 @@
3271
3611
  <xsl:apply-templates/>
3272
3612
  </fo:inline>
3273
3613
  </xsl:template><xsl:template match="*[local-name()='dl']">
3274
- <fo:block-container margin-left="0mm">
3614
+ <fo:block-container>
3615
+
3616
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
3617
+
3618
+
3275
3619
  <xsl:if test="parent::*[local-name() = 'note']">
3276
3620
  <xsl:attribute name="margin-left">
3277
3621
  <xsl:choose>
@@ -3281,8 +3625,11 @@
3281
3625
  </xsl:attribute>
3282
3626
 
3283
3627
  </xsl:if>
3284
- <fo:block-container margin-left="0mm">
3285
-
3628
+ <fo:block-container>
3629
+
3630
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
3631
+
3632
+
3286
3633
  <xsl:variable name="parent" select="local-name(..)"/>
3287
3634
 
3288
3635
  <xsl:variable name="key_iso">
@@ -3300,9 +3647,12 @@
3300
3647
  <xsl:attribute name="margin-bottom">0</xsl:attribute>
3301
3648
 
3302
3649
  <xsl:variable name="title-where">
3303
- <xsl:call-template name="getTitle">
3304
- <xsl:with-param name="name" select="'title-where'"/>
3305
- </xsl:call-template>
3650
+
3651
+ <xsl:call-template name="getLocalizedString">
3652
+ <xsl:with-param name="key">where</xsl:with-param>
3653
+ </xsl:call-template>
3654
+
3655
+
3306
3656
  </xsl:variable>
3307
3657
  <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
3308
3658
  <xsl:apply-templates select="*[local-name()='dt']/*"/>
@@ -3320,9 +3670,12 @@
3320
3670
 
3321
3671
 
3322
3672
  <xsl:variable name="title-where">
3323
- <xsl:call-template name="getTitle">
3324
- <xsl:with-param name="name" select="'title-where'"/>
3325
- </xsl:call-template>
3673
+
3674
+ <xsl:call-template name="getLocalizedString">
3675
+ <xsl:with-param name="key">where</xsl:with-param>
3676
+ </xsl:call-template>
3677
+
3678
+
3326
3679
  </xsl:variable>
3327
3680
  <xsl:value-of select="$title-where"/>
3328
3681
  </fo:block>
@@ -3336,9 +3689,12 @@
3336
3689
 
3337
3690
 
3338
3691
  <xsl:variable name="title-key">
3339
- <xsl:call-template name="getTitle">
3340
- <xsl:with-param name="name" select="'title-key'"/>
3341
- </xsl:call-template>
3692
+
3693
+ <xsl:call-template name="getLocalizedString">
3694
+ <xsl:with-param name="key">key</xsl:with-param>
3695
+ </xsl:call-template>
3696
+
3697
+
3342
3698
  </xsl:variable>
3343
3699
  <xsl:value-of select="$title-key"/>
3344
3700
  </fo:block>
@@ -3375,7 +3731,20 @@
3375
3731
  </xsl:choose>
3376
3732
  <!-- create virtual html table for dl/[dt and dd] -->
3377
3733
  <xsl:variable name="html-table">
3378
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
3734
+ <xsl:variable name="doc_ns">
3735
+
3736
+ </xsl:variable>
3737
+ <xsl:variable name="ns">
3738
+ <xsl:choose>
3739
+ <xsl:when test="normalize-space($doc_ns) != ''">
3740
+ <xsl:value-of select="normalize-space($doc_ns)"/>
3741
+ </xsl:when>
3742
+ <xsl:otherwise>
3743
+ <xsl:value-of select="substring-before(name(/*), '-')"/>
3744
+ </xsl:otherwise>
3745
+ </xsl:choose>
3746
+ </xsl:variable>
3747
+ <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
3379
3748
  <xsl:element name="{$ns}:table">
3380
3749
  <tbody>
3381
3750
  <xsl:apply-templates mode="dl"/>
@@ -3521,6 +3890,7 @@
3521
3890
 
3522
3891
 
3523
3892
 
3893
+
3524
3894
  <xsl:apply-templates/>
3525
3895
  <!-- <xsl:if test="$namespace = 'gb'">
3526
3896
  <xsl:if test="ancestor::*[local-name()='formula']">
@@ -3574,6 +3944,7 @@
3574
3944
  </fo:inline>
3575
3945
  </xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
3576
3946
  <fo:inline font-weight="bold">
3947
+
3577
3948
  <xsl:apply-templates/>
3578
3949
  </fo:inline>
3579
3950
  </xsl:template><xsl:template match="*[local-name()='sup']">
@@ -3587,18 +3958,18 @@
3587
3958
  </xsl:template><xsl:template match="*[local-name()='tt']">
3588
3959
  <fo:inline xsl:use-attribute-sets="tt-style">
3589
3960
  <xsl:variable name="_font-size">
3590
-
3591
-
3592
-
3961
+
3962
+
3963
+
3593
3964
 
3594
3965
 
3595
3966
  10
3596
3967
 
3597
3968
 
3598
3969
 
3599
-
3600
3970
 
3601
-
3971
+
3972
+
3602
3973
 
3603
3974
 
3604
3975
  </xsl:variable>
@@ -3902,7 +4273,18 @@
3902
4273
  <xsl:with-param name="previousRow" select="$newRow"/>
3903
4274
  </xsl:apply-templates>
3904
4275
  </xsl:template><xsl:template name="getLang">
3905
- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
4276
+ <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
4277
+ <xsl:variable name="language">
4278
+ <xsl:choose>
4279
+ <xsl:when test="$language_current != ''">
4280
+ <xsl:value-of select="$language_current"/>
4281
+ </xsl:when>
4282
+ <xsl:otherwise>
4283
+ <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
4284
+ </xsl:otherwise>
4285
+ </xsl:choose>
4286
+ </xsl:variable>
4287
+
3906
4288
  <xsl:choose>
3907
4289
  <xsl:when test="$language = 'English'">en</xsl:when>
3908
4290
  <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
@@ -3936,7 +4318,8 @@
3936
4318
  <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring($str, 1, 1)))"/>
3937
4319
  <xsl:value-of select="substring($str, 2)"/>
3938
4320
  </xsl:template><xsl:template match="mathml:math">
3939
- <fo:inline font-family="STIX2Math">
4321
+ <fo:inline font-family="STIX Two Math"> <!-- -->
4322
+
3940
4323
  <xsl:variable name="mathml">
3941
4324
  <xsl:apply-templates select="." mode="mathml"/>
3942
4325
  </xsl:variable>
@@ -3966,6 +4349,7 @@
3966
4349
  </xsl:choose>
3967
4350
  </xsl:variable>
3968
4351
  <fo:inline xsl:use-attribute-sets="link-style">
4352
+
3969
4353
  <xsl:choose>
3970
4354
  <xsl:when test="$target = ''">
3971
4355
  <xsl:apply-templates/>
@@ -4019,10 +4403,14 @@
4019
4403
  </fo:inline>
4020
4404
  </xsl:template><xsl:template match="*[local-name() = 'modification']">
4021
4405
  <xsl:variable name="title-modified">
4022
- <xsl:call-template name="getTitle">
4023
- <xsl:with-param name="name" select="'title-modified'"/>
4024
- </xsl:call-template>
4406
+
4407
+ <xsl:call-template name="getLocalizedString">
4408
+ <xsl:with-param name="key">modified</xsl:with-param>
4409
+ </xsl:call-template>
4410
+
4411
+
4025
4412
  </xsl:variable>
4413
+
4026
4414
  <xsl:choose>
4027
4415
  <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
4028
4416
  <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
@@ -4030,7 +4418,7 @@
4030
4418
  <xsl:apply-templates/>
4031
4419
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
4032
4420
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
4033
-
4421
+
4034
4422
  <xsl:apply-templates/>
4035
4423
  </fo:basic-link>
4036
4424
  </xsl:template><xsl:template match="*[local-name() = 'formula']" name="formula">
@@ -4083,6 +4471,8 @@
4083
4471
 
4084
4472
 
4085
4473
 
4474
+
4475
+
4086
4476
  <fo:inline xsl:use-attribute-sets="note-name-style">
4087
4477
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
4088
4478
  </fo:inline>
@@ -4173,7 +4563,8 @@
4173
4563
  </fo:inline>
4174
4564
  </xsl:if>
4175
4565
  </xsl:template><xsl:template match="*[local-name() = 'figure']">
4176
- <fo:block-container id="{@id}">
4566
+ <fo:block-container id="{@id}">
4567
+
4177
4568
  <fo:block>
4178
4569
  <xsl:apply-templates/>
4179
4570
  </fo:block>
@@ -4224,7 +4615,7 @@
4224
4615
  <xsl:apply-templates mode="bookmarks"/>
4225
4616
  </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
4226
4617
  <xsl:apply-templates select="."/>
4227
- </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
4618
+ </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
4228
4619
  <xsl:apply-templates mode="bookmarks"/>
4229
4620
  </xsl:template><xsl:template name="addBookmarks">
4230
4621
  <xsl:param name="contents"/>
@@ -4238,18 +4629,9 @@
4238
4629
  <fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
4239
4630
  <fo:bookmark-title>
4240
4631
  <xsl:variable name="bookmark-title_">
4241
- <xsl:choose>
4242
- <xsl:when test="@lang = 'en'">
4243
-
4244
-
4245
- </xsl:when>
4246
- <xsl:when test="@lang = 'fr'">
4247
-
4248
-
4249
- </xsl:when>
4250
- <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
4251
- <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
4252
- </xsl:choose>
4632
+ <xsl:call-template name="getLangVersion">
4633
+ <xsl:with-param name="lang" select="@lang"/>
4634
+ </xsl:call-template>
4253
4635
  </xsl:variable>
4254
4636
  <xsl:choose>
4255
4637
  <xsl:when test="normalize-space($bookmark-title_) != ''">
@@ -4291,6 +4673,20 @@
4291
4673
 
4292
4674
  </fo:bookmark-tree>
4293
4675
  </xsl:if>
4676
+ </xsl:template><xsl:template name="getLangVersion">
4677
+ <xsl:param name="lang"/>
4678
+ <xsl:choose>
4679
+ <xsl:when test="$lang = 'en'">
4680
+
4681
+
4682
+ </xsl:when>
4683
+ <xsl:when test="$lang = 'fr'">
4684
+
4685
+
4686
+ </xsl:when>
4687
+ <xsl:when test="$lang = 'de'">Deutsche</xsl:when>
4688
+ <xsl:otherwise><xsl:value-of select="$lang"/> version</xsl:otherwise>
4689
+ </xsl:choose>
4294
4690
  </xsl:template><xsl:template match="item" mode="bookmark">
4295
4691
  <fo:bookmark internal-destination="{@id}" starting-state="hide">
4296
4692
  <fo:bookmark-title>
@@ -4305,7 +4701,7 @@
4305
4701
  </xsl:template><xsl:template match="title" mode="bookmark"/><xsl:template match="text()" mode="bookmark"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
4306
4702
  <xsl:if test="normalize-space() != ''">
4307
4703
  <fo:block xsl:use-attribute-sets="figure-name-style">
4308
-
4704
+
4309
4705
  <xsl:apply-templates/>
4310
4706
  </fo:block>
4311
4707
  </xsl:if>
@@ -4742,9 +5138,14 @@
4742
5138
 
4743
5139
  <fo:inline>
4744
5140
 
4745
- <xsl:call-template name="getTitle">
4746
- <xsl:with-param name="name" select="'title-source'"/>
4747
- </xsl:call-template>
5141
+
5142
+
5143
+ <xsl:call-template name="getLocalizedString">
5144
+ <xsl:with-param name="key">source</xsl:with-param>
5145
+ </xsl:call-template>
5146
+
5147
+
5148
+
4748
5149
  <xsl:text>: </xsl:text>
4749
5150
  </fo:inline>
4750
5151
 
@@ -4893,9 +5294,12 @@
4893
5294
  </fo:block>
4894
5295
  </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
4895
5296
  <xsl:variable name="title-deprecated">
4896
- <xsl:call-template name="getTitle">
4897
- <xsl:with-param name="name" select="'title-deprecated'"/>
4898
- </xsl:call-template>
5297
+
5298
+ <xsl:call-template name="getLocalizedString">
5299
+ <xsl:with-param name="key">deprecated</xsl:with-param>
5300
+ </xsl:call-template>
5301
+
5302
+
4899
5303
  </xsl:variable>
4900
5304
  <fo:block xsl:use-attribute-sets="deprecates-style">
4901
5305
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
@@ -4942,13 +5346,14 @@
4942
5346
  </xsl:template><xsl:template match="*[local-name() = 'clause']">
4943
5347
  <fo:block>
4944
5348
  <xsl:call-template name="setId"/>
5349
+
4945
5350
  <xsl:apply-templates/>
4946
5351
  </fo:block>
4947
5352
  </xsl:template><xsl:template match="*[local-name() = 'definitions']">
4948
5353
  <fo:block id="{@id}">
4949
5354
  <xsl:apply-templates/>
4950
5355
  </fo:block>
4951
- </xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
5356
+ </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" priority="3"/><xsl:template match="*[local-name() = 'bibitem'][@hidden='true']" priority="3"/><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
4952
5357
 
4953
5358
  <fo:block id="{@id}">
4954
5359
  <xsl:apply-templates/>
@@ -4977,6 +5382,7 @@
4977
5382
  </xsl:choose>
4978
5383
  </xsl:attribute>
4979
5384
 
5385
+
4980
5386
  <fo:block-container margin-left="0mm">
4981
5387
  <fo:block>
4982
5388
  <xsl:apply-templates select="." mode="ul_ol"/>
@@ -5004,7 +5410,8 @@
5004
5410
  <fo:table-column column-width="107mm"/>
5005
5411
  <fo:table-column column-width="15mm"/>
5006
5412
  <fo:table-body>
5007
- <fo:table-row font-family="Arial" text-align="center" font-weight="bold" background-color="black" color="white">
5413
+ <fo:table-row text-align="center" font-weight="bold" background-color="black" color="white">
5414
+
5008
5415
  <fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell>
5009
5416
  <fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell>
5010
5417
  <fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell>
@@ -5022,6 +5429,10 @@
5022
5429
  <fo:block><xsl:apply-templates/></fo:block>
5023
5430
  </fo:table-cell>
5024
5431
  </xsl:template><xsl:template name="processBibitem">
5432
+
5433
+
5434
+ <!-- end BIPM bibitem processing-->
5435
+
5025
5436
 
5026
5437
 
5027
5438
 
@@ -5162,6 +5573,7 @@
5162
5573
 
5163
5574
 
5164
5575
 
5576
+
5165
5577
 
5166
5578
  </xsl:variable>
5167
5579
  <xsl:choose>
@@ -5178,6 +5590,7 @@
5178
5590
  <xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']/*[local-name() = 'organization']/*[local-name() = 'name']"/>
5179
5591
 
5180
5592
 
5593
+
5181
5594
  </dc:creator>
5182
5595
  <dc:description>
5183
5596
  <xsl:variable name="abstract">
@@ -5187,6 +5600,7 @@
5187
5600
 
5188
5601
 
5189
5602
 
5603
+
5190
5604
  </xsl:variable>
5191
5605
  <xsl:value-of select="normalize-space($abstract)"/>
5192
5606
  </dc:description>
@@ -5258,13 +5672,22 @@
5258
5672
  </xsl:template><xsl:template name="split">
5259
5673
  <xsl:param name="pText" select="."/>
5260
5674
  <xsl:param name="sep" select="','"/>
5675
+ <xsl:param name="normalize-space" select="'true'"/>
5261
5676
  <xsl:if test="string-length($pText) &gt;0">
5262
5677
  <item>
5263
- <xsl:value-of select="normalize-space(substring-before(concat($pText, ','), $sep))"/>
5678
+ <xsl:choose>
5679
+ <xsl:when test="$normalize-space = 'true'">
5680
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
5681
+ </xsl:when>
5682
+ <xsl:otherwise>
5683
+ <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
5684
+ </xsl:otherwise>
5685
+ </xsl:choose>
5264
5686
  </item>
5265
5687
  <xsl:call-template name="split">
5266
5688
  <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
5267
5689
  <xsl:with-param name="sep" select="$sep"/>
5690
+ <xsl:with-param name="normalize-space" select="$normalize-space"/>
5268
5691
  </xsl:call-template>
5269
5692
  </xsl:if>
5270
5693
  </xsl:template><xsl:template name="getDocumentId">
@@ -5330,4 +5753,23 @@
5330
5753
  <xsl:with-param name="letter-spacing" select="$letter-spacing"/>
5331
5754
  </xsl:call-template>
5332
5755
  </xsl:if>
5756
+ </xsl:template><xsl:template name="repeat">
5757
+ <xsl:param name="char" select="'*'"/>
5758
+ <xsl:param name="count"/>
5759
+ <xsl:if test="$count &gt; 0">
5760
+ <xsl:value-of select="$char"/>
5761
+ <xsl:call-template name="repeat">
5762
+ <xsl:with-param name="char" select="$char"/>
5763
+ <xsl:with-param name="count" select="$count - 1"/>
5764
+ </xsl:call-template>
5765
+ </xsl:if>
5766
+ </xsl:template><xsl:template name="getLocalizedString">
5767
+ <xsl:param name="key"/>
5768
+
5769
+ <xsl:variable name="curr_lang">
5770
+ <xsl:call-template name="getLang"/>
5771
+ </xsl:variable>
5772
+
5773
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
5774
+
5333
5775
  </xsl:template></xsl:stylesheet>