metanorma-iso 1.5.11 → 1.6.1

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 +83 -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 +2 -2
  7. data/lib/asciidoctor/iso/cleanup.rb +33 -6
  8. data/lib/asciidoctor/iso/front.rb +5 -0
  9. data/lib/asciidoctor/iso/isodoc.rng +61 -3
  10. data/lib/asciidoctor/iso/isostandard-amd.rng +8 -4
  11. data/lib/asciidoctor/iso/isostandard.rng +27 -10
  12. data/lib/asciidoctor/iso/validate.rb +13 -1
  13. data/lib/asciidoctor/iso/validate_section.rb +21 -9
  14. data/lib/isodoc/iso/base_convert.rb +2 -1
  15. data/lib/isodoc/iso/html/header.html +4 -8
  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 +9 -9
  21. data/lib/isodoc/iso/html/style-human.scss +7 -7
  22. data/lib/isodoc/iso/html/style-iso.css +7 -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 +1 -0
  28. data/lib/isodoc/iso/i18n-fr.yaml +2 -0
  29. data/lib/isodoc/iso/i18n-zh-Hans.yaml +1 -0
  30. data/lib/isodoc/iso/i18n.rb +10 -11
  31. data/lib/isodoc/iso/iso.amendment.xsl +381 -86
  32. data/lib/isodoc/iso/iso.international-standard.xsl +381 -86
  33. data/lib/isodoc/iso/metadata.rb +1 -0
  34. data/lib/isodoc/iso/sections.rb +1 -1
  35. data/lib/isodoc/iso/word_convert.rb +4 -0
  36. data/lib/isodoc/iso/xref.rb +34 -8
  37. data/lib/metanorma/iso/processor.rb +11 -9
  38. data/lib/metanorma/iso/version.rb +1 -1
  39. data/metanorma-iso.gemspec +2 -2
  40. data/spec/asciidoctor-iso/amd_spec.rb +14 -14
  41. data/spec/asciidoctor-iso/base_spec.rb +20 -18
  42. data/spec/asciidoctor-iso/blocks_spec.rb +22 -22
  43. data/spec/asciidoctor-iso/cleanup_spec.rb +36 -30
  44. data/spec/asciidoctor-iso/inline_spec.rb +7 -7
  45. data/spec/asciidoctor-iso/lists_spec.rb +9 -9
  46. data/spec/asciidoctor-iso/refs_spec.rb +177 -146
  47. data/spec/asciidoctor-iso/section_spec.rb +12 -7
  48. data/spec/asciidoctor-iso/table_spec.rb +4 -4
  49. data/spec/asciidoctor-iso/validate_spec.rb +401 -85
  50. data/spec/isodoc/amd_spec.rb +13 -13
  51. data/spec/isodoc/blocks_spec.rb +1 -0
  52. data/spec/isodoc/metadata_spec.rb +2 -0
  53. data/spec/isodoc/ref_spec.rb +2 -2
  54. data/spec/isodoc/section_spec.rb +20 -0
  55. data/spec/isodoc/xref_spec.rb +12 -0
  56. metadata +7 -12
  57. data/.github/workflows/macos.yml +0 -49
  58. data/.github/workflows/ubuntu.yml +0 -53
  59. data/.github/workflows/windows.yml +0 -50
  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
 
@@ -2441,6 +2522,7 @@
2441
2522
 
2442
2523
  </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
2443
2524
 
2525
+
2444
2526
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
2445
2527
 
2446
2528
 
@@ -2475,6 +2557,7 @@
2475
2557
  <xsl:attribute name="margin-bottom">10pt</xsl:attribute>
2476
2558
 
2477
2559
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
2560
+
2478
2561
 
2479
2562
 
2480
2563
 
@@ -2597,7 +2680,9 @@
2597
2680
 
2598
2681
 
2599
2682
 
2600
-
2683
+ <!-- <xsl:if test="$namespace = 'bipm'">
2684
+ <fo:block>&#xA0;</fo:block>
2685
+ </xsl:if> -->
2601
2686
 
2602
2687
  <!-- $namespace = 'iso' or -->
2603
2688
 
@@ -2627,10 +2712,12 @@
2627
2712
 
2628
2713
 
2629
2714
  <xsl:variable name="colwidths">
2630
- <xsl:call-template name="calculate-column-widths">
2631
- <xsl:with-param name="cols-count" select="$cols-count"/>
2632
- <xsl:with-param name="table" select="$simple-table"/>
2633
- </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>
2634
2721
  </xsl:variable>
