metanorma-iso 1.5.10 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) 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 +50 -3
  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 +5 -0
  10. data/lib/asciidoctor/iso/isodoc.rng +36 -43
  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 +13 -9
  21. data/lib/isodoc/iso/html/style-human.scss +7 -7
  22. data/lib/isodoc/iso/html/style-iso.css +11 -7
  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 +391 -88
  32. data/lib/isodoc/iso/iso.international-standard.xsl +391 -88
  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/processor.rb +11 -9
  37. data/lib/metanorma/iso/version.rb +1 -1
  38. data/metanorma-iso.gemspec +2 -2
  39. data/spec/asciidoctor-iso/base_spec.rb +26 -14
  40. data/spec/asciidoctor-iso/blocks_spec.rb +1 -1
  41. data/spec/asciidoctor-iso/cleanup_spec.rb +11 -5
  42. data/spec/asciidoctor-iso/lists_spec.rb +6 -6
  43. data/spec/asciidoctor-iso/refs_spec.rb +174 -143
  44. data/spec/asciidoctor-iso/section_spec.rb +5 -0
  45. data/spec/asciidoctor-iso/validate_spec.rb +18 -1
  46. data/spec/isodoc/amd_spec.rb +187 -22
  47. data/spec/isodoc/blocks_spec.rb +1 -0
  48. data/spec/isodoc/i18n_spec.rb +9 -22
  49. data/spec/isodoc/inline_spec.rb +1 -1
  50. data/spec/isodoc/metadata_spec.rb +170 -3
  51. data/spec/isodoc/postproc_spec.rb +2 -5
  52. data/spec/isodoc/ref_spec.rb +4 -7
  53. data/spec/isodoc/section_spec.rb +20 -0
  54. data/spec/isodoc/xref_spec.rb +12 -0
  55. data/spec/spec_helper.rb +17 -1
  56. metadata +8 -12
  57. data/.github/workflows/macos.yml +0 -41
  58. data/.github/workflows/ubuntu.yml +0 -45
  59. data/.github/workflows/windows.yml +0 -43
  60. data/lib/asciidoctor/iso/macros.rb +0 -21
  61. data/lib/asciidoctor/iso/term_lookup_cleanup.rb +0 -86
  62. data/spec/asciidoctor-iso/macros_spec.rb +0 -310
@@ -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>
@@ -756,8 +769,12 @@
756
769
  </fo:block>
757
770
  </fo:table-cell>
758
771
  <fo:table-cell display-align="center">
759
- <fo:block text-align="right">
760
- <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>
761
778
  <fo:block><xsl:value-of select="$ISOname"/></fo:block>
762
779
  <fo:block> </fo:block>
763
780
  <fo:block> </fo:block>
@@ -984,10 +1001,10 @@
984
1001
  <xsl:if test="/iso:iso-standard/iso:boilerplate/iso:copyright-statement">
985
1002
 
986
1003
  <fo:block-container height="252mm" display-align="after">
987
- <fo:block margin-bottom="3mm">
988
- <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}"/>
989
- <fo:inline padding-left="6mm" font-size="12pt" font-weight="bold">COPYRIGHT PROTECTED DOCUMENT</fo:inline>
990
- </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> -->
991
1008
  <fo:block line-height="90%">
992
1009
  <fo:block font-size="9pt" text-align="justify">
993
1010
  <xsl:apply-templates select="/iso:iso-standard/iso:boilerplate/iso:copyright-statement"/>
@@ -1106,20 +1123,26 @@
1106
1123
  </fo:block>
1107
1124
  -->
1108
1125
  <fo:block font-size="18pt" font-weight="bold" margin-top="40pt" margin-bottom="20pt" line-height="1.1">
1109
- <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
+
1110
1131
  <fo:block>
1111
- <xsl:if test="normalize-space($title-intro) != ''">
1112
- <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"/>
1113
1134
  <xsl:text> — </xsl:text>
1114
1135
  </xsl:if>
1115
1136
 
1116
- <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']"/>
1138
+
1139
+ <xsl:value-of select="$title-main-doc-lang"/>
1117
1140
 
1118
- <xsl:if test="normalize-space($part-en) != ''">
1141
+ <xsl:if test="normalize-space($title-part-doc-lang) != ''">
1119
1142
  <xsl:if test="$part != ''">
1120
1143
  <xsl:text> — </xsl:text>
1121
- <fo:block font-weight="normal" margin-top="12pt" line-height="1.1">
1122
- <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)"/>
1123
1146
  <!-- <xsl:value-of select="$title-part-en"/>
1124
1147
  <xsl:value-of select="$part"/>
1125
1148
  <xsl:text>:</xsl:text> -->
@@ -1128,10 +1151,10 @@
1128
1151
  </xsl:if>
1129
1152
  </fo:block>
