metanorma-mpfa 0.5.6 → 0.5.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '028095c8e9593bbd435c9c26a832aa880035eb14677e39cbc3404ade7b43c87c'
4
- data.tar.gz: 0ca0917efb37987a0740e0fae27b57cb36418940cb7a4be77fd6e941835ae4ab
3
+ metadata.gz: aa8dc04fe7159fa549adc2516114541a31411ca3541f4bd528c3ed14499478fb
4
+ data.tar.gz: c7cba808a347d5b850ac98610689623cbc89196045b64792f318c8c16add0af3
5
5
  SHA512:
6
- metadata.gz: 1c94dc642e33f3def7152b42c9805057a1cb70ab01814848c1bc82961f52b26a27c084ddd579ca541d25b387d92642ec771180c5021febe241208e0ed5fddcce
7
- data.tar.gz: eeb38f86787013cd4a977b36e4ea50a55e92c9d7c18641ea193899427efbe98a6550600cf0e08484acd1efd5719b9105041f78f075b73ee94f45ebfdcabea02e
6
+ metadata.gz: 9671e717d844aa493d53cd591eec1cbb2803b5b960ed901383656488512c9315b0cd59031731a26566d6ad8062aaebb699e86fe1c03e8f75ed16d09183812445
7
+ data.tar.gz: 624c66223ca8933f464e37664ebd7fff5d41282bcfa5dea97d9a93ef61c04435745d4c1d7706b9a22ec721864b75ba686d6f4ad1793f9d91f4cf6e2d23fc04dc
@@ -4,7 +4,8 @@ name: rake
4
4
 
5
5
  on:
6
6
  push:
7
- branches: [ master ]
7
+ branches: [ master, main ]
8
+ tags: [ v* ]
8
9
  pull_request:
9
10
 
10
11
  jobs:
@@ -31,14 +32,32 @@ jobs:
31
32
  steps:
32
33
  - uses: actions/checkout@master
33
34
 
34
- - name: Use Ruby
35
- uses: ruby/setup-ruby@v1
35
+ - uses: ruby/setup-ruby@v1
36
36
  with:
37
37
  ruby-version: ${{ matrix.ruby }}
38
- bundler-cache: true
39
38
 
40
- - name: Update gems
41
- run: bundle install --jobs 4 --retry 3
39
+ - uses: actions/cache@v1
40
+ with:
41
+ path: vendor/bundle
42
+ key: bundle-${{ matrix.os }}-${{ matrix.ruby }}-${{ hashFiles('**/*.gemspec') }}
43
+ restore-keys: bundle-${{ matrix.os }}-${{ matrix.ruby }}
44
+
45
+ - run: bundle config set path 'vendor/bundle'
46
+
47
+ - run: bundle install --jobs 4 --retry 3
42
48
 
43
- - name: Run specs
44
- run: bundle exec rake
49
+ - run: bundle exec rake
50
+
51
+ notify:
52
+ name: Trigger notify workflow
53
+ needs: rake
54
+ runs-on: ubuntu-latest
55
+ steps:
56
+ - name: Trigger notify workflow
57
+ uses: Sibz/github-status-action@v1
58
+ with:
59
+ authToken: ${{ secrets.GITHUB_TOKEN }}
60
+ context: 'tests-passed-successfully'
61
+ description: 'Tests passed successfully'
62
+ state: 'success'
63
+ sha: ${{ github.event.pull_request.head.sha || github.sha }}
@@ -1,21 +1,17 @@
1
1
  = Metanorma-MPFA: Metanorma processor for MPFA documents
2
2
 
3
3
  image:https://img.shields.io/gem/v/metanorma-mpfa.svg["Gem Version", link="https://rubygems.org/gems/metanorma-mpfa"]
