metanorma-iso 2.8.8 → 2.9.0

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.
@@ -3731,6 +3731,21 @@
3731
3731
  </xsl:choose>
3732
3732
  </xsl:template>
3733
3733
 
3734
+ <xsl:template match="iso:copyright-statement/iso:clause" priority="3">
3735
+ <fo:block role="SKIP">
3736
+ <xsl:if test="@id = 'boilerplate-copyright-default' and ../iso:clause[not(@id = 'boilerplate-copyright-default')]">
3737
+ <xsl:attribute name="color">blue</xsl:attribute>
3738
+ <xsl:attribute name="border">1pt solid blue</xsl:attribute>
3739
+ <xsl:attribute name="padding">1mm</xsl:attribute>
3740
+ </xsl:if>
3741
+ <xsl:if test="not(@id = 'boilerplate-copyright-default') and preceding-sibling::iso:clause">
3742
+ <xsl:attribute name="margin-top">5mm</xsl:attribute>
3743
+ </xsl:if>
3744
+ <xsl:copy-of select="@id"/>
3745
+ <xsl:apply-templates/>
3746
+ </fo:block>
3747
+ </xsl:template>
3748
+
3734
3749
  <xsl:template match="iso:copyright-statement//iso:p" priority="2">
3735
3750
  <xsl:choose>
3736
3751
  <xsl:when test="$layoutVersion = '1951'">
@@ -3777,7 +3792,7 @@
3777
3792
  <xsl:attribute name="margin-left">0.5mm</xsl:attribute>
3778
3793
  <xsl:attribute name="margin-right">0.5mm</xsl:attribute>
3779
3794
  </xsl:if>
3780
- <xsl:if test="contains(@id, 'address')">
3795
+ <xsl:if test="contains(@id, 'address') or contains(normalize-space(), 'Tel:') or contains(normalize-space(), 'Phone:')">
3781
3796
  <xsl:attribute name="margin-left">4.5mm</xsl:attribute>
3782
3797
  </xsl:if>
3783
3798
  <xsl:apply-templates/>
@@ -4415,6 +4430,8 @@
4415
4430
  </xsl:if>
4416
4431
  </xsl:if>
4417
4432
 
4433
+ <xsl:call-template name="addReviewHelper"/>
4434
+
4418
4435
  <xsl:call-template name="processElementContent"/>
4419
4436
  </fo:block>
4420
4437
  </xsl:template>
@@ -4431,6 +4448,8 @@
4431
4448
 
4432
4449
  <xsl:call-template name="refine_clause_style"/>
4433
4450
 
4451
+ <xsl:call-template name="addReviewHelper"/>
4452
+
4434
4453
  <xsl:call-template name="processElementContent"/>
4435
4454
 
4436
4455
  </fo:block>
@@ -9207,10 +9226,14 @@
9207
9226
  <xsl:variable name="fn_styles">
9208
9227
  <xsl:choose>
9209
9228
  <xsl:when test="ancestor::*[local-name() = 'bibitem']">
9210
- <fn_styles xsl:use-attribute-sets="bibitem-note-fn-style"/>
9229
+ <fn_styles xsl:use-attribute-sets="bibitem-note-fn-style">
9230
+
9231
+ </fn_styles>
9211
9232
  </xsl:when>
9212
9233
  <xsl:otherwise>
9213
- <fn_styles xsl:use-attribute-sets="fn-num-style"/>
9234
+ <fn_styles xsl:use-attribute-sets="fn-num-style">
9235
+
9236
+ </fn_styles>
9214
9237
  </xsl:otherwise>
9215
9238
  </xsl:choose>
9216
9239
  </xsl:variable>
@@ -9353,6 +9376,11 @@
9353
9376
 
9354
9377
  <xsl:value-of select="@reference"/>
9355
9378
 
9379
+ <!-- commented https://github.com/metanorma/isodoc/issues/614 -->
9380
+ <!-- <xsl:if test="$namespace = 'itu'">
9381
+ <xsl:text>)</xsl:text>
9382
+ </xsl:if> -->
9383
+
9356
9384
  </fo:inline>
9357
9385
  <fo:inline xsl:use-attribute-sets="table-fn-body-style">
9358
9386
  <xsl:copy-of select="./node()"/>
@@ -9362,7 +9390,7 @@
9362
9390
 
9363
9391
  </xsl:if>
9364
9392
  </xsl:for-each>