1130
1153
  <fo:block>
1131
- <xsl:value-of select="$part-en"/>
1154
+ <xsl:value-of select="$title-part-doc-lang"/>
1132
1155
  </fo:block>
1133
1156
 
1134
- <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']"/>
1135
1158
  <xsl:if test="$doctype = 'amendment' and normalize-space($title-amd) != ''">
1136
1159
  <fo:block margin-top="12pt">
1137
1160
  <xsl:call-template name="printAmendmentTitle"/>
@@ -1215,7 +1238,28 @@
1215
1238
  </xsl:call-template>
1216
1239
  </fo:block>
1217
1240
  </xsl:if>
1218
- <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>
1219
1263
  </fo:block-container>
1220
1264
  </fo:block-container>
1221
1265
  </fo:flow>
@@ -1319,13 +1363,22 @@
1319
1363
  <xsl:otherwise> <!-- for ordered lists -->
1320
1364
  <xsl:choose>
1321
1365
  <xsl:when test="../@type = 'arabic'">
1322
- <xsl:number format="a)"/>
1366
+ <xsl:number format="1." lang="en"/>
1323
1367
  </xsl:when>
1324
1368
  <xsl:when test="../@type = 'alphabet'">
1325
- <xsl:number format="a)"/>
1369
+ <xsl:number format="a)" lang="en"/>
1370
+ </xsl:when>
1371
+ <xsl:when test="../@type = 'alphabet_upper'">
1372
+ <xsl:number format="A." lang="en"/>
1373
+ </xsl:when>
1374
+ <xsl:when test="../@type = 'roman'">
1375
+ <xsl:number format="i)"/>
1376
+ </xsl:when>
1377
+ <xsl:when test="../@type = 'roman_upper'">
1378
+ <xsl:number format="I."/>
1326
1379
  </xsl:when>
1327
1380
  <xsl:otherwise>
1328
- <xsl:number format="1."/>
1381
+ <xsl:number format="a)"/>
1329
1382
  </xsl:otherwise>
1330
1383
  </xsl:choose>
1331
1384
  </xsl:otherwise>
@@ -1365,6 +1418,14 @@
1365
1418
  <fo:block>www.iso.org</fo:block>
1366
1419
  </fo:block> -->
1367
1420
 
1421
+ <xsl:template match="iso:copyright-statement/iso:clause[1]/iso:title">
1422
+ <fo:block margin-bottom="3mm">
1423
+ <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}"/>
1424
+ <!-- <fo:inline padding-left="6mm" font-size="12pt" font-weight="bold">COPYRIGHT PROTECTED DOCUMENT</fo:inline> -->
1425
+ <fo:inline padding-left="6mm" font-size="12pt" font-weight="bold"><xsl:apply-templates/></fo:inline>
1426
+ </fo:block>
1427
+ </xsl:template>
1428
+
1368
1429
  <xsl:template match="iso:copyright-statement//iso:p">
1369
1430
  <fo:block>
1370
1431
  <xsl:if test="preceding-sibling::iso:p">
@@ -1629,6 +1690,9 @@
1629
1690
  <xsl:if test="normalize-space($docidentifier) != ''">, </xsl:if>
1630
1691
  <fo:inline font-style="italic">
1631
1692
  <xsl:choose>
1693
+ <xsl:when test="iso:title[@type = 'main' and @language = $lang]">
1694
+ <xsl:value-of select="iso:title[@type = 'main' and @language = $lang]"/>
1695
+ </xsl:when>
1632
1696
  <xsl:when test="iso:title[@type = 'main' and @language = 'en']">
1633
1697
  <xsl:value-of select="iso:title[@type = 'main' and @language = 'en']"/>
1634
1698
  </xsl:when>
@@ -1748,6 +1812,9 @@
1748
1812
  <xsl:apply-templates select="iso:note"/>
1749
1813
  <xsl:if test="normalize-space($docidentifier) != ''">, </xsl:if>
1750
1814
  <xsl:choose>
1815
+ <xsl:when test="iso:title[@type = 'main' and @language = $lang]">
1816
+ <xsl:apply-templates select="iso:title[@type = 'main' and @language = $lang]"/>
1817
+ </xsl:when>
1751
1818
  <xsl:when test="iso:title[@type = 'main' and @language = 'en']">
1752
1819
  <xsl:apply-templates select="iso:title[@type = 'main' and @language = 'en']"/>
1753
1820
  </xsl:when>
@@ -1789,7 +1856,12 @@
1789
1856
 
1790
1857
  <xsl:template match="iso:admonition">
1791
1858
  <fo:block margin-bottom="12pt" font-weight="bold"> <!-- text-align="center" -->
