metanorma-mpfa 0.6.8 → 0.6.9

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: f93a2dc55dcfdcedecb16ba4c71a46de3555fc77c0ce99a30f762ea826c0a642
4
- data.tar.gz: fd66d7cfc6b0d779f2dded521ac745b034bcee6fe84af5ac9feb7e62a4176bdf
3
+ metadata.gz: df58e68481327baeb4b01c1fa195032891e17f26d117f92313f9047a64639006
4
+ data.tar.gz: 1fbd960a799d08b7524f8f501e2d5b446a4a3af0206afb1af904afbd0cf1f313
5
5
  SHA512:
6
- metadata.gz: 763bc964fafade67de9f397917324667af138bddabfa97eb4f36608db37a1791af88529a9a05945167d6037750d9977638eb23280e682e4bca1860e5fe51d290
7
- data.tar.gz: 2ab6b1f4e0f72c2bfe057b85ad62eff54bc0667f369ae3b5abd24cbf18d2c5ac2ac8d790772ab4be6414a7850a2a739274fabb3f9db42766185a40f92fe3a209
6
+ metadata.gz: 1ed204b79a90672638f89e039ae7945608841c845938d0317bf119da29029a90b6cae40c02cb3f6d09441dc40442b8c2a4d230a2da40e0d02b9543781a39afee
7
+ data.tar.gz: fad4815ccbfd1a9079e4c351b0ede966bc16ee980bde6afb7e8af52599c1cdd6761725c1a11612c5bd1e09d59c6b08603904f4eafddd38c4905b3af268bce670
@@ -64,9 +64,9 @@
64
64
  <optional>
65
65
  <ref name="label"/>
66
66
  </optional>
67
- <optional>
67
+ <zeroOrMore>
68
68
  <ref name="subject"/>
69
- </optional>
69
+ </zeroOrMore>
70
70
  <zeroOrMore>
71
71
  <ref name="reqinherit"/>
72
72
  </zeroOrMore>
@@ -80,6 +80,7 @@
80
80
  <ref name="verification"/>
81
81
  <ref name="import"/>
82
82
  <ref name="description"/>
83
+ <ref name="component"/>
83
84
  </choice>
84
85
  </zeroOrMore>
85
86
  <optional>
@@ -105,12 +106,16 @@
105
106
  </define>
106
107
  <define name="subject">
107
108
  <element name="subject">
108
- <text/>
109
+ <oneOrMore>
110
+ <ref name="TextElement"/>
111
+ </oneOrMore>
109
112
  </element>
110
113
  </define>
111
114
  <define name="reqinherit">
112
115
  <element name="inherit">
113
- <text/>
116
+ <oneOrMore>
117
+ <ref name="TextElement"/>
118
+ </oneOrMore>
114
119
  </element>
115
120
  </define>
116
121
  <define name="measurementtarget">
@@ -138,6 +143,12 @@
138
143
  <ref name="RequirementSubpart"/>
139
144
  </element>
140
145
  </define>
146
+ <define name="component">
147
+ <element name="component">
148
+ <attribute name="class"/>
149
+ <ref name="RequirementSubpart"/>
150
+ </element>
151
+ </define>
141
152
  <define name="reqt_references">
142
153
  <element name="references">
143
154
  <oneOrMore>
@@ -37,7 +37,6 @@ module IsoDoc
37
37
  def googlefonts
38
38
  <<~HEAD.freeze
39
39
  <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i|Space+Mono:400,700" rel="stylesheet">
40
- <link href="https://fonts.googleapis.com/css?family=Overpass:300,300i,600,900" rel="stylesheet">
41
40
  <link href="https://fonts.googleapis.com/css?family=Titillium+Web:400,400i,700,700i" rel="stylesheet">
42
41
  HEAD
43
42
  end
@@ -1053,6 +1053,7 @@
1053
1053
 
1054
1054
 
1055
1055
 
1056
+
1056
1057
  <xsl:attribute name="font-size">10pt</xsl:attribute>
1057
1058
 
1058
1059
 
@@ -1491,6 +1492,8 @@
1491
1492
  <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1492
1493
  </xsl:if>
1493
1494
 
1495
+
1496
+
1494
1497
  <xsl:choose>
1495
1498
  <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
1496
1499
  <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
@@ -1778,9 +1781,9 @@
1778
1781
  <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation">
1779
1782
  <xsl:with-param name="continued">true</xsl:with-param>
1780
1783
  </xsl:apply-templates>