9365
- </xsl:template>
9393
+ </xsl:template> <!-- table_fn_display -->
9366
9394
 
9367
9395
  <xsl:template name="create_fn">
9368
9396
  <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
@@ -9390,8 +9418,10 @@
9390
9418
  <!-- EMD table's footnotes rendering -->
9391
9419
  <!-- ============================ -->
9392
9420
 
9421
+ <!-- ============================ -->
9393
9422
  <!-- figure's footnotes rendering -->
9394
- <xsl:template name="fn_display_figure">
9423
+ <!-- ============================ -->
9424
+ <xsl:template name="fn_display_figure"> <!-- figure_fn_display -->
9395
9425
 
9396
9426
  <!-- current figure id -->
9397
9427
  <xsl:variable name="figure_id_">
@@ -9504,9 +9534,28 @@
9504
9534
 
9505
9535
  </fo:block>
9506
9536
  </xsl:if>
9507
-
9508
9537
  </xsl:template> <!-- fn_display_figure -->
9509
9538
 
9539
+ <!-- added for https://github.com/metanorma/isodoc/issues/607 -->
9540
+ <!-- figure's footnote label -->
9541
+ <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">
9542
+ <xsl:variable name="key_iso">
9543
+ true
9544
+ </xsl:variable>
9545
+ <xsl:if test="normalize-space($key_iso) = 'true'">
9546
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
9547
+
9548
+ </xsl:if>
9549
+ <fo:inline xsl:use-attribute-sets="figure-fn-number-style"> <!-- id="{@id}" -->
9550
+ <!-- <xsl:value-of select="@reference"/> -->
9551
+ <xsl:apply-templates/>
9552
+ </fo:inline>
9553
+ </xsl:template>
9554
+
9555
+ <!-- ============================ -->
9556
+ <!-- END: figure's footnotes rendering -->
9557
+ <!-- ============================ -->
9558
+
9510
9559
  <!-- fn reference in the text rendering (for instance, 'some text 1) some text' ) -->
9511
9560
  <xsl:template match="*[local-name()='fn']">
9512
9561
  <fo:inline xsl:use-attribute-sets="fn-reference-style">
@@ -9522,6 +9571,10 @@
9522
9571
 
9523
9572
  <xsl:value-of select="@reference"/>
9524
9573
 
9574
+ <!-- commented, https://github.com/metanorma/isodoc/issues/614 -->
9575
+ <!-- <xsl:if test="$namespace = 'jis'">
9576
+ <fo:inline font-weight="normal">)</fo:inline>
9577
+ </xsl:if> -->
9525
9578
  </fo:basic-link>
9526
9579
  </fo:inline>
9527
9580
  </xsl:template>
@@ -9652,17 +9705,22 @@
9652
9705
  </fo:block>
9653
9706
  </xsl:when> <!-- END: a few components -->
9654
9707
  <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')"> <!-- definition list in a figure -->
9655
- <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
9708
+ <!-- Presentation XML contains 'Key' caption, https://github.com/metanorma/isodoc/issues/607 -->
9709
+ <xsl:if test="not(preceding-sibling::*[1][local-name() = 'p' and @keep-with-next])"> <!-- for old Presentation XML -->
9656
9710
 
9657
- <xsl:call-template name="refine_figure_key_style"/>
9711
+ <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
9658
9712
 
9659
- <xsl:variable name="title-key">
9660
- <xsl:call-template name="getLocalizedString">
9661
- <xsl:with-param name="key">key</xsl:with-param>
9662
- </xsl:call-template>
9663
- </xsl:variable>
9664
- <xsl:value-of select="$title-key"/>
9665
- </fo:block>
9713
+ <xsl:call-template name="refine_figure_key_style"/>
9714
+
9715
+ <xsl:variable name="title-key">
9716
+ <xsl:call-template name="getLocalizedString">
9717
+ <xsl:with-param name="key">key</xsl:with-param>
9718
+ </xsl:call-template>
9719
+ </xsl:variable>
9720
+ <xsl:value-of select="$title-key"/>
9721
+ </fo:block>
9722
+
9723
+ </xsl:if>
9666
9724
  </xsl:when> <!-- END: definition list in a figure -->
9667
9725
  </xsl:choose>
9668
9726
 
@@ -9852,6 +9910,14 @@
9852
9910
 
9853
9911
  </xsl:template> <!-- END: dl -->
9854
9912
 