1792
- <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(@type))"/>
1859
+ <xsl:variable name="type">
1860
+ <xsl:call-template name="getLocalizedString">
1861
+ <xsl:with-param name="key">admonition.<xsl:value-of select="@type"/></xsl:with-param>
1862
+ </xsl:call-template>
1863
+ </xsl:variable>
1864
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new($type))"/>
1793
1865
  <xsl:text> — </xsl:text>
1794
1866
  <xsl:apply-templates/>
1795
1867
  </fo:block>
@@ -2111,15 +2183,24 @@
2111
2183
  <xsl:text>Part #:</xsl:text>
2112
2184
 
2113
2185
 
2186
+
2114
2187
  </title-part>
2115
2188
  <title-part lang="fr">
2116
2189
 
2117
2190
  <xsl:text>Partie #:</xsl:text>
2118
2191
 
2119
2192
 
2193
+
2120
2194
  </title-part>
2121
2195
  <title-part lang="zh">第 # 部分:</title-part>
2122
2196
 
2197
+ <title-subpart lang="en">
2198
+
2199
+ </title-subpart>
2200
+ <title-subpart lang="fr">
2201
+
2202
+ </title-subpart>
2203
+
2123
2204
  <title-modified lang="en">modified</title-modified>
2124
2205
  <title-modified lang="fr">modifiée</title-modified>
2125
2206
 
@@ -2395,6 +2476,7 @@
2395
2476
 
2396
2477
 
2397
2478
 
2479
+
2398
2480
  </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">
2399
2481
 
2400
2482
 
@@ -2440,6 +2522,7 @@
2440
2522
 
2441
2523
  </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
2442
2524
 
2525
+
2443
2526
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
2444
2527
 
2445
2528
 
@@ -2474,6 +2557,7 @@
2474
2557
  <xsl:attribute name="margin-bottom">10pt</xsl:attribute>
2475
2558
 
2476
2559
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
2560
+
2477
2561
 
2478
2562
 
2479
2563
 
@@ -2596,7 +2680,9 @@
2596
2680
 
2597
2681
 
2598
2682
 
2599
-
2683
+ <!-- <xsl:if test="$namespace = 'bipm'">
2684
+ <fo:block>&#xA0;</fo:block>
2685
+ </xsl:if> -->
2600
2686
 
2601
2687
  <!-- $namespace = 'iso' or -->
2602
2688
 
@@ -2626,10 +2712,12 @@
2626
2712
 
2627
2713
 
2628
2714
  <xsl:variable name="colwidths">
2629
- <xsl:call-template name="calculate-column-widths">
2630
- <xsl:with-param name="cols-count" select="$cols-count"/>
2631
- <xsl:with-param name="table" select="$simple-table"/>
2632
- </xsl:call-template>
2715
+ <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
2716
+ <xsl:call-template name="calculate-column-widths">
2717
+ <xsl:with-param name="cols-count" select="$cols-count"/>
2718
+ <xsl:with-param name="table" select="$simple-table"/>
2719
+ </xsl:call-template>
2720
+ </xsl:if>
2633
2721
  </xsl:variable>
2634
2722
  <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
2635
2723
 
@@ -2712,16 +2800,25 @@
2712
2800
  <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
2713
2801
  </xsl:if>
2714
2802
 
2715
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
2716
- <xsl:choose>
2717
- <xsl:when test=". = 1 or . = 0">
2718
- <fo:table-column column-width="proportional-column-width(2)"/>
2719
- </xsl:when>
2720
- <xsl:otherwise>
2721
- <fo:table-column column-width="proportional-column-width({.})"/>
2722
- </xsl:otherwise>
2723
- </xsl:choose>
2724
- </xsl:for-each>
2803
+ <xsl:choose>
2804
+ <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
2805
+ <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
2806
+ <fo:table-column column-width="{@width}"/>
2807
+ </xsl:for-each>
2808
+ </xsl:when>
2809
+ <xsl:otherwise>
2810
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
2811
+ <xsl:choose>
2812
+ <xsl:when test=". = 1 or . = 0">
2813
+ <fo:table-column column-width="proportional-column-width(2)"/>
2814
+ </xsl:when>
2815
+ <xsl:otherwise>
2816
+ <fo:table-column column-width="proportional-column-width({.})"/>
2817
+ </xsl:otherwise>
2818
+ </xsl:choose>
2819
+ </xsl:for-each>
2820
+ </xsl:otherwise>
2821
+ </xsl:choose>
2725
2822
 
2726
2823
  <xsl:choose>
2727
2824
  <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
@@ -2734,10 +2831,12 @@
2734
2831
 
2735
2832
  </fo:table>
2736
2833
 
2834
+ <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
2737
2835
  <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
2738
2836
  <xsl:call-template name="insertTableFooterInSeparateTable">
2739
2837
  <xsl:with-param name="table_attributes" select="$table_attributes"/>
2740
2838
  <xsl:with-param name="colwidths" select="$colwidths"/>