1781
- <xsl:for-each select="ancestor::*[local-name()='table'][1]">
1782
- <xsl:call-template name="fn_name_display"/>
1783
- </xsl:for-each>
1784
+
1785
+
1786
+
1784
1787
 
1785
1788
  </fo:table-cell>
1786
1789
  </fo:table-row>
@@ -1862,7 +1865,11 @@
1862
1865
 
1863
1866
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
1864
1867
 
1865
- <xsl:if test="$isNoteOrFnExist = 'true'">
1868
+ <xsl:variable name="isNoteOrFnExistShowAfterTable">
1869
+
1870
+ </xsl:variable>
1871
+
1872
+ <xsl:if test="$isNoteOrFnExist = 'true' or normalize-space($isNoteOrFnExistShowAfterTable) = 'true'">
1866
1873
 
1867
1874
  <xsl:variable name="cols-count">
1868
1875
  <xsl:choose>
@@ -2003,6 +2010,19 @@
2003
2010
 
2004
2011
  </fo:table-body>
2005
2012
 
2013
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/text()[1]" priority="2" mode="presentation_name">
2014
+ <xsl:choose>
2015
+ <xsl:when test="substring-after(., '—') != ''">
2016
+ <xsl:text>—</xsl:text><xsl:value-of select="substring-after(., '—')"/>
2017
+ </xsl:when>
2018
+ <xsl:otherwise>
2019
+ <xsl:value-of select="."/>
2020
+ </xsl:otherwise>
2021
+ </xsl:choose>
2022
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']" mode="presentation_name">
2023
+ <xsl:apply-templates mode="presentation_name"/>
2024
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/node()" mode="presentation_name">
2025
+ <xsl:apply-templates select="."/>
2006
2026
  </xsl:template><xsl:template match="*[local-name()='tr']">
2007
2027
  <xsl:variable name="parent-name" select="local-name(..)"/>
2008
2028
  <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
@@ -2178,14 +2198,12 @@
2178
2198
  <xsl:apply-templates/>
2179
2199
  </xsl:template><xsl:template name="fn_display">
2180
2200
  <xsl:variable name="references">
2201
+
2181
2202
  <xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']">
2182
- <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
2183
-
2184
-
2185
- <xsl:apply-templates/>
2186
- </fn>
2203
+ <xsl:call-template name="create_fn"/>
2187
2204
  </xsl:for-each>
2188
2205
  </xsl:variable>
2206
+
2189
2207
  <xsl:for-each select="xalan:nodeset($references)//fn">
2190
2208
  <xsl:variable name="reference" select="@reference"/>
2191
2209
  <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
@@ -2219,6 +2237,12 @@
2219
2237
  </fo:block>
2220
2238
  </xsl:if>
2221
2239
  </xsl:for-each>
2240
+ </xsl:template><xsl:template name="create_fn">
2241
+ <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
2242
+
2243
+
2244
+ <xsl:apply-templates/>
2245
+ </fn>
2222
2246
  </xsl:template><xsl:template name="fn_name_display">
2223
2247
  <!-- <xsl:variable name="references">
2224
2248
  <xsl:for-each select="*[local-name()='name']//*[local-name()='fn']">
@@ -3217,19 +3241,6 @@
3217
3241
  <!-- replace start and end spaces to non-break space -->
3218
3242
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
3219
3243
  </xsl:copy>
3220
- </xsl:template><xsl:template match="mathml:mi[. = ',' and not(following-sibling::*[1][local-name() = 'mtext' and text() = ' '])]" mode="mathml">
3221
- <xsl:copy>
3222
- <xsl:apply-templates select="@*|node()" mode="mathml"/>
3223
- </xsl:copy>
3224
- <xsl:choose>
3225
- <!-- if in msub, then don't add space -->
3226
- <xsl:when test="ancestor::mathml:mrow[parent::mathml:msub and preceding-sibling::*[1][self::mathml:mrow]]"/>
3227
- <!-- if next char in digit, don't add space -->
3228
- <xsl:when test="translate(substring(following-sibling::*[1]/text(),1,1),'0123456789','') = ''"/>
3229
- <xsl:otherwise>
3230
- <mathml:mspace width="0.5ex"/>
3231
- </xsl:otherwise>
3232
- </xsl:choose>
3233
3244
  </xsl:template><xsl:template match="mathml:math/*[local-name()='unit']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='prefix']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='dimension']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='quantity']" mode="mathml"/><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
3234
3245
  <xsl:variable name="target">
3235
3246
  <xsl:choose>
@@ -4409,7 +4420,19 @@
4409
4420
  </fo:inline>
4410
4421
  </xsl:if>