9913
+ <!-- caption for figure key and another caption, https://github.com/metanorma/isodoc/issues/607 -->
9914
+ <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'p'][@keep-with-next = 'true' and *[local-name() = 'strong']]" priority="3">
9915
+ <fo:block text-align="left" margin-bottom="12pt" keep-with-next="always">
9916
+ <xsl:call-template name="refine_figure_key_style"/>
9917
+ <xsl:apply-templates/>
9918
+ </fo:block>
9919
+ </xsl:template>
9920
+
9855
9921
  <xsl:template name="refine_dl_formula_where_style">
9856
9922
 
9857
9923
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
@@ -11984,6 +12050,39 @@
11984
12050
  </xsl:copy>
11985
12051
  </xsl:template>
11986
12052
 
12053
+ <xsl:template match="@*|node()" mode="mathml_linebreak">
12054
+ <xsl:copy>
12055
+ <xsl:apply-templates select="@*|node()" mode="mathml_linebreak"/>
12056
+ </xsl:copy>
12057
+ </xsl:template>
12058
+
12059
+ <!-- split math into two math -->
12060
+ <xsl:template match="mathml:mo[@linebreak] | mathml:mspace[@linebreak]" mode="mathml_linebreak">
12061
+ <xsl:variable name="math_elements_tree_">
12062
+ <xsl:for-each select="ancestor::*[ancestor-or-self::mathml:math]">
12063
+ <element pos="{position()}">
12064
+ <xsl:copy-of select="@*[local-name() != 'id']"/>
12065
+ <xsl:value-of select="name()"/>
12066
+ </element>
12067
+ </xsl:for-each>
12068
+ </xsl:variable>
12069
+
12070
+ <xsl:variable name="math_elements_tree" select="xalan:nodeset($math_elements_tree_)"/>
12071
+
12072
+ <xsl:call-template name="insertClosingElements">
12073
+ <xsl:with-param name="tree" select="$math_elements_tree"/>
12074
+ </xsl:call-template>
12075
+
12076
+ <xsl:element name="br" namespace="{$namespace_full}"/>
12077
+
12078
+ <xsl:call-template name="insertOpeningElements">
12079
+ <xsl:with-param name="tree" select="$math_elements_tree"/>
12080
+ <xsl:with-param name="xmlns">http://www.w3.org/1998/Math/MathML</xsl:with-param>
12081
+ <xsl:with-param name="add_continue">false</xsl:with-param>
12082
+ </xsl:call-template>
12083
+
12084
+ </xsl:template>
12085
+
11987
12086
  <!-- Examples:
11988
12087
  <stem type="AsciiMath">x = 1</stem>
11989
12088
  <stem type="AsciiMath"><asciimath>x = 1</asciimath></stem>
@@ -12185,6 +12284,7 @@
12185
12284
  <xsl:if test="string-length(normalize-space()) &lt; 30 and not(contains(normalize-space(), 'http://')) and not(contains(normalize-space(), 'https://')) and not(ancestor::*[local-name() = 'table' or local-name() = 'dl'])">
12186
12285
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
12187
12286
  </xsl:if>
12287
+
12188
12288
  <xsl:if test="parent::*[local-name() = 'add']">
12189
12289
  <xsl:call-template name="append_add-style"/>
12190
12290
  </xsl:if>
@@ -12236,9 +12336,11 @@
12236
12336
  </xsl:template>
12237
12337
 
12238
12338
  <xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']"> <!-- show in 'stem' template -->
12339
+ <!-- https://github.com/metanorma/isodoc/issues/607
12239
12340
  <xsl:if test="normalize-space() != ''">
12240
- <xsl:text>(</xsl:text><xsl:apply-templates/><xsl:text>)</xsl:text>
12241
- </xsl:if>
12341
+ <xsl:text>(</xsl:text><xsl:apply-templates /><xsl:text>)</xsl:text>
12342
+ </xsl:if> -->
12343
+ <xsl:apply-templates/>
12242
12344
  </xsl:template>
12243
12345
 