2839
+ <xsl:with-param name="colgroup" select="$colgroup"/>
2741
2840
  </xsl:call-template>
2742
2841
  </xsl:for-each>
2743
2842
 
@@ -2772,6 +2871,7 @@
2772
2871
 
2773
2872
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
2774
2873
 
2874
+
2775
2875
  <xsl:apply-templates/>
2776
2876
  </fo:block>
2777
2877
  </xsl:if>
@@ -2960,12 +3060,26 @@
2960
3060
 
2961
3061
 
2962
3062
 
2963
- <!-- except gb and bipm -->
2964
3063
 
2965
- <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
2966
3064
 
2967
3065
 
3066
+ <!-- except gb -->
2968
3067
 
3068
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
3069
+
3070
+
3071
+ <!-- show Note under table in preface (ex. abstract) sections -->
3072
+ <!-- empty, because notes show at page side in main sections -->
3073
+ <!-- <xsl:if test="$namespace = 'bipm'">
3074
+ <xsl:choose>
3075
+ <xsl:when test="ancestor::*[local-name()='preface']">
3076
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
3077
+ </xsl:when>
3078
+ <xsl:otherwise>
3079
+ <fo:block/>
3080
+ </xsl:otherwise>
3081
+ </xsl:choose>
3082
+ </xsl:if> -->
2969
3083
 
2970
3084
 
2971
3085
  <!-- horizontal row separator -->
@@ -2984,12 +3098,22 @@
2984
3098
  </xsl:template><xsl:template name="insertTableFooterInSeparateTable">
2985
3099
  <xsl:param name="table_attributes"/>
2986
3100
  <xsl:param name="colwidths"/>
3101
+ <xsl:param name="colgroup"/>
2987
3102
 
2988
3103
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
2989
3104
 
2990
3105
  <xsl:if test="$isNoteOrFnExist = 'true'">
2991
3106
 
2992
- <xsl:variable name="cols-count" select="count(xalan:nodeset($colwidths)//column)"/>
3107
+ <xsl:variable name="cols-count">
3108
+ <xsl:choose>
3109
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
3110
+ <xsl:value-of select="count(xalan:nodeset($colgroup)//*[local-name()='col'])"/>
3111
+ </xsl:when>
3112
+ <xsl:otherwise>
3113
+ <xsl:value-of select="count(xalan:nodeset($colwidths)//column)"/>
3114
+ </xsl:otherwise>
3115
+ </xsl:choose>
3116
+ </xsl:variable>
2993
3117
 
2994
3118
  <fo:table keep-with-previous="always">
2995
3119
  <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
@@ -3007,16 +3131,25 @@
3007
3131
  </xsl:choose>
3008
3132
  </xsl:for-each>
3009
3133
 
3010
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
3011
- <xsl:choose>
3012
- <xsl:when test=". = 1 or . = 0">
3013
- <fo:table-column column-width="proportional-column-width(2)"/>
3014
- </xsl:when>
3015
- <xsl:otherwise>
3016
- <fo:table-column column-width="proportional-column-width({.})"/>
3017
- </xsl:otherwise>
3018
- </xsl:choose>
3019
- </xsl:for-each>
3134
+ <xsl:choose>
3135
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
3136
+ <xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
3137
+ <fo:table-column column-width="{@width}"/>
3138
+ </xsl:for-each>
3139
+ </xsl:when>
3140
+ <xsl:otherwise>
3141
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
3142
+ <xsl:choose>
3143
+ <xsl:when test=". = 1 or . = 0">
3144
+ <fo:table-column column-width="proportional-column-width(2)"/>
3145
+ </xsl:when>
3146
+ <xsl:otherwise>
3147
+ <fo:table-column column-width="proportional-column-width({.})"/>
3148
+ </xsl:otherwise>
3149
+ </xsl:choose>
3150
+ </xsl:for-each>
3151
+ </xsl:otherwise>
3152
+ </xsl:choose>
3020
3153
 
3021
3154
  <fo:table-body>
3022
3155
  <fo:table-row>
@@ -3030,7 +3163,11 @@
3030
3163
 
3031
3164
 
3032
3165
 
3033
- <!-- except gb and bipm -->
3166
+
3167
+
3168
+
3169
+
3170
+ <!-- except gb -->
3034
3171
 
3035
3172
  <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
3036
3173
 
@@ -3166,6 +3303,10 @@
3166
3303
 
3167
3304
 
3168
3305
 
3306
+ <!-- <xsl:if test="$namespace = 'bipm'">
3307
+ <xsl:attribute name="height">8mm</xsl:attribute>
3308
+ </xsl:if> -->
3309
+
3169
3310
  <xsl:apply-templates/>
3170
3311
  </fo:table-row>
3171
3312
  </xsl:template><xsl:template match="*[local-name()='th']">
