metanorma-bipm 2.5.4 → 2.5.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isodoc/bipm/base_convert.rb +0 -16
- data/lib/isodoc/bipm/bipm.brochure.xsl +1209 -956
- data/lib/isodoc/bipm/bipm.guide.xsl +1209 -956
- data/lib/isodoc/bipm/bipm.mise-en-pratique.xsl +1209 -956
- data/lib/isodoc/bipm/bipm.rapport.xsl +1209 -956
- data/lib/isodoc/bipm/init.rb +0 -5
- data/lib/isodoc/bipm/jcgm.standard.xsl +248 -53
- data/lib/isodoc/bipm/presentation_biblio.rb +82 -0
- data/lib/isodoc/bipm/presentation_blocks.rb +1 -0
- data/lib/isodoc/bipm/presentation_xml_convert.rb +3 -49
- data/lib/isodoc/bipm/xref.rb +4 -14
- data/lib/metanorma/bipm/biblio.rng +13 -1
- data/lib/metanorma/bipm/isodoc.rng +6 -6
- data/lib/metanorma/bipm/version.rb +1 -1
- data/metanorma-bipm.gemspec +2 -2
- metadata +7 -6
data/lib/isodoc/bipm/init.rb
CHANGED
@@ -5232,10 +5232,14 @@
|
|
5232
5232
|
<xsl:variable name="fn_styles">
|
5233
5233
|
<xsl:choose>
|
5234
5234
|
<xsl:when test="ancestor::*[local-name() = 'bibitem']">
|
5235
|
-
<fn_styles xsl:use-attribute-sets="bibitem-note-fn-style"
|
5235
|
+
<fn_styles xsl:use-attribute-sets="bibitem-note-fn-style">
|
5236
|
+
|
5237
|
+
</fn_styles>
|
5236
5238
|
</xsl:when>
|
5237
5239
|
<xsl:otherwise>
|
5238
|
-
<fn_styles xsl:use-attribute-sets="fn-num-style"
|
5240
|
+
<fn_styles xsl:use-attribute-sets="fn-num-style">
|
5241
|
+
|
5242
|
+
</fn_styles>
|
5239
5243
|
</xsl:otherwise>
|
5240
5244
|
</xsl:choose>
|
5241
5245
|
</xsl:variable>
|
@@ -5374,6 +5378,11 @@
|
|
5374
5378
|
|
5375
5379
|
<xsl:value-of select="@reference"/>
|
5376
5380
|
|
5381
|
+
<!-- commented https://github.com/metanorma/isodoc/issues/614 -->
|
5382
|
+
<!-- <xsl:if test="$namespace = 'itu'">
|
5383
|
+
<xsl:text>)</xsl:text>
|
5384
|
+
</xsl:if> -->
|
5385
|
+
|
5377
5386
|
</fo:inline>
|
5378
5387
|
<fo:inline xsl:use-attribute-sets="table-fn-body-style">
|
5379
5388
|
<xsl:copy-of select="./node()"/>
|
@@ -5383,7 +5392,7 @@
|
|
5383
5392
|
|
5384
5393
|
</xsl:if>
|
5385
5394
|
</xsl:for-each>
|
5386
|
-
</xsl:template>
|
5395
|
+
</xsl:template> <!-- table_fn_display -->
|
5387
5396
|
|
5388
5397
|
<xsl:template name="create_fn">
|
5389
5398
|
<fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
|
@@ -5411,8 +5420,10 @@
|
|
5411
5420
|
<!-- EMD table's footnotes rendering -->
|
5412
5421
|
<!-- ============================ -->
|
5413
5422
|
|
5423
|
+
<!-- ============================ -->
|
5414
5424
|
<!-- figure's footnotes rendering -->
|
5415
|
-
|
5425
|
+
<!-- ============================ -->
|
5426
|
+
<xsl:template name="fn_display_figure"> <!-- figure_fn_display -->
|
5416
5427
|
|
5417
5428
|
<!-- current figure id -->
|
5418
5429
|
<xsl:variable name="figure_id_">
|
@@ -5525,9 +5536,28 @@
|
|
5525
5536
|
|
5526
5537
|
</fo:block>
|
5527
5538
|
</xsl:if>
|
5528
|
-
|
5529
5539
|
</xsl:template> <!-- fn_display_figure -->
|
5530
5540
|
|
5541
|
+
<!-- added for https://github.com/metanorma/isodoc/issues/607 -->
|
5542
|
+
<!-- figure's footnote label -->
|
5543
|
+
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'dl'][@key = 'true']/*[local-name() = 'dt']/ *[local-name() = 'p'][count(node()[normalize-space() != '']) = 1]/*[local-name() = 'sup']" priority="3">
|
5544
|
+
<xsl:variable name="key_iso">
|
5545
|
+
true
|
5546
|
+
</xsl:variable>
|
5547
|
+
<xsl:if test="normalize-space($key_iso) = 'true'">
|
5548
|
+
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
5549
|
+
|
5550
|
+
</xsl:if>
|
5551
|
+
<fo:inline xsl:use-attribute-sets="figure-fn-number-style"> <!-- id="{@id}" -->
|
5552
|
+
<!-- <xsl:value-of select="@reference"/> -->
|
5553
|
+
<xsl:apply-templates/>
|
5554
|
+
</fo:inline>
|
5555
|
+
</xsl:template>
|
5556
|
+
|
5557
|
+
<!-- ============================ -->
|
5558
|
+
<!-- END: figure's footnotes rendering -->
|
5559
|
+
<!-- ============================ -->
|
5560
|
+
|
5531
5561
|
<!-- fn reference in the text rendering (for instance, 'some text 1) some text' ) -->
|
5532
5562
|
<xsl:template match="*[local-name()='fn']">
|
5533
5563
|
<fo:inline xsl:use-attribute-sets="fn-reference-style">
|
@@ -5543,6 +5573,10 @@
|
|
5543
5573
|
|
5544
5574
|
<xsl:value-of select="@reference"/>
|
5545
5575
|
|
5576
|
+
<!-- commented, https://github.com/metanorma/isodoc/issues/614 -->
|
5577
|
+
<!-- <xsl:if test="$namespace = 'jis'">
|
5578
|
+
<fo:inline font-weight="normal">)</fo:inline>
|
5579
|
+
</xsl:if> -->
|
5546
5580
|
</fo:basic-link>
|
5547
5581
|
</fo:inline>
|
5548
5582
|
</xsl:template>
|
@@ -5673,17 +5707,22 @@
|
|
5673
5707
|
</fo:block>
|
5674
5708
|
</xsl:when> <!-- END: a few components -->
|
5675
5709
|
<xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')"> <!-- definition list in a figure -->
|
5676
|
-
|
5710
|
+
<!-- Presentation XML contains 'Key' caption, https://github.com/metanorma/isodoc/issues/607 -->
|
5711
|
+
<xsl:if test="not(preceding-sibling::*[1][local-name() = 'p' and @keep-with-next])"> <!-- for old Presentation XML -->
|
5677
5712
|
|
5678
|
-
|
5713
|
+
<fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
|
5679
5714
|
|
5680
|
-
|
5681
|
-
|
5682
|
-
|
5683
|
-
|
5684
|
-
|
5685
|
-
|
5686
|
-
|
5715
|
+
<xsl:call-template name="refine_figure_key_style"/>
|
5716
|
+
|
5717
|
+
<xsl:variable name="title-key">
|
5718
|
+
<xsl:call-template name="getLocalizedString">
|
5719
|
+
<xsl:with-param name="key">key</xsl:with-param>
|
5720
|
+
</xsl:call-template>
|
5721
|
+
</xsl:variable>
|
5722
|
+
<xsl:value-of select="$title-key"/>
|
5723
|
+
</fo:block>
|
5724
|
+
|
5725
|
+
</xsl:if>
|
5687
5726
|
</xsl:when> <!-- END: definition list in a figure -->
|
5688
5727
|
</xsl:choose>
|
5689
5728
|
|
@@ -5869,6 +5908,14 @@
|
|
5869
5908
|
|
5870
5909
|
</xsl:template> <!-- END: dl -->
|
5871
5910
|
|
5911
|
+
<!-- caption for figure key and another caption, https://github.com/metanorma/isodoc/issues/607 -->
|
5912
|
+
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'p'][@keep-with-next = 'true' and *[local-name() = 'strong']]" priority="3">
|
5913
|
+
<fo:block text-align="left" margin-bottom="12pt" keep-with-next="always">
|
5914
|
+
<xsl:call-template name="refine_figure_key_style"/>
|
5915
|
+
<xsl:apply-templates/>
|
5916
|
+
</fo:block>
|
5917
|
+
</xsl:template>
|
5918
|
+
|
5872
5919
|
<xsl:template name="refine_dl_formula_where_style">
|
5873
5920
|
|
5874
5921
|
<xsl:attribute name="margin-bottom">6pt</xsl:attribute>
|
@@ -7919,6 +7966,39 @@
|
|
7919
7966
|
</xsl:copy>
|
7920
7967
|
</xsl:template>
|
7921
7968
|
|
7969
|
+
<xsl:template match="@*|node()" mode="mathml_linebreak">
|
7970
|
+
<xsl:copy>
|
7971
|
+
<xsl:apply-templates select="@*|node()" mode="mathml_linebreak"/>
|
7972
|
+
</xsl:copy>
|
7973
|
+
</xsl:template>
|
7974
|
+
|
7975
|
+
<!-- split math into two math -->
|
7976
|
+
<xsl:template match="mathml:mo[@linebreak] | mathml:mspace[@linebreak]" mode="mathml_linebreak">
|
7977
|
+
<xsl:variable name="math_elements_tree_">
|
7978
|
+
<xsl:for-each select="ancestor::*[ancestor-or-self::mathml:math]">
|
7979
|
+
<element pos="{position()}">
|
7980
|
+
<xsl:copy-of select="@*[local-name() != 'id']"/>
|
7981
|
+
<xsl:value-of select="name()"/>
|
7982
|
+
</element>
|
7983
|
+
</xsl:for-each>
|
7984
|
+
</xsl:variable>
|
7985
|
+
|
7986
|
+
<xsl:variable name="math_elements_tree" select="xalan:nodeset($math_elements_tree_)"/>
|
7987
|
+
|
7988
|
+
<xsl:call-template name="insertClosingElements">
|
7989
|
+
<xsl:with-param name="tree" select="$math_elements_tree"/>
|
7990
|
+
</xsl:call-template>
|
7991
|
+
|
7992
|
+
<xsl:element name="br" namespace="{$namespace_full}"/>
|
7993
|
+
|
7994
|
+
<xsl:call-template name="insertOpeningElements">
|
7995
|
+
<xsl:with-param name="tree" select="$math_elements_tree"/>
|
7996
|
+
<xsl:with-param name="xmlns">http://www.w3.org/1998/Math/MathML</xsl:with-param>
|
7997
|
+
<xsl:with-param name="add_continue">false</xsl:with-param>
|
7998
|
+
</xsl:call-template>
|
7999
|
+
|
8000
|
+
</xsl:template>
|
8001
|
+
|
7922
8002
|
<!-- Examples:
|
7923
8003
|
<stem type="AsciiMath">x = 1</stem>
|
7924
8004
|
<stem type="AsciiMath"><asciimath>x = 1</asciimath></stem>
|
@@ -8120,6 +8200,7 @@
|
|
8120
8200
|
<xsl:if test="string-length(normalize-space()) < 30 and not(contains(normalize-space(), 'http://')) and not(contains(normalize-space(), 'https://')) and not(ancestor::*[local-name() = 'table' or local-name() = 'dl'])">
|
8121
8201
|
<xsl:attribute name="keep-together.within-line">always</xsl:attribute>
|
8122
8202
|
</xsl:if>
|
8203
|
+
|
8123
8204
|
<xsl:if test="parent::*[local-name() = 'add']">
|
8124
8205
|
<xsl:call-template name="append_add-style"/>
|
8125
8206
|
</xsl:if>
|
@@ -8169,9 +8250,11 @@
|
|
8169
8250
|
</xsl:template>
|
8170
8251
|
|
8171
8252
|
<xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']"> <!-- show in 'stem' template -->
|
8253
|
+
<!-- https://github.com/metanorma/isodoc/issues/607
|
8172
8254
|
<xsl:if test="normalize-space() != ''">
|
8173
|
-
<xsl:text>(</xsl:text><xsl:apply-templates/><xsl:text>)</xsl:text>
|
8174
|
-
</xsl:if>
|
8255
|
+
<xsl:text>(</xsl:text><xsl:apply-templates /><xsl:text>)</xsl:text>
|
8256
|
+
</xsl:if> -->
|
8257
|
+
<xsl:apply-templates/>
|
8175
8258
|
</xsl:template>
|
8176
8259
|
|
8177
8260
|
<!-- stem inside formula with name (with formula's number) -->
|
@@ -8228,44 +8311,44 @@
|
|
8228
8311
|
|
8229
8312
|
<xsl:template match="*[local-name() = 'note']" name="note">
|
8230
8313
|
|
8231
|
-
|
8314
|
+
<fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
|
8232
8315
|
|
8233
|
-
|
8316
|
+
<xsl:call-template name="setBlockSpanAll"/>
|
8234
8317
|
|
8235
|
-
|
8318
|
+
<xsl:call-template name="refine_note-style"/>
|
8236
8319
|
|
8237
|
-
|
8320
|
+
<fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
|
8238
8321
|
|
8239
|
-
|
8322
|
+
<fo:block>
|
8240
8323
|
|
8241
|
-
|
8324
|
+
<xsl:call-template name="refine_note_block_style"/>
|
8242
8325
|
|
8243
|
-
|
8326
|
+
<fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
|
8244
8327
|
|
8245
|
-
|
8328
|
+
<xsl:call-template name="refine_note-name-style"/>
|
8246
8329
|
|
8247
|
-
|
8248
|
-
|
8249
|
-
|
8250
|
-
|
8251
|
-
|
8330
|
+
<!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
|
8331
|
+
<!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
|
8332
|
+
<xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
|
8333
|
+
<xsl:call-template name="append_add-style"/>
|
8334
|
+
</xsl:if>
|
8252
8335
|
|
8253
|
-
|
8254
|
-
|
8255
|
-
|
8256
|
-
|
8257
|
-
|
8258
|
-
|
8336
|
+
<!-- if note contains only one element and first and last childs are `add` ace-tag, then move start ace-tag before NOTE's name-->
|
8337
|
+
<xsl:if test="count(*[not(local-name() = 'name')]) = 1 and *[not(local-name() = 'name')]/node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]">
|
8338
|
+
<xsl:apply-templates select="*[not(local-name() = 'name')]/node()[1][local-name() = 'add'][starts-with(text(), $ace_tag)]">
|
8339
|
+
<xsl:with-param name="skip">false</xsl:with-param>
|
8340
|
+
</xsl:apply-templates>
|
8341
|
+
</xsl:if>
|
8259
8342
|
|
8260
|
-
|
8343
|
+
<xsl:apply-templates select="*[local-name() = 'name']"/>
|
8261
8344
|
|
8262
|
-
|
8345
|
+
</fo:inline>
|
8263
8346
|
|
8264
|
-
|
8265
|
-
|
8347
|
+
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
8348
|
+
</fo:block>
|
8266
8349
|
|
8267
|
-
|
8268
|
-
|
8350
|
+
</fo:block-container>
|
8351
|
+
</fo:block-container>
|
8269
8352
|
|
8270
8353
|
</xsl:template>
|
8271
8354
|
|
@@ -8327,6 +8410,17 @@
|
|
8327
8410
|
</xsl:when>
|
8328
8411
|
<xsl:otherwise>
|
8329
8412
|
|
8413
|
+
<!-- https://github.com/metanorma/isodoc/issues/607 -->
|
8414
|
+
<!-- <xsl:if test="$namespace = 'ieee'">
|
8415
|
+
<xsl:text>—</xsl:text> em dash —
|
8416
|
+
</xsl:if> -->
|
8417
|
+
<!-- <xsl:if test="$namespace = 'iho' or $namespace = 'gb' or $namespace = 'm3d' or $namespace = 'unece-rec' or $namespace = 'unece' or $namespace = 'rsd'">
|
8418
|
+
<xsl:text>:</xsl:text>
|
8419
|
+
</xsl:if> -->
|
8420
|
+
|
8421
|
+
<!-- <xsl:if test="$namespace = 'itu' or $namespace = 'nist-cswp' or $namespace = 'nist-sp'">
|
8422
|
+
<xsl:text> – </xsl:text> en dash –
|
8423
|
+
</xsl:if> -->
|
8330
8424
|
</xsl:otherwise>
|
8331
8425
|
</xsl:choose>
|
8332
8426
|
</xsl:variable>
|
@@ -8345,8 +8439,16 @@
|
|
8345
8439
|
</xsl:when>
|
8346
8440
|
<xsl:otherwise>
|
8347
8441
|
|
8442
|
+
<!-- https://github.com/metanorma/isodoc/issues/607 -->
|
8443
|
+
<!-- <xsl:if test="$namespace = 'ieee'">
|
8444
|
+
<xsl:text>—</xsl:text> em dash —
|
8445
|
+
</xsl:if> -->
|
8446
|
+
<!-- <xsl:if test="$namespace = 'gb' or $namespace = 'iso' or $namespace = 'iec' or $namespace = 'ogc' or $namespace = 'ogc-white-paper' or $namespace = 'rsd' or $namespace = 'jcgm'">
|
8348
8447
|
<xsl:text>:</xsl:text>
|
8349
|
-
|
8448
|
+
</xsl:if> -->
|
8449
|
+
<!-- <xsl:if test="$namespace = 'itu' or $namespace = 'nist-cswp' or $namespace = 'nist-sp' or $namespace = 'unece-rec' or $namespace = 'unece'">
|
8450
|
+
<xsl:text> – </xsl:text> en dash –
|
8451
|
+
</xsl:if> -->
|
8350
8452
|
</xsl:otherwise>
|
8351
8453
|
</xsl:choose>
|
8352
8454
|
</xsl:variable>
|
@@ -10513,7 +10615,7 @@
|
|
10513
10615
|
<xsl:if test="normalize-space() != ''">
|
10514
10616
|
<fo:inline xsl:use-attribute-sets="termexample-name-style">
|
10515
10617
|
<xsl:call-template name="refine_termexample-name-style"/>
|
10516
|
-
<xsl:apply-templates/>
|
10618
|
+
<xsl:apply-templates/> <!-- commented $namespace = 'ieee', https://github.com/metanorma/isodoc/issues/614-->
|
10517
10619
|
</fo:inline>
|
10518
10620
|
</xsl:if>
|
10519
10621
|
</xsl:template>
|
@@ -10668,13 +10770,14 @@
|
|
10668
10770
|
</xsl:when>
|
10669
10771
|
<xsl:when test="contains(normalize-space($fo_element), 'block')">
|
10670
10772
|
<fo:block xsl:use-attribute-sets="example-name-style">
|
10773
|
+
|
10671
10774
|
<xsl:apply-templates/>
|
10672
10775
|
</fo:block>
|
10673
10776
|
</xsl:when>
|
10674
10777
|
<xsl:otherwise>
|
10675
10778
|
<fo:inline xsl:use-attribute-sets="example-name-style">
|
10676
10779
|
<xsl:call-template name="refine_example-name-style"/>
|
10677
|
-
<xsl:apply-templates/>
|
10780
|
+
<xsl:apply-templates/> <!-- $namespace = 'ieee', see https://github.com/metanorma/isodoc/issues/614 -->
|
10678
10781
|
</fo:inline>
|
10679
10782
|
</xsl:otherwise>
|
10680
10783
|
</xsl:choose>
|
@@ -10683,6 +10786,7 @@
|
|
10683
10786
|
|
10684
10787
|
<xsl:template match="*[local-name() = 'table']/*[local-name() = 'example']/*[local-name() = 'name']">
|
10685
10788
|
<fo:inline xsl:use-attribute-sets="example-name-style">
|
10789
|
+
|
10686
10790
|
<xsl:apply-templates/>
|
10687
10791
|
</fo:inline>
|
10688
10792
|
</xsl:template>
|
@@ -10864,15 +10968,17 @@
|
|
10864
10968
|
|
10865
10969
|
<fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
|
10866
10970
|
<fo:block role="BlockQuote">
|
10867
|
-
<xsl:apply-templates select="./node()[not(local-name() = 'author') and
|
10971
|
+
<xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source') and not(local-name() = 'attribution')]"/> <!-- process all nested nodes, except author and source -->
|
10868
10972
|
</fo:block>
|
10869
10973
|
</fo:block-container>
|
10870
10974
|
</fo:block-container>
|
10871
|
-
<xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
|
10975
|
+
<xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source'] or *[local-name() = 'attribution']">
|
10872
10976
|
<fo:block xsl:use-attribute-sets="quote-source-style">
|
10873
10977
|
<!-- — ISO, ISO 7301:2011, Clause 1 -->
|
10874
10978
|
<xsl:apply-templates select="*[local-name() = 'author']"/>
|
10875
10979
|
<xsl:apply-templates select="*[local-name() = 'source']"/>
|
10980
|
+
<!-- added for https://github.com/metanorma/isodoc/issues/607 -->
|
10981
|
+
<xsl:apply-templates select="*[local-name() = 'attribution']/*[local-name() = 'p']/node()"/>
|
10876
10982
|
</fo:block>
|
10877
10983
|
</xsl:if>
|
10878
10984
|
|
@@ -10894,9 +11000,13 @@
|
|
10894
11000
|
</xsl:template>
|
10895
11001
|
|
10896
11002
|
<xsl:template match="*[local-name() = 'author']">
|
10897
|
-
<xsl:
|
11003
|
+
<xsl:if test="local-name(..) = 'quote'"> <!-- for old Presentation XML, https://github.com/metanorma/isodoc/issues/607 -->
|
11004
|
+
<xsl:text>— </xsl:text>
|
11005
|
+
</xsl:if>
|
10898
11006
|
<xsl:apply-templates/>
|
10899
11007
|
</xsl:template>
|
11008
|
+
|
11009
|
+
<xsl:template match="*[local-name() = 'quote']//*[local-name() = 'referenceFrom']"/>
|
10900
11010
|
<!-- ====== -->
|
10901
11011
|
<!-- ====== -->
|
10902
11012
|
|
@@ -11060,20 +11170,26 @@
|
|
11060
11170
|
|
11061
11171
|
<xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'preferred'])"> <!-- if first preffered in term, then display term's name -->
|
11062
11172
|
<fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
|
11173
|
+
|
11063
11174
|
<xsl:apply-templates select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"/>
|
11064
11175
|
</fo:block>
|
11065
11176
|
</xsl:if>
|
11066
11177
|
|
11067
11178
|
<fo:block xsl:use-attribute-sets="preferred-term-style" role="SKIP">
|
11068
11179
|
<xsl:call-template name="setStyle_preferred"/>
|
11180
|
+
|
11069
11181
|
<xsl:apply-templates/>
|
11070
11182
|
</fo:block>
|
11071
11183
|
</fo:block>
|
11072
11184
|
</xsl:template>
|
11073
11185
|
|
11074
11186
|
<xsl:template match="*[local-name() = 'domain']">
|
11187
|
+
<!-- https://github.com/metanorma/isodoc/issues/607
|
11075
11188
|
<fo:inline xsl:use-attribute-sets="domain-style"><<xsl:apply-templates/>></fo:inline>
|
11076
|
-
<xsl:text> </xsl:text>
|
11189
|
+
<xsl:text> </xsl:text> -->
|
11190
|
+
<xsl:if test="not(@hidden = 'true')">
|
11191
|
+
<xsl:apply-templates/>
|
11192
|
+
</xsl:if>
|
11077
11193
|
</xsl:template>
|
11078
11194
|
|
11079
11195
|
<xsl:template match="*[local-name() = 'admitted']">
|
@@ -11121,6 +11237,29 @@
|
|
11121
11237
|
<!-- END definition -->
|
11122
11238
|
<!-- ========== -->
|
11123
11239
|
|
11240
|
+
<xsl:variable name="reviews_">
|
11241
|
+
<xsl:for-each select="//*[local-name() = 'review'][@from]">
|
11242
|
+
<xsl:copy>
|
11243
|
+
<xsl:copy-of select="@from"/>
|
11244
|
+
<xsl:copy-of select="@id"/>
|
11245
|
+
</xsl:copy>
|
11246
|
+
</xsl:for-each>
|
11247
|
+
</xsl:variable>
|
11248
|
+
<xsl:variable name="reviews" select="xalan:nodeset($reviews_)"/>
|
11249
|
+
|
11250
|
+
<xsl:template name="addReviewHelper">
|
11251
|
+
<!-- if there is review with from="...", then add small helper block for Annot tag adding, see 'review' template -->
|
11252
|
+
<xsl:variable name="curr_id" select="@id"/>
|
11253
|
+
<xsl:variable name="review_id" select="normalize-space($reviews//*[local-name() = 'review'][@from = $curr_id]/@id)"/>
|
11254
|
+
<xsl:if test="$review_id != ''"> <!-- i.e. if review found -->
|
11255
|
+
<fo:block keep-with-next="always" line-height="0.1" id="{$review_id}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{$review_id}" fox:alt-text="Annot___{$review_id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
|
11256
|
+
</xsl:if>
|
11257
|
+
<!-- <fo:block>
|
11258
|
+
<curr_id><xsl:value-of select="$curr_id"/></curr_id>
|
11259
|
+
<xsl:copy-of select="$reviews"/>
|
11260
|
+
</fo:block> -->
|
11261
|
+
</xsl:template>
|
11262
|
+
|
11124
11263
|
<!-- main sections -->
|
11125
11264
|
<xsl:template match="/*/*[local-name() = 'sections']/*" name="sections_node" priority="2">
|
11126
11265
|
|
@@ -11129,6 +11268,8 @@
|
|
11129
11268
|
|
11130
11269
|
<xsl:call-template name="sections_element_style"/>
|
11131
11270
|
|
11271
|
+
<xsl:call-template name="addReviewHelper"/>
|
11272
|
+
|
11132
11273
|
<xsl:apply-templates/>
|
11133
11274
|
</fo:block>
|
11134
11275
|
|
@@ -11167,6 +11308,7 @@
|
|
11167
11308
|
|
11168
11309
|
<fo:block>
|
11169
11310
|
<xsl:call-template name="setId"/>
|
11311
|
+
<xsl:call-template name="addReviewHelper"/>
|
11170
11312
|
<xsl:apply-templates/>
|
11171
11313
|
</fo:block>
|
11172
11314
|
</xsl:template>
|
@@ -11203,6 +11345,8 @@
|
|
11203
11345
|
|
11204
11346
|
<xsl:call-template name="refine_clause_style"/>
|
11205
11347
|
|
11348
|
+
<xsl:call-template name="addReviewHelper"/>
|
11349
|
+
|
11206
11350
|
<xsl:apply-templates/>
|
11207
11351
|
</fo:block>
|
11208
11352
|
</xsl:template>
|
@@ -11259,6 +11403,23 @@
|
|
11259
11403
|
|
11260
11404
|
<xsl:variable name="id_from" select="normalize-space(current()/@from)"/>
|
11261
11405
|
|
11406
|
+
<xsl:if test="1 = 1">
|
11407
|
+
<xsl:choose>
|
11408
|
+
<!-- if there isn't the attribute '@from', then -->
|
11409
|
+
<xsl:when test="$id_from = ''">
|
11410
|
+
<fo:block id="{@id}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@id}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
|
11411
|
+
</xsl:when>
|
11412
|
+
<!-- if there isn't element with id 'from', then create 'bookmark' here -->
|
11413
|
+
<xsl:when test="ancestor::*[contains(local-name(), '-standard')] and not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
|
11414
|
+
<fo:block id="{@from}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@from}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
|
11415
|
+
</xsl:when>
|
11416
|
+
<xsl:when test="not(/*[@id = $id_from]) and not(/*//*[@id = $id_from]) and not(preceding-sibling::*[@id = $id_from])">
|
11417
|
+
<fo:block id="{@from}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@from}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
|
11418
|
+
</xsl:when>
|
11419
|
+
</xsl:choose>
|
11420
|
+
</xsl:if>
|
11421
|
+
|
11422
|
+
<xsl:if test="1 = 2">
|
11262
11423
|
<xsl:choose>
|
11263
11424
|
<!-- if there isn't the attribute '@from', then -->
|
11264
11425
|
<xsl:when test="$id_from = ''">
|
@@ -11272,6 +11433,7 @@
|
|
11272
11433
|
<fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
|
11273
11434
|
</xsl:when>
|
11274
11435
|
</xsl:choose>
|
11436
|
+
</xsl:if>
|
11275
11437
|
|
11276
11438
|
</xsl:template>
|
11277
11439
|
|
@@ -12642,7 +12804,7 @@
|
|
12642
12804
|
<!-- remove preprocess-xslt -->
|
12643
12805
|
<xsl:template match="*[local-name() = 'preprocess-xslt']" mode="update_xml_step1"/>
|
12644
12806
|
|
12645
|
-
<xsl:template match="*[local-name() = 'stem'] | *[local-name() = 'image'] | *[local-name() = 'sourcecode'] | *[local-name() = 'bibdata'] | *[local-name() = 'localized-strings']" mode="update_xml_step1">
|
12807
|
+
<xsl:template match="*[local-name() = 'stem'][not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])] | *[local-name() = 'image'][not(.//*[local-name() = 'passthrough'])] | *[local-name() = 'sourcecode'][not(.//*[local-name() = 'passthrough'])] | *[local-name() = 'bibdata'][not(.//*[local-name() = 'passthrough'])] | *[local-name() = 'localized-strings']" mode="update_xml_step1">
|
12646
12808
|
<xsl:copy-of select="."/>
|
12647
12809
|
</xsl:template>
|
12648
12810
|
|
@@ -12708,6 +12870,22 @@
|
|
12708
12870
|
</xsl:choose>
|
12709
12871
|
</xsl:template>
|
12710
12872
|
|
12873
|
+
<xsl:variable name="regex_passthrough">.*\bpdf\b.*</xsl:variable>
|
12874
|
+
<xsl:template match="*[local-name() = 'passthrough']" mode="update_xml_step1">
|
12875
|
+
<!-- <xsl:if test="contains(@formats, ' pdf ')"> -->
|
12876
|
+
<xsl:if test="normalize-space(java:matches(java:java.lang.String.new(@formats), $regex_passthrough)) = 'true'">
|
12877
|
+
<xsl:apply-templates mode="update_xml_step1"/>
|
12878
|
+
</xsl:if>
|
12879
|
+
</xsl:template>
|
12880
|
+
|
12881
|
+
<!-- split math by element with @linebreak into maths -->
|
12882
|
+
<xsl:template match="mathml:math[.//mathml:mo[@linebreak] or .//mathml:mspace[@linebreak]]" mode="update_xml_step1">
|
12883
|
+
<xsl:variable name="maths">
|
12884
|
+
<xsl:apply-templates select="." mode="mathml_linebreak"/>
|
12885
|
+
</xsl:variable>
|
12886
|
+
<xsl:copy-of select="$maths"/>
|
12887
|
+
</xsl:template>
|
12888
|
+
|
12711
12889
|
<!-- =========================================================================== -->
|
12712
12890
|
<!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
|
12713
12891
|
<!-- =========================================================================== -->
|
@@ -12811,6 +12989,8 @@
|
|
12811
12989
|
|
12812
12990
|
<xsl:template name="insertOpeningElements">
|
12813
12991
|
<xsl:param name="tree"/>
|
12992
|
+
<xsl:param name="xmlns"/>
|
12993
|
+
<xsl:param name="add_continue">true</xsl:param>
|
12814
12994
|
<xsl:for-each select="$tree//element">
|
12815
12995
|
<xsl:text disable-output-escaping="yes"><</xsl:text>
|
12816
12996
|
<xsl:value-of select="."/>
|
@@ -12821,7 +13001,8 @@
|
|
12821
13001
|
<xsl:value-of select="."/>
|
12822
13002
|
<xsl:text>"</xsl:text>
|
12823
13003
|
</xsl:for-each>
|
12824
|
-
<xsl:if test="position() = 1"> continue="true"</xsl:if>
|
13004
|
+
<xsl:if test="position() = 1 and $add_continue = 'true'"> continue="true"</xsl:if>
|
13005
|
+
<xsl:if test="position() = 1 and $xmlns != ''"> xmlns="<xsl:value-of select="$xmlns"/>"</xsl:if>
|
12825
13006
|
<xsl:text disable-output-escaping="yes">></xsl:text>
|
12826
13007
|
<xsl:if test="$debug = 'true'">
|
12827
13008
|
<xsl:message><<xsl:value-of select="."/>></xsl:message>
|
@@ -14029,9 +14210,10 @@
|
|
14029
14210
|
<xsl:template name="insertBackgroundPageImage">
|
14030
14211
|
<xsl:param name="number">1</xsl:param>
|
14031
14212
|
<xsl:param name="name">coverpage-image</xsl:param>
|
14213
|
+
<xsl:param name="suffix"/>
|
14032
14214
|
<xsl:variable name="num" select="number($number)"/>
|
14033
14215
|
<!-- background image -->
|
14034
|
-
<fo:block-container absolute-position="fixed" left="0mm" top="0mm" font-size="0" id="
|
14216
|
+
<fo:block-container absolute-position="fixed" left="0mm" top="0mm" font-size="0" id="__internal_layout__coverpage{$suffix}_{$name}_{$number}_{generate-id()}">
|
14035
14217
|
<fo:block>
|
14036
14218
|
<xsl:for-each select="/*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = $name][1]/*[local-name() = 'value']/*[local-name() = 'image'][$num]">
|
14037
14219
|
<xsl:choose>
|
@@ -14097,16 +14279,29 @@
|
|
14097
14279
|
|
14098
14280
|
<!-- END: insert cover page image -->
|
14099
14281
|
|
14282
|
+
<xsl:variable name="regex_ja_spec">[\uFF08\uFF09]</xsl:variable>
|
14100
14283
|
<xsl:template name="insertVerticalChar">
|
14101
14284
|
<xsl:param name="str"/>
|
14285
|
+
<xsl:param name="writing-mode">lr-tb</xsl:param>
|
14286
|
+
<xsl:param name="reference-orientation">90</xsl:param>
|
14102
14287
|
<xsl:if test="string-length($str) > 0">
|
14103
|
-
<fo:inline-container
|
14288
|
+
<fo:inline-container text-align="center" alignment-baseline="central" width="1em" margin="0" padding="0" text-indent="0mm" last-line-end-indent="0mm" start-indent="0mm" end-indent="0mm">
|
14289
|
+
<xsl:if test="normalize-space($writing-mode) != ''">
|
14290
|
+
<xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
|
14291
|
+
<xsl:attribute name="reference-orientation">90</xsl:attribute>
|
14292
|
+
</xsl:if>
|
14293
|
+
<xsl:variable name="char" select="substring($str,1,1)"/>
|
14294
|
+
<xsl:if test="normalize-space(java:matches(java:java.lang.String.new($char), concat('(', $regex_ja_spec, '{1,})'))) = 'true'">
|
14295
|
+
<xsl:attribute name="reference-orientation">0</xsl:attribute>
|
14296
|
+
</xsl:if>
|
14104
14297
|
<fo:block-container width="1em">
|
14105
|
-
<fo:block line-height="1em"><xsl:value-of select="
|
14298
|
+
<fo:block line-height="1em"><xsl:value-of select="$char"/></fo:block>
|
14106
14299
|
</fo:block-container>
|
14107
14300
|
</fo:inline-container>
|
14108
14301
|
<xsl:call-template name="insertVerticalChar">
|
14109
14302
|
<xsl:with-param name="str" select="substring($str, 2)"/>
|
14303
|
+
<xsl:with-param name="writing-mode" select="$writing-mode"/>
|
14304
|
+
<xsl:with-param name="reference-orientation" select="$reference-orientation"/>
|
14110
14305
|
</xsl:call-template>
|
14111
14306
|
</xsl:if>
|
14112
14307
|
</xsl:template>
|