12244
12346
  <!-- stem inside formula with name (with formula's number) -->
@@ -12295,44 +12397,44 @@
12295
12397
 
12296
12398
  <xsl:template match="*[local-name() = 'note']" name="note">
12297
12399
 
12298
- <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
12400
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
12299
12401
 
12300
- <xsl:call-template name="setBlockSpanAll"/>
12402
+ <xsl:call-template name="setBlockSpanAll"/>
12301
12403
 
12302
- <xsl:call-template name="refine_note-style"/>
12404
+ <xsl:call-template name="refine_note-style"/>
12303
12405
 
12304
- <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
12406
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
12305
12407
 
12306
- <fo:block>
12408
+ <fo:block>
12307
12409
 
12308
- <xsl:call-template name="refine_note_block_style"/>
12410
+ <xsl:call-template name="refine_note_block_style"/>
12309
12411
 
12310
- <fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
12412
+ <fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
12311
12413
 
12312
- <xsl:call-template name="refine_note-name-style"/>
12414
+ <xsl:call-template name="refine_note-name-style"/>
12313
12415
 
12314
- <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
12315
- <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
12316
- <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
12317
- <xsl:call-template name="append_add-style"/>
12318
- </xsl:if>
12416
+ <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
12417
+ <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
12418
+ <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
12419
+ <xsl:call-template name="append_add-style"/>
12420
+ </xsl:if>
12319
12421
 
12320
- <!-- if note contains only one element and first and last childs are `add` ace-tag, then move start ace-tag before NOTE's name-->
12321
- <xsl:if test="count(*[not(local-name() = 'name')]) = 1 and *[not(local-name() = 'name')]/node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]">
12322
- <xsl:apply-templates select="*[not(local-name() = 'name')]/node()[1][local-name() = 'add'][starts-with(text(), $ace_tag)]">
12323
- <xsl:with-param name="skip">false</xsl:with-param>
12324
- </xsl:apply-templates>
12325
- </xsl:if>
12422
+ <!-- if note contains only one element and first and last childs are `add` ace-tag, then move start ace-tag before NOTE's name-->
12423
+ <xsl:if test="count(*[not(local-name() = 'name')]) = 1 and *[not(local-name() = 'name')]/node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]">
12424
+ <xsl:apply-templates select="*[not(local-name() = 'name')]/node()[1][local-name() = 'add'][starts-with(text(), $ace_tag)]">
12425
+ <xsl:with-param name="skip">false</xsl:with-param>
12426
+ </xsl:apply-templates>
12427
+ </xsl:if>
12326
12428
 
12327
- <xsl:apply-templates select="*[local-name() = 'name']"/>
12429
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
12328
12430
 
12329
- </fo:inline>
12431
+ </fo:inline>
12330
12432
 
12331
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
12332
- </fo:block>
12433
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
12434
+ </fo:block>
12333
12435
 
12334
- </fo:block-container>
12335
- </fo:block-container>
12436
+ </fo:block-container>
12437
+ </fo:block-container>
12336
12438
 
12337
12439
  </xsl:template>
12338
12440
 
@@ -12417,10 +12519,21 @@
12417
12519
  </xsl:when>
12418
12520
  <xsl:otherwise>
12419
12521
 
12522
+ <!-- https://github.com/metanorma/isodoc/issues/607 -->
12523
+ <!-- <xsl:if test="$namespace = 'ieee'">
12524
+ <xsl:text>—</xsl:text> em dash &#x2014;
12525
+ </xsl:if> -->
12526
+ <!-- <xsl:if test="$namespace = 'iho' or $namespace = 'gb' or $namespace = 'm3d' or $namespace = 'unece-rec' or $namespace = 'unece' or $namespace = 'rsd'">
12527
+ <xsl:text>:</xsl:text>
12528
+ </xsl:if> -->
12529
+
12420
12530
  <xsl:if test="$layoutVersion = '1987' and . = translate(.,'1234567890','')"> <!-- NOTE without number -->
12421
12531
  <xsl:text> — </xsl:text>
12422
12532
  </xsl:if>
12423
12533
 
12534
+ <!-- <xsl:if test="$namespace = 'itu' or $namespace = 'nist-cswp' or $namespace = 'nist-sp'">
12535
+ <xsl:text> – </xsl:text> en dash &#x2013;
12536
+ </xsl:if> -->
12424
12537
  </xsl:otherwise>
12425
12538
  </xsl:choose>
12426
12539
  </xsl:variable>
@@ -12439,8 +12552,16 @@
12439
12552
  </xsl:when>
12440
12553
  <xsl:otherwise>
12441
12554
 
12555
+ <!-- https://github.com/metanorma/isodoc/issues/607 -->
12556
+ <!-- <xsl:if test="$namespace = 'ieee'">
12557
+ <xsl:text>—</xsl:text> em dash &#x2014;
12558
+ </xsl:if> -->
12559
+ <!-- <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'">
12442
12560
  <xsl:text>:</xsl:text>
12443
-
12561
+ </xsl:if> -->
12562
+ <!-- <xsl:if test="$namespace = 'itu' or $namespace = 'nist-cswp' or $namespace = 'nist-sp' or $namespace = 'unece-rec' or $namespace = 'unece'">
12563
+ <xsl:text> – </xsl:text> en dash &#x2013;
12564
+ </xsl:if> -->
12444
12565
  </xsl:otherwise>
12445
12566
  </xsl:choose>
12446
12567
  </xsl:variable>
@@ -14610,7 +14731,7 @@
14610
14731
  <xsl:if test="normalize-space() != ''">
14611
14732
  <fo:inline xsl:use-attribute-sets="termexample-name-style">
14612
14733
  <xsl:call-template name="refine_termexample-name-style"/>
14613
- <xsl:apply-templates/>
14734
+ <xsl:apply-templates/> <!-- commented $namespace = 'ieee', https://github.com/metanorma/isodoc/issues/614-->
14614
14735
  </fo:inline>
14615
14736
  </xsl:if>
14616
14737
  </xsl:template>
@@ -14770,13 +14891,14 @@
14770
14891
  </xsl:when>
14771
14892
  <xsl:when test="contains(normalize-space($fo_element), 'block')">
14772
14893
  <fo:block xsl:use-attribute-sets="example-name-style">
14894
+
14773
14895
  <xsl:apply-templates/>
14774
14896
  </fo:block>
14775
14897
  </xsl:when>
14776
14898
  <xsl:otherwise>
14777
14899
  <fo:inline xsl:use-attribute-sets="example-name-style">
14778
14900
  <xsl:call-template name="refine_example-name-style"/>
14779
- <xsl:apply-templates/>
14901
+ <xsl:apply-templates/> <!-- $namespace = 'ieee', see https://github.com/metanorma/isodoc/issues/614 -->
14780
14902
  </fo:inline>
14781
14903
  </xsl:otherwise>
14782
14904
  </xsl:choose>
@@ -14785,6 +14907,7 @@
14785
14907
 
14786
14908
  <xsl:template match="*[local-name() = 'table']/*[local-name() = 'example']/*[local-name() = 'name']">
14787
14909
  <fo:inline xsl:use-attribute-sets="example-name-style">
14910
+
14788
14911
  <xsl:apply-templates/>
14789
14912
  </fo:inline>
14790
14913
  </xsl:template>
@@ -14967,15 +15090,17 @@
14967
15090
 
14968
15091
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
14969
15092
  <fo:block role="BlockQuote">
14970
- <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
15093
+ <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 -->
14971
15094
  </fo:block>
14972
15095
  </fo:block-container>
14973
15096
  </fo:block-container>
14974
- <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
15097
+ <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source'] or *[local-name() = 'attribution']">
14975
15098
  <fo:block xsl:use-attribute-sets="quote-source-style">
14976
15099
  <!-- — ISO, ISO 7301:2011, Clause 1 -->
14977
15100
  <xsl:apply-templates select="*[local-name() = 'author']"/>
14978
15101
  <xsl:apply-templates select="*[local-name() = 'source']"/>
15102
+ <!-- added for https://github.com/metanorma/isodoc/issues/607 -->
15103
+ <xsl:apply-templates select="*[local-name() = 'attribution']/*[local-name() = 'p']/node()"/>
14979
15104
  </fo:block>
14980
15105
  </xsl:if>
14981
15106
 
@@ -14997,9 +15122,13 @@
14997
15122
  </xsl:template>
14998
15123
 
14999
15124
  <xsl:template match="*[local-name() = 'author']">
15000
- <xsl:text>— </xsl:text>
15125
+ <xsl:if test="local-name(..) = 'quote'"> <!-- for old Presentation XML, https://github.com/metanorma/isodoc/issues/607 -->
15126
+ <xsl:text>— </xsl:text>
15127
+ </xsl:if>
15001
15128
  <xsl:apply-templates/>
15002
15129
  </xsl:template>
15130
+
15131
+ <xsl:template match="*[local-name() = 'quote']//*[local-name() = 'referenceFrom']"/>
15003
15132
  <!-- ====== -->
15004
15133
  <!-- ====== -->
15005
15134
 
@@ -15166,20 +15295,26 @@
15166
15295
 
15167
15296
  <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'preferred'])"> <!-- if first preffered in term, then display term's name -->