@@ -3255,7 +3396,8 @@
3255
3396
  </xsl:attribute>
3256
3397
  </xsl:if>
3257
3398
  <xsl:call-template name="display-align"/>
3258
- <fo:block>
3399
+ <fo:block>
3400
+
3259
3401
  <xsl:apply-templates/>
3260
3402
  </fo:block>
3261
3403
  </fo:table-cell>
@@ -3479,7 +3621,13 @@
3479
3621
  <xsl:apply-templates/>
3480
3622
  </fo:inline>
3481
3623
  </xsl:template><xsl:template match="*[local-name()='dl']">
3482
- <fo:block-container margin-left="0mm">
3624
+ <fo:block-container>
3625
+
3626
+ <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
3627
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
3628
+ </xsl:if>
3629
+
3630
+
3483
3631
  <xsl:if test="parent::*[local-name() = 'note']">
3484
3632
  <xsl:attribute name="margin-left">
3485
3633
  <xsl:choose>
@@ -3489,8 +3637,12 @@
3489
3637
  </xsl:attribute>
3490
3638
 
3491
3639
  </xsl:if>
3492
- <fo:block-container margin-left="0mm">
3493
-
3640
+ <fo:block-container>
3641
+
3642
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
3643
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
3644
+
3645
+
3494
3646
  <xsl:variable name="parent" select="local-name(..)"/>
3495
3647
 
3496
3648
  <xsl:variable name="key_iso">
@@ -3508,9 +3660,12 @@
3508
3660
  <xsl:attribute name="margin-bottom">0</xsl:attribute>
3509
3661
 
3510
3662
  <xsl:variable name="title-where">
3511
- <xsl:call-template name="getTitle">
3512
- <xsl:with-param name="name" select="'title-where'"/>
3513
- </xsl:call-template>
3663
+
3664
+ <xsl:call-template name="getLocalizedString">
3665
+ <xsl:with-param name="key">where</xsl:with-param>
3666
+ </xsl:call-template>
3667
+
3668
+
3514
3669
  </xsl:variable>
3515
3670
  <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
3516
3671
  <xsl:apply-templates select="*[local-name()='dt']/*"/>
@@ -3528,9 +3683,12 @@
3528
3683
 
3529
3684
 
3530
3685
  <xsl:variable name="title-where">
3531
- <xsl:call-template name="getTitle">
3532
- <xsl:with-param name="name" select="'title-where'"/>
3533
- </xsl:call-template>
3686
+
3687
+ <xsl:call-template name="getLocalizedString">
3688
+ <xsl:with-param name="key">where</xsl:with-param>
3689
+ </xsl:call-template>
3690
+
3691
+
3534
3692
  </xsl:variable>
3535
3693
  <xsl:value-of select="$title-where"/>
3536
3694
  </fo:block>
@@ -3544,9 +3702,12 @@
3544
3702
 
3545
3703
 
3546
3704
  <xsl:variable name="title-key">
3547
- <xsl:call-template name="getTitle">
3548
- <xsl:with-param name="name" select="'title-key'"/>
3549
- </xsl:call-template>
3705
+
3706
+ <xsl:call-template name="getLocalizedString">
3707
+ <xsl:with-param name="key">key</xsl:with-param>
3708
+ </xsl:call-template>
3709
+
3710
+
3550
3711
  </xsl:variable>
3551
3712
  <xsl:value-of select="$title-key"/>
3552
3713
  </fo:block>
@@ -3677,12 +3838,32 @@
3677
3838
  </xsl:otherwise>
3678
3839
  </xsl:choose>
3679
3840
  </xsl:template><xsl:template name="getMaxLength_dt">
3680
- <xsl:for-each select="*[local-name()='dt']">
3681
- <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
3682
- <xsl:if test="position() = 1">
3683
- <xsl:value-of select="string-length(normalize-space(.))"/>
3684
- </xsl:if>
3685
- </xsl:for-each>
3841
+ <xsl:variable name="lengths">
3842
+ <xsl:for-each select="*[local-name()='dt']">
3843
+ <xsl:variable name="maintext_length" select="string-length(normalize-space(.))"/>
3844
+ <xsl:variable name="attributes">
3845
+ <xsl:for-each select=".//@open"><xsl:value-of select="."/></xsl:for-each>
3846
+ <xsl:for-each select=".//@close"><xsl:value-of select="."/></xsl:for-each>
3847
+ </xsl:variable>
3848
+ <length><xsl:value-of select="string-length(normalize-space(.)) + string-length($attributes)"/></length>
3849
+ </xsl:for-each>
3850
+ </xsl:variable>
3851
+ <xsl:variable name="maxLength">
3852
+ <!-- <xsl:for-each select="*[local-name()='dt']">
3853
+ <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
3854
+ <xsl:if test="position() = 1">
3855
+ <xsl:value-of select="string-length(normalize-space(.))"/>
3856
+ </xsl:if>
3857
+ </xsl:for-each> -->
3858
+ <xsl:for-each select="xalan:nodeset($lengths)/length">
3859
+ <xsl:sort select="." data-type="number" order="descending"/>
3860
+ <xsl:if test="position() = 1">
3861
+ <xsl:value-of select="."/>
3862
+ </xsl:if>
3863
+ </xsl:for-each>
3864
+ </xsl:variable>
3865
+ <!-- <xsl:message>DEBUG:<xsl:value-of select="$maxLength"/></xsl:message> -->
3866
+ <xsl:value-of select="$maxLength"/>
3686
3867
  </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']" priority="2">