4
- image:https://github.com/metanorma/metanorma-mpfa/workflows/macos/badge.svg["Build Status (macOS)", link="https://github.com/metanorma/metanorma-mpfa/actions?workflow=macos"]
5
- image:https://github.com/metanorma/metanorma-mpfa/workflows/ubuntu/badge.svg["Build Status (ubuntu)", link="https://github.com/metanorma/metanorma-mpfa/actions?workflow=ubuntu"]
6
- image:https://github.com/metanorma/metanorma-mpfa/workflows/windows/badge.svg["Build Status (Windows)", link="https://github.com/metanorma/metanorma-mpfa/actions?workflow=windows"]
4
+ image:https://github.com/metanorma/metanorma-mpfa/workflows/rake/badge.svg["Build Status", link="https://github.com/metanorma/metanorma-mpfa/actions?workflow=rake"]
7
5
  image:https://codeclimate.com/github/metanorma/metanorma-mpfa/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/metanorma/metanorma-mpfa"]
8
6
  image:https://img.shields.io/github/issues-pr-raw/metanorma/metanorma-mpfa.svg["Pull Requests", link="https://github.com/metanorma/metanorma-mpfa/pulls"]
9
7
  image:https://img.shields.io/github/commits-since/metanorma/metanorma-mpfa/latest.svg["Commits since latest",link="https://github.com/metanorma/metanorma-mpfa/releases"]
10
8
 
11
- _Formerly known as_ `metanorma-mpfd`.
12
-
13
9
  WARNING: This gem is still under development. Moreover, unlike other Metanorma gems,
14
10
  there is no formal MPFA specification, and this work is still currently exploratory.
15
11
 
16
12
  == Functionality
17
13
 
18
- This gem processes http://asciidoctor.org/[Asciidoctor] documents following
14
+ This gem processes https://www.metanorma.com/[Metanorma documents] following
19
15
  a template for generating documents for the http://www.mpfa.org.hk[Mandatory Provident Fund Schemes Authority of Hong Kong].
20
16
 
21
17
  The gem currently inherits from the https://github.com/metanorma/metanorma-standoc
@@ -77,3 +73,7 @@ this general model can be found on its page.
77
73
  ////
78
74
  * Document templates are available at the https://github.com/metanorma/mn-templates-mpf[mn-templates-mpf] repository.
79
75
  /////
76
+
77
+ == Notes
78
+
79
+ Metanorma-MPFA was formerly published as `metanorma-mpfd`.
@@ -24,6 +24,14 @@
24
24
  <start>
25
25
  <ref name="standard-document"/>
26
26
  </start>
27
+ <define name="doctype">
28
+ <element name="doctype">
29
+ <optional>
30
+ <attribute name="abbreviation"/>
31
+ </optional>
32
+ <ref name="DocumentType"/>
33
+ </element>
34
+ </define>
27
35
  <define name="hyperlink">
28
36
  <element name="link">
29
37
  <attribute name="target">
@@ -141,6 +149,11 @@
141
149
  <data type="boolean"/>
142
150
  </attribute>
143
151
  </optional>
152
+ <optional>
153
+ <attribute name="key">
154
+ <data type="boolean"/>
155
+ </attribute>
156
+ </optional>
144
157
  <oneOrMore>
145
158
  <ref name="dt"/>
146
159
  <ref name="dd"/>
@@ -833,13 +833,22 @@
833
833
  <title-part lang="en">
834
834
 
835
835
 
836
+
836
837
  </title-part>
837
838
  <title-part lang="fr">
838
839
 
839
840
 
841
+
840
842
  </title-part>
841
843
  <title-part lang="zh">第 # 部分:</title-part>
842
844
 
845
+ <title-subpart lang="en">
846
+
847
+ </title-subpart>
848
+ <title-subpart lang="fr">
849
+
850
+ </title-subpart>
851
+
843
852
  <title-modified lang="en">modified</title-modified>
844
853
  <title-modified lang="fr">modifiée</title-modified>
845
854
 
@@ -1277,7 +1286,9 @@
1277
1286
 
1278
1287
 
1279
1288
 
1280
-
1289
+ <!-- <xsl:if test="$namespace = 'bipm'">
1290
+ <fo:block>&#xA0;</fo:block>
1291
+ </xsl:if> -->
1281
1292
 
1282
1293
  <!-- $namespace = 'iso' or -->
1283
1294
 
