metanorma-iho 0.6.10 → 0.6.12
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.
- checksums.yaml +4 -4
- data/lib/isodoc/iho/html/htmlstyle.css +1 -1
- data/lib/isodoc/iho/iho.specification.xsl +136 -18
- data/lib/isodoc/iho/iho.standard.xsl +136 -18
- data/lib/metanorma/iho/basicdoc.rng +0 -27
- data/lib/metanorma/iho/biblio-standoc.rng +164 -0
- data/lib/metanorma/iho/biblio.rng +50 -18
- data/lib/metanorma/iho/iho.rng +1 -84
- data/lib/metanorma/iho/isodoc.rng +68 -206
- data/lib/metanorma/iho/relaton-iho.rng +92 -0
- data/lib/metanorma/iho/version.rb +1 -1
- data/metanorma-iho.gemspec +3 -2
- metadata +6 -10
- data/.github/workflows/rake.yml +0 -15
- data/.github/workflows/release.yml +0 -24
- data/Rakefile +0 -8
- data/bin/console +0 -14
- data/bin/rspec +0 -18
- data/bin/setup +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 769a2b34f9a1bff86b6249fc1b32a9f47c54c3ce6098ed0eb2d0cdf8c4d8f5ee
|
4
|
+
data.tar.gz: 7523b2410d9fc205d2747980d02ba388f547f9f2d17ca9ca9043fc671c9c3b24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c1c9fe715119c315a023160e57c74466fff4a5903b1d544ee53ee5a778cf914c409d054569f69635196d6719c2d504a5f47825e1ef285a9113a89c10bda98af
|
7
|
+
data.tar.gz: 6b2e599718ff877827a0e564d353c92a56e7e6df441ea8b7f54afd28f5cf518a64396a75b3964e232497dca51c5619bd766057bc95378a5c419fafc2cabb8f9d
|
@@ -1170,6 +1170,15 @@
|
|
1170
1170
|
|
1171
1171
|
</xsl:attribute-set>
|
1172
1172
|
|
1173
|
+
<xsl:attribute-set name="pre-style">
|
1174
|
+
<xsl:attribute name="font-family">Courier New, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
|
1175
|
+
<xsl:attribute name="margin-bottom">6pt</xsl:attribute>
|
1176
|
+
|
1177
|
+
<xsl:attribute name="font-family">Fira Code, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
|
1178
|
+
<xsl:attribute name="line-height">113%</xsl:attribute>
|
1179
|
+
|
1180
|
+
</xsl:attribute-set>
|
1181
|
+
|
1173
1182
|
<xsl:attribute-set name="permission-style">
|
1174
1183
|
|
1175
1184
|
</xsl:attribute-set>
|
@@ -1281,6 +1290,11 @@
|
|
1281
1290
|
</xsl:variable>
|
1282
1291
|
<xsl:variable name="table-border" select="normalize-space($table-border_)"/>
|
1283
1292
|
|
1293
|
+
<xsl:variable name="table-cell-border_">
|
1294
|
+
|
1295
|
+
</xsl:variable>
|
1296
|
+
<xsl:variable name="table-cell-border" select="normalize-space($table-cell-border_)"/>
|
1297
|
+
|
1284
1298
|
<xsl:attribute-set name="table-container-style">
|
1285
1299
|
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
1286
1300
|
<xsl:attribute name="margin-right">0mm</xsl:attribute>
|
@@ -1292,8 +1306,6 @@
|
|
1292
1306
|
<xsl:attribute-set name="table-style">
|
1293
1307
|
<xsl:attribute name="table-omit-footer-at-break">true</xsl:attribute>
|
1294
1308
|
<xsl:attribute name="table-layout">fixed</xsl:attribute>
|
1295
|
-
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
1296
|
-
<xsl:attribute name="margin-right">0mm</xsl:attribute>
|
1297
1309
|
|
1298
1310
|
</xsl:attribute-set><!-- table-style -->
|
1299
1311
|
|
@@ -2405,6 +2417,12 @@
|
|
2405
2417
|
<xsl:variable name="table_attributes">
|
2406
2418
|
|
2407
2419
|
<xsl:element name="table_attributes" use-attribute-sets="table-style">
|
2420
|
+
|
2421
|
+
<xsl:if test="$margin-side != 0">
|
2422
|
+
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
2423
|
+
<xsl:attribute name="margin-right">0mm</xsl:attribute>
|
2424
|
+
</xsl:if>
|
2425
|
+
|
2408
2426
|
<xsl:attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></xsl:attribute>
|
2409
2427
|
|
2410
2428
|
</xsl:element>
|
@@ -3161,6 +3179,10 @@
|
|
3161
3179
|
<xsl:template match="*[local-name()='tr']">
|
3162
3180
|
<fo:table-row xsl:use-attribute-sets="table-body-row-style">
|
3163
3181
|
|
3182
|
+
<xsl:if test="*[local-name() = 'th']">
|
3183
|
+
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
3184
|
+
</xsl:if>
|
3185
|
+
|
3164
3186
|
<xsl:call-template name="setTableRowAttributes"/>
|
3165
3187
|
<xsl:apply-templates/>
|
3166
3188
|
</fo:table-row>
|
@@ -4201,8 +4223,17 @@
|
|
4201
4223
|
</fo:inline>
|
4202
4224
|
</xsl:template> <!-- tt -->
|
4203
4225
|
|
4226
|
+
<xsl:variable name="regex_url_start">^(http://|https://|www\.)?(.*)</xsl:variable>
|
4204
4227
|
<xsl:template match="*[local-name()='tt']/text()" priority="2">
|
4205
|
-
<xsl:
|
4228
|
+
<xsl:choose>
|
4229
|
+
<xsl:when test="java:replaceAll(java:java.lang.String.new(.), '$2', '') != ''">
|
4230
|
+
<!-- url -->
|
4231
|
+
<xsl:call-template name="add-zero-spaces-link-java"/>
|
4232
|
+
</xsl:when>
|
4233
|
+
<xsl:otherwise>
|
4234
|
+
<xsl:call-template name="add_spaces_to_sourcecode"/>
|
4235
|
+
</xsl:otherwise>
|
4236
|
+
</xsl:choose>
|
4206
4237
|
</xsl:template>
|
4207
4238
|
|
4208
4239
|
<xsl:template match="*[local-name()='underline']">
|
@@ -4558,8 +4589,11 @@
|
|
4558
4589
|
|
4559
4590
|
<xsl:template name="add-zero-spaces-link-java">
|
4560
4591
|
<xsl:param name="text" select="."/>
|
4592
|
+
|
4593
|
+
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$1')"/> <!-- http://. https:// or www. -->
|
4594
|
+
<xsl:variable name="url_continue" select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$2')"/>
|
4561
4595
|
<!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
|
4562
|
-
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($
|
4596
|
+
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/)','$1')"/>
|
4563
4597
|
</xsl:template>
|
4564
4598
|
|
4565
4599
|
<!-- add zero space after dash character (for table's entries) -->
|
@@ -5116,6 +5150,9 @@
|
|
5116
5150
|
<xsl:value-of select="substring($str, 2)"/>
|
5117
5151
|
</xsl:template>
|
5118
5152
|
|
5153
|
+
<!-- ======================================= -->
|
5154
|
+
<!-- math -->
|
5155
|
+
<!-- ======================================= -->
|
5119
5156
|
<xsl:template match="mathml:math">
|
5120
5157
|
<xsl:variable name="isAdded" select="@added"/>
|
5121
5158
|
<xsl:variable name="isDeleted" select="@deleted"/>
|
@@ -5166,14 +5203,57 @@
|
|
5166
5203
|
<xsl:value-of select="$comment_text"/>
|
5167
5204
|
</xsl:template>
|
5168
5205
|
|
5206
|
+
<xsl:template match="*[local-name() = 'asciimath']">
|
5207
|
+
<xsl:param name="process" select="'false'"/>
|
5208
|
+
<xsl:if test="$process = 'true'">
|
5209
|
+
<xsl:apply-templates/>
|
5210
|
+
</xsl:if>
|
5211
|
+
</xsl:template>
|
5212
|
+
|
5213
|
+
<xsl:template match="*[local-name() = 'latexmath']"/>
|
5214
|
+
|
5215
|
+
<xsl:template name="getMathml_asciimath_text">
|
5216
|
+
<xsl:variable name="asciimath" select="../*[local-name() = 'asciimath']"/>
|
5217
|
+
<xsl:variable name="latexmath">
|
5218
|
+
|
5219
|
+
</xsl:variable>
|
5220
|
+
<xsl:variable name="asciimath_text_following">
|
5221
|
+
<xsl:choose>
|
5222
|
+
<xsl:when test="normalize-space($latexmath) != ''">
|
5223
|
+
<xsl:value-of select="$latexmath"/>
|
5224
|
+
</xsl:when>
|
5225
|
+
<xsl:when test="normalize-space($asciimath) != ''">
|
5226
|
+
<xsl:value-of select="$asciimath"/>
|
5227
|
+
</xsl:when>
|
5228
|
+
<xsl:otherwise>
|
5229
|
+
<xsl:value-of select="following-sibling::node()[1][self::comment()]"/>
|
5230
|
+
</xsl:otherwise>
|
5231
|
+
</xsl:choose>
|
5232
|
+
</xsl:variable>
|
5233
|
+
<xsl:variable name="asciimath_text_">
|
5234
|
+
<xsl:choose>
|
5235
|
+
<xsl:when test="normalize-space($asciimath_text_following) != ''">
|
5236
|
+
<xsl:value-of select="$asciimath_text_following"/>
|
5237
|
+
</xsl:when>
|
5238
|
+
<xsl:otherwise>
|
5239
|
+
<xsl:value-of select="normalize-space(translate(.,' ',' '))"/>
|
5240
|
+
</xsl:otherwise>
|
5241
|
+
</xsl:choose>
|
5242
|
+
</xsl:variable>
|
5243
|
+
<xsl:variable name="asciimath_text_2" select="java:org.metanorma.fop.Util.unescape($asciimath_text_)"/>
|
5244
|
+
<xsl:variable name="asciimath_text" select="java:trim(java:java.lang.String.new($asciimath_text_2))"/>
|
5245
|
+
<xsl:value-of select="$asciimath_text"/>
|
5246
|
+
</xsl:template>
|
5247
|
+
|
5169
5248
|
<xsl:template name="mathml_instream_object">
|
5170
|
-
<xsl:param name="
|
5249
|
+
<xsl:param name="asciimath_text"/>
|
5171
5250
|
<xsl:param name="mathml_content"/>
|
5172
5251
|
|
5173
|
-
<xsl:variable name="
|
5252
|
+
<xsl:variable name="asciimath_text_">
|
5174
5253
|
<xsl:choose>
|
5175
|
-
<xsl:when test="normalize-space($
|
5176
|
-
<xsl:otherwise><xsl:call-template name="getMathml_comment_text"/></xsl:otherwise>
|
5254
|
+
<xsl:when test="normalize-space($asciimath_text) != ''"><xsl:value-of select="$asciimath_text"/></xsl:when>
|
5255
|
+
<!-- <xsl:otherwise><xsl:call-template name="getMathml_comment_text"/></xsl:otherwise> -->
|
5256
|
+
<xsl:otherwise><xsl:call-template name="getMathml_asciimath_text"/></xsl:otherwise>
|
5177
5257
|
</xsl:choose>
|
5178
5258
|
</xsl:variable>
|
5179
5259
|
|
@@ -5190,10 +5270,10 @@
|
|
5190
5270
|
</xsl:attribute>
|
5191
5271
|
|
5192
5272
|
<!-- <xsl:if test="$add_math_as_text = 'true'"> -->
|
5193
|
-
<xsl:if test="normalize-space($
|
5273
|
+
<xsl:if test="normalize-space($asciimath_text_) != ''">
|
5194
5274
|
<!-- put Mathin Alternate Text -->
|
5195
5275
|
<xsl:attribute name="fox:alt-text">
|
5196
|
-
<xsl:value-of select="$
|
5276
|
+
<xsl:value-of select="$asciimath_text_"/>
|
5197
5277
|
</xsl:attribute>
|
5198
5278
|
</xsl:if>
|
5199
5279
|
<!-- </xsl:if> -->
|
@@ -5266,6 +5346,29 @@
|
|
5266
5346
|
<xsl:value-of select="."/><xsl:value-of select="$zero_width_space"/>
|
5267
5347
|
</xsl:template>
|
5268
5348
|
|
5349
|
+
<!-- Examples:
|
5350
|
+
<stem type="AsciiMath">x = 1</stem>
|
5351
|
+
<stem type="AsciiMath"><asciimath>x = 1</asciimath></stem>
|
5352
|
+
<stem type="AsciiMath"><asciimath>x = 1</asciimath><latexmath>x = 1</latexmath></stem>
|
5353
|
+
-->
|
5354
|
+
<xsl:template match="*[local-name() = 'stem'][@type = 'AsciiMath'][count(*) = 0]/text() | *[local-name() = 'stem'][@type = 'AsciiMath'][*[local-name() = 'asciimath']]" priority="3">
|
5355
|
+
<fo:inline xsl:use-attribute-sets="mathml-style">
|
5356
|
+
|
5357
|
+
<xsl:choose>
|
5358
|
+
<xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
|
5359
|
+
<xsl:otherwise>
|
5360
|
+
<xsl:apply-templates>
|
5361
|
+
<xsl:with-param name="process">true</xsl:with-param>
|
5362
|
+
</xsl:apply-templates>
|
5363
|
+
</xsl:otherwise>
|
5364
|
+
</xsl:choose>
|
5365
|
+
|
5366
|
+
</fo:inline>
|
5367
|
+
</xsl:template>
|
5368
|
+
<!-- ======================================= -->
|
5369
|
+
<!-- END: math -->
|
5370
|
+
<!-- ======================================= -->
|
5371
|
+
|
5269
5372
|
<xsl:template match="*[local-name()='localityStack']"/>
|
5270
5373
|
|
5271
5374
|
<xsl:template match="*[local-name()='link']" name="link">
|
@@ -6606,9 +6709,9 @@
|
|
6606
6709
|
<xsl:apply-templates mode="contents_item"/>
|
6607
6710
|
</xsl:template>
|
6608
6711
|
|
6609
|
-
<!--
|
6610
|
-
<!-- sourcecode
|
6611
|
-
<!--
|
6712
|
+
<!-- =============== -->
|
6713
|
+
<!-- sourcecode -->
|
6714
|
+
<!-- =============== -->
|
6612
6715
|
<xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
|
6613
6716
|
|
6614
6717
|
<fo:block-container xsl:use-attribute-sets="sourcecode-container-style">
|
@@ -6906,8 +7009,22 @@
|
|
6906
7009
|
</fo:block>
|
6907
7010
|
</xsl:if>
|
6908
7011
|
</xsl:template>
|
6909
|
-
<!--
|
6910
|
-
<!--
|
7012
|
+
<!-- =============== -->
|
7013
|
+
<!-- END sourcecode -->
|
7014
|
+
<!-- =============== -->
|
7015
|
+
|
7016
|
+
<!-- =============== -->
|
7017
|
+
<!-- pre -->
|
7018
|
+
<!-- =============== -->
|
7019
|
+
<xsl:template match="*[local-name()='pre']" name="pre">
|
7020
|
+
<fo:block xsl:use-attribute-sets="pre-style">
|
7021
|
+
<xsl:copy-of select="@id"/>
|
7022
|
+
<xsl:apply-templates/>
|
7023
|
+
</fo:block>
|
7024
|
+
</xsl:template>
|
7025
|
+
<!-- =============== -->
|
7026
|
+
<!-- pre -->
|
7027
|
+
<!-- =============== -->
|
6911
7028
|
|
6912
7029
|
<!-- ========== -->
|
6913
7030
|
<!-- permission -->
|
@@ -8943,7 +9060,7 @@
|
|
8943
9060
|
|
8944
9061
|
<xsl:variable name="element_name_keep-together_within-line">keep-together_within-line</xsl:variable>
|
8945
9062
|
|
8946
|
-
<xsl:template match="text()[not(ancestor::*[local-name() = 'bibdata'] or ancestor::*[local-name() = 'sourcecode'] or
|
9063
|
+
<xsl:template match="text()[not(ancestor::*[local-name() = 'bibdata'] or ancestor::*[local-name() = 'link'][not(contains(.,' '))] or ancestor::*[local-name() = 'sourcecode'] or ancestor::*[local-name() = 'math'] or starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.') )]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
|
8947
9064
|
|
8948
9065
|
<!-- enclose standard's number into tag 'keep-together_within-line' -->
|
8949
9066
|
<xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
|
@@ -9419,13 +9536,14 @@
|
|
9419
9536
|
</xsl:template>
|
9420
9537
|
|
9421
9538
|
<xsl:template name="setId">
|
9539
|
+
<xsl:param name="prefix"/>
|
9422
9540
|
<xsl:attribute name="id">
|
9423
9541
|
<xsl:choose>
|
9424
9542
|
<xsl:when test="@id">
|
9425
|
-
<xsl:value-of select="@id"/>
|
9543
|
+
<xsl:value-of select="concat($prefix, @id)"/>
|
9426
9544
|
</xsl:when>
|
9427
9545
|
<xsl:otherwise>
|
9428
|
-
<xsl:value-of select="generate-id()"/>
|
9546
|
+
<xsl:value-of select="concat($prefix, generate-id())"/>
|
9429
9547
|
</xsl:otherwise>
|
9430
9548
|
</xsl:choose>
|
9431
9549
|
</xsl:attribute>
|
@@ -1170,6 +1170,15 @@
|
|
1170
1170
|
|
1171
1171
|
</xsl:attribute-set>
|
1172
1172
|
|
1173
|
+
<xsl:attribute-set name="pre-style">
|
1174
|
+
<xsl:attribute name="font-family">Courier New, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
|
1175
|
+
<xsl:attribute name="margin-bottom">6pt</xsl:attribute>
|
1176
|
+
|
1177
|
+
<xsl:attribute name="font-family">Fira Code, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
|
1178
|
+
<xsl:attribute name="line-height">113%</xsl:attribute>
|
1179
|
+
|
1180
|
+
</xsl:attribute-set>
|
1181
|
+
|
1173
1182
|
<xsl:attribute-set name="permission-style">
|
1174
1183
|
|
1175
1184
|
</xsl:attribute-set>
|
@@ -1281,6 +1290,11 @@
|
|
1281
1290
|
</xsl:variable>
|
1282
1291
|
<xsl:variable name="table-border" select="normalize-space($table-border_)"/>
|
1283
1292
|
|
1293
|
+
<xsl:variable name="table-cell-border_">
|
1294
|
+
|
1295
|
+
</xsl:variable>
|
1296
|
+
<xsl:variable name="table-cell-border" select="normalize-space($table-cell-border_)"/>
|
1297
|
+
|
1284
1298
|
<xsl:attribute-set name="table-container-style">
|
1285
1299
|
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
1286
1300
|
<xsl:attribute name="margin-right">0mm</xsl:attribute>
|
@@ -1292,8 +1306,6 @@
|
|
1292
1306
|
<xsl:attribute-set name="table-style">
|
1293
1307
|
<xsl:attribute name="table-omit-footer-at-break">true</xsl:attribute>
|
1294
1308
|
<xsl:attribute name="table-layout">fixed</xsl:attribute>
|
1295
|
-
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
1296
|
-
<xsl:attribute name="margin-right">0mm</xsl:attribute>
|
1297
1309
|
|
1298
1310
|
</xsl:attribute-set><!-- table-style -->
|
1299
1311
|
|
@@ -2405,6 +2417,12 @@
|
|
2405
2417
|
<xsl:variable name="table_attributes">
|
2406
2418
|
|
2407
2419
|
<xsl:element name="table_attributes" use-attribute-sets="table-style">
|
2420
|
+
|
2421
|
+
<xsl:if test="$margin-side != 0">
|
2422
|
+
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
2423
|
+
<xsl:attribute name="margin-right">0mm</xsl:attribute>
|
2424
|
+
</xsl:if>
|
2425
|
+
|
2408
2426
|
<xsl:attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></xsl:attribute>
|
2409
2427
|
|
2410
2428
|
</xsl:element>
|
@@ -3161,6 +3179,10 @@
|
|
3161
3179
|
<xsl:template match="*[local-name()='tr']">
|
3162
3180
|
<fo:table-row xsl:use-attribute-sets="table-body-row-style">
|
3163
3181
|
|
3182
|
+
<xsl:if test="*[local-name() = 'th']">
|
3183
|
+
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
3184
|
+
</xsl:if>
|
3185
|
+
|
3164
3186
|
<xsl:call-template name="setTableRowAttributes"/>
|
3165
3187
|
<xsl:apply-templates/>
|
3166
3188
|
</fo:table-row>
|
@@ -4201,8 +4223,17 @@
|
|
4201
4223
|
</fo:inline>
|
4202
4224
|
</xsl:template> <!-- tt -->
|
4203
4225
|
|
4226
|
+
<xsl:variable name="regex_url_start">^(http://|https://|www\.)?(.*)</xsl:variable>
|
4204
4227
|
<xsl:template match="*[local-name()='tt']/text()" priority="2">
|
4205
|
-
<xsl:
|
4228
|
+
<xsl:choose>
|
4229
|
+
<xsl:when test="java:replaceAll(java:java.lang.String.new(.), '$2', '') != ''">
|
4230
|
+
<!-- url -->
|
4231
|
+
<xsl:call-template name="add-zero-spaces-link-java"/>
|
4232
|
+
</xsl:when>
|
4233
|
+
<xsl:otherwise>
|
4234
|
+
<xsl:call-template name="add_spaces_to_sourcecode"/>
|
4235
|
+
</xsl:otherwise>
|
4236
|
+
</xsl:choose>
|
4206
4237
|
</xsl:template>
|
4207
4238
|
|
4208
4239
|
<xsl:template match="*[local-name()='underline']">
|
@@ -4558,8 +4589,11 @@
|
|
4558
4589
|
|
4559
4590
|
<xsl:template name="add-zero-spaces-link-java">
|
4560
4591
|
<xsl:param name="text" select="."/>
|
4592
|
+
|
4593
|
+
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$1')"/> <!-- http://. https:// or www. -->
|
4594
|
+
<xsl:variable name="url_continue" select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$2')"/>
|
4561
4595
|
<!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
|
4562
|
-
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($
|
4596
|
+
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/)','$1')"/>
|
4563
4597
|
</xsl:template>
|
4564
4598
|
|
4565
4599
|
<!-- add zero space after dash character (for table's entries) -->
|
@@ -5116,6 +5150,9 @@
|
|
5116
5150
|
<xsl:value-of select="substring($str, 2)"/>
|
5117
5151
|
</xsl:template>
|
5118
5152
|
|
5153
|
+
<!-- ======================================= -->
|
5154
|
+
<!-- math -->
|
5155
|
+
<!-- ======================================= -->
|
5119
5156
|
<xsl:template match="mathml:math">
|
5120
5157
|
<xsl:variable name="isAdded" select="@added"/>
|
5121
5158
|
<xsl:variable name="isDeleted" select="@deleted"/>
|
@@ -5166,14 +5203,57 @@
|
|
5166
5203
|
<xsl:value-of select="$comment_text"/>
|
5167
5204
|
</xsl:template>
|
5168
5205
|
|
5206
|
+
<xsl:template match="*[local-name() = 'asciimath']">
|
5207
|
+
<xsl:param name="process" select="'false'"/>
|
5208
|
+
<xsl:if test="$process = 'true'">
|
5209
|
+
<xsl:apply-templates/>
|
5210
|
+
</xsl:if>
|
5211
|
+
</xsl:template>
|
5212
|
+
|
5213
|
+
<xsl:template match="*[local-name() = 'latexmath']"/>
|
5214
|
+
|
5215
|
+
<xsl:template name="getMathml_asciimath_text">
|
5216
|
+
<xsl:variable name="asciimath" select="../*[local-name() = 'asciimath']"/>
|
5217
|
+
<xsl:variable name="latexmath">
|
5218
|
+
|
5219
|
+
</xsl:variable>
|
5220
|
+
<xsl:variable name="asciimath_text_following">
|
5221
|
+
<xsl:choose>
|
5222
|
+
<xsl:when test="normalize-space($latexmath) != ''">
|
5223
|
+
<xsl:value-of select="$latexmath"/>
|
5224
|
+
</xsl:when>
|
5225
|
+
<xsl:when test="normalize-space($asciimath) != ''">
|
5226
|
+
<xsl:value-of select="$asciimath"/>
|
5227
|
+
</xsl:when>
|
5228
|
+
<xsl:otherwise>
|
5229
|
+
<xsl:value-of select="following-sibling::node()[1][self::comment()]"/>
|
5230
|
+
</xsl:otherwise>
|
5231
|
+
</xsl:choose>
|
5232
|
+
</xsl:variable>
|
5233
|
+
<xsl:variable name="asciimath_text_">
|
5234
|
+
<xsl:choose>
|
5235
|
+
<xsl:when test="normalize-space($asciimath_text_following) != ''">
|
5236
|
+
<xsl:value-of select="$asciimath_text_following"/>
|
5237
|
+
</xsl:when>
|
5238
|
+
<xsl:otherwise>
|
5239
|
+
<xsl:value-of select="normalize-space(translate(.,' ',' '))"/>
|
5240
|
+
</xsl:otherwise>
|
5241
|
+
</xsl:choose>
|
5242
|
+
</xsl:variable>
|
5243
|
+
<xsl:variable name="asciimath_text_2" select="java:org.metanorma.fop.Util.unescape($asciimath_text_)"/>
|
5244
|
+
<xsl:variable name="asciimath_text" select="java:trim(java:java.lang.String.new($asciimath_text_2))"/>
|
5245
|
+
<xsl:value-of select="$asciimath_text"/>
|
5246
|
+
</xsl:template>
|
5247
|
+
|
5169
5248
|
<xsl:template name="mathml_instream_object">
|
5170
|
-
<xsl:param name="
|
5249
|
+
<xsl:param name="asciimath_text"/>
|
5171
5250
|
<xsl:param name="mathml_content"/>
|
5172
5251
|
|
5173
|
-
<xsl:variable name="
|
5252
|
+
<xsl:variable name="asciimath_text_">
|
5174
5253
|
<xsl:choose>
|
5175
|
-
<xsl:when test="normalize-space($
|
5176
|
-
<xsl:otherwise><xsl:call-template name="getMathml_comment_text"/></xsl:otherwise>
|
5254
|
+
<xsl:when test="normalize-space($asciimath_text) != ''"><xsl:value-of select="$asciimath_text"/></xsl:when>
|
5255
|
+
<!-- <xsl:otherwise><xsl:call-template name="getMathml_comment_text"/></xsl:otherwise> -->
|
5256
|
+
<xsl:otherwise><xsl:call-template name="getMathml_asciimath_text"/></xsl:otherwise>
|
5177
5257
|
</xsl:choose>
|
5178
5258
|
</xsl:variable>
|
5179
5259
|
|
@@ -5190,10 +5270,10 @@
|
|
5190
5270
|
</xsl:attribute>
|
5191
5271
|
|
5192
5272
|
<!-- <xsl:if test="$add_math_as_text = 'true'"> -->
|
5193
|
-
<xsl:if test="normalize-space($
|
5273
|
+
<xsl:if test="normalize-space($asciimath_text_) != ''">
|
5194
5274
|
<!-- put Mathin Alternate Text -->
|
5195
5275
|
<xsl:attribute name="fox:alt-text">
|
5196
|
-
<xsl:value-of select="$
|
5276
|
+
<xsl:value-of select="$asciimath_text_"/>
|
5197
5277
|
</xsl:attribute>
|
5198
5278
|
</xsl:if>
|
5199
5279
|
<!-- </xsl:if> -->
|
@@ -5266,6 +5346,29 @@
|
|
5266
5346
|
<xsl:value-of select="."/><xsl:value-of select="$zero_width_space"/>
|
5267
5347
|
</xsl:template>
|
5268
5348
|
|
5349
|
+
<!-- Examples:
|
5350
|
+
<stem type="AsciiMath">x = 1</stem>
|
5351
|
+
<stem type="AsciiMath"><asciimath>x = 1</asciimath></stem>
|
5352
|
+
<stem type="AsciiMath"><asciimath>x = 1</asciimath><latexmath>x = 1</latexmath></stem>
|
5353
|
+
-->
|
5354
|
+
<xsl:template match="*[local-name() = 'stem'][@type = 'AsciiMath'][count(*) = 0]/text() | *[local-name() = 'stem'][@type = 'AsciiMath'][*[local-name() = 'asciimath']]" priority="3">
|
5355
|
+
<fo:inline xsl:use-attribute-sets="mathml-style">
|
5356
|
+
|
5357
|
+
<xsl:choose>
|
5358
|
+
<xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
|
5359
|
+
<xsl:otherwise>
|
5360
|
+
<xsl:apply-templates>
|
5361
|
+
<xsl:with-param name="process">true</xsl:with-param>
|
5362
|
+
</xsl:apply-templates>
|
5363
|
+
</xsl:otherwise>
|
5364
|
+
</xsl:choose>
|
5365
|
+
|
5366
|
+
</fo:inline>
|
5367
|
+
</xsl:template>
|
5368
|
+
<!-- ======================================= -->
|
5369
|
+
<!-- END: math -->
|
5370
|
+
<!-- ======================================= -->
|
5371
|
+
|
5269
5372
|
<xsl:template match="*[local-name()='localityStack']"/>
|
5270
5373
|
|
5271
5374
|
<xsl:template match="*[local-name()='link']" name="link">
|
@@ -6606,9 +6709,9 @@
|
|
6606
6709
|
<xsl:apply-templates mode="contents_item"/>
|
6607
6710
|
</xsl:template>
|
6608
6711
|
|
6609
|
-
<!--
|
6610
|
-
<!-- sourcecode
|
6611
|
-
<!--
|
6712
|
+
<!-- =============== -->
|
6713
|
+
<!-- sourcecode -->
|
6714
|
+
<!-- =============== -->
|
6612
6715
|
<xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
|
6613
6716
|
|
6614
6717
|
<fo:block-container xsl:use-attribute-sets="sourcecode-container-style">
|
@@ -6906,8 +7009,22 @@
|
|
6906
7009
|
</fo:block>
|
6907
7010
|
</xsl:if>
|
6908
7011
|
</xsl:template>
|
6909
|
-
<!--
|
6910
|
-
<!--
|
7012
|
+
<!-- =============== -->
|
7013
|
+
<!-- END sourcecode -->
|
7014
|
+
<!-- =============== -->
|
7015
|
+
|
7016
|
+
<!-- =============== -->
|
7017
|
+
<!-- pre -->
|
7018
|
+
<!-- =============== -->
|
7019
|
+
<xsl:template match="*[local-name()='pre']" name="pre">
|
7020
|
+
<fo:block xsl:use-attribute-sets="pre-style">
|
7021
|
+
<xsl:copy-of select="@id"/>
|
7022
|
+
<xsl:apply-templates/>
|
7023
|
+
</fo:block>
|
7024
|
+
</xsl:template>
|
7025
|
+
<!-- =============== -->
|
7026
|
+
<!-- pre -->
|
7027
|
+
<!-- =============== -->
|
6911
7028
|
|
6912
7029
|
<!-- ========== -->
|
6913
7030
|
<!-- permission -->
|
@@ -8943,7 +9060,7 @@
|
|
8943
9060
|
|
8944
9061
|
<xsl:variable name="element_name_keep-together_within-line">keep-together_within-line</xsl:variable>
|
8945
9062
|
|
8946
|
-
<xsl:template match="text()[not(ancestor::*[local-name() = 'bibdata'] or ancestor::*[local-name() = 'sourcecode'] or
|
9063
|
+
<xsl:template match="text()[not(ancestor::*[local-name() = 'bibdata'] or ancestor::*[local-name() = 'link'][not(contains(.,' '))] or ancestor::*[local-name() = 'sourcecode'] or ancestor::*[local-name() = 'math'] or starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.') )]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
|
8947
9064
|
|
8948
9065
|
<!-- enclose standard's number into tag 'keep-together_within-line' -->
|
8949
9066
|
<xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
|
@@ -9419,13 +9536,14 @@
|
|
9419
9536
|
</xsl:template>
|
9420
9537
|
|
9421
9538
|
<xsl:template name="setId">
|
9539
|
+
<xsl:param name="prefix"/>
|
9422
9540
|
<xsl:attribute name="id">
|
9423
9541
|
<xsl:choose>
|
9424
9542
|
<xsl:when test="@id">
|
9425
|
-
<xsl:value-of select="@id"/>
|
9543
|
+
<xsl:value-of select="concat($prefix, @id)"/>
|
9426
9544
|
</xsl:when>
|
9427
9545
|
<xsl:otherwise>
|
9428
|
-
<xsl:value-of select="generate-id()"/>
|
9546
|
+
<xsl:value-of select="concat($prefix, generate-id())"/>
|
9429
9547
|
</xsl:otherwise>
|
9430
9548
|
</xsl:choose>
|
9431
9549
|
</xsl:attribute>
|
@@ -1,10 +1,5 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
2
|
<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
3
|
-
<include href="biblio.rng">
|
4
|
-
<start>
|
5
|
-
<ref name="document"/>
|
6
|
-
</start>
|
7
|
-
</include>
|
8
3
|
<define name="document">
|
9
4
|
<element name="document">
|
10
5
|
<optional>
|
@@ -1125,26 +1120,4 @@
|
|
1125
1120
|
</zeroOrMore>
|
1126
1121
|
</element>
|
1127
1122
|
</define>
|
1128
|
-
<define name="ext">
|
1129
|
-
<element name="ext">
|
1130
|
-
<ref name="BibDataExtensionType"/>
|
1131
|
-
</element>
|
1132
|
-
</define>
|
1133
|
-
<define name="BibDataExtensionType">
|
1134
|
-
<ref name="doctype"/>
|
1135
|
-
</define>
|
1136
|
-
<define name="doctype">
|
1137
|
-
<element name="doctype">
|
1138
|
-
<ref name="DocumentType"/>
|
1139
|
-
</element>
|
1140
|
-
</define>
|
1141
|
-
<define name="DocumentType">
|
1142
|
-
<value>document</value>
|
1143
|
-
</define>
|
1144
|
-
<define name="BibData">
|
1145
|
-
<ref name="BibliographicItem"/>
|
1146
|
-
<optional>
|
1147
|
-
<ref name="ext"/>
|
1148
|
-
</optional>
|
1149
|
-
</define>
|
1150
1123
|
</grammar>
|