3687
3868
  <xsl:param name="key_iso"/>
3688
3869
 
@@ -3796,6 +3977,7 @@
3796
3977
  </fo:inline>
3797
3978
  </xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
3798
3979
  <fo:inline font-weight="bold">
3980
+
3799
3981
  <xsl:apply-templates/>
3800
3982
  </fo:inline>
3801
3983
  </xsl:template><xsl:template match="*[local-name()='sup']">
@@ -4124,7 +4306,18 @@
4124
4306
  <xsl:with-param name="previousRow" select="$newRow"/>
4125
4307
  </xsl:apply-templates>
4126
4308
  </xsl:template><xsl:template name="getLang">
4127
- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
4309
+ <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
4310
+ <xsl:variable name="language">
4311
+ <xsl:choose>
4312
+ <xsl:when test="$language_current != ''">
4313
+ <xsl:value-of select="$language_current"/>
4314
+ </xsl:when>
4315
+ <xsl:otherwise>
4316
+ <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
4317
+ </xsl:otherwise>
4318
+ </xsl:choose>
4319
+ </xsl:variable>
4320
+
4128
4321
  <xsl:choose>
4129
4322
  <xsl:when test="$language = 'English'">en</xsl:when>
4130
4323
  <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
@@ -4159,6 +4352,7 @@
4159
4352
  <xsl:value-of select="substring($str, 2)"/>
4160
4353
  </xsl:template><xsl:template match="mathml:math">
4161
4354
  <fo:inline font-family="STIX Two Math"> <!-- -->
4355
+
4162
4356
  <xsl:variable name="mathml">
4163
4357
  <xsl:apply-templates select="." mode="mathml"/>
4164
4358
  </xsl:variable>
@@ -4188,6 +4382,7 @@
4188
4382
  </xsl:choose>
4189
4383
  </xsl:variable>
4190
4384
  <fo:inline xsl:use-attribute-sets="link-style">
4385
+
4191
4386
  <xsl:choose>
4192
4387
  <xsl:when test="$target = ''">
4193
4388
  <xsl:apply-templates/>
@@ -4241,10 +4436,14 @@
4241
4436
  </fo:inline>
4242
4437
  </xsl:template><xsl:template match="*[local-name() = 'modification']">
4243
4438
  <xsl:variable name="title-modified">
4244
- <xsl:call-template name="getTitle">
4245
- <xsl:with-param name="name" select="'title-modified'"/>
4246
- </xsl:call-template>
4439
+
4440
+ <xsl:call-template name="getLocalizedString">
4441
+ <xsl:with-param name="key">modified</xsl:with-param>
4442
+ </xsl:call-template>
4443
+
4444
+
4247
4445
  </xsl:variable>
4446
+
4248
4447
  <xsl:choose>
4249
4448
  <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
4250
4449
  <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
@@ -4305,6 +4504,8 @@
4305
4504
 
4306
4505
 
4307
4506
 
4507
+
4508
+
4308
4509
  <fo:inline xsl:use-attribute-sets="note-name-style">
4309
4510
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
4310
4511
  </fo:inline>
@@ -4395,7 +4596,8 @@
4395
4596
  </fo:inline>
4396
4597
  </xsl:if>
4397
4598
  </xsl:template><xsl:template match="*[local-name() = 'figure']">
4398
- <fo:block-container id="{@id}">
4599
+ <fo:block-container id="{@id}">
4600
+
4399
4601
  <fo:block>
4400
4602
  <xsl:apply-templates/>
4401
4603
  </fo:block>
@@ -4446,7 +4648,7 @@
4446
4648
  <xsl:apply-templates mode="bookmarks"/>
4447
4649
  </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
4448
4650
  <xsl:apply-templates select="."/>
4449
- </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
4651
+ </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
4450
4652
  <xsl:apply-templates mode="bookmarks"/>
4451
4653
  </xsl:template><xsl:template name="addBookmarks">
4452
4654
  <xsl:param name="contents"/>
@@ -4462,6 +4664,8 @@
4462
4664
  <xsl:variable name="bookmark-title_">