@@ -1447,6 +1458,7 @@
1447
1458
  <xsl:if test="normalize-space() != ''">
1448
1459
  <fo:block xsl:use-attribute-sets="table-name-style">
1449
1460
 
1461
+
1450
1462
  <xsl:apply-templates/>
1451
1463
  </fo:block>
1452
1464
  </xsl:if>
@@ -1800,6 +1812,7 @@
1800
1812
 
1801
1813
 
1802
1814
 
1815
+
1803
1816
  <!-- <xsl:if test="$namespace = 'bipm'">
1804
1817
  <xsl:attribute name="height">8mm</xsl:attribute>
1805
1818
  </xsl:if> -->
@@ -1888,7 +1901,8 @@
1888
1901
  </xsl:attribute>
1889
1902
  </xsl:if>
1890
1903
  <xsl:call-template name="display-align"/>
1891
- <fo:block>
1904
+ <fo:block>
1905
+
1892
1906
  <xsl:apply-templates/>
1893
1907
  </fo:block>
1894
1908
  </fo:table-cell>
@@ -2098,7 +2112,11 @@
2098
2112
  <xsl:apply-templates/>
2099
2113
  </fo:inline>
2100
2114
  </xsl:template><xsl:template match="*[local-name()='dl']">
2101
- <fo:block-container margin-left="0mm">
2115
+ <fo:block-container>
2116
+
2117
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2118
+
2119
+
2102
2120
  <xsl:if test="parent::*[local-name() = 'note']">
2103
2121
  <xsl:attribute name="margin-left">
2104
2122
  <xsl:choose>
@@ -2108,8 +2126,11 @@
2108
2126
  </xsl:attribute>
2109
2127
 
2110
2128
  </xsl:if>
2111
- <fo:block-container margin-left="0mm">
2112
-
2129
+ <fo:block-container>
2130
+
2131
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2132
+
2133
+
2113
2134
  <xsl:variable name="parent" select="local-name(..)"/>
2114
2135
 
2115
2136
  <xsl:variable name="key_iso">
@@ -2123,9 +2144,12 @@
2123
2144
  <fo:block margin-bottom="12pt" text-align="left">
2124
2145
 
2125
2146
  <xsl:variable name="title-where">
2126
- <xsl:call-template name="getTitle">
2127
- <xsl:with-param name="name" select="'title-where'"/>
2128
- </xsl:call-template>
2147
+
2148
+
2149
+ <xsl:call-template name="getTitle">
2150
+ <xsl:with-param name="name" select="'title-where'"/>
2151
+ </xsl:call-template>
2152
+
2129
2153
  </xsl:variable>
2130
2154
  <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
2131
2155
  <xsl:apply-templates select="*[local-name()='dt']/*"/>
@@ -2141,9 +2165,12 @@
2141
2165
 
2142
2166
 
2143
2167
  <xsl:variable name="title-where">
2144
- <xsl:call-template name="getTitle">
2145
- <xsl:with-param name="name" select="'title-where'"/>
2146
- </xsl:call-template>
2168
+
2169
+
2170
+ <xsl:call-template name="getTitle">
2171
+ <xsl:with-param name="name" select="'title-where'"/>
2172
+ </xsl:call-template>
2173
+
2147
2174
  </xsl:variable>
2148
2175
  <xsl:value-of select="$title-where"/>
2149
2176
  </fo:block>
@@ -2154,9 +2181,12 @@
2154
2181
 
2155
2182
 
2156
2183
  <xsl:variable name="title-key">
2157
- <xsl:call-template name="getTitle">
2158
- <xsl:with-param name="name" select="'title-key'"/>
2159
- </xsl:call-template>
2184
+
2185
+
2186
+ <xsl:call-template name="getTitle">
2187
+ <xsl:with-param name="name" select="'title-key'"/>
2188
+ </xsl:call-template>
2189
+
2160
2190
  </xsl:variable>
2161
2191
  <xsl:value-of select="$title-key"/>
2162
2192
  </fo:block>
@@ -2727,7 +2757,18 @@
2727
2757
  <xsl:with-param name="previousRow" select="$newRow"/>
