metanorma-ieee 1.3.2 → 1.3.4

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.
@@ -1649,6 +1649,7 @@
1649
1649
  <xsl:template match="ieee:abstract">
1650
1650
  <fo:block>
1651
1651
  <xsl:call-template name="setId"/>
1652
+ <xsl:call-template name="addReviewHelper"/>
1652
1653
  <xsl:apply-templates/>
1653
1654
  </fo:block>
1654
1655
  </xsl:template>
@@ -2281,6 +2282,7 @@
2281
2282
  <xsl:template match="*[local-name() = 'introduction'] | *[local-name() = 'foreword'] | *[local-name() = 'acknowledgements']">
2282
2283
  <fo:block>
2283
2284
  <xsl:call-template name="setId"/>
2285
+ <xsl:call-template name="addReviewHelper"/>
2284
2286
  <xsl:apply-templates/>
2285
2287
  </fo:block>
2286
2288
  </xsl:template>
@@ -6697,6 +6699,7 @@
6697
6699
  </xsl:if>
6698
6700
 
6699
6701
  <fo:block xsl:use-attribute-sets="table-name-style" role="SKIP">
6702
+
6700
6703
  <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']">
6701
6704
  <xsl:with-param name="continued">true</xsl:with-param>
6702
6705
  </xsl:apply-templates>
@@ -7233,10 +7236,14 @@
7233
7236
  <xsl:variable name="fn_styles">
7234
7237
  <xsl:choose>
7235
7238
  <xsl:when test="ancestor::*[local-name() = 'bibitem']">
7236
- <fn_styles xsl:use-attribute-sets="bibitem-note-fn-style"/>
7239
+ <fn_styles xsl:use-attribute-sets="bibitem-note-fn-style">
7240
+
7241
+ </fn_styles>
7237
7242
  </xsl:when>
7238
7243
  <xsl:otherwise>
7239
- <fn_styles xsl:use-attribute-sets="fn-num-style"/>
7244
+ <fn_styles xsl:use-attribute-sets="fn-num-style">
7245
+
7246
+ </fn_styles>
7240
7247
  </xsl:otherwise>
7241
7248
  </xsl:choose>
7242
7249
  </xsl:variable>
@@ -7375,6 +7382,11 @@
7375
7382
 
7376
7383
  <xsl:value-of select="@reference"/>
7377
7384
 
7385
+ <!-- commented https://github.com/metanorma/isodoc/issues/614 -->
7386
+ <!-- <xsl:if test="$namespace = 'itu'">
7387
+ <xsl:text>)</xsl:text>
7388
+ </xsl:if> -->
7389
+
7378
7390
  </fo:inline>
7379
7391
  <fo:inline xsl:use-attribute-sets="table-fn-body-style">
7380
7392
  <xsl:copy-of select="./node()"/>
@@ -7384,7 +7396,7 @@
7384
7396
 
7385
7397
  </xsl:if>
7386
7398
  </xsl:for-each>
7387
- </xsl:template>
7399
+ </xsl:template> <!-- table_fn_display -->
7388
7400
 
7389
7401
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="create_fn">
7390
7402
  <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
@@ -7412,8 +7424,10 @@
7412
7424
  <!-- EMD table's footnotes rendering -->
7413
7425
  <!-- ============================ -->
7414
7426
 
7427
+ <!-- ============================ -->
7415
7428
  <!-- figure's footnotes rendering -->
7416
- <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="fn_display_figure">
7429
+ <!-- ============================ -->
7430
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="fn_display_figure"> <!-- figure_fn_display -->
7417
7431
 
7418
7432
  <!-- current figure id -->
7419
7433
  <xsl:variable name="figure_id_">
@@ -7526,9 +7540,28 @@
7526
7540
 
7527
7541
  </fo:block>
7528
7542
  </xsl:if>
7529
-
7530
7543
  </xsl:template> <!-- fn_display_figure -->
7531
7544
 