4411
4422
  </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'p']">
4412
- <fo:inline><xsl:apply-templates/></fo:inline>
4423
+ <xsl:variable name="element">inline
4424
+
4425
+ </xsl:variable>
4426
+ <xsl:choose>
4427
+ <xsl:when test="contains($element, 'block')">
4428
+ <fo:block xsl:use-attribute-sets="example-p-style">
4429
+ <xsl:apply-templates/>
4430
+ </fo:block>
4431
+ </xsl:when>
4432
+ <xsl:otherwise>
4433
+ <fo:inline><xsl:apply-templates/></fo:inline>
4434
+ </xsl:otherwise>
4435
+ </xsl:choose>
4413
4436
  </xsl:template><xsl:template match="*[local-name() = 'example']">
4414
4437
  <fo:block id="{@id}" xsl:use-attribute-sets="example-style">
4415
4438
 
@@ -4981,7 +5004,6 @@
4981
5004
  </xsl:template><xsl:template name="processBibitem">
4982
5005
 
4983
5006
 
4984
- <!-- end BIPM bibitem processing-->
4985
5007
 
4986
5008
 
4987
5009
 
@@ -1053,6 +1053,7 @@
1053
1053
 
1054
1054
 
1055
1055
 
1056
+
1056
1057
  <xsl:attribute name="font-size">10pt</xsl:attribute>
1057
1058
 
1058
1059
 
@@ -1491,6 +1492,8 @@
1491
1492
  <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1492
1493
  </xsl:if>
1493
1494
 
1495
+
1496
+
1494
1497
  <xsl:choose>
1495
1498
  <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
1496
1499
  <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
@@ -1778,9 +1781,9 @@
1778
1781
  <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation">
1779
1782
  <xsl:with-param name="continued">true</xsl:with-param>
1780
1783
  </xsl:apply-templates>
1781
- <xsl:for-each select="ancestor::*[local-name()='table'][1]">
1782
- <xsl:call-template name="fn_name_display"/>
1783
- </xsl:for-each>
1784
+
1785
+
1786
+
1784
1787
 
1785
1788
  </fo:table-cell>
1786
1789
  </fo:table-row>
@@ -1862,7 +1865,11 @@
1862
1865
 
1863
1866
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
1864
1867
 
1865
- <xsl:if test="$isNoteOrFnExist = 'true'">
1868
+ <xsl:variable name="isNoteOrFnExistShowAfterTable">
1869
+
1870
+ </xsl:variable>
1871
+
1872
+ <xsl:if test="$isNoteOrFnExist = 'true' or normalize-space($isNoteOrFnExistShowAfterTable) = 'true'">
1866
1873
 
1867
1874
  <xsl:variable name="cols-count">
1868
1875
  <xsl:choose>
@@ -2003,6 +2010,19 @@
2003
2010
 
2004
2011
  </fo:table-body>
2005
2012
 
2013
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/text()[1]" priority="2" mode="presentation_name">
2014
+ <xsl:choose>
2015
+ <xsl:when test="substring-after(., '—') != ''">
2016
+ <xsl:text>—</xsl:text><xsl:value-of select="substring-after(., '—')"/>
2017
+ </xsl:when>
2018
+ <xsl:otherwise>
2019
+ <xsl:value-of select="."/>
2020
+ </xsl:otherwise>
2021
+ </xsl:choose>
2022
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']" mode="presentation_name">
2023
+ <xsl:apply-templates mode="presentation_name"/>
2024
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/node()" mode="presentation_name">
2025
+ <xsl:apply-templates select="."/>
2006
2026
  </xsl:template><xsl:template match="*[local-name()='tr']">
2007
2027
  <xsl:variable name="parent-name" select="local-name(..)"/>
2008
2028
  <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
@@ -2178,14 +2198,12 @@
2178
2198
  <xsl:apply-templates/>
2179
2199
  </xsl:template><xsl:template name="fn_display">
2180
2200
  <xsl:variable name="references">
2201
+
2181
2202
  <xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']">
2182
- <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
2183
-
2184
-
2185
- <xsl:apply-templates/>
2186
- </fn>
2203
+ <xsl:call-template name="create_fn"/>
2187
2204
  </xsl:for-each>
2188
2205
  </xsl:variable>
2206
+
2189
2207
  <xsl:for-each select="xalan:nodeset($references)//fn">
2190
2208
  <xsl:variable name="reference" select="@reference"/>
2191
2209
  <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
@@ -2219,6 +2237,12 @@
2219
2237
  </fo:block>
2220
2238
  </xsl:if>