4463
4665
  <xsl:call-template name="getLangVersion">
4464
4666
  <xsl:with-param name="lang" select="@lang"/>
4667
+ <xsl:with-param name="doctype" select="@doctype"/>
4668
+ <xsl:with-param name="title" select="@title-part"/>
4465
4669
  </xsl:call-template>
4466
4670
  </xsl:variable>
4467
4671
  <xsl:choose>
@@ -4479,13 +4683,34 @@
4479
4683
  </xsl:choose>
4480
4684
  </fo:bookmark-title>
4481
4685
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
4686
+
4687
+ <xsl:call-template name="insertFigureBookmarks">
4688
+ <xsl:with-param name="contents" select="contents"/>
4689
+ </xsl:call-template>
4690
+
4691
+ <xsl:call-template name="insertTableBookmarks">
4692
+ <xsl:with-param name="contents" select="contents"/>
4693
+ <xsl:with-param name="lang" select="@lang"/>
4694
+ </xsl:call-template>
4695
+
4482
4696
  </fo:bookmark>
4483
4697
 
4484
4698
  </xsl:for-each>
4485
4699
  </xsl:when>
4486
4700
  <xsl:otherwise>
4487
4701
  <xsl:for-each select="xalan:nodeset($contents)/doc">
4702
+
4488
4703
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
4704
+
4705
+ <xsl:call-template name="insertFigureBookmarks">
4706
+ <xsl:with-param name="contents" select="contents"/>
4707
+ </xsl:call-template>
4708
+
4709
+ <xsl:call-template name="insertTableBookmarks">
4710
+ <xsl:with-param name="contents" select="contents"/>
4711
+ <xsl:with-param name="lang" select="@lang"/>
4712
+ </xsl:call-template>
4713
+
4489
4714
  </xsl:for-each>
4490
4715
  </xsl:otherwise>
4491
4716
  </xsl:choose>
@@ -4504,8 +4729,44 @@
4504
4729
 
4505
4730
  </fo:bookmark-tree>
4506
4731
  </xsl:if>
4732
+ </xsl:template><xsl:template name="insertFigureBookmarks">
4733
+ <xsl:param name="contents"/>
4734
+ <xsl:if test="xalan:nodeset($contents)/figure">
4735
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/figure[1]/@id}" starting-state="hide">
4736
+ <fo:bookmark-title>Figures</fo:bookmark-title>
4737
+ <xsl:for-each select="xalan:nodeset($contents)/figure">
4738
+ <fo:bookmark internal-destination="{@id}">
4739
+ <fo:bookmark-title>
4740
+ <xsl:value-of select="normalize-space(title)"/>
4741
+ </fo:bookmark-title>
4742
+ </fo:bookmark>
4743
+ </xsl:for-each>
4744
+ </fo:bookmark>
4745
+ </xsl:if>
4746
+ </xsl:template><xsl:template name="insertTableBookmarks">
4747
+ <xsl:param name="contents"/>
4748
+ <xsl:param name="lang"/>
4749
+ <xsl:if test="xalan:nodeset($contents)/table">
4750
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/table[1]/@id}" starting-state="hide">
4751
+ <fo:bookmark-title>
4752
+ <xsl:choose>
4753
+ <xsl:when test="$lang = 'fr'">Tableaux</xsl:when>
4754
+ <xsl:otherwise>Tables</xsl:otherwise>
4755
+ </xsl:choose>
4756
+ </fo:bookmark-title>
4757
+ <xsl:for-each select="xalan:nodeset($contents)/table">
4758
+ <fo:bookmark internal-destination="{@id}">
4759
+ <fo:bookmark-title>
4760
+ <xsl:value-of select="normalize-space(title)"/>
4761
+ </fo:bookmark-title>
4762
+ </fo:bookmark>
4763
+ </xsl:for-each>
4764
+ </fo:bookmark>
4765
+ </xsl:if>
4507
4766
  </xsl:template><xsl:template name="getLangVersion">
4508
4767
  <xsl:param name="lang"/>
4768
+ <xsl:param name="doctype" select="''"/>
4769
+ <xsl:param name="title" select="''"/>
4509
4770
  <xsl:choose>
4510
4771
  <xsl:when test="$lang = 'en'">
4511
4772
 
@@ -4969,9 +5230,14 @@
4969
5230
 
4970
5231
  <fo:inline>
4971
5232
 
4972
- <xsl:call-template name="getTitle">
4973
- <xsl:with-param name="name" select="'title-source'"/>
4974
- </xsl:call-template>
5233
+
5234
+
5235
+ <xsl:call-template name="getLocalizedString">
5236
+ <xsl:with-param name="key">source</xsl:with-param>
5237
+ </xsl:call-template>
5238
+
5239
+
5240
+
4975
5241
  <xsl:text>: </xsl:text>
4976
5242
  </fo:inline>