15168
15297
  <fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
15298
+
15169
15299
  <xsl:apply-templates select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"/>
15170
15300
  </fo:block>
15171
15301
  </xsl:if>
15172
15302
 
15173
15303
  <fo:block xsl:use-attribute-sets="preferred-term-style" role="SKIP">
15174
15304
  <xsl:call-template name="setStyle_preferred"/>
15305
+
15175
15306
  <xsl:apply-templates/>
15176
15307
  </fo:block>
15177
15308
  </fo:block>
15178
15309
  </xsl:template>
15179
15310
 
15180
15311
  <xsl:template match="*[local-name() = 'domain']">
15312
+ <!-- https://github.com/metanorma/isodoc/issues/607
15181
15313
  <fo:inline xsl:use-attribute-sets="domain-style">&lt;<xsl:apply-templates/>&gt;</fo:inline>
15182
- <xsl:text> </xsl:text>
15314
+ <xsl:text> </xsl:text> -->
15315
+ <xsl:if test="not(@hidden = 'true')">
15316
+ <xsl:apply-templates/>
15317
+ </xsl:if>
15183
15318
  </xsl:template>
15184
15319
 
15185
15320
  <xsl:template match="*[local-name() = 'admitted']">
@@ -15227,6 +15362,29 @@
15227
15362
  <!-- END definition -->