2728
2758
  </xsl:apply-templates>
2729
2759
  </xsl:template><xsl:template name="getLang">
2730
- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
2760
+ <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
2761
+ <xsl:variable name="language">
2762
+ <xsl:choose>
2763
+ <xsl:when test="$language_current != ''">
2764
+ <xsl:value-of select="$language_current"/>
2765
+ </xsl:when>
2766
+ <xsl:otherwise>
2767
+ <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
2768
+ </xsl:otherwise>
2769
+ </xsl:choose>
2770
+ </xsl:variable>
2771
+
2731
2772
  <xsl:choose>
2732
2773
  <xsl:when test="$language = 'English'">en</xsl:when>
2733
2774
  <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
@@ -2762,6 +2803,7 @@
2762
2803
  <xsl:value-of select="substring($str, 2)"/>
2763
2804
  </xsl:template><xsl:template match="mathml:math">
2764
2805
  <fo:inline font-family="STIX Two Math"> <!-- -->
2806
+
2765
2807
  <xsl:variable name="mathml">
2766
2808
  <xsl:apply-templates select="." mode="mathml"/>
2767
2809
  </xsl:variable>
@@ -2844,10 +2886,14 @@
2844
2886
  </fo:inline>
2845
2887
  </xsl:template><xsl:template match="*[local-name() = 'modification']">
2846
2888
  <xsl:variable name="title-modified">
2847
- <xsl:call-template name="getTitle">
2848
- <xsl:with-param name="name" select="'title-modified'"/>
2849
- </xsl:call-template>
2889
+
2890
+
2891
+ <xsl:call-template name="getTitle">
2892
+ <xsl:with-param name="name" select="'title-modified'"/>
2893
+ </xsl:call-template>
2894
+
2850
2895
  </xsl:variable>
2896
+
2851
2897
  <xsl:choose>
2852
2898
  <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
2853
2899
  <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
@@ -3568,9 +3614,14 @@
3568
3614
 
3569
3615
  <fo:inline>
3570
3616
 
3571
- <xsl:call-template name="getTitle">
3572
- <xsl:with-param name="name" select="'title-source'"/>
3573
- </xsl:call-template>
3617
+
3618
+
3619
+
3620
+ <xsl:call-template name="getTitle">
3621
+ <xsl:with-param name="name" select="'title-source'"/>
3622
+ </xsl:call-template>
3623
+
3624
+
3574
3625
  <xsl:text>: </xsl:text>
3575
3626
  </fo:inline>
3576
3627
 
@@ -3717,9 +3768,12 @@
3717
3768
  </fo:block>
3718
3769
  </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
3719
3770
  <xsl:variable name="title-deprecated">
3720
- <xsl:call-template name="getTitle">
3721
- <xsl:with-param name="name" select="'title-deprecated'"/>
3722
- </xsl:call-template>
3771
+
3772
+
3773
+ <xsl:call-template name="getTitle">
3774
+ <xsl:with-param name="name" select="'title-deprecated'"/>
3775
+ </xsl:call-template>
3776
+
3723
3777
  </xsl:variable>
3724
3778
  <fo:block xsl:use-attribute-sets="deprecates-style">
3725
3779
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
@@ -4078,13 +4132,22 @@
4078
4132
  </xsl:template><xsl:template name="split">
4079
4133
  <xsl:param name="pText" select="."/>
4080
4134
  <xsl:param name="sep" select="','"/>
4135
+ <xsl:param name="normalize-space" select="'true'"/>
4081
4136
  <xsl:if test="string-length($pText) &gt;0">
4082
4137
  <item>
4083
- <xsl:value-of select="normalize-space(substring-before(concat($pText, ','), $sep))"/>
4138
+ <xsl:choose>
4139
+ <xsl:when test="$normalize-space = 'true'">
4140
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
4141
+ </xsl:when>
4142
+ <xsl:otherwise>
4143
+ <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
4144
+ </xsl:otherwise>
4145
+ </xsl:choose>
4084
4146
  </item>
4085
4147
  <xsl:call-template name="split">
4086
4148
  <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
4087
4149
  <xsl:with-param name="sep" select="$sep"/>
4150
+ <xsl:with-param name="normalize-space" select="$normalize-space"/>
4088
4151
  </xsl:call-template>
4089
4152
  </xsl:if>
4090
4153
  </xsl:template><xsl:template name="getDocumentId">
@@ -4150,4 +4213,23 @@
4150
4213
  <xsl:with-param name="letter-spacing" select="$letter-spacing"/>
4151
4214
  </xsl:call-template>
4152
4215
  </xsl:if>
4216
+ </xsl:template><xsl:template name="repeat">
4217
+ <xsl:param name="char" select="'*'"/>
4218
+ <xsl:param name="count"/>
4219
+ <xsl:if test="$count &gt; 0">
4220
+ <xsl:value-of select="$char"/>
4221
+ <xsl:call-template name="repeat">
4222
+ <xsl:with-param name="char" select="$char"/>
4223
+ <xsl:with-param name="count" select="$count - 1"/>
4224
+ </xsl:call-template>
4225
+ </xsl:if>
4226
+ </xsl:template><xsl:template name="getLocalizedString">
4227
+ <xsl:param name="key"/>
4228
+
4229
+ <xsl:variable name="curr_lang">
4230
+ <xsl:call-template name="getLang"/>
4231
+ </xsl:variable>
4232
+
4233
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
4234
+
4153
4235
  </xsl:template></xsl:stylesheet>
@@ -833,13 +833,22 @@
833
833
  <title-part lang="en">
834
834
 
835
835
 
836
+
836
837
  </title-part>
837
838
  <title-part lang="fr">
838
839
 
839
840
 
841
+
840
842
  </title-part>
841
843
  <title-part lang="zh">第 # 部分:</title-part>
842
844
 
845
+ <title-subpart lang="en">
846
+
847
+ </title-subpart>
848
+ <title-subpart lang="fr">
849
+
850
+ </title-subpart>
851
+
843
852
  <title-modified lang="en">modified</title-modified>
844
853
  <title-modified lang="fr">modifiée</title-modified>
845
854
 
@@ -1277,7 +1286,9 @@
1277
1286
 
1278
1287
 
1279
1288
 
1280
-
1289
+ <!-- <xsl:if test="$namespace = 'bipm'">
1290
+ <fo:block>&#xA0;</fo:block>
1291
+ </xsl:if> -->
1281
1292
 
1282
1293
  <!-- $namespace = 'iso' or -->
1283
1294
 
@@ -1447,6 +1458,7 @@
1447
1458
  <xsl:if test="normalize-space() != ''">
1448
1459
  <fo:block xsl:use-attribute-sets="table-name-style">
1449
1460
 
1461
+
1450
1462
  <xsl:apply-templates/>
1451
1463
  </fo:block>
1452
1464
  </xsl:if>
@@ -1800,6 +1812,7 @@
1800
1812
 
1801
1813
 
1802
1814
 
1815
+
1803
1816
  <!-- <xsl:if test="$namespace = 'bipm'">
1804
1817
  <xsl:attribute name="height">8mm</xsl:attribute>
1805
1818
  </xsl:if> -->
@@ -1888,7 +1901,8 @@
1888
1901
  </xsl:attribute>
1889
1902
  </xsl:if>
1890
1903
  <xsl:call-template name="display-align"/>
1891
- <fo:block>
1904
+ <fo:block>
1905
+
1892
1906
  <xsl:apply-templates/>
1893
1907
  </fo:block>
1894
1908
  </fo:table-cell>
@@ -2098,7 +2112,11 @@
2098
2112
  <xsl:apply-templates/>
2099
2113
  </fo:inline>
2100
2114
  </xsl:template><xsl:template match="*[local-name()='dl']">
2101
- <fo:block-container margin-left="0mm">
2115
+ <fo:block-container>
2116
+
2117
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2118
+
2119
+
2102
2120
  <xsl:if test="parent::*[local-name() = 'note']">