2221
2239
  </xsl:for-each>
2240
+ </xsl:template><xsl:template name="create_fn">
2241
+ <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
2242
+
2243
+
2244
+ <xsl:apply-templates/>
2245
+ </fn>
2222
2246
  </xsl:template><xsl:template name="fn_name_display">
2223
2247
  <!-- <xsl:variable name="references">
2224
2248
  <xsl:for-each select="*[local-name()='name']//*[local-name()='fn']">
@@ -3217,19 +3241,6 @@
3217
3241
  <!-- replace start and end spaces to non-break space -->
3218
3242
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
3219
3243
  </xsl:copy>
3220
- </xsl:template><xsl:template match="mathml:mi[. = ',' and not(following-sibling::*[1][local-name() = 'mtext' and text() = ' '])]" mode="mathml">
3221
- <xsl:copy>
3222
- <xsl:apply-templates select="@*|node()" mode="mathml"/>
3223
- </xsl:copy>
3224
- <xsl:choose>
3225
- <!-- if in msub, then don't add space -->
3226
- <xsl:when test="ancestor::mathml:mrow[parent::mathml:msub and preceding-sibling::*[1][self::mathml:mrow]]"/>
3227
- <!-- if next char in digit, don't add space -->
3228
- <xsl:when test="translate(substring(following-sibling::*[1]/text(),1,1),'0123456789','') = ''"/>
3229
- <xsl:otherwise>
3230
- <mathml:mspace width="0.5ex"/>
3231
- </xsl:otherwise>
3232
- </xsl:choose>
3233
3244
  </xsl:template><xsl:template match="mathml:math/*[local-name()='unit']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='prefix']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='dimension']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='quantity']" mode="mathml"/><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
3234
3245
  <xsl:variable name="target">
3235
3246
  <xsl:choose>
@@ -4409,7 +4420,19 @@
4409
4420
  </fo:inline>
4410
4421
  </xsl:if>
4411
4422
  </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'p']">
4412
- <fo:inline><xsl:apply-templates/></fo:inline>
4423
+ <xsl:variable name="element">inline
4424
+
4425
+ </xsl:variable>
4426
+ <xsl:choose>
4427
+ <xsl:when test="contains($element, 'block')">
4428
+ <fo:block xsl:use-attribute-sets="example-p-style">
4429
+ <xsl:apply-templates/>
4430
+ </fo:block>
4431
+ </xsl:when>
4432
+ <xsl:otherwise>
4433
+ <fo:inline><xsl:apply-templates/></fo:inline>
4434
+ </xsl:otherwise>
4435
+ </xsl:choose>
4413
4436
  </xsl:template><xsl:template match="*[local-name() = 'example']">
4414
4437
  <fo:block id="{@id}" xsl:use-attribute-sets="example-style">
4415
4438
 
@@ -4981,7 +5004,6 @@
4981
5004
  </xsl:template><xsl:template name="processBibitem">
4982
5005
 
4983
5006
 
4984
- <!-- end BIPM bibitem processing-->
4985
5007
 
4986
5008
 
4987
5009
 
@@ -1053,6 +1053,7 @@
1053
1053
 
1054
1054
 
1055
1055
 
1056
+
1056
1057
  <xsl:attribute name="font-size">10pt</xsl:attribute>
1057
1058
 
1058
1059
 
@@ -1491,6 +1492,8 @@
1491
1492
  <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1492
1493
  </xsl:if>
1493
1494
 
1495
+
1496
+
1494
1497
  <xsl:choose>
1495
1498
  <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
1496
1499
  <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
@@ -1778,9 +1781,9 @@
1778
1781
  <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation">
1779
1782
  <xsl:with-param name="continued">true</xsl:with-param>
1780
1783
  </xsl:apply-templates>
1781
- <xsl:for-each select="ancestor::*[local-name()='table'][1]">
1782
- <xsl:call-template name="fn_name_display"/>
1783
- </xsl:for-each>
1784
+
1785
+
1786
+
1784
1787
 
1785
1788
  </fo:table-cell>
1786
1789
  </fo:table-row>
@@ -1862,7 +1865,11 @@
1862
1865
 
1863
1866
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
1864
1867
 
1865
- <xsl:if test="$isNoteOrFnExist = 'true'">
1868
+ <xsl:variable name="isNoteOrFnExistShowAfterTable">
1869
+
1870
+ </xsl:variable>
1871
+
1872
+ <xsl:if test="$isNoteOrFnExist = 'true' or normalize-space($isNoteOrFnExistShowAfterTable) = 'true'">
1866
1873
 