4977
5243
 
@@ -4996,7 +5262,8 @@
4996
5262
  <fo:block-container margin-left="0mm">
4997
5263
 
4998
5264
  <fo:block xsl:use-attribute-sets="quote-style">
4999
- <xsl:apply-templates select=".//*[local-name() = 'p']"/>
5265
+ <!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
5266
+ <xsl:apply-templates select="./*[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
5000
5267
  </fo:block>
5001
5268
  <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
5002
5269
  <fo:block xsl:use-attribute-sets="quote-source-style">
@@ -5120,9 +5387,12 @@
5120
5387
  </fo:block>
5121
5388
  </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
5122
5389
  <xsl:variable name="title-deprecated">
5123
- <xsl:call-template name="getTitle">
5124
- <xsl:with-param name="name" select="'title-deprecated'"/>
5125
- </xsl:call-template>
5390
+
5391
+ <xsl:call-template name="getLocalizedString">
5392
+ <xsl:with-param name="key">deprecated</xsl:with-param>
5393
+ </xsl:call-template>
5394
+
5395
+
5126
5396
  </xsl:variable>
5127
5397
  <fo:block xsl:use-attribute-sets="deprecates-style">
5128
5398
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
@@ -5176,7 +5446,7 @@
5176
5446
  <fo:block id="{@id}">
5177
5447
  <xsl:apply-templates/>
5178
5448
  </fo:block>
5179
- </xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
5449
+ </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']">
5180
5450
 
5181
5451
  <fo:block id="{@id}">
5182
5452
  <xsl:apply-templates/>
@@ -5233,7 +5503,8 @@
5233
5503
  <fo:table-column column-width="107mm"/>
5234
5504
  <fo:table-column column-width="15mm"/>
5235
5505
  <fo:table-body>
5236
- <fo:table-row font-family="Arial" text-align="center" font-weight="bold" background-color="black" color="white">
5506
+ <fo:table-row text-align="center" font-weight="bold" background-color="black" color="white">
5507
+
5237
5508
  <fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell>
5238
5509
  <fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell>
5239
5510
  <fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell>
@@ -5251,6 +5522,10 @@
5251
5522
  <fo:block><xsl:apply-templates/></fo:block>
5252
5523
  </fo:table-cell>
5253
5524
  </xsl:template><xsl:template name="processBibitem">
5525
+
5526
+
5527
+ <!-- end BIPM bibitem processing-->
5528
+
5254
5529
 
5255
5530
 
5256
5531
 
@@ -5490,13 +5765,22 @@
5490
5765
  </xsl:template><xsl:template name="split">
5491
5766
  <xsl:param name="pText" select="."/>
5492
5767
  <xsl:param name="sep" select="','"/>
5768
+ <xsl:param name="normalize-space" select="'true'"/>
5493
5769
  <xsl:if test="string-length($pText) &gt;0">
5494
5770
  <item>
5495
- <xsl:value-of select="normalize-space(substring-before(concat($pText, ','), $sep))"/>
5771
+ <xsl:choose>
5772
+ <xsl:when test="$normalize-space = 'true'">
5773
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
5774
+ </xsl:when>
5775
+ <xsl:otherwise>
5776
+ <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
5777
+ </xsl:otherwise>
5778
+ </xsl:choose>
5496
5779
  </item>
5497
5780
  <xsl:call-template name="split">
5498
5781
  <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
5499
5782
  <xsl:with-param name="sep" select="$sep"/>
5783
+ <xsl:with-param name="normalize-space" select="$normalize-space"/>
5500
5784
  </xsl:call-template>
5501
5785
  </xsl:if>
5502
5786
  </xsl:template><xsl:template name="getDocumentId">
@@ -5562,4 +5846,23 @@
5562
5846
  <xsl:with-param name="letter-spacing" select="$letter-spacing"/>
5563
5847
  </xsl:call-template>
5564
5848
  </xsl:if>
5849
+ </xsl:template><xsl:template name="repeat">
5850
+ <xsl:param name="char" select="'*'"/>
5851
+ <xsl:param name="count"/>
5852
+ <xsl:if test="$count &gt; 0">
5853
+ <xsl:value-of select="$char"/>
5854
+ <xsl:call-template name="repeat">
5855
+ <xsl:with-param name="char" select="$char"/>
5856
+ <xsl:with-param name="count" select="$count - 1"/>
5857
+ </xsl:call-template>
5858
+ </xsl:if>
5859
+ </xsl:template><xsl:template name="getLocalizedString">
5860
+ <xsl:param name="key"/>
5861
+
5862
+ <xsl:variable name="curr_lang">
5863
+ <xsl:call-template name="getLang"/>
5864
+ </xsl:variable>
5865
+
5866
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
5867
+
5565
5868
  </xsl:template></xsl:stylesheet>