2635
2722
  <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
2636
2723
 
@@ -2676,7 +2763,12 @@
2676
2763
 
2677
2764
  <xsl:variable name="table_attributes">
2678
2765
  <attribute name="table-layout">fixed</attribute>
2679
- <attribute name="width">100%</attribute>
2766
+ <attribute name="width">
2767
+ <xsl:choose>
2768
+ <xsl:when test="@width"><xsl:value-of select="@width"/></xsl:when>
2769
+ <xsl:otherwise>100%</xsl:otherwise>
2770
+ </xsl:choose>
2771
+ </attribute>
2680
2772
  <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
2681
2773
  <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
2682
2774
 
@@ -2713,16 +2805,25 @@
2713
2805
  <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
2714
2806
  </xsl:if>
2715
2807
 
2716
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
2717
- <xsl:choose>
2718
- <xsl:when test=". = 1 or . = 0">
2719
- <fo:table-column column-width="proportional-column-width(2)"/>
2720
- </xsl:when>
2721
- <xsl:otherwise>
2722
- <fo:table-column column-width="proportional-column-width({.})"/>
2723
- </xsl:otherwise>
2724
- </xsl:choose>
2725
- </xsl:for-each>
2808
+ <xsl:choose>
2809
+ <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
2810
+ <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
2811
+ <fo:table-column column-width="{@width}"/>
2812
+ </xsl:for-each>
2813
+ </xsl:when>
2814
+ <xsl:otherwise>
2815
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
2816
+ <xsl:choose>
2817
+ <xsl:when test=". = 1 or . = 0">
2818
+ <fo:table-column column-width="proportional-column-width(2)"/>
2819
+ </xsl:when>
2820
+ <xsl:otherwise>
2821
+ <fo:table-column column-width="proportional-column-width({.})"/>
2822
+ </xsl:otherwise>
2823
+ </xsl:choose>
2824
+ </xsl:for-each>
2825
+ </xsl:otherwise>
2826
+ </xsl:choose>
2726
2827
 
2727
2828
  <xsl:choose>
2728
2829
  <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
@@ -2735,10 +2836,12 @@
2735
2836
 
2736
2837
  </fo:table>
2737
2838
 
2839
+ <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
2738
2840
  <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
2739
2841
  <xsl:call-template name="insertTableFooterInSeparateTable">
2740
2842
  <xsl:with-param name="table_attributes" select="$table_attributes"/>
2741
2843
  <xsl:with-param name="colwidths" select="$colwidths"/>
2844
+ <xsl:with-param name="colgroup" select="$colgroup"/>
2742
2845
  </xsl:call-template>
2743
2846
  </xsl:for-each>
2744
2847
 
@@ -2773,6 +2876,7 @@
2773
2876
 
2774
2877
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
2775
2878
 
2879
+
2776
2880
  <xsl:apply-templates/>
2777
2881
  </fo:block>
2778
2882
  </xsl:if>
@@ -2999,12 +3103,22 @@
2999
3103
  </xsl:template><xsl:template name="insertTableFooterInSeparateTable">
3000
3104
  <xsl:param name="table_attributes"/>
3001
3105
  <xsl:param name="colwidths"/>
3106
+ <xsl:param name="colgroup"/>
3002
3107
 
3003
3108
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
3004
3109
 
3005
3110
  <xsl:if test="$isNoteOrFnExist = 'true'">
3006
3111
 
3007
- <xsl:variable name="cols-count" select="count(xalan:nodeset($colwidths)//column)"/>
3112
+ <xsl:variable name="cols-count">
3113
+ <xsl:choose>
3114
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
3115
+ <xsl:value-of select="count(xalan:nodeset($colgroup)//*[local-name()='col'])"/>
3116
+ </xsl:when>
3117
+ <xsl:otherwise>
3118
+ <xsl:value-of select="count(xalan:nodeset($colwidths)//column)"/>
3119
+ </xsl:otherwise>
3120
+ </xsl:choose>
3121
+ </xsl:variable>
3008
3122
 
3009
3123
  <fo:table keep-with-previous="always">
3010
3124
  <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
@@ -3022,16 +3136,25 @@
3022
3136
  </xsl:choose>
3023
3137
  </xsl:for-each>
3024
3138
 