1867
1874
  <xsl:variable name="cols-count">
1868
1875
  <xsl:choose>
@@ -2003,6 +2010,19 @@
2003
2010
 
2004
2011
  </fo:table-body>
2005
2012
 
2013
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/text()[1]" priority="2" mode="presentation_name">
2014
+ <xsl:choose>
2015
+ <xsl:when test="substring-after(., '—') != ''">
2016
+ <xsl:text>—</xsl:text><xsl:value-of select="substring-after(., '—')"/>
2017
+ </xsl:when>
2018
+ <xsl:otherwise>
2019
+ <xsl:value-of select="."/>
2020
+ </xsl:otherwise>
2021
+ </xsl:choose>
2022
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']" mode="presentation_name">
2023
+ <xsl:apply-templates mode="presentation_name"/>
2024
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/node()" mode="presentation_name">
2025
+ <xsl:apply-templates select="."/>
2006
2026
  </xsl:template><xsl:template match="*[local-name()='tr']">
2007
2027
  <xsl:variable name="parent-name" select="local-name(..)"/>
2008
2028
  <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
@@ -2178,14 +2198,12 @@
2178
2198
  <xsl:apply-templates/>
2179
2199
  </xsl:template><xsl:template name="fn_display">
2180
2200
  <xsl:variable name="references">
2201
+
2181
2202
  <xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']">
2182
- <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
2183
-
2184
-
2185
- <xsl:apply-templates/>
2186
- </fn>
2203
+ <xsl:call-template name="create_fn"/>
2187
2204
  </xsl:for-each>
2188
2205
  </xsl:variable>
2206
+
2189
2207
  <xsl:for-each select="xalan:nodeset($references)//fn">
2190
2208
  <xsl:variable name="reference" select="@reference"/>
2191
2209
  <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
@@ -2219,6 +2237,12 @@
2219
2237
  </fo:block>
2220
2238
  </xsl:if>
2221
2239
  </xsl:for-each>
2240
+ </xsl:template><xsl:template name="create_fn">
2241
+ <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
2242
+
2243
+
2244
+ <xsl:apply-templates/>
2245
+ </fn>
2222
2246
  </xsl:template><xsl:template name="fn_name_display">
2223
2247
  <!-- <xsl:variable name="references">
2224
2248
  <xsl:for-each select="*[local-name()='name']//*[local-name()='fn']">
@@ -3217,19 +3241,6 @@
3217
3241
  <!-- replace start and end spaces to non-break space -->
3218
3242
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
3219
3243
  </xsl:copy>
3220
- </xsl:template><xsl:template match="mathml:mi[. = ',' and not(following-sibling::*[1][local-name() = 'mtext' and text() = ' '])]" mode="mathml">
3221
- <xsl:copy>
3222
- <xsl:apply-templates select="@*|node()" mode="mathml"/>
3223
- </xsl:copy>
3224
- <xsl:choose>
3225
- <!-- if in msub, then don't add space -->
3226
- <xsl:when test="ancestor::mathml:mrow[parent::mathml:msub and preceding-sibling::*[1][self::mathml:mrow]]"/>
3227
- <!-- if next char in digit, don't add space -->
3228
- <xsl:when test="translate(substring(following-sibling::*[1]/text(),1,1),'0123456789','') = ''"/>
3229
- <xsl:otherwise>
3230
- <mathml:mspace width="0.5ex"/>
3231
- </xsl:otherwise>
3232
- </xsl:choose>
3233
3244
  </xsl:template><xsl:template match="mathml:math/*[local-name()='unit']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='prefix']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='dimension']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='quantity']" mode="mathml"/><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
3234
3245
  <xsl:variable name="target">
3235
3246
  <xsl:choose>
@@ -4409,7 +4420,19 @@
4409
4420
  </fo:inline>
4410
4421
  </xsl:if>
4411
4422
  </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'p']">
4412
- <fo:inline><xsl:apply-templates/></fo:inline>
4423
+ <xsl:variable name="element">inline
4424
+
4425
+ </xsl:variable>
4426
+ <xsl:choose>
4427
+ <xsl:when test="contains($element, 'block')">
4428
+ <fo:block xsl:use-attribute-sets="example-p-style">
4429
+ <xsl:apply-templates/>
4430
+ </fo:block>
4431
+ </xsl:when>
4432
+ <xsl:otherwise>
4433
+ <fo:inline><xsl:apply-templates/></fo:inline>
4434
+ </xsl:otherwise>
4435
+ </xsl:choose>
4413
4436
  </xsl:template><xsl:template match="*[local-name() = 'example']">