15228
15363
  <!-- ========== -->
15229
15364
 
15365
+ <xsl:variable name="reviews_">
15366
+ <xsl:for-each select="//*[local-name() = 'review'][@from]">
15367
+ <xsl:copy>
15368
+ <xsl:copy-of select="@from"/>
15369
+ <xsl:copy-of select="@id"/>
15370
+ </xsl:copy>
15371
+ </xsl:for-each>
15372
+ </xsl:variable>
15373
+ <xsl:variable name="reviews" select="xalan:nodeset($reviews_)"/>
15374
+
15375
+ <xsl:template name="addReviewHelper">
15376
+ <!-- if there is review with from="...", then add small helper block for Annot tag adding, see 'review' template -->
15377
+ <xsl:variable name="curr_id" select="@id"/>
15378
+ <xsl:variable name="review_id" select="normalize-space($reviews//*[local-name() = 'review'][@from = $curr_id]/@id)"/>
15379
+ <xsl:if test="$review_id != ''"> <!-- i.e. if review found -->
15380
+ <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>
15381
+ </xsl:if>
15382
+ <!-- <fo:block>
15383
+ <curr_id><xsl:value-of select="$curr_id"/></curr_id>
15384
+ <xsl:copy-of select="$reviews"/>
15385
+ </fo:block> -->
15386
+ </xsl:template>
15387
+
15230
15388
  <!-- main sections -->
15231
15389
  <xsl:template match="/*/*[local-name() = 'sections']/*" name="sections_node" priority="2">
15232
15390
 
@@ -15235,6 +15393,8 @@
15235
15393
 
15236
15394
  <xsl:call-template name="sections_element_style"/>
15237
15395
 
15396
+ <xsl:call-template name="addReviewHelper"/>
15397
+
15238
15398
  <xsl:apply-templates/>
15239
15399
  </fo:block>
15240
15400
 
@@ -15281,6 +15441,7 @@
15281
15441
 
15282
15442
  <fo:block>
15283
15443
  <xsl:call-template name="setId"/>
15444
+ <xsl:call-template name="addReviewHelper"/>
15284
15445
  <xsl:apply-templates/>
15285
15446
  </fo:block>
15286
15447
  </xsl:template>
@@ -15317,6 +15478,8 @@
15317
15478
 
15318
15479
  <xsl:call-template name="refine_clause_style"/>
15319
15480
 
15481
+ <xsl:call-template name="addReviewHelper"/>
15482
+
15320
15483
  <xsl:apply-templates/>
15321
15484
  </fo:block>
15322
15485
  </xsl:template>
@@ -15369,6 +15532,23 @@
15369
15532
 
15370
15533
  <xsl:variable name="id_from" select="normalize-space(current()/@from)"/>
15371
15534
 
15535
+ <xsl:if test="1 = 1">
15536
+ <xsl:choose>
15537
+ <!-- if there isn't the attribute '@from', then -->
15538
+ <xsl:when test="$id_from = ''">
15539
+ <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>
15540
+ </xsl:when>
15541
+ <!-- if there isn't element with id 'from', then create 'bookmark' here -->
15542
+ <xsl:when test="ancestor::*[contains(local-name(), '-standard')] and not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
15543
+ <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>
15544
+ </xsl:when>
15545
+ <xsl:when test="not(/*[@id = $id_from]) and not(/*//*[@id = $id_from]) and not(preceding-sibling::*[@id = $id_from])">
15546
+ <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>
15547
+ </xsl:when>
15548
+ </xsl:choose>
15549
+ </xsl:if>
15550
+
15551
+ <xsl:if test="1 = 2">
15372
15552
  <xsl:choose>
15373
15553
  <!-- if there isn't the attribute '@from', then -->
15374
15554
  <xsl:when test="$id_from = ''">
@@ -15382,6 +15562,7 @@
15382
15562
  <fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
15383
15563
  </xsl:when>
15384
15564
  </xsl:choose>
15565
+ </xsl:if>
15385
15566
 
15386
15567
  </xsl:template>
15387
15568
 
@@ -16536,9 +16717,9 @@
16536
16717
  </xsl:if>
16537
16718
 
16538
16719
  <xsl:if test="@type != 'editorial'">
16539
- <xsl:call-template name="displayAdmonitionName">
16540
- <xsl:with-param name="sep"> — </xsl:with-param>
16541
- </xsl:call-template>
16720
+ <xsl:call-template name="displayAdmonitionName"/>
16721
+ <!-- https://github.com/metanorma/isodoc/issues/614 -->
16722
+ <!-- <xsl:with-param name="sep"> — </xsl:with-param> -->
16542
16723
  </xsl:if>
16543
16724
 
16544
16725
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
@@ -16796,7 +16977,7 @@
16796
16977
  <!-- remove preprocess-xslt -->
16797
16978
  <xsl:template match="*[local-name() = 'preprocess-xslt']" mode="update_xml_step1"/>
16798
16979
 
16799
- <xsl:template match="*[local-name() = 'stem'] | *[local-name() = 'image'] | *[local-name() = 'sourcecode'] | *[local-name() = 'bibdata'] | *[local-name() = 'localized-strings']" mode="update_xml_step1">
16980
+ <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">
16800
16981
  <xsl:copy-of select="."/>
16801
16982
  </xsl:template>
16802
16983
 
@@ -16862,6 +17043,22 @@
16862
17043
  </xsl:choose>
16863
17044
  </xsl:template>
16864
17045
 
17046
+ <xsl:variable name="regex_passthrough">.*\bpdf\b.*</xsl:variable>
17047
+ <xsl:template match="*[local-name() = 'passthrough']" mode="update_xml_step1">
17048
+ <!-- <xsl:if test="contains(@formats, ' pdf ')"> -->
17049
+ <xsl:if test="normalize-space(java:matches(java:java.lang.String.new(@formats), $regex_passthrough)) = 'true'">
17050
+ <xsl:apply-templates mode="update_xml_step1"/>
17051
+ </xsl:if>
17052
+ </xsl:template>
17053
+
17054
+ <!-- split math by element with @linebreak into maths -->
17055
+ <xsl:template match="mathml:math[.//mathml:mo[@linebreak] or .//mathml:mspace[@linebreak]]" mode="update_xml_step1">
17056
+ <xsl:variable name="maths">
17057
+ <xsl:apply-templates select="." mode="mathml_linebreak"/>
17058
+ </xsl:variable>
17059
+ <xsl:copy-of select="$maths"/>
17060
+ </xsl:template>
17061
+
16865
17062
  <!-- =========================================================================== -->
16866
17063
  <!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
16867
17064
  <!-- =========================================================================== -->
@@ -16965,6 +17162,8 @@
16965
17162
 
16966
17163
  <xsl:template name="insertOpeningElements">
16967
17164
  <xsl:param name="tree"/>
17165
+ <xsl:param name="xmlns"/>
17166
+ <xsl:param name="add_continue">true</xsl:param>
16968
17167
  <xsl:for-each select="$tree//element">
16969
17168
  <xsl:text disable-output-escaping="yes">&lt;</xsl:text>
16970
17169
  <xsl:value-of select="."/>
@@ -16975,7 +17174,8 @@
16975
17174
  <xsl:value-of select="."/>
