metanorma-bipm 2.1.11 → 2.1.13
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/bipm/base_convert.rb +3 -2
- data/lib/isodoc/bipm/bipm.brochure.xsl +327 -75
- data/lib/isodoc/bipm/bipm.guide.xsl +327 -75
- data/lib/isodoc/bipm/bipm.mise-en-pratique.xsl +327 -75
- data/lib/isodoc/bipm/bipm.rapport.xsl +327 -75
- data/lib/isodoc/bipm/doccontrol.rb +3 -3
- data/lib/isodoc/bipm/html/htmlstyle.css +6 -0
- data/lib/isodoc/bipm/jcgm.standard.xsl +307 -68
- data/lib/metanorma/bipm/biblio.rng +5 -0
- data/lib/metanorma/bipm/converter.rb +0 -23
- data/lib/metanorma/bipm/isodoc.rng +47 -13
- data/lib/metanorma/bipm/version.rb +1 -1
- data/metanorma-bipm.gemspec +3 -2
- metadata +4 -11
- data/.github/workflows/automerge.yml +0 -31
- 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
@@ -1058,7 +1058,7 @@
|
|
1058
1058
|
<!-- <xsl:copy-of select="$contents"/> -->
|
1059
1059
|
|
1060
1060
|
<xsl:if test="$contents/doc[@id = $docid]//item[@display='true']">
|
1061
|
-
<fo:table table-layout="fixed" width="100%">
|
1061
|
+
<fo:table table-layout="fixed" width="100%" id="__internal_layout__toc_{generate-id()}">
|
1062
1062
|
<fo:table-column column-width="127mm"/>
|
1063
1063
|
<fo:table-column column-width="12mm"/>
|
1064
1064
|
<fo:table-body>
|
@@ -2242,8 +2242,13 @@
|
|
2242
2242
|
<!-- ====== -->
|
2243
2243
|
|
2244
2244
|
<xsl:template match="bipm:preface/*[not(local-name() = 'note' or local-name() = 'admonition')][1]" priority="3">
|
2245
|
-
<fo:
|
2245
|
+
<fo:block keep-with-next="always">
|
2246
2246
|
<xsl:call-template name="setId"/>
|
2247
|
+
</fo:block>
|
2248
|
+
<fo:table table-layout="fixed" width="173.5mm">
|
2249
|
+
<xsl:call-template name="setId">
|
2250
|
+
<xsl:with-param name="prefix">__internal_layout__</xsl:with-param>
|
2251
|
+
</xsl:call-template>
|
2247
2252
|
<fo:table-column column-width="137mm"/>
|
2248
2253
|
<fo:table-column column-width="2.5mm"/>
|
2249
2254
|
<fo:table-column column-width="34mm"/>
|
@@ -2386,11 +2391,16 @@
|
|
2386
2391
|
</xsl:variable>
|
2387
2392
|
<xsl:variable name="space-before-value" select="normalize-space($space-before)"/>
|
2388
2393
|
|
2394
|
+
<fo:block keep-with-next="always">
|
2395
|
+
<xsl:call-template name="setId"/>
|
2396
|
+
</fo:block>
|
2389
2397
|
<fo:table table-layout="fixed" width="174mm" line-height="135%">
|
2390
2398
|
<xsl:if test="@orientation = 'landscape'">
|
2391
2399
|
<xsl:attribute name="width">261mm</xsl:attribute> <!-- 87 = (297 - 210) -->
|
2392
2400
|
</xsl:if>
|
2393
|
-
<xsl:call-template name="setId"
|
2401
|
+
<xsl:call-template name="setId">
|
2402
|
+
<xsl:with-param name="prefix">__internal_layout__</xsl:with-param>
|
2403
|
+
</xsl:call-template>
|
2394
2404
|
<xsl:if test="$space-before-value != ''">
|
2395
2405
|
<xsl:attribute name="space-before"><xsl:value-of select="$space-before-value"/></xsl:attribute>
|
2396
2406
|
</xsl:if>
|
@@ -3743,7 +3753,7 @@
|
|
3743
3753
|
</fo:block>
|
3744
3754
|
</fo:block-container>
|
3745
3755
|
<!-- grey opacity -->
|
3746
|
-
<fo:block-container absolute-position="fixed" left="0" top="0">
|
3756
|
+
<fo:block-container absolute-position="fixed" left="0" top="0" id="{concat('__internal_layout__', 'Logo-BIPM-Metro_', generate-id())}">
|
3747
3757
|
<fo:block>
|
3748
3758
|
<fo:instream-foreign-object content-height="{$pageHeight}mm" fox:alt-text="Background color">
|
3749
3759
|
<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="215.9mm" height="279.4mm">
|
@@ -3788,6 +3798,8 @@
|
|
3788
3798
|
</xsl:if>
|
3789
3799
|
</xsl:template>
|
3790
3800
|
|
3801
|
+
<xsl:strip-space elements="bipm:xref"/>
|
3802
|
+
|
3791
3803
|
<!-- external parameters -->
|
3792
3804
|
|
3793
3805
|
<xsl:param name="svg_images"/> <!-- svg images array -->
|
@@ -4215,6 +4227,12 @@
|
|
4215
4227
|
|
4216
4228
|
</xsl:attribute-set>
|
4217
4229
|
|
4230
|
+
<xsl:attribute-set name="pre-style">
|
4231
|
+
<xsl:attribute name="font-family">Courier New, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
|
4232
|
+
<xsl:attribute name="margin-bottom">6pt</xsl:attribute>
|
4233
|
+
|
4234
|
+
</xsl:attribute-set>
|
4235
|
+
|
4218
4236
|
<xsl:attribute-set name="permission-style">
|
4219
4237
|
|
4220
4238
|
</xsl:attribute-set>
|
@@ -4313,6 +4331,11 @@
|
|
4313
4331
|
</xsl:variable>
|
4314
4332
|
<xsl:variable name="table-border" select="normalize-space($table-border_)"/>
|
4315
4333
|
|
4334
|
+
<xsl:variable name="table-cell-border_">
|
4335
|
+
|
4336
|
+
</xsl:variable>
|
4337
|
+
<xsl:variable name="table-cell-border" select="normalize-space($table-cell-border_)"/>
|
4338
|
+
|
4316
4339
|
<xsl:attribute-set name="table-container-style">
|
4317
4340
|
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
4318
4341
|
<xsl:attribute name="margin-right">0mm</xsl:attribute>
|
@@ -4325,8 +4348,6 @@
|
|
4325
4348
|
<xsl:attribute-set name="table-style">
|
4326
4349
|
<xsl:attribute name="table-omit-footer-at-break">true</xsl:attribute>
|
4327
4350
|
<xsl:attribute name="table-layout">fixed</xsl:attribute>
|
4328
|
-
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
4329
|
-
<xsl:attribute name="margin-right">0mm</xsl:attribute>
|
4330
4351
|
|
4331
4352
|
</xsl:attribute-set><!-- table-style -->
|
4332
4353
|
|
@@ -5174,17 +5195,22 @@
|
|
5174
5195
|
</xsl:for-each>
|
5175
5196
|
</xsl:template>
|
5176
5197
|
|
5198
|
+
<xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
|
5177
5199
|
<xsl:variable name="tag_fo_inline_keep-together_within-line_open">###fo:inline keep-together_within-line###</xsl:variable>
|
5178
5200
|
<xsl:variable name="tag_fo_inline_keep-together_within-line_close">###/fo:inline keep-together_within-line###</xsl:variable>
|
5179
5201
|
<xsl:template match="text()" name="text">
|
5180
5202
|
|
5181
|
-
<xsl:
|
5182
|
-
|
5183
|
-
|
5184
|
-
|
5185
|
-
|
5186
|
-
|
5187
|
-
|
5203
|
+
<xsl:choose>
|
5204
|
+
<xsl:when test="ancestor::*[local-name() = 'table']"><xsl:value-of select="."/></xsl:when>
|
5205
|
+
<xsl:otherwise>
|
5206
|
+
<xsl:variable name="text" select="java:replaceAll(java:java.lang.String.new(.),$regex_standard_reference,concat($tag_fo_inline_keep-together_within-line_open,'$1',$tag_fo_inline_keep-together_within-line_close))"/>
|
5207
|
+
<xsl:call-template name="replace_fo_inline_tags">
|
5208
|
+
<xsl:with-param name="tag_open" select="$tag_fo_inline_keep-together_within-line_open"/>
|
5209
|
+
<xsl:with-param name="tag_close" select="$tag_fo_inline_keep-together_within-line_close"/>
|
5210
|
+
<xsl:with-param name="text" select="$text"/>
|
5211
|
+
</xsl:call-template>
|
5212
|
+
</xsl:otherwise>
|
5213
|
+
</xsl:choose>
|
5188
5214
|
|
5189
5215
|
</xsl:template>
|
5190
5216
|
|
@@ -5459,6 +5485,12 @@
|
|
5459
5485
|
<xsl:variable name="table_attributes">
|
5460
5486
|
|
5461
5487
|
<xsl:element name="table_attributes" use-attribute-sets="table-style">
|
5488
|
+
|
5489
|
+
<xsl:if test="$margin-side != 0">
|
5490
|
+
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
5491
|
+
<xsl:attribute name="margin-right">0mm</xsl:attribute>
|
5492
|
+
</xsl:if>
|
5493
|
+
|
5462
5494
|
<xsl:attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></xsl:attribute>
|
5463
5495
|
|
5464
5496
|
<xsl:if test="not(ancestor::*[local-name()='preface']) and not(ancestor::*[local-name()='note_side']) and not(ancestor::*[local-name() = 'annex'] and .//*[local-name() = 'xref'][@pagenumber]) and not(ancestor::*[local-name() = 'doccontrol'])">
|
@@ -6247,6 +6279,10 @@
|
|
6247
6279
|
<xsl:template match="*[local-name()='tr']">
|
6248
6280
|
<fo:table-row xsl:use-attribute-sets="table-body-row-style">
|
6249
6281
|
|
6282
|
+
<xsl:if test="count(*) = count(*[local-name() = 'th'])"> <!-- row contains 'th' only -->
|
6283
|
+
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
6284
|
+
</xsl:if>
|
6285
|
+
|
6250
6286
|
<xsl:call-template name="setTableRowAttributes"/>
|
6251
6287
|
<xsl:apply-templates/>
|
6252
6288
|
</fo:table-row>
|
@@ -7262,7 +7298,8 @@
|
|
7262
7298
|
<xsl:copy-of select="node()"/>
|
7263
7299
|
</td>
|
7264
7300
|
<td>
|
7265
|
-
<xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()[not(local-name() = 'dl')]"/>
|
7301
|
+
<!-- <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()[not(local-name() = 'dl')]"/> -->
|
7302
|
+
<xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]/node()[not(local-name() = 'dl')]" mode="dl_if"/>
|
7266
7303
|
<!-- get paragraphs from nested 'dl' -->
|
7267
7304
|
<xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]/*[local-name() = 'dl']" mode="dl_if_nested"/>
|
7268
7305
|
</td>
|
@@ -7270,6 +7307,53 @@
|
|
7270
7307
|
</xsl:template>
|
7271
7308
|
<xsl:template match="*[local-name()='dd']" mode="dl_if"/>
|
7272
7309
|
|
7310
|
+
<xsl:template match="*" mode="dl_if">
|
7311
|
+
<xsl:copy-of select="."/>
|
7312
|
+
</xsl:template>
|
7313
|
+
|
7314
|
+
<xsl:template match="*[local-name() = 'p']" mode="dl_if">
|
7315
|
+
<xsl:param name="indent"/>
|
7316
|
+
<p>
|
7317
|
+
<xsl:copy-of select="@*"/>
|
7318
|
+
<xsl:value-of select="$indent"/>
|
7319
|
+
<xsl:copy-of select="node()"/>
|
7320
|
+
</p>
|
7321
|
+
|
7322
|
+
</xsl:template>
|
7323
|
+
|
7324
|
+
<xsl:template match="*[local-name() = 'ul' or local-name() = 'ol']" mode="dl_if">
|
7325
|
+
<xsl:variable name="list_rendered_">
|
7326
|
+
<xsl:apply-templates select="."/>
|
7327
|
+
</xsl:variable>
|
7328
|
+
<xsl:variable name="list_rendered" select="xalan:nodeset($list_rendered_)"/>
|
7329
|
+
|
7330
|
+
<xsl:variable name="indent">
|
7331
|
+
<xsl:for-each select="($list_rendered//fo:block[not(.//fo:block)])[1]">
|
7332
|
+
<xsl:apply-templates select="ancestor::*[@provisional-distance-between-starts]/@provisional-distance-between-starts" mode="dl_if"/>
|
7333
|
+
</xsl:for-each>
|
7334
|
+
</xsl:variable>
|
7335
|
+
|
7336
|
+
<xsl:apply-templates mode="dl_if">
|
7337
|
+
<xsl:with-param name="indent" select="$indent"/>
|
7338
|
+
</xsl:apply-templates>
|
7339
|
+
</xsl:template>
|
7340
|
+
|
7341
|
+
<xsl:template match="*[local-name() = 'li']" mode="dl_if">
|
7342
|
+
<xsl:param name="indent"/>
|
7343
|
+
<xsl:apply-templates mode="dl_if">
|
7344
|
+
<xsl:with-param name="indent" select="$indent"/>
|
7345
|
+
</xsl:apply-templates>
|
7346
|
+
</xsl:template>
|
7347
|
+
|
7348
|
+
<xsl:template match="@provisional-distance-between-starts" mode="dl_if">
|
7349
|
+
<xsl:variable name="value" select="round(substring-before(.,'mm'))"/>
|
7350
|
+
<!-- emulate left indent for list item -->
|
7351
|
+
<xsl:call-template name="repeat">
|
7352
|
+
<xsl:with-param name="char" select="'x'"/>
|
7353
|
+
<xsl:with-param name="count" select="$value"/>
|
7354
|
+
</xsl:call-template>
|
7355
|
+
</xsl:template>
|
7356
|
+
|
7273
7357
|
<xsl:template match="*[local-name()='dl']" mode="dl_if_nested">
|
7274
7358
|
<xsl:for-each select="*[local-name() = 'dt']">
|
7275
7359
|
<p>
|
@@ -7663,6 +7747,7 @@
|
|
7663
7747
|
</word>
|
7664
7748
|
<xsl:call-template name="tokenize_with_tags">
|
7665
7749
|
<xsl:with-param name="text" select="substring-after($text, $separator)"/>
|
7750
|
+
<xsl:with-param name="tags" select="$tags"/>
|
7666
7751
|
</xsl:call-template>
|
7667
7752
|
</xsl:otherwise>
|
7668
7753
|
</xsl:choose>
|
@@ -7702,8 +7787,18 @@
|
|
7702
7787
|
|
7703
7788
|
<xsl:template name="add-zero-spaces-java">
|
7704
7789
|
<xsl:param name="text" select="."/>
|
7705
|
-
<!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space
|
7706
|
-
<xsl:
|
7790
|
+
<!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space, arrow right -->
|
7791
|
+
<xsl:variable name="text1" select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| |→)','$1')"/>
|
7792
|
+
<!-- add zero-width space (#x200B) after characters: 'great than' -->
|
7793
|
+
<xsl:variable name="text2" select="java:replaceAll(java:java.lang.String.new($text1), '(\u003e)(?!\u003e)', '$1')"/><!-- negative lookahead: 'great than' not followed by 'great than' -->
|
7794
|
+
<!-- add zero-width space (#x200B) before characters: 'less than' -->
|
7795
|
+
<xsl:variable name="text3" select="java:replaceAll(java:java.lang.String.new($text2), '(?<!\u003c)(\u003c)', '$1')"/> <!-- (?<!\u003c)(\u003c) --> <!-- negative lookbehind: 'less than' not preceeded by 'less than' -->
|
7796
|
+
<!-- add zero-width space (#x200B) before character: { -->
|
7797
|
+
<xsl:variable name="text4" select="java:replaceAll(java:java.lang.String.new($text3), '(?<!\W)(\{)', '$1')"/> <!-- negative lookbehind: '{' not preceeded by 'punctuation char' -->
|
7798
|
+
<!-- add zero-width space (#x200B) after character: , -->
|
7799
|
+
<xsl:variable name="text5" select="java:replaceAll(java:java.lang.String.new($text4), '(\,)(?!\d)', '$1')"/> <!-- negative lookahead: ',' not followed by digit -->
|
7800
|
+
|
7801
|
+
<xsl:value-of select="$text5"/>
|
7707
7802
|
</xsl:template>
|
7708
7803
|
|
7709
7804
|
<xsl:template name="add-zero-spaces-link-java">
|
@@ -7849,7 +7944,7 @@
|
|
7849
7944
|
</xsl:copy>
|
7850
7945
|
</xsl:template>
|
7851
7946
|
|
7852
|
-
<xsl:template match="*[local-name()='th' or local-name() = 'td'][not(*[local-name()='br']) and not(*[local-name()='p'])]" mode="table-without-br">
|
7947
|
+
<xsl:template match="*[local-name()='th' or local-name() = 'td'][not(*[local-name()='br']) and not(*[local-name()='p']) and not(*[local-name()='sourcecode'])]" mode="table-without-br">
|
7853
7948
|
<xsl:copy>
|
7854
7949
|
<xsl:copy-of select="@*"/>
|
7855
7950
|
<p>
|
@@ -7897,6 +7992,28 @@
|
|
7897
7992
|
</xsl:for-each>
|
7898
7993
|
</xsl:template>
|
7899
7994
|
|
7995
|
+
<xsl:template match="*[local-name()='th' or local-name()='td']/*[local-name() = 'sourcecode']" mode="table-without-br">
|
7996
|
+
<xsl:apply-templates mode="table-without-br"/>
|
7997
|
+
</xsl:template>
|
7998
|
+
|
7999
|
+
<xsl:template match="*[local-name()='th' or local-name()='td']/*[local-name() = 'sourcecode']/text()[contains(., ' ') or contains(., ' ')]" mode="table-without-br">
|
8000
|
+
|
8001
|
+
<xsl:variable name="sep">###SOURCECODE_NEWLINE###</xsl:variable>
|
8002
|
+
<xsl:variable name="sourcecode_text" select="java:replaceAll(java:java.lang.String.new(.),'( | | )', $sep)"/>
|
8003
|
+
<xsl:variable name="items">
|
8004
|
+
<xsl:call-template name="split">
|
8005
|
+
<xsl:with-param name="pText" select="$sourcecode_text"/>
|
8006
|
+
<xsl:with-param name="sep" select="$sep"/>
|
8007
|
+
<xsl:with-param name="normalize-space">false</xsl:with-param>
|
8008
|
+
</xsl:call-template>
|
8009
|
+
</xsl:variable>
|
8010
|
+
<xsl:for-each select="xalan:nodeset($items)/*">
|
8011
|
+
<p>
|
8012
|
+
<sourcecode><xsl:copy-of select="node()"/></sourcecode>
|
8013
|
+
</p>
|
8014
|
+
</xsl:for-each>
|
8015
|
+
</xsl:template>
|
8016
|
+
|
7900
8017
|
<!-- remove redundant white spaces -->
|
7901
8018
|
<xsl:template match="text()[not(ancestor::*[local-name() = 'sourcecode'])]" mode="table-without-br">
|
7902
8019
|
<xsl:variable name="text" select="translate(.,'	 ','')"/>
|
@@ -8207,6 +8324,7 @@
|
|
8207
8324
|
<xsl:if test="ancestor::*[local-name() = 'sub']"><tag>sub</tag></xsl:if>
|
8208
8325
|
<xsl:if test="ancestor::*[local-name() = 'sup']"><tag>sup</tag></xsl:if>
|
8209
8326
|
<xsl:if test="ancestor::*[local-name() = 'tt']"><tag>tt</tag></xsl:if>
|
8327
|
+
<xsl:if test="ancestor::*[local-name() = 'sourcecode']"><tag>sourcecode</tag></xsl:if>
|
8210
8328
|
<xsl:if test="ancestor::*[local-name() = 'keep-together_within-line']"><tag>keep-together_within-line</tag></xsl:if>
|
8211
8329
|
</tags>
|
8212
8330
|
</xsl:template>
|
@@ -8269,6 +8387,9 @@
|
|
8269
8387
|
<xsl:value-of select="substring($str, 2)"/>
|
8270
8388
|
</xsl:template>
|
8271
8389
|
|
8390
|
+
<!-- ======================================= -->
|
8391
|
+
<!-- math -->
|
8392
|
+
<!-- ======================================= -->
|
8272
8393
|
<xsl:template match="mathml:math">
|
8273
8394
|
<xsl:variable name="isAdded" select="@added"/>
|
8274
8395
|
<xsl:variable name="isDeleted" select="@deleted"/>
|
@@ -8304,17 +8425,18 @@
|
|
8304
8425
|
<xsl:when test="$add_math_as_attachment = 'true' and normalize-space($filename) != ''">
|
8305
8426
|
<xsl:variable name="url" select="concat('url(embedded-file:', $filename, ')')"/>
|
8306
8427
|
<fo:basic-link external-destination="{$url}" fox:alt-text="MathLink">
|
8307
|
-
<xsl:variable name="
|
8308
|
-
<xsl:call-template name="getMathml_comment_text"/>
|
8428
|
+
<xsl:variable name="asciimath_text">
|
8429
|
+
<!-- <xsl:call-template name="getMathml_comment_text"/> -->
|
8430
|
+
<xsl:call-template name="getMathml_asciimath_text"/>
|
8309
8431
|
</xsl:variable>
|
8310
|
-
<xsl:if test="normalize-space($
|
8432
|
+
<xsl:if test="normalize-space($asciimath_text) != ''">
|
8311
8433
|
<!-- put Mathin Alternate Text -->
|
8312
8434
|
<xsl:attribute name="fox:alt-text">
|
8313
|
-
<xsl:value-of select="$
|
8435
|
+
<xsl:value-of select="$asciimath_text"/>
|
8314
8436
|
</xsl:attribute>
|
8315
8437
|
</xsl:if>
|
8316
8438
|
<xsl:call-template name="mathml_instream_object">
|
8317
|
-
<xsl:with-param name="
|
8439
|
+
<xsl:with-param name="asciimath_text" select="$asciimath_text"/>
|
8318
8440
|
<xsl:with-param name="mathml_content" select="$mathml_content"/>
|
8319
8441
|
</xsl:call-template>
|
8320
8442
|
</fo:basic-link>
|
@@ -8325,7 +8447,7 @@
|
|
8325
8447
|
</xsl:call-template>
|
8326
8448
|
</xsl:otherwise>
|
8327
8449
|
</xsl:choose>
|
8328
|
-
<!-- end
|
8450
|
+
<!-- end BIPM -->
|
8329
8451
|
|
8330
8452
|
</fo:inline>
|
8331
8453
|
</xsl:template>
|
@@ -8347,14 +8469,57 @@
|
|
8347
8469
|
<xsl:value-of select="$comment_text"/>
|
8348
8470
|
</xsl:template>
|
8349
8471
|
|
8472
|
+
<xsl:template match="*[local-name() = 'asciimath']">
|
8473
|
+
<xsl:param name="process" select="'false'"/>
|
8474
|
+
<xsl:if test="$process = 'true'">
|
8475
|
+
<xsl:apply-templates/>
|
8476
|
+
</xsl:if>
|
8477
|
+
</xsl:template>
|
8478
|
+
|
8479
|
+
<xsl:template match="*[local-name() = 'latexmath']"/>
|
8480
|
+
|
8481
|
+
<xsl:template name="getMathml_asciimath_text">
|
8482
|
+
<xsl:variable name="asciimath" select="../*[local-name() = 'asciimath']"/>
|
8483
|
+
<xsl:variable name="latexmath">
|
8484
|
+
|
8485
|
+
</xsl:variable>
|
8486
|
+
<xsl:variable name="asciimath_text_following">
|
8487
|
+
<xsl:choose>
|
8488
|
+
<xsl:when test="normalize-space($latexmath) != ''">
|
8489
|
+
<xsl:value-of select="$latexmath"/>
|
8490
|
+
</xsl:when>
|
8491
|
+
<xsl:when test="normalize-space($asciimath) != ''">
|
8492
|
+
<xsl:value-of select="$asciimath"/>
|
8493
|
+
</xsl:when>
|
8494
|
+
<xsl:otherwise>
|
8495
|
+
<xsl:value-of select="following-sibling::node()[1][self::comment()]"/>
|
8496
|
+
</xsl:otherwise>
|
8497
|
+
</xsl:choose>
|
8498
|
+
</xsl:variable>
|
8499
|
+
<xsl:variable name="asciimath_text_">
|
8500
|
+
<xsl:choose>
|
8501
|
+
<xsl:when test="normalize-space($asciimath_text_following) != ''">
|
8502
|
+
<xsl:value-of select="$asciimath_text_following"/>
|
8503
|
+
</xsl:when>
|
8504
|
+
<xsl:otherwise>
|
8505
|
+
<xsl:value-of select="normalize-space(translate(.,' ',' '))"/>
|
8506
|
+
</xsl:otherwise>
|
8507
|
+
</xsl:choose>
|
8508
|
+
</xsl:variable>
|
8509
|
+
<xsl:variable name="asciimath_text_2" select="java:org.metanorma.fop.Util.unescape($asciimath_text_)"/>
|
8510
|
+
<xsl:variable name="asciimath_text" select="java:trim(java:java.lang.String.new($asciimath_text_2))"/>
|
8511
|
+
<xsl:value-of select="$asciimath_text"/>
|
8512
|
+
</xsl:template>
|
8513
|
+
|
8350
8514
|
<xsl:template name="mathml_instream_object">
|
8351
|
-
<xsl:param name="
|
8515
|
+
<xsl:param name="asciimath_text"/>
|
8352
8516
|
<xsl:param name="mathml_content"/>
|
8353
8517
|
|
8354
|
-
<xsl:variable name="
|
8518
|
+
<xsl:variable name="asciimath_text_">
|
8355
8519
|
<xsl:choose>
|
8356
|
-
<xsl:when test="normalize-space($
|
8357
|
-
<xsl:otherwise><xsl:call-template name="getMathml_comment_text"/></xsl:otherwise>
|
8520
|
+
<xsl:when test="normalize-space($asciimath_text) != ''"><xsl:value-of select="$asciimath_text"/></xsl:when>
|
8521
|
+
<!-- <xsl:otherwise><xsl:call-template name="getMathml_comment_text"/></xsl:otherwise> -->
|
8522
|
+
<xsl:otherwise><xsl:call-template name="getMathml_asciimath_text"/></xsl:otherwise>
|
8358
8523
|
</xsl:choose>
|
8359
8524
|
</xsl:variable>
|
8360
8525
|
|
@@ -8378,10 +8543,10 @@
|
|
8378
8543
|
</xsl:attribute>
|
8379
8544
|
|
8380
8545
|
<!-- <xsl:if test="$add_math_as_text = 'true'"> -->
|
8381
|
-
<xsl:if test="normalize-space($
|
8546
|
+
<xsl:if test="normalize-space($asciimath_text_) != ''">
|
8382
8547
|
<!-- put Mathin Alternate Text -->
|
8383
8548
|
<xsl:attribute name="fox:alt-text">
|
8384
|
-
<xsl:value-of select="$
|
8549
|
+
<xsl:value-of select="$asciimath_text_"/>
|
8385
8550
|
</xsl:attribute>
|
8386
8551
|
</xsl:if>
|
8387
8552
|
<!-- </xsl:if> -->
|
@@ -8454,6 +8619,33 @@
|
|
8454
8619
|
<xsl:value-of select="."/><xsl:value-of select="$zero_width_space"/>
|
8455
8620
|
</xsl:template>
|
8456
8621
|
|
8622
|
+
<!-- Examples:
|
8623
|
+
<stem type="AsciiMath">x = 1</stem>
|
8624
|
+
<stem type="AsciiMath"><asciimath>x = 1</asciimath></stem>
|
8625
|
+
<stem type="AsciiMath"><asciimath>x = 1</asciimath><latexmath>x = 1</latexmath></stem>
|
8626
|
+
-->
|
8627
|
+
<xsl:template match="*[local-name() = 'stem'][@type = 'AsciiMath'][count(*) = 0]/text() | *[local-name() = 'stem'][@type = 'AsciiMath'][*[local-name() = 'asciimath']]" priority="3">
|
8628
|
+
<fo:inline xsl:use-attribute-sets="mathml-style">
|
8629
|
+
|
8630
|
+
<xsl:if test="ancestor::*[local-name()='table']">
|
8631
|
+
<xsl:attribute name="font-size">95%</xsl:attribute> <!-- base font in table is 10pt -->
|
8632
|
+
</xsl:if>
|
8633
|
+
|
8634
|
+
<xsl:choose>
|
8635
|
+
<xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
|
8636
|
+
<xsl:otherwise>
|
8637
|
+
<xsl:apply-templates>
|
8638
|
+
<xsl:with-param name="process">true</xsl:with-param>
|
8639
|
+
</xsl:apply-templates>
|
8640
|
+
</xsl:otherwise>
|
8641
|
+
</xsl:choose>
|
8642
|
+
|
8643
|
+
</fo:inline>
|
8644
|
+
</xsl:template>
|
8645
|
+
<!-- ======================================= -->
|
8646
|
+
<!-- END: math -->
|
8647
|
+
<!-- ======================================= -->
|
8648
|
+
|
8457
8649
|
<xsl:template match="*[local-name()='localityStack']"/>
|
8458
8650
|
|
8459
8651
|
<xsl:template match="*[local-name()='link']" name="link">
|
@@ -8661,6 +8853,12 @@
|
|
8661
8853
|
|
8662
8854
|
<fo:block-container margin-left="0mm">
|
8663
8855
|
|
8856
|
+
<!-- <xsl:if test="$namespace = 'iho'">
|
8857
|
+
<xsl:if test="ancestor::iho:td">
|
8858
|
+
<xsl:attribute name="font-size">12pt</xsl:attribute>
|
8859
|
+
</xsl:if>
|
8860
|
+
</xsl:if> -->
|
8861
|
+
|
8664
8862
|
<fo:block>
|
8665
8863
|
|
8666
8864
|
<xsl:if test="@parent-type = 'quote'">
|
@@ -9834,42 +10032,20 @@
|
|
9834
10032
|
<xsl:apply-templates mode="contents_item"/>
|
9835
10033
|
</xsl:template>
|
9836
10034
|
|
9837
|
-
<!--
|
9838
|
-
<!-- sourcecode
|
9839
|
-
<!--
|
10035
|
+
<!-- =============== -->
|
10036
|
+
<!-- sourcecode -->
|
10037
|
+
<!-- =============== -->
|
9840
10038
|
<xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
|
9841
10039
|
|
9842
|
-
<
|
9843
|
-
|
9844
|
-
|
9845
|
-
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
9846
|
-
</xsl:if>
|
9847
|
-
|
9848
|
-
<xsl:if test="ancestor::*[local-name() = 'example']">
|
9849
|
-
<xsl:attribute name="margin-right">0mm</xsl:attribute>
|
9850
|
-
</xsl:if>
|
10040
|
+
<xsl:variable name="sourcecode_attributes">
|
10041
|
+
<xsl:element name="sourcecode_attributes" use-attribute-sets="sourcecode-style">
|
10042
|
+
<xsl:variable name="_font-size">
|
9851
10043
|
|
9852
|
-
|
9853
|
-
|
9854
|
-
<xsl:if test="parent::*[local-name() = 'note']">
|
9855
|
-
<xsl:attribute name="margin-left">
|
9856
|
-
<xsl:choose>
|
9857
|
-
<xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
|
9858
|
-
<xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
|
9859
|
-
</xsl:choose>
|
9860
|
-
</xsl:attribute>
|
10044
|
+
<!-- 9 -->
|
9861
10045
|
|
9862
|
-
|
9863
|
-
|
9864
|
-
|
9865
|
-
<fo:block xsl:use-attribute-sets="sourcecode-style">
|
9866
|
-
<xsl:variable name="_font-size">
|
9867
|
-
|
9868
|
-
<!-- 9 -->
|
9869
|
-
|
9870
|
-
<!-- <xsl:if test="$namespace = 'ieee'">
|
9871
|
-
<xsl:if test="$current_template = 'standard'">8</xsl:if>
|
9872
|
-
</xsl:if> -->
|
10046
|
+
<!-- <xsl:if test="$namespace = 'ieee'">
|
10047
|
+
<xsl:if test="$current_template = 'standard'">8</xsl:if>
|
10048
|
+
</xsl:if> -->
|
9873
10049
|
|
9874
10050
|
</xsl:variable>
|
9875
10051
|
|
@@ -9884,14 +10060,60 @@
|
|
9884
10060
|
</xsl:choose>
|
9885
10061
|
</xsl:attribute>
|
9886
10062
|
</xsl:if>
|
10063
|
+
</xsl:element>
|
10064
|
+
</xsl:variable>
|
9887
10065
|
|
10066
|
+
<xsl:choose>
|
10067
|
+
<xsl:when test="$isGenerateTableIF = 'true' and (ancestor::*[local-name() = 'td'] or ancestor::*[local-name() = 'th'])">
|
10068
|
+
<xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@*">
|
10069
|
+
<xsl:attribute name="{local-name()}">
|
10070
|
+
<xsl:value-of select="."/>
|
10071
|
+
</xsl:attribute>
|
10072
|
+
</xsl:for-each>
|
9888
10073
|
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
9889
|
-
</
|
10074
|
+
</xsl:when>
|
10075
|
+
|
10076
|
+
<xsl:otherwise>
|
10077
|
+
<fo:block-container xsl:use-attribute-sets="sourcecode-container-style">
|
9890
10078
|
|
9891
|
-
<xsl:
|
10079
|
+
<xsl:if test="not(ancestor::*[local-name() = 'li']) or ancestor::*[local-name() = 'example']">
|
10080
|
+
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
10081
|
+
</xsl:if>
|
9892
10082
|
|
9893
|
-
|
9894
|
-
|
10083
|
+
<xsl:if test="ancestor::*[local-name() = 'example']">
|
10084
|
+
<xsl:attribute name="margin-right">0mm</xsl:attribute>
|
10085
|
+
</xsl:if>
|
10086
|
+
|
10087
|
+
<xsl:copy-of select="@id"/>
|
10088
|
+
|
10089
|
+
<xsl:if test="parent::*[local-name() = 'note']">
|
10090
|
+
<xsl:attribute name="margin-left">
|
10091
|
+
<xsl:choose>
|
10092
|
+
<xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
|
10093
|
+
<xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
|
10094
|
+
</xsl:choose>
|
10095
|
+
</xsl:attribute>
|
10096
|
+
|
10097
|
+
</xsl:if>
|
10098
|
+
<fo:block-container margin-left="0mm">
|
10099
|
+
|
10100
|
+
<fo:block xsl:use-attribute-sets="sourcecode-style">
|
10101
|
+
|
10102
|
+
<xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@*">
|
10103
|
+
<xsl:attribute name="{local-name()}">
|
10104
|
+
<xsl:value-of select="."/>
|
10105
|
+
</xsl:attribute>
|
10106
|
+
</xsl:for-each>
|
10107
|
+
|
10108
|
+
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
10109
|
+
</fo:block>
|
10110
|
+
|
10111
|
+
<xsl:apply-templates select="*[local-name()='name']"/> <!-- show sourcecode's name AFTER content -->
|
10112
|
+
|
10113
|
+
</fo:block-container>
|
10114
|
+
</fo:block-container>
|
10115
|
+
</xsl:otherwise>
|
10116
|
+
</xsl:choose>
|
9895
10117
|
</xsl:template>
|
9896
10118
|
|
9897
10119
|
<xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
|
@@ -10133,8 +10355,22 @@
|
|
10133
10355
|
</fo:block>
|
10134
10356
|
</xsl:if>
|
10135
10357
|
</xsl:template>
|
10136
|
-
<!--
|
10137
|
-
<!--
|
10358
|
+
<!-- =============== -->
|
10359
|
+
<!-- END sourcecode -->
|
10360
|
+
<!-- =============== -->
|
10361
|
+
|
10362
|
+
<!-- =============== -->
|
10363
|
+
<!-- pre -->
|
10364
|
+
<!-- =============== -->
|
10365
|
+
<xsl:template match="*[local-name()='pre']" name="pre">
|
10366
|
+
<fo:block xsl:use-attribute-sets="pre-style">
|
10367
|
+
<xsl:copy-of select="@id"/>
|
10368
|
+
<xsl:apply-templates/>
|
10369
|
+
</fo:block>
|
10370
|
+
</xsl:template>
|
10371
|
+
<!-- =============== -->
|
10372
|
+
<!-- pre -->
|
10373
|
+
<!-- =============== -->
|
10138
10374
|
|
10139
10375
|
<!-- ========== -->
|
10140
10376
|
<!-- permission -->
|
@@ -12106,7 +12342,9 @@
|
|
12106
12342
|
<!-- ===================================== -->
|
12107
12343
|
<!-- Update xml -->
|
12108
12344
|
<!-- ===================================== -->
|
12345
|
+
<!-- =========================================================================== -->
|
12109
12346
|
<!-- STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
|
12347
|
+
<!-- =========================================================================== -->
|
12110
12348
|
<xsl:template match="@*|node()" mode="update_xml_step1">
|
12111
12349
|
<xsl:copy>
|
12112
12350
|
<xsl:apply-templates select="@*|node()" mode="update_xml_step1"/>
|
@@ -12198,10 +12436,15 @@
|
|
12198
12436
|
<xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
|
12199
12437
|
<xsl:apply-templates mode="update_xml_step1"/>
|
12200
12438
|
</xsl:template>
|
12201
|
-
|
12439
|
+
<!-- =========================================================================== -->
|
12202
12440
|
<!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
|
12441
|
+
<!-- =========================================================================== -->
|
12203
12442
|
|
12443
|
+
<!-- =========================================================================== -->
|
12204
12444
|
<!-- XML UPDATE STEP: enclose standard's name into tag 'keep-together_within-line' -->
|
12445
|
+
<!-- keep-together_within-line for: a/b, aaa/b, a/bbb, /b -->
|
12446
|
+
<!-- keep-together_within-line for: a.b, aaa.b, a.bbb, .b in table's cell ONLY -->
|
12447
|
+
<!-- =========================================================================== -->
|
12205
12448
|
<!-- Example: <keep-together_within-line>ISO 10303-51</keep-together_within-line> -->
|
12206
12449
|
<xsl:template match="@*|node()" mode="update_xml_enclose_keep-together_within-line">
|
12207
12450
|
<xsl:copy>
|
@@ -12217,10 +12460,15 @@
|
|
12217
12460
|
<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">
|
12218
12461
|
|
12219
12462
|
<!-- enclose standard's number into tag 'keep-together_within-line' -->
|
12220
|
-
<xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
|
12221
12463
|
<xsl:variable name="tag_keep-together_within-line_open">###<xsl:value-of select="$element_name_keep-together_within-line"/>###</xsl:variable>
|
12222
12464
|
<xsl:variable name="tag_keep-together_within-line_close">###/<xsl:value-of select="$element_name_keep-together_within-line"/>###</xsl:variable>
|
12223
|
-
<xsl:variable name="
|
12465
|
+
<xsl:variable name="text__" select="java:replaceAll(java:java.lang.String.new(.), $regex_standard_reference, concat($tag_keep-together_within-line_open,'$1',$tag_keep-together_within-line_close))"/>
|
12466
|
+
<xsl:variable name="text_">
|
12467
|
+
<xsl:choose>
|
12468
|
+
<xsl:when test="ancestor::*[local-name() = 'table']"><xsl:value-of select="."/></xsl:when> <!-- no need enclose standard's number into tag 'keep-together_within-line' in table cells -->
|
12469
|
+
<xsl:otherwise><xsl:value-of select="$text__"/></xsl:otherwise>
|
12470
|
+
</xsl:choose>
|
12471
|
+
</xsl:variable>
|
12224
12472
|
<xsl:variable name="text"><text><xsl:call-template name="replace_text_tags">
|
12225
12473
|
<xsl:with-param name="tag_open" select="$tag_keep-together_within-line_open"/>
|
12226
12474
|
<xsl:with-param name="tag_close" select="$tag_keep-together_within-line_close"/>
|
@@ -12236,7 +12484,11 @@
|
|
12236
12484
|
</xsl:variable>
|
12237
12485
|
|
12238
12486
|
<!-- keep-together_within-line for: a/b, aaa/b, a/bbb, /b -->
|
12239
|
-
|
12487
|
+
<!-- \S matches any non-whitespace character (equivalent to [^\r\n\t\f\v ]) -->
|
12488
|
+
<!-- <xsl:variable name="regex_solidus_units">((\b((\S{1,3}\/\S+)|(\S+\/\S{1,3}))\b)|(\/\S{1,3})\b)</xsl:variable> -->
|
12489
|
+
<!-- add < and > to \S -->
|
12490
|
+
<xsl:variable name="regex_S">[^\r\n\t\f\v \<>]</xsl:variable>
|
12491
|
+
<xsl:variable name="regex_solidus_units">((\b((<xsl:value-of select="$regex_S"/>{1,3}\/<xsl:value-of select="$regex_S"/>+)|(<xsl:value-of select="$regex_S"/>+\/<xsl:value-of select="$regex_S"/>{1,3}))\b)|(\/<xsl:value-of select="$regex_S"/>{1,3})\b)</xsl:variable>
|
12240
12492
|
<xsl:variable name="text3">
|
12241
12493
|
<text><xsl:for-each select="xalan:nodeset($text2)/text/node()">
|
12242
12494
|
<xsl:choose>
|
@@ -12300,9 +12552,8 @@
|
|
12300
12552
|
<xsl:otherwise><xsl:value-of select="$text"/></xsl:otherwise>
|
12301
12553
|
</xsl:choose>
|
12302
12554
|
</xsl:template>
|
12303
|
-
|
12304
12555
|
<!-- ===================================== -->
|
12305
|
-
<!--
|
12556
|
+
<!-- END XML UPDATE STEP: enclose standard's name into tag 'keep-together_within-line' -->
|
12306
12557
|
<!-- ===================================== -->
|
12307
12558
|
|
12308
12559
|
<!-- for correct rendering combining chars -->
|
@@ -12690,13 +12941,14 @@
|
|
12690
12941
|
</xsl:template>
|
12691
12942
|
|
12692
12943
|
<xsl:template name="setId">
|
12944
|
+
<xsl:param name="prefix"/>
|
12693
12945
|
<xsl:attribute name="id">
|
12694
12946
|
<xsl:choose>
|
12695
12947
|
<xsl:when test="@id">
|
12696
|
-
<xsl:value-of select="@id"/>
|
12948
|
+
<xsl:value-of select="concat($prefix, @id)"/>
|
12697
12949
|
</xsl:when>
|
12698
12950
|
<xsl:otherwise>
|
12699
|
-
<xsl:value-of select="generate-id()"/>
|
12951
|
+
<xsl:value-of select="concat($prefix, generate-id())"/>
|
12700
12952
|
</xsl:otherwise>
|
12701
12953
|
</xsl:choose>
|
12702
12954
|
</xsl:attribute>
|