3025
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
3026
- <xsl:choose>
3027
- <xsl:when test=". = 1 or . = 0">
3028
- <fo:table-column column-width="proportional-column-width(2)"/>
3029
- </xsl:when>
3030
- <xsl:otherwise>
3031
- <fo:table-column column-width="proportional-column-width({.})"/>
3032
- </xsl:otherwise>
3033
- </xsl:choose>
3034
- </xsl:for-each>
3139
+ <xsl:choose>
3140
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
3141
+ <xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
3142
+ <fo:table-column column-width="{@width}"/>
3143
+ </xsl:for-each>
3144
+ </xsl:when>
3145
+ <xsl:otherwise>
3146
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
3147
+ <xsl:choose>
3148
+ <xsl:when test=". = 1 or . = 0">
3149
+ <fo:table-column column-width="proportional-column-width(2)"/>
3150
+ </xsl:when>
3151
+ <xsl:otherwise>
3152
+ <fo:table-column column-width="proportional-column-width({.})"/>
3153
+ </xsl:otherwise>
3154
+ </xsl:choose>
3155
+ </xsl:for-each>
3156
+ </xsl:otherwise>
3157
+ </xsl:choose>
3035
3158
 
3036
3159
  <fo:table-body>
3037
3160
  <fo:table-row>
@@ -3184,6 +3307,7 @@
3184
3307
 
3185
3308
 
3186
3309
 
3310
+
3187
3311
  <!-- <xsl:if test="$namespace = 'bipm'">
3188
3312
  <xsl:attribute name="height">8mm</xsl:attribute>
3189
3313
  </xsl:if> -->
@@ -3277,7 +3401,8 @@
3277
3401
  </xsl:attribute>
3278
3402
  </xsl:if>
3279
3403
  <xsl:call-template name="display-align"/>
3280
- <fo:block>
3404
+ <fo:block>
3405
+
3281
3406
  <xsl:apply-templates/>
3282
3407
  </fo:block>
3283
3408
  </fo:table-cell>
@@ -3501,7 +3626,13 @@
3501
3626
  <xsl:apply-templates/>
3502
3627
  </fo:inline>
3503
3628
  </xsl:template><xsl:template match="*[local-name()='dl']">
3504
- <fo:block-container margin-left="0mm">
3629
+ <fo:block-container>
3630
+
3631
+ <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
3632
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
3633
+ </xsl:if>
3634
+
3635
+
3505
3636
  <xsl:if test="parent::*[local-name() = 'note']">
3506
3637
  <xsl:attribute name="margin-left">
3507
3638
  <xsl:choose>
@@ -3511,8 +3642,12 @@
3511
3642
  </xsl:attribute>
3512
3643
 
3513
3644
  </xsl:if>
3514
- <fo:block-container margin-left="0mm">
3515
-
3645
+ <fo:block-container>
3646
+
3647
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
3648
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
3649
+
3650
+
3516
3651
  <xsl:variable name="parent" select="local-name(..)"/>
3517
3652
 
3518
3653
  <xsl:variable name="key_iso">
@@ -3530,9 +3665,12 @@
3530
3665
  <xsl:attribute name="margin-bottom">0</xsl:attribute>
3531
3666
 
3532
3667
  <xsl:variable name="title-where">
3533
- <xsl:call-template name="getTitle">
3534
- <xsl:with-param name="name" select="'title-where'"/>
3535
- </xsl:call-template>
3668
+
3669
+ <xsl:call-template name="getLocalizedString">
3670
+ <xsl:with-param name="key">where</xsl:with-param>
3671
+ </xsl:call-template>
3672
+
3673
+
3536
3674
  </xsl:variable>
3537
3675
  <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
3538
3676
  <xsl:apply-templates select="*[local-name()='dt']/*"/>
@@ -3550,9 +3688,12 @@
3550
3688
 
3551
3689
 
3552
3690
  <xsl:variable name="title-where">
3553
- <xsl:call-template name="getTitle">
3554
- <xsl:with-param name="name" select="'title-where'"/>
3555
- </xsl:call-template>
3691
+
3692
+ <xsl:call-template name="getLocalizedString">
3693
+ <xsl:with-param name="key">where</xsl:with-param>
3694
+ </xsl:call-template>
3695
+
3696
+
3556
3697
  </xsl:variable>
3557
3698
  <xsl:value-of select="$title-where"/>
3558
3699
  </fo:block>