16976
17175
  <xsl:text>"</xsl:text>
16977
17176
  </xsl:for-each>
16978
- <xsl:if test="position() = 1"> continue="true"</xsl:if>
17177
+ <xsl:if test="position() = 1 and $add_continue = 'true'"> continue="true"</xsl:if>
17178
+ <xsl:if test="position() = 1 and $xmlns != ''"> xmlns="<xsl:value-of select="$xmlns"/>"</xsl:if>
16979
17179
  <xsl:text disable-output-escaping="yes">&gt;</xsl:text>
16980
17180
  <xsl:if test="$debug = 'true'">
16981
17181
  <xsl:message>&lt;<xsl:value-of select="."/>&gt;</xsl:message>
@@ -18312,9 +18512,10 @@
18312
18512
  <xsl:template name="insertBackgroundPageImage">
18313
18513
  <xsl:param name="number">1</xsl:param>
18314
18514
  <xsl:param name="name">coverpage-image</xsl:param>
18515
+ <xsl:param name="suffix"/>
18315
18516
  <xsl:variable name="num" select="number($number)"/>
18316
18517
  <!-- background image -->
18317
- <fo:block-container absolute-position="fixed" left="0mm" top="0mm" font-size="0" id="__internal_layout__coverpage_{$name}_{$number}_{generate-id()}">
18518
+ <fo:block-container absolute-position="fixed" left="0mm" top="0mm" font-size="0" id="__internal_layout__coverpage{$suffix}_{$name}_{$number}_{generate-id()}">
18318
18519
  <fo:block>
18319
18520
  <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]">
18320
18521
  <xsl:choose>
@@ -18380,16 +18581,29 @@
18380
18581
 
18381
18582
  <!-- END: insert cover page image -->
18382
18583
 
18584
+ <xsl:variable name="regex_ja_spec">[\uFF08\uFF09]</xsl:variable>
18383
18585
  <xsl:template name="insertVerticalChar">
18384
18586
  <xsl:param name="str"/>
18587
+ <xsl:param name="writing-mode">lr-tb</xsl:param>
18588
+ <xsl:param name="reference-orientation">90</xsl:param>
18385
18589
  <xsl:if test="string-length($str) &gt; 0">
18386
- <fo:inline-container writing-mode="lr-tb" text-align="center" alignment-baseline="central" reference-orientation="90" width="1em" margin="0" padding="0" text-indent="0mm" last-line-end-indent="0mm" start-indent="0mm" end-indent="0mm">
18590
+ <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">
18591
+ <xsl:if test="normalize-space($writing-mode) != ''">
18592
+ <xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
18593
+ <xsl:attribute name="reference-orientation">90</xsl:attribute>
18594
+ </xsl:if>
18595
+ <xsl:variable name="char" select="substring($str,1,1)"/>
18596
+ <xsl:if test="normalize-space(java:matches(java:java.lang.String.new($char), concat('(', $regex_ja_spec, '{1,})'))) = 'true'">
18597
+ <xsl:attribute name="reference-orientation">0</xsl:attribute>
18598
+ </xsl:if>
18387
18599
  <fo:block-container width="1em">
18388
- <fo:block line-height="1em"><xsl:value-of select="substring($str,1,1)"/></fo:block>
18600
+ <fo:block line-height="1em"><xsl:value-of select="$char"/></fo:block>
18389
18601
  </fo:block-container>
18390
18602
  </fo:inline-container>
18391
18603
  <xsl:call-template name="insertVerticalChar">
18392
18604
  <xsl:with-param name="str" select="substring($str, 2)"/>
18605
+ <xsl:with-param name="writing-mode" select="$writing-mode"/>
18606
+ <xsl:with-param name="reference-orientation" select="$reference-orientation"/>
18393
18607
  </xsl:call-template>
18394
18608
  </xsl:if>
18395
18609
  </xsl:template>
@@ -32,7 +32,7 @@ module IsoDoc
32
32
  ret = "<review date='#{Date.today}' reviewer='Metanorma' id='_#{id}'>" \
33
33
  "<p><strong>Metadata warnings:<strong></p> #{ret}</review>"
34
34
  ins = docxml.at(ns("//sections//title")) or return
35
- ins.children.first.previous = ret
35
+ ins.add_first_child ret
36
36
  end
37
37
 
38
38
  def editorialgroup_identifier(docxml)