4414
4437
  <fo:block id="{@id}" xsl:use-attribute-sets="example-style">
4415
4438
 
@@ -4981,7 +5004,6 @@
4981
5004
  </xsl:template><xsl:template name="processBibitem">
4982
5005
 
4983
5006
 
4984
- <!-- end BIPM bibitem processing-->
4985
5007
 
4986
5008
 
4987
5009
 
@@ -1053,6 +1053,7 @@
1053
1053
 
1054
1054
 
1055
1055
 
1056
+
1056
1057
  <xsl:attribute name="font-size">10pt</xsl:attribute>
1057
1058
 
1058
1059
 
@@ -1491,6 +1492,8 @@
1491
1492
  <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1492
1493
  </xsl:if>
1493
1494
 
1495
+
1496
+
1494
1497
  <xsl:choose>
1495
1498
  <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
1496
1499
  <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
@@ -1778,9 +1781,9 @@
1778
1781
  <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation">
1779
1782
  <xsl:with-param name="continued">true</xsl:with-param>
1780
1783
  </xsl:apply-templates>
1781
- <xsl:for-each select="ancestor::*[local-name()='table'][1]">
1782
- <xsl:call-template name="fn_name_display"/>
1783
- </xsl:for-each>
1784
+
1785
+
1786
+
1784
1787
 
1785
1788
  </fo:table-cell>
1786
1789
  </fo:table-row>
@@ -1862,7 +1865,11 @@
1862
1865
 
1863
1866
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
1864
1867
 
1865
- <xsl:if test="$isNoteOrFnExist = 'true'">
1868
+ <xsl:variable name="isNoteOrFnExistShowAfterTable">
1869
+
1870
+ </xsl:variable>
1871
+
1872
+ <xsl:if test="$isNoteOrFnExist = 'true' or normalize-space($isNoteOrFnExistShowAfterTable) = 'true'">
1866
1873
 
1867
1874
  <xsl:variable name="cols-count">
1868
1875
  <xsl:choose>
@@ -2003,6 +2010,19 @@
2003
2010
 
2004
2011
  </fo:table-body>
2005
2012
 
2013
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/text()[1]" priority="2" mode="presentation_name">
2014
+ <xsl:choose>
2015
+ <xsl:when test="substring-after(., '—') != ''">
2016
+ <xsl:text>—</xsl:text><xsl:value-of select="substring-after(., '—')"/>
2017
+ </xsl:when>
2018
+ <xsl:otherwise>
2019
+ <xsl:value-of select="."/>
2020
+ </xsl:otherwise>
2021
+ </xsl:choose>
2022
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']" mode="presentation_name">
2023
+ <xsl:apply-templates mode="presentation_name"/>
2024
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/node()" mode="presentation_name">
2025
+ <xsl:apply-templates select="."/>
2006
2026
  </xsl:template><xsl:template match="*[local-name()='tr']">
2007
2027
  <xsl:variable name="parent-name" select="local-name(..)"/>
2008
2028
  <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
@@ -2178,14 +2198,12 @@
2178
2198
  <xsl:apply-templates/>
2179
2199
  </xsl:template><xsl:template name="fn_display">
2180
2200
  <xsl:variable name="references">
2201
+
2181
2202
  <xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']">
2182
- <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
2183
-
2184
-
2185
- <xsl:apply-templates/>
2186
- </fn>
2203
+ <xsl:call-template name="create_fn"/>
2187
2204
  </xsl:for-each>
2188
2205
  </xsl:variable>
2206
+
2189
2207
  <xsl:for-each select="xalan:nodeset($references)//fn">
2190
2208
  <xsl:variable name="reference" select="@reference"/>
2191
2209
  <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
@@ -2219,6 +2237,12 @@
2219
2237
  </fo:block>
2220
2238
  </xsl:if>
2221
2239
  </xsl:for-each>
2240
+ </xsl:template><xsl:template name="create_fn">
2241
+ <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
2242
+
2243
+
2244
+ <xsl:apply-templates/>
2245
+ </fn>
2222
2246
  </xsl:template><xsl:template name="fn_name_display">
2223
2247
  <!-- <xsl:variable name="references">
2224
2248
  <xsl:for-each select="*[local-name()='name']//*[local-name()='fn']">
@@ -3217,19 +3241,6 @@
3217
3241
  <!-- replace start and end spaces to non-break space -->
3218
3242
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
3219
3243
  </xsl:copy>