@@ -3566,9 +3707,12 @@
3566
3707
 
3567
3708
 
3568
3709
  <xsl:variable name="title-key">
3569
- <xsl:call-template name="getTitle">
3570
- <xsl:with-param name="name" select="'title-key'"/>
3571
- </xsl:call-template>
3710
+
3711
+ <xsl:call-template name="getLocalizedString">
3712
+ <xsl:with-param name="key">key</xsl:with-param>
3713
+ </xsl:call-template>
3714
+
3715
+
3572
3716
  </xsl:variable>
3573
3717
  <xsl:value-of select="$title-key"/>
3574
3718
  </fo:block>
@@ -3699,12 +3843,32 @@
3699
3843
  </xsl:otherwise>
3700
3844
  </xsl:choose>
3701
3845
  </xsl:template><xsl:template name="getMaxLength_dt">
3702
- <xsl:for-each select="*[local-name()='dt']">
3703
- <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
3704
- <xsl:if test="position() = 1">
3705
- <xsl:value-of select="string-length(normalize-space(.))"/>
3706
- </xsl:if>
3707
- </xsl:for-each>
3846
+ <xsl:variable name="lengths">
3847
+ <xsl:for-each select="*[local-name()='dt']">
3848
+ <xsl:variable name="maintext_length" select="string-length(normalize-space(.))"/>
3849
+ <xsl:variable name="attributes">
3850
+ <xsl:for-each select=".//@open"><xsl:value-of select="."/></xsl:for-each>
3851
+ <xsl:for-each select=".//@close"><xsl:value-of select="."/></xsl:for-each>
3852
+ </xsl:variable>
3853
+ <length><xsl:value-of select="string-length(normalize-space(.)) + string-length($attributes)"/></length>
3854
+ </xsl:for-each>
3855
+ </xsl:variable>
3856
+ <xsl:variable name="maxLength">
3857
+ <!-- <xsl:for-each select="*[local-name()='dt']">
3858
+ <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
3859
+ <xsl:if test="position() = 1">
3860
+ <xsl:value-of select="string-length(normalize-space(.))"/>
3861
+ </xsl:if>
3862
+ </xsl:for-each> -->
3863
+ <xsl:for-each select="xalan:nodeset($lengths)/length">
3864
+ <xsl:sort select="." data-type="number" order="descending"/>
3865
+ <xsl:if test="position() = 1">
3866
+ <xsl:value-of select="."/>
3867
+ </xsl:if>
3868
+ </xsl:for-each>
3869
+ </xsl:variable>
3870
+ <!-- <xsl:message>DEBUG:<xsl:value-of select="$maxLength"/></xsl:message> -->
3871
+ <xsl:value-of select="$maxLength"/>
3708
3872
  </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']" priority="2">
3709
3873
  <xsl:param name="key_iso"/>
3710
3874
 
@@ -3818,6 +3982,7 @@
3818
3982
  </fo:inline>
3819
3983
  </xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
3820
3984
  <fo:inline font-weight="bold">
3985
+
3821
3986
  <xsl:apply-templates/>
3822
3987
  </fo:inline>
3823
3988
  </xsl:template><xsl:template match="*[local-name()='sup']">
@@ -3857,6 +4022,10 @@
3857
4022
  </xsl:if>
3858
4023
  <xsl:apply-templates/>
3859
4024
  </fo:inline>
4025
+ </xsl:template><xsl:template match="*[local-name()='underline']">
4026
+ <fo:inline text-decoration="underline">
4027
+ <xsl:apply-templates/>
4028
+ </fo:inline>
3860
4029
  </xsl:template><xsl:template match="*[local-name()='del']">
3861
4030
  <fo:inline font-size="10pt" color="red" text-decoration="line-through">
3862
4031
  <xsl:apply-templates/>
@@ -4146,7 +4315,18 @@
4146
4315
  <xsl:with-param name="previousRow" select="$newRow"/>
4147
4316
  </xsl:apply-templates>
4148
4317
  </xsl:template><xsl:template name="getLang">
4149
- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
4318
+ <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
4319
+ <xsl:variable name="language">
4320
+ <xsl:choose>
4321
+ <xsl:when test="$language_current != ''">
4322
+ <xsl:value-of select="$language_current"/>
4323
+ </xsl:when>
4324
+ <xsl:otherwise>
4325
+ <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
4326
+ </xsl:otherwise>
4327
+ </xsl:choose>
4328
+ </xsl:variable>
4329
+
4150
4330
  <xsl:choose>
4151
4331
  <xsl:when test="$language = 'English'">en</xsl:when>
4152
4332
  <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
@@ -4181,6 +4361,7 @@
4181
4361
  <xsl:value-of select="substring($str, 2)"/>
4182
4362
  </xsl:template><xsl:template match="mathml:math">
4183
4363
  <fo:inline font-family="STIX Two Math"> <!-- -->
4364
+
4184
4365
  <xsl:variable name="mathml">
4185
4366
  <xsl:apply-templates select="." mode="mathml"/>
4186
4367
  </xsl:variable>
@@ -4210,6 +4391,7 @@
4210
4391
  </xsl:choose>
4211
4392
  </xsl:variable>
4212
4393
  <fo:inline xsl:use-attribute-sets="link-style">
4394
+
4213
4395
  <xsl:choose>
4214
4396
  <xsl:when test="$target = ''">
4215
4397
  <xsl:apply-templates/>
@@ -4263,10 +4445,14 @@
4263
4445
  </fo:inline>
4264
4446
  </xsl:template><xsl:template match="*[local-name() = 'modification']">
4265
4447
  <xsl:variable name="title-modified">
4266
- <xsl:call-template name="getTitle">
4267
- <xsl:with-param name="name" select="'title-modified'"/>
4268
- </xsl:call-template>
4448
+
4449
+ <xsl:call-template name="getLocalizedString">
4450
+ <xsl:with-param name="key">modified</xsl:with-param>
4451
+ </xsl:call-template>
4452
+
4453
+
4269
4454
  </xsl:variable>
4455
+
4270
4456
  <xsl:choose>
4271
4457
  <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
4272
4458
  <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
@@ -4419,7 +4605,8 @@
4419
4605
  </fo:inline>
4420
4606
  </xsl:if>
4421
4607
  </xsl:template><xsl:template match="*[local-name() = 'figure']">
4422
- <fo:block-container id="{@id}">
4608
+ <fo:block-container id="{@id}">
4609
+
4423
4610
  <fo:block>
4424
4611
  <xsl:apply-templates/>
4425
4612
  </fo:block>
@@ -4470,7 +4657,7 @@
4470
4657
  <xsl:apply-templates mode="bookmarks"/>
4471
4658
  </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
4472
4659
  <xsl:apply-templates select="."/>
4473
- </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
4660
+ </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
4474
4661
  <xsl:apply-templates mode="bookmarks"/>
4475
4662
  </xsl:template><xsl:template name="addBookmarks">
4476
4663
  <xsl:param name="contents"/>
@@ -4486,6 +4673,8 @@
4486
4673
  <xsl:variable name="bookmark-title_">
4487
4674
  <xsl:call-template name="getLangVersion">
4488
4675
  <xsl:with-param name="lang" select="@lang"/>
4676
+ <xsl:with-param name="doctype" select="@doctype"/>
4677
+ <xsl:with-param name="title" select="@title-part"/>
4489
4678
  </xsl:call-template>
4490
4679
  </xsl:variable>
4491
4680
  <xsl:choose>
@@ -4503,13 +4692,34 @@
4503
4692
  </xsl:choose>
4504
4693
  </fo:bookmark-title>
4505
4694
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
4695
+
4696
+ <xsl:call-template name="insertFigureBookmarks">
4697
+ <xsl:with-param name="contents" select="contents"/>
4698
+ </xsl:call-template>
4699
+
4700
+ <xsl:call-template name="insertTableBookmarks">
4701
+ <xsl:with-param name="contents" select="contents"/>
4702
+ <xsl:with-param name="lang" select="@lang"/>
4703
+ </xsl:call-template>
4704
+
4506
4705
  </fo:bookmark>
4507
4706
 
4508
4707
  </xsl:for-each>
4509
4708
  </xsl:when>
4510
4709
  <xsl:otherwise>
4511
4710
  <xsl:for-each select="xalan:nodeset($contents)/doc">
4711
+
4512
4712
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
4713
+
4714
+ <xsl:call-template name="insertFigureBookmarks">
4715
+ <xsl:with-param name="contents" select="contents"/>
4716
+ </xsl:call-template>
4717
+
4718
+ <xsl:call-template name="insertTableBookmarks">
4719
+ <xsl:with-param name="contents" select="contents"/>
4720
+ <xsl:with-param name="lang" select="@lang"/>
4721
+ </xsl:call-template>
4722
+
4513
4723
  </xsl:for-each>
4514
4724
  </xsl:otherwise>
4515
4725
  </xsl:choose>
@@ -4528,8 +4738,44 @@
4528
4738
 
4529
4739
  </fo:bookmark-tree>
4530
4740
  </xsl:if>
4741
+ </xsl:template><xsl:template name="insertFigureBookmarks">
4742
+ <xsl:param name="contents"/>
4743
+ <xsl:if test="xalan:nodeset($contents)/figure">
4744
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/figure[1]/@id}" starting-state="hide">
4745
+ <fo:bookmark-title>Figures</fo:bookmark-title>
4746
+ <xsl:for-each select="xalan:nodeset($contents)/figure">
4747
+ <fo:bookmark internal-destination="{@id}">
4748
+ <fo:bookmark-title>
4749
+ <xsl:value-of select="normalize-space(title)"/>
4750
+ </fo:bookmark-title>
4751
+ </fo:bookmark>
4752
+ </xsl:for-each>
4753
+ </fo:bookmark>
4754
+ </xsl:if>
4755
+ </xsl:template><xsl:template name="insertTableBookmarks">
4756
+ <xsl:param name="contents"/>
4757
+ <xsl:param name="lang"/>
4758
+ <xsl:if test="xalan:nodeset($contents)/table">
4759
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/table[1]/@id}" starting-state="hide">
4760
+ <fo:bookmark-title>
4761
+ <xsl:choose>
4762
+ <xsl:when test="$lang = 'fr'">Tableaux</xsl:when>
4763
+ <xsl:otherwise>Tables</xsl:otherwise>
4764
+ </xsl:choose>
4765
+ </fo:bookmark-title>
4766
+ <xsl:for-each select="xalan:nodeset($contents)/table">
4767
+ <fo:bookmark internal-destination="{@id}">
4768
+ <fo:bookmark-title>
4769
+ <xsl:value-of select="normalize-space(title)"/>
4770
+ </fo:bookmark-title>
4771
+ </fo:bookmark>
4772
+ </xsl:for-each>
4773
+ </fo:bookmark>
4774
+ </xsl:if>
4531
4775
  </xsl:template><xsl:template name="getLangVersion">
4532
4776
  <xsl:param name="lang"/>
4777
+ <xsl:param name="doctype" select="''"/>
4778
+ <xsl:param name="title" select="''"/>
4533
4779
  <xsl:choose>
4534
4780
  <xsl:when test="$lang = 'en'">
4535
4781
 
@@ -4993,9 +5239,14 @@
4993
5239
 
4994
5240
  <fo:inline>
4995
5241
 
4996
- <xsl:call-template name="getTitle">
4997
- <xsl:with-param name="name" select="'title-source'"/>
4998
- </xsl:call-template>
5242
+
5243
+
5244
+ <xsl:call-template name="getLocalizedString">
5245
+ <xsl:with-param name="key">source</xsl:with-param>
5246
+ </xsl:call-template>
5247
+
5248
+
5249
+
4999
5250
  <xsl:text>: </xsl:text>
5000
5251
  </fo:inline>
5001
5252
 
@@ -5020,7 +5271,8 @@
5020
5271
  <fo:block-container margin-left="0mm">
5021
5272
 
5022
5273
  <fo:block xsl:use-attribute-sets="quote-style">
5023
- <xsl:apply-templates select=".//*[local-name() = 'p']"/>
5274
+ <!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
5275
+ <xsl:apply-templates select="./*[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
5024
5276
  </fo:block>
5025
5277
  <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
5026
5278
  <fo:block xsl:use-attribute-sets="quote-source-style">
@@ -5144,9 +5396,12 @@
5144
5396
  </fo:block>
5145
5397
  </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
5146
5398
  <xsl:variable name="title-deprecated">
5147
- <xsl:call-template name="getTitle">
5148
- <xsl:with-param name="name" select="'title-deprecated'"/>
5149
- </xsl:call-template>
5399
+
5400
+ <xsl:call-template name="getLocalizedString">
5401
+ <xsl:with-param name="key">deprecated</xsl:with-param>
5402
+ </xsl:call-template>
5403
+
5404
+
5150
5405
  </xsl:variable>
5151
5406
  <fo:block xsl:use-attribute-sets="deprecates-style">