2103
2121
  <xsl:attribute name="margin-left">
2104
2122
  <xsl:choose>
@@ -2108,8 +2126,11 @@
2108
2126
  </xsl:attribute>
2109
2127
 
2110
2128
  </xsl:if>
2111
- <fo:block-container margin-left="0mm">
2112
-
2129
+ <fo:block-container>
2130
+
2131
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2132
+
2133
+
2113
2134
  <xsl:variable name="parent" select="local-name(..)"/>
2114
2135
 
2115
2136
  <xsl:variable name="key_iso">
@@ -2123,9 +2144,12 @@
2123
2144
  <fo:block margin-bottom="12pt" text-align="left">
2124
2145
 
2125
2146
  <xsl:variable name="title-where">
2126
- <xsl:call-template name="getTitle">
2127
- <xsl:with-param name="name" select="'title-where'"/>
2128
- </xsl:call-template>
2147
+
2148
+
2149
+ <xsl:call-template name="getTitle">
2150
+ <xsl:with-param name="name" select="'title-where'"/>
2151
+ </xsl:call-template>
2152
+
2129
2153
  </xsl:variable>
2130
2154
  <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
2131
2155
  <xsl:apply-templates select="*[local-name()='dt']/*"/>
@@ -2141,9 +2165,12 @@
2141
2165
 
2142
2166
 
2143
2167
  <xsl:variable name="title-where">
2144
- <xsl:call-template name="getTitle">
2145
- <xsl:with-param name="name" select="'title-where'"/>
2146
- </xsl:call-template>
2168
+
2169
+
2170
+ <xsl:call-template name="getTitle">
2171
+ <xsl:with-param name="name" select="'title-where'"/>
2172
+ </xsl:call-template>
2173
+
2147
2174
  </xsl:variable>
2148
2175
  <xsl:value-of select="$title-where"/>
2149
2176
  </fo:block>
@@ -2154,9 +2181,12 @@
2154
2181
 
2155
2182
 
2156
2183
  <xsl:variable name="title-key">
2157
- <xsl:call-template name="getTitle">
2158
- <xsl:with-param name="name" select="'title-key'"/>
2159
- </xsl:call-template>
2184
+
2185
+
2186
+ <xsl:call-template name="getTitle">
2187
+ <xsl:with-param name="name" select="'title-key'"/>
2188
+ </xsl:call-template>
2189
+
2160
2190
  </xsl:variable>
2161
2191
  <xsl:value-of select="$title-key"/>
2162
2192
  </fo:block>
@@ -2727,7 +2757,18 @@
2727
2757
  <xsl:with-param name="previousRow" select="$newRow"/>
2728
2758
  </xsl:apply-templates>
2729
2759
  </xsl:template><xsl:template name="getLang">
2730
- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
2760
+ <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
2761
+ <xsl:variable name="language">
2762
+ <xsl:choose>
2763
+ <xsl:when test="$language_current != ''">
2764
+ <xsl:value-of select="$language_current"/>
2765
+ </xsl:when>
2766
+ <xsl:otherwise>
2767
+ <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
2768
+ </xsl:otherwise>
2769
+ </xsl:choose>
2770
+ </xsl:variable>
2771
+
2731
2772
  <xsl:choose>
2732
2773
  <xsl:when test="$language = 'English'">en</xsl:when>
2733
2774
  <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
@@ -2762,6 +2803,7 @@
2762
2803
  <xsl:value-of select="substring($str, 2)"/>
2763
2804
  </xsl:template><xsl:template match="mathml:math">
2764
2805
  <fo:inline font-family="STIX Two Math"> <!-- -->
2806
+
2765
2807
  <xsl:variable name="mathml">
2766
2808
  <xsl:apply-templates select="." mode="mathml"/>
2767
2809
  </xsl:variable>
@@ -2844,10 +2886,14 @@
2844
2886
  </fo:inline>
2845
2887
  </xsl:template><xsl:template match="*[local-name() = 'modification']">
2846
2888
  <xsl:variable name="title-modified">