3220
- </xsl:template><xsl:template match="mathml:mi[. = ',' and not(following-sibling::*[1][local-name() = 'mtext' and text() = ' '])]" mode="mathml">
3221
- <xsl:copy>
3222
- <xsl:apply-templates select="@*|node()" mode="mathml"/>
3223
- </xsl:copy>
3224
- <xsl:choose>
3225
- <!-- if in msub, then don't add space -->
3226
- <xsl:when test="ancestor::mathml:mrow[parent::mathml:msub and preceding-sibling::*[1][self::mathml:mrow]]"/>
3227
- <!-- if next char in digit, don't add space -->
3228
- <xsl:when test="translate(substring(following-sibling::*[1]/text(),1,1),'0123456789','') = ''"/>
3229
- <xsl:otherwise>
3230
- <mathml:mspace width="0.5ex"/>
3231
- </xsl:otherwise>
3232
- </xsl:choose>
3233
3244
  </xsl:template><xsl:template match="mathml:math/*[local-name()='unit']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='prefix']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='dimension']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='quantity']" mode="mathml"/><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
3234
3245
  <xsl:variable name="target">
3235
3246
  <xsl:choose>
@@ -4409,7 +4420,19 @@
4409
4420
  </fo:inline>
4410
4421
  </xsl:if>
4411
4422
  </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'p']">
4412
- <fo:inline><xsl:apply-templates/></fo:inline>
4423
+ <xsl:variable name="element">inline
4424
+
4425
+ </xsl:variable>
4426
+ <xsl:choose>
4427
+ <xsl:when test="contains($element, 'block')">
4428
+ <fo:block xsl:use-attribute-sets="example-p-style">
4429
+ <xsl:apply-templates/>
4430
+ </fo:block>
4431
+ </xsl:when>
4432
+ <xsl:otherwise>
4433
+ <fo:inline><xsl:apply-templates/></fo:inline>
4434
+ </xsl:otherwise>
4435
+ </xsl:choose>
4413
4436
  </xsl:template><xsl:template match="*[local-name() = 'example']">
4414
4437
  <fo:block id="{@id}" xsl:use-attribute-sets="example-style">
4415
4438
 
@@ -4981,7 +5004,6 @@
4981
5004
  </xsl:template><xsl:template name="processBibitem">
4982
5005
 
4983
5006
 
4984
- <!-- end BIPM bibitem processing-->
4985
5007
 
4986
5008
 
4987
5009
 
@@ -1053,6 +1053,7 @@
1053
1053
 
1054
1054
 
1055
1055
 
1056
+
1056
1057
  <xsl:attribute name="font-size">10pt</xsl:attribute>
1057
1058
 
1058
1059
 
@@ -1491,6 +1492,8 @@
1491
1492
  <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1492
1493
  </xsl:if>
1493
1494
 
1495
+
1496
+
1494
1497
  <xsl:choose>
1495
1498
  <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
1496
1499
  <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
@@ -1778,9 +1781,9 @@
1778
1781
  <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation">
1779
1782
  <xsl:with-param name="continued">true</xsl:with-param>
1780
1783
  </xsl:apply-templates>
1781
- <xsl:for-each select="ancestor::*[local-name()='table'][1]">
1782
- <xsl:call-template name="fn_name_display"/>
1783
- </xsl:for-each>
1784
+
1785
+
1786
+
1784
1787
 
1785
1788
  </fo:table-cell>
1786
1789
  </fo:table-row>
@@ -1862,7 +1865,11 @@
1862
1865
 
1863
1866
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
1864
1867
 
1865
- <xsl:if test="$isNoteOrFnExist = 'true'">
1868
+ <xsl:variable name="isNoteOrFnExistShowAfterTable">
1869
+
1870
+ </xsl:variable>
1871
+
1872
+ <xsl:if test="$isNoteOrFnExist = 'true' or normalize-space($isNoteOrFnExistShowAfterTable) = 'true'">
1866
1873
 
1867
1874
  <xsl:variable name="cols-count">
1868
1875
  <xsl:choose>
@@ -2003,6 +2010,19 @@
2003
2010
 
2004
2011
  </fo:table-body>
2005
2012
 
2013
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/text()[1]" priority="2" mode="presentation_name">
2014
+ <xsl:choose>
2015
+ <xsl:when test="substring-after(., '—') != ''">
2016
+ <xsl:text>—</xsl:text><xsl:value-of select="substring-after(., '—')"/>
2017
+ </xsl:when>
2018
+ <xsl:otherwise>
2019
+ <xsl:value-of select="."/>
2020
+ </xsl:otherwise>
2021
+ </xsl:choose>
2022
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']" mode="presentation_name">
2023
+ <xsl:apply-templates mode="presentation_name"/>
2024
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/node()" mode="presentation_name">
2025
+ <xsl:apply-templates select="."/>
2006
2026
  </xsl:template><xsl:template match="*[local-name()='tr']">