5152
5407
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
@@ -5200,7 +5455,7 @@
5200
5455
  <fo:block id="{@id}">
5201
5456
  <xsl:apply-templates/>
5202
5457
  </fo:block>
5203
- </xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
5458
+ </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']">
5204
5459
 
5205
5460
  <fo:block id="{@id}">
5206
5461
  <xsl:apply-templates/>
@@ -5257,7 +5512,8 @@
5257
5512
  <fo:table-column column-width="107mm"/>
5258
5513
  <fo:table-column column-width="15mm"/>
5259
5514
  <fo:table-body>
5260
- <fo:table-row font-family="Arial" text-align="center" font-weight="bold" background-color="black" color="white">
5515
+ <fo:table-row text-align="center" font-weight="bold" background-color="black" color="white">
5516
+
5261
5517
  <fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell>
5262
5518
  <fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell>
5263
5519
  <fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell>
@@ -5275,6 +5531,10 @@
5275
5531
  <fo:block><xsl:apply-templates/></fo:block>
5276
5532
  </fo:table-cell>
5277
5533
  </xsl:template><xsl:template name="processBibitem">
5534
+
5535
+
5536
+ <!-- end BIPM bibitem processing-->
5537
+
5278
5538
 
5279
5539
 
5280
5540
 
@@ -5333,6 +5593,8 @@
5333
5593
  <xsl:value-of select="translate(.,'. ','')"/>
5334
5594
  </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
5335
5595
  <xsl:value-of select="substring(.,1,1)"/>
5596
+ </xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
5597
+ <fo:inline><xsl:apply-templates/></fo:inline>
5336
5598
  </xsl:template><xsl:template name="convertDate">
5337
5599
  <xsl:param name="date"/>
5338
5600
  <xsl:param name="format" select="'short'"/>
@@ -5514,13 +5776,22 @@
5514
5776
  </xsl:template><xsl:template name="split">
5515
5777
  <xsl:param name="pText" select="."/>
5516
5778
  <xsl:param name="sep" select="','"/>
5779
+ <xsl:param name="normalize-space" select="'true'"/>
5517
5780
  <xsl:if test="string-length($pText) &gt;0">
5518
5781
  <item>
5519
- <xsl:value-of select="normalize-space(substring-before(concat($pText, ','), $sep))"/>
5782
+ <xsl:choose>
5783
+ <xsl:when test="$normalize-space = 'true'">
5784
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
5785
+ </xsl:when>
5786
+ <xsl:otherwise>
5787
+ <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
5788
+ </xsl:otherwise>
5789
+ </xsl:choose>
5520
5790
  </item>
5521
5791
  <xsl:call-template name="split">
5522
5792
  <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
5523
5793
  <xsl:with-param name="sep" select="$sep"/>
5794
+ <xsl:with-param name="normalize-space" select="$normalize-space"/>
5524
5795
  </xsl:call-template>
5525
5796
  </xsl:if>
5526
5797
  </xsl:template><xsl:template name="getDocumentId">
@@ -5586,4 +5857,28 @@
5586
5857
  <xsl:with-param name="letter-spacing" select="$letter-spacing"/>
5587
5858
  </xsl:call-template>
5588
5859
  </xsl:if>
5860
+ </xsl:template><xsl:template name="repeat">
5861
+ <xsl:param name="char" select="'*'"/>
5862
+ <xsl:param name="count"/>
5863
+ <xsl:if test="$count &gt; 0">
5864
+ <xsl:value-of select="$char"/>
5865
+ <xsl:call-template name="repeat">
5866
+ <xsl:with-param name="char" select="$char"/>
5867
+ <xsl:with-param name="count" select="$count - 1"/>
5868
+ </xsl:call-template>
5869
+ </xsl:if>
5870
+ </xsl:template><xsl:template name="getLocalizedString">
5871
+ <xsl:param name="key"/>
5872
+
5873
+ <xsl:variable name="curr_lang">
5874
+ <xsl:call-template name="getLang"/>
5875
+ </xsl:variable>
5876
+
5877
+ <xsl:choose>
5878
+ <xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
5879
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
5880
+ </xsl:when>
5881
+ <xsl:otherwise><xsl:value-of select="$key"/></xsl:otherwise>
5882
+ </xsl:choose>
5883
+
5589
5884
  </xsl:template></xsl:stylesheet>