2847
- <xsl:call-template name="getTitle">
2848
- <xsl:with-param name="name" select="'title-modified'"/>
2849
- </xsl:call-template>
2889
+
2890
+
2891
+ <xsl:call-template name="getTitle">
2892
+ <xsl:with-param name="name" select="'title-modified'"/>
2893
+ </xsl:call-template>
2894
+
2850
2895
  </xsl:variable>
2896
+
2851
2897
  <xsl:choose>
2852
2898
  <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
2853
2899
  <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
@@ -3568,9 +3614,14 @@
3568
3614
 
3569
3615
  <fo:inline>
3570
3616
 
3571
- <xsl:call-template name="getTitle">
3572
- <xsl:with-param name="name" select="'title-source'"/>
3573
- </xsl:call-template>
3617
+
3618
+
3619
+
3620
+ <xsl:call-template name="getTitle">
3621
+ <xsl:with-param name="name" select="'title-source'"/>
3622
+ </xsl:call-template>
3623
+
3624
+
3574
3625
  <xsl:text>: </xsl:text>
3575
3626
  </fo:inline>
3576
3627
 
@@ -3717,9 +3768,12 @@
3717
3768
  </fo:block>
3718
3769
  </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
3719
3770
  <xsl:variable name="title-deprecated">
3720
- <xsl:call-template name="getTitle">
3721
- <xsl:with-param name="name" select="'title-deprecated'"/>
3722
- </xsl:call-template>
3771
+
3772
+
3773
+ <xsl:call-template name="getTitle">
3774
+ <xsl:with-param name="name" select="'title-deprecated'"/>
3775
+ </xsl:call-template>
3776
+
3723
3777
  </xsl:variable>
3724
3778
  <fo:block xsl:use-attribute-sets="deprecates-style">
3725
3779
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
@@ -4078,13 +4132,22 @@
4078
4132
  </xsl:template><xsl:template name="split">
4079
4133
  <xsl:param name="pText" select="."/>
4080
4134
  <xsl:param name="sep" select="','"/>
4135
+ <xsl:param name="normalize-space" select="'true'"/>
4081
4136
  <xsl:if test="string-length($pText) &gt;0">
4082
4137
  <item>
4083
- <xsl:value-of select="normalize-space(substring-before(concat($pText, ','), $sep))"/>
4138
+ <xsl:choose>
4139
+ <xsl:when test="$normalize-space = 'true'">
4140
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
4141
+ </xsl:when>
4142
+ <xsl:otherwise>
4143
+ <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
4144
+ </xsl:otherwise>
4145
+ </xsl:choose>
4084
4146
  </item>
4085
4147
  <xsl:call-template name="split">
4086
4148
  <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
4087
4149
  <xsl:with-param name="sep" select="$sep"/>
4150
+ <xsl:with-param name="normalize-space" select="$normalize-space"/>
4088
4151
  </xsl:call-template>
4089
4152
  </xsl:if>
4090
4153
  </xsl:template><xsl:template name="getDocumentId">
@@ -4150,4 +4213,23 @@
4150
4213
  <xsl:with-param name="letter-spacing" select="$letter-spacing"/>
4151
4214
  </xsl:call-template>
4152
4215
  </xsl:if>
4216
+ </xsl:template><xsl:template name="repeat">
4217
+ <xsl:param name="char" select="'*'"/>
4218
+ <xsl:param name="count"/>
4219
+ <xsl:if test="$count &gt; 0">
4220
+ <xsl:value-of select="$char"/>
4221
+ <xsl:call-template name="repeat">
4222
+ <xsl:with-param name="char" select="$char"/>
4223
+ <xsl:with-param name="count" select="$count - 1"/>
4224
+ </xsl:call-template>
4225
+ </xsl:if>
4226
+ </xsl:template><xsl:template name="getLocalizedString">
4227
+ <xsl:param name="key"/>
4228
+
4229
+ <xsl:variable name="curr_lang">
4230
+ <xsl:call-template name="getLang"/>
4231
+ </xsl:variable>
4232
+
4233
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
4234
+
4153
4235
  </xsl:template></xsl:stylesheet>