7545
+ <!-- added for https://github.com/metanorma/isodoc/issues/607 -->
7546
+ <!-- figure's footnote label -->
7547
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" 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">
7548
+ <xsl:variable name="key_iso">
7549
+
7550
+ </xsl:variable>
7551
+ <xsl:if test="normalize-space($key_iso) = 'true'">
7552
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
7553
+
7554
+ </xsl:if>
7555
+ <fo:inline xsl:use-attribute-sets="figure-fn-number-style"> <!-- id="{@id}" -->
7556
+ <!-- <xsl:value-of select="@reference"/> -->
7557
+ <xsl:apply-templates/>
7558
+ </fo:inline>
7559
+ </xsl:template>
7560
+
7561
+ <!-- ============================ -->
7562
+ <!-- END: figure's footnotes rendering -->
7563
+ <!-- ============================ -->
7564
+
7532
7565
  <!-- fn reference in the text rendering (for instance, 'some text 1) some text' ) -->
7533
7566
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name()='fn']">
7534
7567
  <fo:inline xsl:use-attribute-sets="fn-reference-style">
@@ -7544,6 +7577,10 @@
7544
7577
 
7545
7578
  <xsl:value-of select="@reference"/>
7546
7579
 
7580
+ <!-- commented, https://github.com/metanorma/isodoc/issues/614 -->
7581
+ <!-- <xsl:if test="$namespace = 'jis'">
7582
+ <fo:inline font-weight="normal">)</fo:inline>
7583
+ </xsl:if> -->
7547
7584
  </fo:basic-link>
7548
7585
  </fo:inline>
7549
7586
  </xsl:template>
@@ -7670,17 +7707,22 @@
7670
7707
  </fo:block>
7671
7708
  </xsl:when> <!-- END: a few components -->
7672
7709
  <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')"> <!-- definition list in a figure -->
7673
- <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
7710
+ <!-- Presentation XML contains 'Key' caption, https://github.com/metanorma/isodoc/issues/607 -->
7711
+ <xsl:if test="not(preceding-sibling::*[1][local-name() = 'p' and @keep-with-next])"> <!-- for old Presentation XML -->
7674
7712
 
7675
- <xsl:call-template name="refine_figure_key_style"/>
7713
+ <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
7676
7714
 
7677
- <xsl:variable name="title-key">
7678
- <xsl:call-template name="getLocalizedString">
7679
- <xsl:with-param name="key">key</xsl:with-param>
7680
- </xsl:call-template>
7681
- </xsl:variable>
7682
- <xsl:value-of select="$title-key"/>
7683
- </fo:block>
7715
+ <xsl:call-template name="refine_figure_key_style"/>
7716
+
7717
+ <xsl:variable name="title-key">
7718
+ <xsl:call-template name="getLocalizedString">
7719
+ <xsl:with-param name="key">key</xsl:with-param>
7720
+ </xsl:call-template>
7721
+ </xsl:variable>
7722
+ <xsl:value-of select="$title-key"/>
7723
+ </fo:block>
7724
+
7725
+ </xsl:if>
7684
7726
  </xsl:when> <!-- END: definition list in a figure -->
7685
7727
  </xsl:choose>
7686
7728
 
@@ -7866,6 +7908,14 @@
7866
7908
 
7867
7909
  </xsl:template> <!-- END: dl -->
7868
7910
 