2007
2027
  <xsl:variable name="parent-name" select="local-name(..)"/>
2008
2028
  <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
@@ -2178,14 +2198,12 @@
2178
2198
  <xsl:apply-templates/>
2179
2199
  </xsl:template><xsl:template name="fn_display">
2180
2200
  <xsl:variable name="references">
2201
+
2181
2202
  <xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']">
2182
- <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
2183
-
2184
-
2185
- <xsl:apply-templates/>
2186
- </fn>
2203
+ <xsl:call-template name="create_fn"/>
2187
2204
  </xsl:for-each>
2188
2205
  </xsl:variable>
2206
+
2189
2207
  <xsl:for-each select="xalan:nodeset($references)//fn">
2190
2208
  <xsl:variable name="reference" select="@reference"/>
2191
2209
  <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
@@ -2219,6 +2237,12 @@
2219
2237
  </fo:block>
2220
2238
  </xsl:if>
2221
2239
  </xsl:for-each>
2240
+ </xsl:template><xsl:template name="create_fn">
2241
+ <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
2242
+
2243
+
2244
+ <xsl:apply-templates/>
2245
+ </fn>
2222
2246
  </xsl:template><xsl:template name="fn_name_display">
2223
2247
  <!-- <xsl:variable name="references">
2224
2248
  <xsl:for-each select="*[local-name()='name']//*[local-name()='fn']">
@@ -3217,19 +3241,6 @@
3217
3241
  <!-- replace start and end spaces to non-break space -->
3218
3242
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
3219
3243
  </xsl:copy>
3220
- </xsl:template><xsl:template match="mathml:mi[. = ',' and not(following-sibling::*[1][local-name() = 'mtext' and text() = ' '])]" mode="mathml">
3221
- <xsl:copy>
3222
- <xsl:apply-templates select="@*|node()" mode="mathml"/>
3223
- </xsl:copy>
3224
- <xsl:choose>
3225
- <!-- if in msub, then don't add space -->
3226
- <xsl:when test="ancestor::mathml:mrow[parent::mathml:msub and preceding-sibling::*[1][self::mathml:mrow]]"/>
3227
- <!-- if next char in digit, don't add space -->
3228
- <xsl:when test="translate(substring(following-sibling::*[1]/text(),1,1),'0123456789','') = ''"/>
3229
- <xsl:otherwise>
3230
- <mathml:mspace width="0.5ex"/>
3231
- </xsl:otherwise>
3232
- </xsl:choose>
3233
3244
  </xsl:template><xsl:template match="mathml:math/*[local-name()='unit']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='prefix']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='dimension']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='quantity']" mode="mathml"/><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
3234
3245
  <xsl:variable name="target">
3235
3246
  <xsl:choose>
@@ -4409,7 +4420,19 @@
4409
4420
  </fo:inline>
4410
4421
  </xsl:if>
4411
4422
  </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'p']">
4412
- <fo:inline><xsl:apply-templates/></fo:inline>
4423
+ <xsl:variable name="element">inline
4424
+
4425
+ </xsl:variable>
4426
+ <xsl:choose>
4427
+ <xsl:when test="contains($element, 'block')">
4428
+ <fo:block xsl:use-attribute-sets="example-p-style">
4429
+ <xsl:apply-templates/>
4430
+ </fo:block>
4431
+ </xsl:when>
4432
+ <xsl:otherwise>
4433
+ <fo:inline><xsl:apply-templates/></fo:inline>
4434
+ </xsl:otherwise>
4435
+ </xsl:choose>
4413
4436
  </xsl:template><xsl:template match="*[local-name() = 'example']">
4414
4437
  <fo:block id="{@id}" xsl:use-attribute-sets="example-style">
4415
4438
 
@@ -4981,7 +5004,6 @@
4981
5004
  </xsl:template><xsl:template name="processBibitem">
4982
5005
 
4983
5006
 
4984
- <!-- end BIPM bibitem processing-->
4985
5007
 
4986
5008
 
4987
5009
 
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module MPFA
3
- VERSION = "0.6.8".freeze
3
+ VERSION = "0.6.9".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-mpfa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.8
4
+ version: 0.6.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-08-02 00:00:00.000000000 Z
11
+ date: 2021-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities