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.
@@ -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>