7911
+ <!-- caption for figure key and another caption, https://github.com/metanorma/isodoc/issues/607 -->
7912
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name() = 'figure']/*[local-name() = 'p'][@keep-with-next = 'true' and *[local-name() = 'strong']]" priority="3">
7913
+ <fo:block text-align="left" margin-bottom="12pt" keep-with-next="always">
7914
+ <xsl:call-template name="refine_figure_key_style"/>
7915
+ <xsl:apply-templates/>
7916
+ </fo:block>
7917
+ </xsl:template>
7918
+
7869
7919
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="refine_dl_formula_where_style">
7870
7920
 
7871
7921
  </xsl:template> <!-- refine_dl_formula_where_style -->
@@ -9898,6 +9948,39 @@
9898
9948
  </xsl:copy>
9899
9949
  </xsl:template>
9900
9950
 
9951
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="@*|node()" mode="mathml_linebreak">
9952
+ <xsl:copy>
9953
+ <xsl:apply-templates select="@*|node()" mode="mathml_linebreak"/>
9954
+ </xsl:copy>
9955
+ </xsl:template>
9956
+
9957
+ <!-- split math into two math -->
9958
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="mathml:mo[@linebreak] | mathml:mspace[@linebreak]" mode="mathml_linebreak">
9959
+ <xsl:variable name="math_elements_tree_">
9960
+ <xsl:for-each select="ancestor::*[ancestor-or-self::mathml:math]">
9961
+ <element pos="{position()}">
9962
+ <xsl:copy-of select="@*[local-name() != 'id']"/>
9963
+ <xsl:value-of select="name()"/>
9964
+ </element>
9965
+ </xsl:for-each>
9966
+ </xsl:variable>
9967
+
9968
+ <xsl:variable name="math_elements_tree" select="xalan:nodeset($math_elements_tree_)"/>
9969
+
9970
+ <xsl:call-template name="insertClosingElements">
9971
+ <xsl:with-param name="tree" select="$math_elements_tree"/>
9972
+ </xsl:call-template>
9973
+
9974
+ <xsl:element name="br" namespace="{$namespace_full}"/>
9975
+
9976
+ <xsl:call-template name="insertOpeningElements">
9977
+ <xsl:with-param name="tree" select="$math_elements_tree"/>
9978
+ <xsl:with-param name="xmlns">http://www.w3.org/1998/Math/MathML</xsl:with-param>
9979
+ <xsl:with-param name="add_continue">false</xsl:with-param>
9980
+ </xsl:call-template>
9981
+
9982
+ </xsl:template>
9983
+
9901
9984
  <!-- Examples:
9902
9985
  <stem type="AsciiMath">x = 1</stem>
9903
9986
  <stem type="AsciiMath"><asciimath>x = 1</asciimath></stem>
@@ -10099,6 +10182,7 @@
10099
10182
  <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'])">
10100
10183
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
10101
10184
  </xsl:if>
10185
+
10102
10186
  <xsl:if test="parent::*[local-name() = 'add']">
10103
10187
  <xsl:call-template name="append_add-style"/>
10104
10188
  </xsl:if>
@@ -10148,9 +10232,11 @@
10148
10232
  </xsl:template>
10149
10233
 
10150
10234
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name() = 'formula']/*[local-name() = 'name']"> <!-- show in 'stem' template -->
10235
+ <!-- https://github.com/metanorma/isodoc/issues/607
10151
10236
  <xsl:if test="normalize-space() != ''">
10152
- <xsl:text>(</xsl:text><xsl:apply-templates/><xsl:text>)</xsl:text>
10153
- </xsl:if>
10237
+ <xsl:text>(</xsl:text><xsl:apply-templates /><xsl:text>)</xsl:text>
10238
+ </xsl:if> -->
10239
+ <xsl:apply-templates/>
10154
10240
  </xsl:template>
10155
10241
 
10156
10242
  <!-- stem inside formula with name (with formula's number) -->
@@ -10207,44 +10293,44 @@
10207
10293
 
10208
10294
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name() = 'note']" name="note">
10209
10295
 
10210
- <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
10296
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
10211
10297
 
10212
- <xsl:call-template name="setBlockSpanAll"/>
10298
+ <xsl:call-template name="setBlockSpanAll"/>
10213
10299
 
10214
- <xsl:call-template name="refine_note-style"/>
10300
+ <xsl:call-template name="refine_note-style"/>
10215
10301
 
10216
- <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
10302
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
10217
10303
 
10218
- <fo:block>
10304
+ <fo:block>
10219
10305
 
10220
- <xsl:call-template name="refine_note_block_style"/>
10306
+ <xsl:call-template name="refine_note_block_style"/>
10221
10307
 
10222
- <fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
10308
+ <fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
10223
10309
 
10224
- <xsl:call-template name="refine_note-name-style"/>
10310
+ <xsl:call-template name="refine_note-name-style"/>
10225
10311
 
10226
- <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
10227
- <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
10228
- <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
10229
- <xsl:call-template name="append_add-style"/>
10230
- </xsl:if>
10312
+ <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
10313
+ <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
10314
+ <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
10315
+ <xsl:call-template name="append_add-style"/>
10316
+ </xsl:if>
10231
10317
 
10232
- <!-- if note contains only one element and first and last childs are `add` ace-tag, then move start ace-tag before NOTE's name-->
10233
- <xsl:if test="count(*[not(local-name() = 'name')]) = 1 and *[not(local-name() = 'name')]/node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]">
10234
- <xsl:apply-templates select="*[not(local-name() = 'name')]/node()[1][local-name() = 'add'][starts-with(text(), $ace_tag)]">
10235
- <xsl:with-param name="skip">false</xsl:with-param>
10236
- </xsl:apply-templates>
10237
- </xsl:if>
10318
+ <!-- if note contains only one element and first and last childs are `add` ace-tag, then move start ace-tag before NOTE's name-->
10319
+ <xsl:if test="count(*[not(local-name() = 'name')]) = 1 and *[not(local-name() = 'name')]/node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]">
10320
+ <xsl:apply-templates select="*[not(local-name() = 'name')]/node()[1][local-name() = 'add'][starts-with(text(), $ace_tag)]">
10321
+ <xsl:with-param name="skip">false</xsl:with-param>
10322
+ </xsl:apply-templates>
10323
+ </xsl:if>
10238
10324
 
10239
- <xsl:apply-templates select="*[local-name() = 'name']"/>
10325
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
10240
10326
 
10241
- </fo:inline>
10327
+ </fo:inline>
10242
10328
 
10243
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
10244
- </fo:block>
10329
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
10330
+ </fo:block>
10245
10331
 
10246
- </fo:block-container>
10247
- </fo:block-container>
10332
+ </fo:block-container>
10333
+ </fo:block-container>
10248
10334
 
10249
10335
  </xsl:template>
10250
10336
 
@@ -10306,8 +10392,17 @@
10306
10392
  </xsl:when>
10307
10393
  <xsl:otherwise>
10308
10394
 
10309
- <xsl:text>—</xsl:text>
10395
+ <!-- https://github.com/metanorma/isodoc/issues/607 -->
10396
+ <!-- <xsl:if test="$namespace = 'ieee'">
10397
+ <xsl:text>—</xsl:text> em dash &#x2014;
10398
+ </xsl:if> -->
10399
+ <!-- <xsl:if test="$namespace = 'iho' or $namespace = 'gb' or $namespace = 'm3d' or $namespace = 'unece-rec' or $namespace = 'unece' or $namespace = 'rsd'">
10400
+ <xsl:text>:</xsl:text>
10401
+ </xsl:if> -->
10310
10402
 
10403
+ <!-- <xsl:if test="$namespace = 'itu' or $namespace = 'nist-cswp' or $namespace = 'nist-sp'">
10404
+ <xsl:text> – </xsl:text> en dash &#x2013;
10405
+ </xsl:if> -->
10311
10406
  </xsl:otherwise>
10312
10407
  </xsl:choose>
10313
10408
  </xsl:variable>
@@ -10326,8 +10421,16 @@
10326
10421
  </xsl:when>
10327
10422
  <xsl:otherwise>
10328
10423
 
10329
- <xsl:text>—</xsl:text>
10330
-
10424
+ <!-- https://github.com/metanorma/isodoc/issues/607 -->
10425
+ <!-- <xsl:if test="$namespace = 'ieee'">
10426
+ <xsl:text>—</xsl:text> em dash &#x2014;
10427
+ </xsl:if> -->
10428
+ <!-- <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'">
10429
+ <xsl:text>:</xsl:text>
10430
+ </xsl:if> -->
10431
+ <!-- <xsl:if test="$namespace = 'itu' or $namespace = 'nist-cswp' or $namespace = 'nist-sp' or $namespace = 'unece-rec' or $namespace = 'unece'">
10432
+ <xsl:text> – </xsl:text> en dash &#x2013;
10433
+ </xsl:if> -->
10331
10434
  </xsl:otherwise>
10332
10435
  </xsl:choose>
10333
10436
  </xsl:variable>
@@ -12493,7 +12596,7 @@
12493
12596
  <xsl:if test="normalize-space() != ''">
12494
12597
  <fo:inline xsl:use-attribute-sets="termexample-name-style">
12495
12598
  <xsl:call-template name="refine_termexample-name-style"/>
12496
- <xsl:apply-templates/>:
12599
+ <xsl:apply-templates/> <!-- commented $namespace = 'ieee', https://github.com/metanorma/isodoc/issues/614-->
12497
12600
  </fo:inline>
12498
12601
  </xsl:if>
12499
12602
  </xsl:template>
@@ -12652,13 +12755,14 @@
12652
12755
  </xsl:when>
12653
12756
  <xsl:when test="contains(normalize-space($fo_element), 'block')">
12654
12757
  <fo:block xsl:use-attribute-sets="example-name-style">
12758
+
12655
12759
  <xsl:apply-templates/>
12656
12760
  </fo:block>
12657
12761
  </xsl:when>
12658
12762
  <xsl:otherwise>
12659
12763
  <fo:inline xsl:use-attribute-sets="example-name-style">
12660
12764
  <xsl:call-template name="refine_example-name-style"/>
12661
- <xsl:apply-templates/>:
12765
+ <xsl:apply-templates/> <!-- $namespace = 'ieee', see https://github.com/metanorma/isodoc/issues/614 -->
12662
12766
  </fo:inline>
12663
12767
  </xsl:otherwise>
12664
12768
  </xsl:choose>
@@ -12667,6 +12771,7 @@
12667
12771
 
12668
12772
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name() = 'table']/*[local-name() = 'example']/*[local-name() = 'name']">
12669
12773
  <fo:inline xsl:use-attribute-sets="example-name-style">
12774
+
12670
12775
  <xsl:apply-templates/>
12671
12776
  </fo:inline>
12672
12777
  </xsl:template>
@@ -12839,15 +12944,17 @@
12839
12944
 
12840
12945
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
12841
12946
  <fo:block role="BlockQuote">
12842
- <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
12947
+ <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 -->
12843
12948
  </fo:block>
12844
12949
  </fo:block-container>
12845
12950
  </fo:block-container>
12846
- <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
12951
+ <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source'] or *[local-name() = 'attribution']">
12847
12952
  <fo:block xsl:use-attribute-sets="quote-source-style">
12848
12953
  <!-- — ISO, ISO 7301:2011, Clause 1 -->
12849
12954
  <xsl:apply-templates select="*[local-name() = 'author']"/>
12850
12955
  <xsl:apply-templates select="*[local-name() = 'source']"/>
12956
+ <!-- added for https://github.com/metanorma/isodoc/issues/607 -->
12957
+ <xsl:apply-templates select="*[local-name() = 'attribution']/*[local-name() = 'p']/node()"/>
12851
12958
  </fo:block>
12852
12959
  </xsl:if>
12853
12960
 
@@ -12869,9 +12976,13 @@
12869
12976
  </xsl:template>
12870
12977
 
12871
12978
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name() = 'author']">
12872
- <xsl:text>— </xsl:text>
12979
+ <xsl:if test="local-name(..) = 'quote'"> <!-- for old Presentation XML, https://github.com/metanorma/isodoc/issues/607 -->
12980
+ <xsl:text>— </xsl:text>
12981
+ </xsl:if>
12873
12982
  <xsl:apply-templates/>
12874
12983
  </xsl:template>
12984
+
12985
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name() = 'quote']//*[local-name() = 'referenceFrom']"/>
12875
12986
  <!-- ====== -->
12876
12987
  <!-- ====== -->
12877
12988
 
@@ -13033,20 +13144,26 @@
13033
13144
 
13034
13145
  <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'preferred'])"> <!-- if first preffered in term, then display term's name -->
13035
13146
  <fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
13147
+
13036
13148
  <xsl:apply-templates select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"/>
13037
13149
  </fo:block>
13038
13150
  </xsl:if>
13039
13151
 
13040
13152
  <fo:block xsl:use-attribute-sets="preferred-term-style" role="SKIP">
13041
13153
  <xsl:call-template name="setStyle_preferred"/>
13154
+
13042
13155
  <xsl:apply-templates/>
13043
13156
  </fo:block>
13044
13157
  </fo:block>
13045
13158
  </xsl:template>
13046
13159
 
13047
13160
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name() = 'domain']">
13161
+ <!-- https://github.com/metanorma/isodoc/issues/607
13048
13162
  <fo:inline xsl:use-attribute-sets="domain-style">&lt;<xsl:apply-templates/>&gt;</fo:inline>
13049
- <xsl:text> </xsl:text>
13163
+ <xsl:text> </xsl:text> -->
13164
+ <xsl:if test="not(@hidden = 'true')">
13165
+ <xsl:apply-templates/>
13166
+ </xsl:if>
13050
13167
  </xsl:template>
13051
13168
 
13052
13169
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name() = 'admitted']">
@@ -13094,6 +13211,29 @@
13094
13211
  <!-- END definition -->
13095
13212
  <!-- ========== -->
13096
13213
 
13214
+ <xsl:variable xmlns:redirect="http://xml.apache.org/xalan/redirect" name="reviews_">
13215
+ <xsl:for-each select="//*[local-name() = 'review'][@from]">
13216
+ <xsl:copy>
13217
+ <xsl:copy-of select="@from"/>
13218
+ <xsl:copy-of select="@id"/>
13219
+ </xsl:copy>
13220
+ </xsl:for-each>
13221
+ </xsl:variable>
13222
+ <xsl:variable xmlns:redirect="http://xml.apache.org/xalan/redirect" name="reviews" select="xalan:nodeset($reviews_)"/>
13223
+
13224
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="addReviewHelper">
13225
+ <!-- if there is review with from="...", then add small helper block for Annot tag adding, see 'review' template -->
13226
+ <xsl:variable name="curr_id" select="@id"/>
13227
+ <xsl:variable name="review_id" select="normalize-space($reviews//*[local-name() = 'review'][@from = $curr_id]/@id)"/>
13228
+ <xsl:if test="$review_id != ''"> <!-- i.e. if review found -->
13229
+ <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>
13230
+ </xsl:if>
13231
+ <!-- <fo:block>
13232
+ <curr_id><xsl:value-of select="$curr_id"/></curr_id>
13233
+ <xsl:copy-of select="$reviews"/>
13234
+ </fo:block> -->
13235
+ </xsl:template>
13236
+
13097
13237
  <!-- main sections -->
13098
13238
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="/*/*[local-name() = 'sections']/*" name="sections_node" priority="2">
13099
13239
 
@@ -13102,6 +13242,8 @@
13102
13242
 
13103
13243
  <xsl:call-template name="sections_element_style"/>
13104
13244
 
13245
+ <xsl:call-template name="addReviewHelper"/>
13246
+
13105
13247
  <xsl:apply-templates/>
13106
13248
  </fo:block>
13107
13249
 
@@ -13137,6 +13279,7 @@
13137
13279
 
13138
13280
  <fo:block>
13139
13281
  <xsl:call-template name="setId"/>
13282
+ <xsl:call-template name="addReviewHelper"/>
13140
13283
  <xsl:apply-templates/>
13141
13284
  </fo:block>
13142
13285
  </xsl:template>
@@ -13173,6 +13316,8 @@
13173
13316
 
13174
13317
  <xsl:call-template name="refine_clause_style"/>
13175
13318
 
13319
+ <xsl:call-template name="addReviewHelper"/>
13320
+
13176
13321
  <xsl:apply-templates/>
13177
13322
  </fo:block>
13178
13323
  </xsl:template>
@@ -13225,6 +13370,23 @@
13225
13370
 
13226
13371
  <xsl:variable name="id_from" select="normalize-space(current()/@from)"/>
13227
13372
 
13373
+ <xsl:if test="1 = 1">
13374
+ <xsl:choose>
13375
+ <!-- if there isn't the attribute '@from', then -->
13376
+ <xsl:when test="$id_from = ''">
13377
+ <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>
13378
+ </xsl:when>
13379
+ <!-- if there isn't element with id 'from', then create 'bookmark' here -->
13380
+ <xsl:when test="ancestor::*[contains(local-name(), '-standard')] and not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
13381
+ <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>
13382
+ </xsl:when>
13383
+ <xsl:when test="not(/*[@id = $id_from]) and not(/*//*[@id = $id_from]) and not(preceding-sibling::*[@id = $id_from])">
13384
+ <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>
13385
+ </xsl:when>
13386
+ </xsl:choose>
13387
+ </xsl:if>
13388
+
13389
+ <xsl:if test="1 = 2">
13228
13390
  <xsl:choose>
13229
13391
  <!-- if there isn't the attribute '@from', then -->
13230
13392
  <xsl:when test="$id_from = ''">
@@ -13238,6 +13400,7 @@
13238
13400
  <fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
13239
13401
  </xsl:when>
13240
13402
  </xsl:choose>
13403
+ </xsl:if>
13241
13404
 
13242
13405
  </xsl:template>
13243
13406
 
@@ -14657,7 +14820,7 @@
14657
14820
  <!-- remove preprocess-xslt -->
14658
14821
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name() = 'preprocess-xslt']" mode="update_xml_step1"/>
14659
14822
 
14660
- <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name() = 'stem'] | *[local-name() = 'image'] | *[local-name() = 'sourcecode'] | *[local-name() = 'bibdata'] | *[local-name() = 'localized-strings']" mode="update_xml_step1">
14823
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" 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">
14661
14824
  <xsl:copy-of select="."/>
14662
14825
  </xsl:template>
14663
14826
 
@@ -14723,6 +14886,22 @@
14723
14886
  </xsl:choose>
14724
14887
  </xsl:template>
14725
14888
 
14889
+ <xsl:variable xmlns:redirect="http://xml.apache.org/xalan/redirect" name="regex_passthrough">.*\bpdf\b.*</xsl:variable>
14890
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name() = 'passthrough']" mode="update_xml_step1">
14891
+ <!-- <xsl:if test="contains(@formats, ' pdf ')"> -->
14892
+ <xsl:if test="normalize-space(java:matches(java:java.lang.String.new(@formats), $regex_passthrough)) = 'true'">
14893
+ <xsl:apply-templates mode="update_xml_step1"/>
14894
+ </xsl:if>
14895
+ </xsl:template>
14896
+
14897
+ <!-- split math by element with @linebreak into maths -->
14898
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="mathml:math[.//mathml:mo[@linebreak] or .//mathml:mspace[@linebreak]]" mode="update_xml_step1">
14899
+ <xsl:variable name="maths">
14900
+ <xsl:apply-templates select="." mode="mathml_linebreak"/>
14901
+ </xsl:variable>
14902
+ <xsl:copy-of select="$maths"/>
14903
+ </xsl:template>
14904
+
14726
14905
  <!-- =========================================================================== -->
14727
14906
  <!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
14728
14907
  <!-- =========================================================================== -->
@@ -14826,6 +15005,8 @@
14826
15005
 
14827
15006
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="insertOpeningElements">
14828
15007
  <xsl:param name="tree"/>
15008
+ <xsl:param name="xmlns"/>
15009
+ <xsl:param name="add_continue">true</xsl:param>
14829
15010
  <xsl:for-each select="$tree//element">
14830
15011
  <xsl:text disable-output-escaping="yes">&lt;</xsl:text>
14831
15012
  <xsl:value-of select="."/>
@@ -14836,7 +15017,8 @@
14836
15017
  <xsl:value-of select="."/>
14837
15018
  <xsl:text>"</xsl:text>
14838
15019
  </xsl:for-each>
14839
- <xsl:if test="position() = 1"> continue="true"</xsl:if>
15020
+ <xsl:if test="position() = 1 and $add_continue = 'true'"> continue="true"</xsl:if>
15021
+ <xsl:if test="position() = 1 and $xmlns != ''"> xmlns="<xsl:value-of select="$xmlns"/>"</xsl:if>
14840
15022
  <xsl:text disable-output-escaping="yes">&gt;</xsl:text>
14841
15023
  <xsl:if test="$debug = 'true'">
14842
15024
  <xsl:message>&lt;<xsl:value-of select="."/>&gt;</xsl:message>
@@ -16148,9 +16330,10 @@
16148
16330
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="insertBackgroundPageImage">
16149
16331
  <xsl:param name="number">1</xsl:param>
16150
16332
  <xsl:param name="name">coverpage-image</xsl:param>
16333
+ <xsl:param name="suffix"/>
16151
16334
  <xsl:variable name="num" select="number($number)"/>
16152
16335
  <!-- background image -->
16153
- <fo:block-container absolute-position="fixed" left="0mm" top="0mm" font-size="0" id="__internal_layout__coverpage_{$name}_{$number}_{generate-id()}">
16336
+ <fo:block-container absolute-position="fixed" left="0mm" top="0mm" font-size="0" id="__internal_layout__coverpage{$suffix}_{$name}_{$number}_{generate-id()}">
16154
16337
  <fo:block>
16155
16338
  <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]">
16156
16339
  <xsl:choose>
@@ -16216,16 +16399,29 @@
16216
16399
 
16217
16400
  <!-- END: insert cover page image -->
16218
16401
 
16402
+ <xsl:variable xmlns:redirect="http://xml.apache.org/xalan/redirect" name="regex_ja_spec">[\uFF08\uFF09]</xsl:variable>
16219
16403
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="insertVerticalChar">
16220
16404
  <xsl:param name="str"/>
16405
+ <xsl:param name="writing-mode">lr-tb</xsl:param>
16406
+ <xsl:param name="reference-orientation">90</xsl:param>
16221
16407
  <xsl:if test="string-length($str) &gt; 0">
16222
- <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">
16408
+ <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">
16409
+ <xsl:if test="normalize-space($writing-mode) != ''">
16410
+ <xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
16411
+ <xsl:attribute name="reference-orientation">90</xsl:attribute>
16412
+ </xsl:if>
16413
+ <xsl:variable name="char" select="substring($str,1,1)"/>
16414
+ <xsl:if test="normalize-space(java:matches(java:java.lang.String.new($char), concat('(', $regex_ja_spec, '{1,})'))) = 'true'">
16415
+ <xsl:attribute name="reference-orientation">0</xsl:attribute>
16416
+ </xsl:if>
16223
16417
  <fo:block-container width="1em">
16224
- <fo:block line-height="1em"><xsl:value-of select="substring($str,1,1)"/></fo:block>
16418
+ <fo:block line-height="1em"><xsl:value-of select="$char"/></fo:block>
16225
16419
  </fo:block-container>
16226
16420
  </fo:inline-container>
16227
16421
  <xsl:call-template name="insertVerticalChar">
16228
16422
  <xsl:with-param name="str" select="substring($str, 2)"/>
16423
+ <xsl:with-param name="writing-mode" select="$writing-mode"/>
16424
+ <xsl:with-param name="reference-orientation" select="$reference-orientation"/>
16229
16425
  </xsl:call-template>
16230
16426
  </xsl:if>
16231
16427
  </xsl:template>