metanorma-cc 2.8.10 → 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.
@@ -991,6 +991,7 @@
991
991
 
992
992
  <!-- Characters -->
993
993
  <xsl:variable name="linebreak">&#8232;</xsl:variable>
994
+ <xsl:variable name="em_space"> </xsl:variable>
994
995
  <xsl:variable name="tab_zh"> </xsl:variable>
995
996
  <xsl:variable name="non_breaking_hyphen">‑</xsl:variable>
996
997
  <xsl:variable name="thin_space"> </xsl:variable>
@@ -1771,7 +1772,7 @@
1771
1772
  </xsl:element>
1772
1773
  </xsl:template> -->
1773
1774
 
1774
- <xsl:template match="mn:span[ @class = 'fmt-caption-label' or @class = 'fmt-element-name' or @class = 'fmt-caption-delim' or @class = 'fmt-autonum-delim']" mode="update_xml_step1" priority="3">
1775
+ <xsl:template match="mn:span[ @class = 'fmt-caption-label' or @class = 'fmt-element-name' or @class = 'fmt-caption-delim' or @class = 'fmt-autonum-delim' or @class = 'fmt-clause-delim']" mode="update_xml_step1" priority="3">
1775
1776
  <xsl:apply-templates mode="update_xml_step1"/>
1776
1777
  </xsl:template>
1777
1778
 
@@ -2803,6 +2804,9 @@
2803
2804
 
2804
2805
  <xsl:template name="refine_sourcecode-style">
2805
2806
  <xsl:call-template name="setKeepAttributes"/>
2807
+ <xsl:if test="ancestor::mn:sourcecode and parent::mn:td">
2808
+ <xsl:attribute name="role">SKIP</xsl:attribute>
2809
+ </xsl:if>
2806
2810
  </xsl:template> <!-- refine_sourcecode-style -->
2807
2811
 
2808
2812
  <xsl:attribute-set name="sourcecode-number-style">
@@ -3129,30 +3133,30 @@
3129
3133
  </xsl:template>
3130
3134
 
3131
3135
  <!-- outer table with line numbers for sourcecode -->
3132
- <xsl:template match="mn:sourcecode[@linenums = 'true']/mn:table" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] | -->
3133
- <fo:block>
3134
- <fo:table width="100%" table-layout="fixed">
3136
+ <xsl:template match="mn:sourcecode[@linenums = 'true']/mn:table" priority="3"> <!-- *[local-name()='table'][@type = 'sourcecode'] | -->
3137
+ <fo:block role="SKIP">
3138
+ <fo:table width="100%" table-layout="fixed" role="SKIP">
3135
3139
  <xsl:copy-of select="@id"/>
3136
3140
  <fo:table-column column-width="8%"/>
3137
3141
  <fo:table-column column-width="92%"/>
3138
- <fo:table-body>
3142
+ <fo:table-body role="SKIP">
3139
3143
  <xsl:apply-templates/>
3140
3144
  </fo:table-body>
3141
3145
  </fo:table>
3142
3146
  </fo:block>
3143
3147
  </xsl:template>
3144
- <xsl:template match="mn:sourcecode[@linenums = 'true']/mn:table/mn:tbody" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody'] | -->
3148
+ <xsl:template match="mn:sourcecode[@linenums = 'true']/mn:table/mn:tbody" priority="3"> <!-- *[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody'] | -->
3145
3149
  <xsl:apply-templates/>
3146
3150
  </xsl:template>
3147
- <xsl:template match="mn:sourcecode[@linenums = 'true']/mn:table//mn:tr" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr'] | -->
3148
- <fo:table-row>
3151
+ <xsl:template match="mn:sourcecode[@linenums = 'true']/mn:table//mn:tr" priority="3"> <!-- *[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr'] | -->
3152
+ <fo:table-row role="SKIP">
3149
3153
  <xsl:apply-templates/>
3150
3154
  </fo:table-row>
3151
3155
  </xsl:template>
3152
3156
  <!-- first td with line numbers -->
3153
- <xsl:template match="mn:sourcecode[@linenums = 'true']/mn:table//mn:tr/*[local-name() = 'td'][not(preceding-sibling::*)]" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] -->
3154
- <fo:table-cell>
3155
- <fo:block>
3157
+ <xsl:template match="mn:sourcecode[@linenums = 'true']/mn:table//mn:tr/*[local-name() = 'td'][not(preceding-sibling::*)]" priority="3"> <!-- *[local-name()='table'][@type = 'sourcecode'] -->
3158
+ <fo:table-cell role="SKIP">
3159
+ <fo:block role="SKIP">
3156
3160
 
3157
3161
  <!-- set attibutes for line numbers - same as sourcecode -->
3158
3162
  <xsl:variable name="sourcecode_attributes">
@@ -3160,7 +3164,7 @@
3160
3164
  <xsl:call-template name="get_sourcecode_attributes"/>
3161
3165
  </xsl:for-each>
3162
3166
  </xsl:variable>
3163
- <xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@*[not(starts-with(local-name(), 'margin-') or starts-with(local-name(), 'space-'))]">
3167
+ <xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@*[not(starts-with(local-name(), 'margin-') or starts-with(local-name(), 'space-') or starts-with(local-name(), 'role'))]">
3164
3168
  <xsl:attribute name="{name()}">
3165
3169
  <xsl:value-of select="."/>
3166
3170
  </xsl:attribute>
@@ -3172,8 +3176,8 @@
3172
3176
  </xsl:template>
3173
3177
 
3174
3178
  <!-- second td with sourcecode -->
3175
- <xsl:template match="mn:sourcecode[@linenums = 'true']/mn:table//mn:tr/*[local-name() = 'td'][preceding-sibling::*]" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] -->
3176
- <fo:table-cell>
3179
+ <xsl:template match="mn:sourcecode[@linenums = 'true']/mn:table//mn:tr/*[local-name() = 'td'][preceding-sibling::*]" priority="3"> <!-- *[local-name()='table'][@type = 'sourcecode'] -->
3180
+ <fo:table-cell role="SKIP">
3177
3181
  <fo:block role="SKIP">
3178
3182
  <xsl:apply-templates/>
3179
3183
  </fo:block>
@@ -3742,7 +3746,7 @@
3742
3746
  <xsl:param name="value"/>
3743
3747
  <xsl:variable name="add_width" select="string-length($value) * 20"/>
3744
3748
  <xsl:variable name="maxwidth" select="60 + $add_width"/>
3745
- <fo:instream-foreign-object fox:alt-text="OpeningTag" baseline-shift="-10%"><!-- alignment-baseline="middle" -->
3749
+ <fo:instream-foreign-object fox:alt-text="OpeningTag" baseline-shift="-10%" fox:placement="Inline"><!-- alignment-baseline="middle" -->
3746
3750
  <xsl:attribute name="height">3.5mm</xsl:attribute> <!-- 5mm -->
3747
3751
  <xsl:attribute name="content-width">100%</xsl:attribute>
3748
3752
  <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
@@ -3971,11 +3975,12 @@
3971
3975
  <xsl:choose>
3972
3976
 
3973
3977
  <xsl:when test="ancestor::mn:sourcecode[@linenums = 'true'] and ancestor::*[local-name() = 'td'][1][not(preceding-sibling::*)]"> <!-- pre in the first td in the table with @linenums = 'true' -->
3978
+ <xsl:attribute name="role">SKIP</xsl:attribute>
3974
3979
  <xsl:if test="ancestor::mn:tr[1]/following-sibling::mn:tr"> <!-- is current tr isn't last -->
3975
3980
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
3976
3981
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
3977
3982
  </xsl:if>
3978
- <fo:instream-foreign-object fox:alt-text="{.}" content-width="95%">
3983
+ <fo:instream-foreign-object fox:alt-text="{.}" content-width="95%" fox:placement="Inline" role="artifact">
3979
3984
  <math xmlns="http://www.w3.org/1998/Math/MathML">
3980
3985
  <mtext><xsl:value-of select="."/></mtext>
3981
3986
  </math>
@@ -4352,7 +4357,15 @@
4352
4357
  <!-- END requirement, recommendation, permission table -->
4353
4358
  <!-- ========== -->
4354
4359
 
4360
+ <xsl:attribute-set name="terms-style">
4361
+ <xsl:attribute name="role">Sect</xsl:attribute>
4362
+ </xsl:attribute-set>
4363
+
4364
+ <xsl:template name="refine_terms-style">
4365
+ </xsl:template>
4366
+
4355
4367
  <xsl:attribute-set name="term-style">
4368
+ <xsl:attribute name="role">Sect</xsl:attribute>
4356
4369
  </xsl:attribute-set> <!-- term-style -->
4357
4370
 
4358
4371
  <xsl:template name="refine_term-style">
@@ -4448,7 +4461,10 @@
4448
4461
  <xsl:template match="mn:terms">
4449
4462
  <!-- <xsl:message>'terms' <xsl:number/> processing...</xsl:message> -->
4450
4463
  <xsl:call-template name="setNamedDestination"/>
4451
- <fo:block id="{@id}">
4464
+ <fo:block id="{@id}" xsl:use-attribute-sets="terms-style">
4465
+ <xsl:call-template name="refine_terms-style"/>
4466
+ <xsl:call-template name="addTagElementT"/>
4467
+
4452
4468
  <xsl:apply-templates/>
4453
4469
  </fo:block>
4454
4470
  </xsl:template>
@@ -4457,6 +4473,7 @@
4457
4473
  <xsl:call-template name="setNamedDestination"/>
4458
4474
  <fo:block id="{@id}" xsl:use-attribute-sets="term-style">
4459
4475
  <xsl:call-template name="refine_term-style"/>
4476
+ <xsl:call-template name="addTagElementT"/>
4460
4477
 
4461
4478
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
4462
4479
  </fo:block>
@@ -4692,7 +4709,9 @@
4692
4709
 
4693
4710
  <xsl:template match="mn:definitions">
4694
4711
  <xsl:call-template name="setNamedDestination"/>
4695
- <fo:block id="{@id}">
4712
+ <fo:block id="{@id}" role="Sect">
4713
+ <xsl:call-template name="addTagElementT"/>
4714
+
4696
4715
  <xsl:apply-templates/>
4697
4716
  </fo:block>
4698
4717
  </xsl:template>
@@ -4769,6 +4788,7 @@
4769
4788
  <xsl:template match="mn:termexample/mn:p">
4770
4789
  <xsl:variable name="element">inline
4771
4790
 
4791
+ <xsl:value-of select="$example_display_in"/>
4772
4792
  </xsl:variable>
4773
4793
  <xsl:choose>
4774
4794
  <xsl:when test="contains($element, 'block')">
@@ -5144,6 +5164,9 @@
5144
5164
  </xsl:attribute-set><!-- table-note-style -->
5145
5165
 
5146
5166
  <xsl:template name="refine_table-note-style">
5167
+ <xsl:if test="self::mn:note">
5168
+ <xsl:attribute name="role">Note</xsl:attribute>
5169
+ </xsl:if>
5147
5170
  </xsl:template> <!-- refine_table-note-style -->
5148
5171
 
5149
5172
  <xsl:attribute-set name="table-fn-style">
@@ -5496,19 +5519,22 @@
5496
5519
  <xsl:if test="normalize-space() != ''">
5497
5520
 
5498
5521
  <fo:block xsl:use-attribute-sets="table-name-style">
5499
-
5500
5522
  <xsl:call-template name="refine_table-name-style">
5501
5523
  <xsl:with-param name="continued" select="$continued"/>
5502
5524
  </xsl:call-template>
5503
5525
 
5504
- <xsl:choose>
5505
- <xsl:when test="$continued = 'true'">
5506
- </xsl:when>
5507
- <xsl:otherwise>
5508
- <xsl:apply-templates/>
5509
- </xsl:otherwise>
5510
- </xsl:choose>
5526
+ <!-- <Caption><P> tags, see https://github.com/metanorma/metanorma-pdfa/issues/81 -->
5527
+ <fo:block role="P">
5528
+
5529
+ <xsl:choose>
5530
+ <xsl:when test="$continued = 'true'">
5531
+ </xsl:when>
5532
+ <xsl:otherwise>
5533
+ <xsl:apply-templates/>
5534
+ </xsl:otherwise>
5535
+ </xsl:choose>
5511
5536
 
5537
+ </fo:block>
5512
5538
  </fo:block>
5513
5539
 
5514
5540
  <!-- <xsl:if test="$namespace = 'bsi' or $namespace = 'pas' or $namespace = 'iec' or $namespace = 'iso'"> -->
@@ -5992,7 +6018,7 @@
5992
6018
 
5993
6019
  <xsl:variable name="tableWithNotesAndFootnotes">
5994
6020
 
5995
- <fo:table keep-with-previous="always" role="SKIP">
6021
+ <fo:table keep-with-previous="always" role="TFoot">
5996
6022
  <xsl:for-each select="xalan:nodeset($table_attributes)/table_attributes/@*">
5997
6023
  <xsl:variable name="name" select="local-name()"/>
5998
6024
  <xsl:choose>
@@ -6030,14 +6056,14 @@
6030
6056
  </xsl:choose>
6031
6057
 
6032
6058
  <fo:table-body role="SKIP">
6033
- <fo:table-row role="SKIP">
6059
+ <fo:table-row>
6034
6060
  <xsl:for-each select="ancestor::mn:table[1]">
6035
6061
  <xsl:call-template name="setTableStyles">
6036
6062
  <xsl:with-param name="scope">ancestor_table</xsl:with-param>
6037
6063
  </xsl:call-template>
6038
6064
  </xsl:for-each>
6039
6065
 
6040
- <fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}" role="SKIP">
6066
+ <fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}">
6041
6067
 
6042
6068
  <xsl:call-template name="refine_table-footer-cell-style"/>
6043
6069
 
@@ -6445,7 +6471,7 @@
6445
6471
  </xsl:template> <!-- table/note -->
6446
6472
 
6447
6473
  <xsl:template match="mn:table/*[self::mn:note or self::mn:example]/mn:p | mn:table/mn:tfoot//*[self::mn:note or self::mn:example]/mn:p" priority="2">
6448
- <xsl:apply-templates/>
6474
+ <fo:inline role="P"><xsl:apply-templates/></fo:inline>
6449
6475
  </xsl:template>
6450
6476
 
6451
6477
  <!-- ============================ -->
@@ -7374,6 +7400,7 @@
7374
7400
  <!-- ========================== -->
7375
7401
 
7376
7402
  <xsl:attribute-set name="dl-block-style">
7403
+ <xsl:attribute name="role">SKIP</xsl:attribute>
7377
7404
  </xsl:attribute-set>
7378
7405
 
7379
7406
  <xsl:template name="refine_dl-block-style">
@@ -7383,18 +7410,21 @@
7383
7410
  </xsl:template>
7384
7411
 
7385
7412
  <xsl:attribute-set name="dt-row-style">
7413
+ <xsl:attribute name="role">LI</xsl:attribute>
7386
7414
  </xsl:attribute-set>
7387
7415
 
7388
7416
  <xsl:template name="refine_dt-row-style">
7389
7417
  </xsl:template>
7390
7418
 
7391
7419
  <xsl:attribute-set name="dt-cell-style">
7420
+ <xsl:attribute name="role">Lbl</xsl:attribute>
7392
7421
  </xsl:attribute-set>
7393
7422
 
7394
7423
  <xsl:template name="refine_dt-cell-style">
7395
7424
  </xsl:template> <!-- refine_dt-cell-style -->
7396
7425
 
7397
7426
  <xsl:attribute-set name="dt-block-style">
7427
+ <xsl:attribute name="role">SKIP</xsl:attribute>
7398
7428
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
7399
7429
  <xsl:attribute name="margin-left">7mm</xsl:attribute>
7400
7430
  </xsl:attribute-set>
@@ -7412,6 +7442,7 @@
7412
7442
  </xsl:template>
7413
7443
 
7414
7444
  <xsl:attribute-set name="dd-cell-style">
7445
+ <xsl:attribute name="role">LBody</xsl:attribute>
7415
7446
  <xsl:attribute name="padding-left">2mm</xsl:attribute>
7416
7447
  </xsl:attribute-set>
7417
7448
 
@@ -7447,7 +7478,7 @@
7447
7478
  <xsl:variable name="isAdded" select="@added"/>
7448
7479
  <xsl:variable name="isDeleted" select="@deleted"/>
7449
7480
  <!-- <dl><xsl:copy-of select="."/></dl> -->
7450
- <fo:block-container xsl:use-attribute-sets="dl-block-style" role="SKIP">
7481
+ <fo:block-container xsl:use-attribute-sets="dl-block-style">
7451
7482
 
7452
7483
  <xsl:call-template name="refine_dl-block-style"/>
7453
7484
 
@@ -7567,7 +7598,7 @@
7567
7598
  <fo:block id="{concat('table_if_start_',@id)}" keep-with-next="always" font-size="1pt">Start table '<xsl:value-of select="@id"/>'.</fo:block>
7568
7599
  </xsl:if>
7569
7600
 
7570
- <fo:table width="95%" table-layout="fixed">
7601
+ <fo:table width="95%" table-layout="fixed" role="L">
7571
7602
 
7572
7603
  <xsl:if test="$isGenerateTableIF = 'true'">
7573
7604
  <xsl:attribute name="wrap-option">no-wrap</xsl:attribute>
@@ -7635,7 +7666,7 @@
7635
7666
  <xsl:with-param name="table_or_dl">dl</xsl:with-param>
7636
7667
  </xsl:apply-templates>
7637
7668
 
7638
- </xsl:when>
7669
+ </xsl:when> <!-- $isGenerateTableIF = 'true' -->
7639
7670
  <xsl:otherwise>
7640
7671
 
7641
7672
  <xsl:variable name="simple-table">
@@ -7690,7 +7721,7 @@
7690
7721
  <xsl:with-param name="isContainsKeepTogetherTag" select="$isContainsKeepTogetherTag"/>
7691
7722
  </xsl:call-template>
7692
7723
 
7693
- <fo:table-body>
7724
+ <fo:table-body role="SKIP">
7694
7725
 
7695
7726
  <!-- DEBUG -->
7696
7727
  <xsl:if test="$table_if_debug = 'true'">
@@ -7899,8 +7930,8 @@
7899
7930
  <td number-columns-spanned="2">NOTE <xsl:apply-templates /> </td>
7900
7931
  </tr>
7901
7932
  -->
7902
- <fo:table-row>
7903
- <fo:table-cell number-columns-spanned="2">
7933
+ <fo:table-row role="SKIP">
7934
+ <fo:table-cell number-columns-spanned="2" role="SKIP">
7904
7935
  <fo:block role="SKIP">
7905
7936
  <xsl:call-template name="note"/>
7906
7937
  </fo:block>
@@ -7964,7 +7995,7 @@
7964
7995
  <xsl:call-template name="refine_dt-cell-style"/>
7965
7996
 
7966
7997
  <xsl:call-template name="setNamedDestination"/>
7967
- <fo:block xsl:use-attribute-sets="dt-block-style" role="SKIP">
7998
+ <fo:block xsl:use-attribute-sets="dt-block-style">
7968
7999
 
7969
8000
  <xsl:choose>
7970
8001
  <xsl:when test="$isGenerateTableIF = 'true'">
@@ -8053,7 +8084,7 @@
8053
8084
  </xsl:variable>
8054
8085
  <xsl:choose>
8055
8086
  <xsl:when test="$is_inline_element_after_where = 'true'">
8056
- <fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
8087
+ <fo:inline role="SKIP"><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
8057
8088
  </xsl:when>
8058
8089
  <xsl:otherwise>
8059
8090
  <xsl:apply-templates select="."/>
@@ -8341,6 +8372,7 @@
8341
8372
  <!-- ====== -->
8342
8373
 
8343
8374
  <xsl:attribute-set name="note-style">
8375
+ <xsl:attribute name="role">Note</xsl:attribute>
8344
8376
  <xsl:attribute name="font-size">10pt</xsl:attribute>
8345
8377
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
8346
8378
  </xsl:attribute-set> <!-- note-style -->
@@ -8348,10 +8380,18 @@
8348
8380
  <xsl:template name="refine_note-style">
8349
8381
  </xsl:template> <!-- refine_note-style -->
8350
8382
 
8383
+ <xsl:attribute-set name="note-block-style">
8384
+ <xsl:attribute name="role">SKIP</xsl:attribute>
8385
+ </xsl:attribute-set> <!-- note-block-style -->
8386
+
8387
+ <xsl:template name="refine_note-block-style">
8388
+ </xsl:template> <!-- refine_note-block-style -->
8389
+
8351
8390
  <xsl:variable name="note-body-indent">10mm</xsl:variable>
8352
8391
  <xsl:variable name="note-body-indent-table">5mm</xsl:variable>
8353
8392
 
8354
8393
  <xsl:attribute-set name="note-name-style">
8394
+ <xsl:attribute name="role">Lbl</xsl:attribute>
8355
8395
  <xsl:attribute name="padding-right">6mm</xsl:attribute>
8356
8396
  </xsl:attribute-set> <!-- note-name-style -->
8357
8397
 
@@ -8363,9 +8403,13 @@
8363
8403
  </xsl:attribute-set>
8364
8404
 
8365
8405
  <xsl:template name="refine_table-note-name-style">
8406
+ <xsl:if test="self::mn:note">
8407
+ <xsl:attribute name="role">Lbl</xsl:attribute>
8408
+ </xsl:if>
8366
8409
  </xsl:template> <!-- refine_table-note-name-style -->
8367
8410
 
8368
8411
  <xsl:attribute-set name="note-p-style">
8412
+ <xsl:attribute name="role">P</xsl:attribute>
8369
8413
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
8370
8414
  </xsl:attribute-set> <!-- note-p-style -->
8371
8415
 
@@ -8373,6 +8417,7 @@
8373
8417
  </xsl:template>
8374
8418
 
8375
8419
  <xsl:attribute-set name="termnote-style">
8420
+ <xsl:attribute name="role">Note</xsl:attribute>
8376
8421
  <xsl:attribute name="font-size">10pt</xsl:attribute>
8377
8422
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
8378
8423
  </xsl:attribute-set> <!-- termnote-style -->
@@ -8381,12 +8426,14 @@
8381
8426
  </xsl:template> <!-- refine_termnote-style -->
8382
8427
 
8383
8428
  <xsl:attribute-set name="termnote-name-style">
8429
+ <xsl:attribute name="role">Lbl</xsl:attribute>
8384
8430
  </xsl:attribute-set> <!-- termnote-name-style -->
8385
8431
 
8386
8432
  <xsl:template name="refine_termnote-name-style">
8387
8433
  </xsl:template>
8388
8434
 
8389
8435
  <xsl:attribute-set name="termnote-p-style">
8436
+ <xsl:attribute name="role">P</xsl:attribute>
8390
8437
  </xsl:attribute-set>
8391
8438
 
8392
8439
  <xsl:template name="refine_termnote-p-style">
@@ -8401,7 +8448,7 @@
8401
8448
 
8402
8449
  <xsl:call-template name="setNamedDestination"/>
8403
8450
 
8404
- <fo:block-container xsl:use-attribute-sets="note-style" role="SKIP">
8451
+ <fo:block-container xsl:use-attribute-sets="note-style">
8405
8452
  <xsl:if test="not(parent::mn:references)">
8406
8453
  <xsl:copy-of select="@id"/>
8407
8454
  </xsl:if>
@@ -8411,11 +8458,11 @@
8411
8458
  <xsl:call-template name="refine_note-style"/>
8412
8459
 
8413
8460
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
8414
- <fo:block>
8461
+ <fo:block xsl:use-attribute-sets="note-block-style">
8415
8462
 
8416
- <xsl:call-template name="refine_note_block_style"/>
8463
+ <xsl:call-template name="refine_note-block-style"/>
8417
8464
 
8418
- <fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
8465
+ <fo:inline xsl:use-attribute-sets="note-name-style">
8419
8466
 
8420
8467
  <xsl:apply-templates select="mn:fmt-name/mn:tab" mode="tab"/>
8421
8468
 
@@ -8438,26 +8485,31 @@
8438
8485
 
8439
8486
  </fo:inline>
8440
8487
 
8441
- <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
8488
+ <xsl:choose>
8489
+ <xsl:when test="parent::mn:formattedref and ancestor::mn:bibitem">
8490
+ <fo:inline role="P"><xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/></fo:inline>
8491
+ </xsl:when>
8492
+ <xsl:otherwise>
8493
+ <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
8494
+ </xsl:otherwise>
8495
+ </xsl:choose>
8496
+
8442
8497
  </fo:block>
8443
8498
  </fo:block-container>
8444
8499
  </fo:block-container>
8445
8500
  </xsl:template>
8446
8501
 
8447
- <xsl:template name="refine_note_block_style">
8448
- </xsl:template> <!-- refine_note_block_style -->
8449
-
8450
8502
  <xsl:template match="mn:note/mn:p">
8451
8503
  <xsl:variable name="num"><xsl:number/></xsl:variable>
8452
8504
  <xsl:choose>
8453
8505
  <xsl:when test="$num = 1"> <!-- display first NOTE's paragraph in the same line with label NOTE -->
8454
- <fo:inline xsl:use-attribute-sets="note-p-style" role="SKIP">
8506
+ <fo:inline xsl:use-attribute-sets="note-p-style">
8455
8507
  <xsl:call-template name="refine_note-p-style"/>
8456
8508
  <xsl:apply-templates/>
8457
8509
  </fo:inline>
8458
8510
  </xsl:when>
8459
8511
  <xsl:otherwise>
8460
- <fo:block xsl:use-attribute-sets="note-p-style" role="SKIP">
8512
+ <fo:block xsl:use-attribute-sets="note-p-style">
8461
8513
  <xsl:call-template name="refine_note-p-style"/>
8462
8514
  <xsl:apply-templates/>
8463
8515
  </fo:block>
@@ -8567,9 +8619,9 @@
8567
8619
  <!-- ====== -->
8568
8620
 
8569
8621
  <xsl:attribute-set name="quote-container-style">
8622
+ <xsl:attribute name="role">BlockQuote</xsl:attribute>
8570
8623
  <xsl:attribute name="margin-left">12mm</xsl:attribute>
8571
8624
  <xsl:attribute name="margin-right">12mm</xsl:attribute>
8572
- <xsl:attribute name="role">SKIP</xsl:attribute>
8573
8625
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
8574
8626
  </xsl:attribute-set>
8575
8627
 
@@ -8592,6 +8644,7 @@
8592
8644
  </xsl:template> <!-- refine_quote-style -->
8593
8645
 
8594
8646
  <xsl:attribute-set name="quote-source-style">
8647
+ <xsl:attribute name="role">Caption</xsl:attribute>
8595
8648
  <xsl:attribute name="text-align">right</xsl:attribute>
8596
8649
  <xsl:attribute name="margin-right">-12mm</xsl:attribute>
8597
8650
  </xsl:attribute-set> <!-- quote-source-style -->
@@ -8624,7 +8677,7 @@
8624
8677
  <xsl:call-template name="refine_quote-style"/>
8625
8678
 
8626
8679
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
8627
- <fo:block role="BlockQuote">
8680
+ <fo:block role="SKIP"> <!-- BlockQuote -->
8628
8681
  <xsl:apply-templates select="./node()[not(self::mn:author) and not(self::mn:fmt-source) and not(self::mn:attribution)]"/> <!-- process all nested nodes, except author and source -->
8629
8682
  </fo:block>
8630
8683
  </fo:block-container>
@@ -8633,11 +8686,15 @@
8633
8686
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
8634
8687
  <fo:block xsl:use-attribute-sets="quote-source-style">
8635
8688
  <xsl:call-template name="refine_quote-source-style"/>
8636
- <!-- — ISO, ISO 7301:2011, Clause 1 -->
8637
- <xsl:apply-templates select="mn:author"/>
8638
- <xsl:apply-templates select="mn:fmt-source"/>
8639
- <!-- added for https://github.com/metanorma/isodoc/issues/607 -->
8640
- <xsl:apply-templates select="mn:attribution/mn:p/node()"/>
8689
+
8690
+ <!-- <Caption><P> tags, see https://github.com/metanorma/metanorma-pdfa/issues/81 -->
8691
+ <fo:block role="P">
8692
+ <!-- — ISO, ISO 7301:2011, Clause 1 -->
8693
+ <xsl:apply-templates select="mn:author"/>
8694
+ <xsl:apply-templates select="mn:fmt-source"/>
8695
+ <!-- added for https://github.com/metanorma/isodoc/issues/607 -->
8696
+ <xsl:apply-templates select="mn:attribution/mn:p/node()"/>
8697
+ </fo:block>
8641
8698
  </fo:block>
8642
8699
  </fo:block-container>
8643
8700
  </xsl:if>
@@ -9103,7 +9160,8 @@
9103
9160
 
9104
9161
  <!-- debug scale='<xsl:value-of select="$scale"/>', indent='<xsl:value-of select="$indent"/>' -->
9105
9162
 
9106
- <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" vertical-align="middle">
9163
+ <fo:external-graphic src="{$src}" vertical-align="middle" fox:placement="Inline">
9164
+ <xsl:call-template name="addAltText"/>
9107
9165
 
9108
9166
  <xsl:if test="parent::mn:logo"> <!-- publisher's logo -->
9109
9167
  <xsl:attribute name="scaling">uniform</xsl:attribute>
@@ -9167,11 +9225,12 @@
9167
9225
  <xsl:choose>
9168
9226
  <xsl:when test="$isDeleted = 'true'">
9169
9227
  <!-- enclose in svg -->
9170
- <fo:instream-foreign-object fox:alt-text="Image {@alt}">
9228
+ <fo:instream-foreign-object fox:placement="Block">
9171
9229
  <xsl:attribute name="width">100%</xsl:attribute>
9172
9230
  <xsl:attribute name="content-height">100%</xsl:attribute>
9173
9231
  <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
9174
9232
  <xsl:attribute name="scaling">uniform</xsl:attribute>
9233
+ <xsl:call-template name="addAltText"/>
9175
9234
 
9176
9235
  <xsl:apply-templates select="." mode="cross_image"/>
9177
9236
 
@@ -9187,7 +9246,8 @@
9187
9246
  <xsl:value-of select="concat('scale=', $scale,', indent=', $indent)"/>
9188
9247
  </fo:block> -->
9189
9248
 
9190
- <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}">
9249
+ <fo:external-graphic src="{$src}" fox:placement="Block">
9250
+ <xsl:call-template name="addAltText"/>
9191
9251
 
9192
9252
  <xsl:choose>
9193
9253
  <!-- default -->
@@ -9247,6 +9307,25 @@
9247
9307
  </xsl:choose>
9248
9308
  </xsl:template>
9249
9309
 
9310
+ <xsl:template name="addAltText">
9311
+ <xsl:param name="name">Image</xsl:param>
9312
+ <xsl:variable name="alt-text">
9313
+ <xsl:choose>
9314
+ <xsl:when test="self::mn:image and normalize-space(@alt) != ''">
9315
+ <xsl:value-of select="@alt"/>
9316
+ </xsl:when>
9317
+ <xsl:when test="normalize-space(../@alt) != ''">
9318
+ <xsl:value-of select="../@alt"/>
9319
+ </xsl:when>
9320
+ <xsl:when test="normalize-space(../mn:fmt-name) != ''">
9321
+ <xsl:value-of select="../mn:fmt-name"/>
9322
+ </xsl:when>
9323
+ <xsl:otherwise><xsl:value-of select="$name"/></xsl:otherwise>
9324
+ </xsl:choose>
9325
+ </xsl:variable>
9326
+ <xsl:attribute name="fox:alt-text"><xsl:value-of select="$alt-text"/></xsl:attribute>
9327
+ </xsl:template>
9328
+
9250
9329
  <xsl:template name="setImageWidth">
9251
9330
  <xsl:if test="@width != '' and @width != 'auto' and @width != 'text-width' and @width != 'full-page-width' and @width != 'narrow'">
9252
9331
  <xsl:value-of select="@width"/>
@@ -9435,6 +9514,9 @@
9435
9514
 
9436
9515
  <xsl:variable name="alt-text">
9437
9516
  <xsl:choose>
9517
+ <xsl:when test="normalize-space(../@alt) != ''">
9518
+ <xsl:value-of select="../@alt"/>
9519
+ </xsl:when>
9438
9520
  <xsl:when test="normalize-space(../mn:fmt-name) != ''">
9439
9521
  <xsl:value-of select="../mn:fmt-name"/>
9440
9522
  </xsl:when>
@@ -9503,7 +9585,7 @@
9503
9585
  </xsl:if>
9504
9586
  <fo:block text-depth="0" line-height="0" font-size="0">
9505
9587
 
9506
- <fo:instream-foreign-object fox:alt-text="{$alt-text}">
9588
+ <fo:instream-foreign-object fox:alt-text="{$alt-text}" fox:placement="Block">
9507
9589
  <xsl:attribute name="width">100%</xsl:attribute>
9508
9590
  <xsl:attribute name="content-height">100%</xsl:attribute>
9509
9591
  <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
@@ -9552,7 +9634,7 @@
9552
9634
  <xsl:copy>
9553
9635
  <xsl:copy-of select="@*"/>
9554
9636
  <!-- <fo:block xsl:use-attribute-sets="image-style"> -->
9555
- <fo:instream-foreign-object fox:alt-text="{$alt-text}">
9637
+ <fo:instream-foreign-object fox:alt-text="{$alt-text}" fox:placement="Block">
9556
9638
 
9557
9639
  <xsl:choose>
9558
9640
  <xsl:when test="$image_class = 'corrigenda-tag'">
@@ -9617,6 +9699,10 @@
9617
9699
  <xsl:attribute name="content-height"><xsl:value-of select="round($scale_x * $scale_y * 100)"/>%</xsl:attribute>
9618
9700
  </xsl:if>
9619
9701
 
9702
+ <xsl:if test="self::fo:inline">
9703
+ <xsl:attribute name="fox:placement">Inline</xsl:attribute>
9704
+ </xsl:if>
9705
+
9620
9706
  <xsl:copy-of select="$svg_content"/>
9621
9707
 
9622
9708
  <!-- <debug>
@@ -9892,10 +9978,12 @@
9892
9978
  <xsl:template match="mn:figure/mn:fmt-name | mn:image/mn:fmt-name">
9893
9979
  <xsl:if test="normalize-space() != ''">
9894
9980
  <fo:block xsl:use-attribute-sets="figure-name-style">
9895
-
9896
9981
  <xsl:call-template name="refine_figure-name-style"/>
9897
9982
 
9898
- <xsl:apply-templates/>
9983
+ <!-- <Caption><P> tags, see https://github.com/metanorma/metanorma-pdfa/issues/81 -->
9984
+ <fo:block role="P">
9985
+ <xsl:apply-templates/>
9986
+ </fo:block>
9899
9987
  </fo:block>
9900
9988
  </xsl:if>
9901
9989
  </xsl:template>
@@ -9917,6 +10005,7 @@
9917
10005
 
9918
10006
  <!-- Formula's styles -->
9919
10007
  <xsl:attribute-set name="formula-style">
10008
+ <xsl:attribute name="role">P</xsl:attribute>
9920
10009
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
9921
10010
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
9922
10011
  </xsl:attribute-set> <!-- formula-style -->
@@ -9925,6 +10014,7 @@
9925
10014
  </xsl:template>
9926
10015
 
9927
10016
  <xsl:attribute-set name="formula-stem-block-style">
10017
+ <xsl:attribute name="role">SKIP</xsl:attribute>
9928
10018
  <xsl:attribute name="text-align">center</xsl:attribute>
9929
10019
  <xsl:attribute name="text-align">left</xsl:attribute>
9930
10020
  <xsl:attribute name="margin-left">5mm</xsl:attribute>
@@ -9934,6 +10024,7 @@
9934
10024
  </xsl:template> <!-- refine_formula-stem-block-style -->
9935
10025
 
9936
10026
  <xsl:attribute-set name="formula-stem-number-style">
10027
+ <xsl:attribute name="role">Span</xsl:attribute>
9937
10028
  <xsl:attribute name="text-align">right</xsl:attribute>
9938
10029
  </xsl:attribute-set> <!-- formula-stem-number-style -->
9939
10030
  <!-- End Formula's styles -->
@@ -9942,12 +10033,25 @@
9942
10033
  </xsl:template>
9943
10034
 
9944
10035
  <xsl:attribute-set name="mathml-style">
10036
+ <xsl:attribute name="role">Formula</xsl:attribute>
9945
10037
  <xsl:attribute name="font-family">STIX Two Math</xsl:attribute>
9946
10038
  </xsl:attribute-set>
9947
10039
 
9948
10040
  <xsl:template name="refine_mathml-style">
9949
10041
  </xsl:template>
9950
10042
 
10043
+ <xsl:attribute-set name="mathml-instream-foreign-object-style">
10044
+ <xsl:attribute name="fox:alt-text">Math</xsl:attribute>
10045
+ <xsl:attribute name="fox:actual-text">Math</xsl:attribute>
10046
+ <xsl:attribute name="fox:placement">Inline</xsl:attribute>
10047
+ </xsl:attribute-set> <!-- mathml-instream-foreign-object-style -->
10048
+
10049
+ <xsl:template name="refine_mathml-instream-foreign-object-style">
10050
+ <xsl:if test="ancestor::mn:formula">
10051
+ <xsl:attribute name="fox:placement">Block</xsl:attribute>
10052
+ </xsl:if>
10053
+ </xsl:template> <!-- refine_mathml-instream-foreign-object-style -->
10054
+
9951
10055
  <!-- ====== -->
9952
10056
  <!-- formula -->
9953
10057
  <!-- ====== -->
@@ -9963,7 +10067,7 @@
9963
10067
  </xsl:if>
9964
10068
  <fo:block-container margin-left="0mm" role="SKIP">
9965
10069
  <xsl:call-template name="setNamedDestination"/>
9966
- <fo:block id="{@id}">
10070
+ <fo:block id="{@id}" role="SKIP">
9967
10071
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/> <!-- formula's number will be process in 'stem' template -->
9968
10072
  </fo:block>
9969
10073
  </fo:block-container>
@@ -9996,22 +10100,22 @@
9996
10100
 
9997
10101
  <xsl:call-template name="refine_formula-style"/>
9998
10102
 
9999
- <fo:table table-layout="fixed" width="100%">
10103
+ <fo:table table-layout="fixed" width="100%" role="SKIP">
10000
10104
  <fo:table-column column-width="95%"/>
10001
10105
  <fo:table-column column-width="5%"/>
10002
- <fo:table-body>
10003
- <fo:table-row>
10004
- <fo:table-cell display-align="center">
10005
- <fo:block xsl:use-attribute-sets="formula-stem-block-style" role="SKIP">
10106
+ <fo:table-body role="SKIP">
10107
+ <fo:table-row role="SKIP">
10108
+ <fo:table-cell display-align="center" role="SKIP">
10109
+ <fo:block xsl:use-attribute-sets="formula-stem-block-style">
10006
10110
 
10007
10111
  <xsl:call-template name="refine_formula-stem-block-style"/>
10008
10112
 
10009
10113
  <xsl:apply-templates/>
10010
10114
  </fo:block>
10011
10115
  </fo:table-cell>
10012
- <fo:table-cell display-align="center">
10116
+ <fo:table-cell display-align="center" role="SKIP">
10013
10117
 
10014
- <fo:block xsl:use-attribute-sets="formula-stem-number-style" role="SKIP">
10118
+ <fo:block xsl:use-attribute-sets="formula-stem-number-style">
10015
10119
 
10016
10120
  <xsl:for-each select="../mn:fmt-name">
10017
10121
  <xsl:call-template name="setIDforNamedDestination"/>
@@ -10159,9 +10263,9 @@
10159
10263
  <xsl:apply-templates select="." mode="mathml"/>
10160
10264
  </xsl:variable>
10161
10265
 
10162
- <fo:instream-foreign-object fox:alt-text="Math" fox:actual-text="Math">
10266
+ <fo:instream-foreign-object xsl:use-attribute-sets="mathml-instream-foreign-object-style">
10163
10267
 
10164
- <xsl:call-template name="refine_mathml_insteam_object_style"/>
10268
+ <xsl:call-template name="refine_mathml-instream-foreign-object-style"/>
10165
10269
 
10166
10270
  <xsl:if test="$isGenerateTableIF = 'false'">
10167
10271
  <!-- put MathML in Actual Text -->
@@ -10185,9 +10289,6 @@
10185
10289
  </fo:instream-foreign-object>
10186
10290
  </xsl:template>
10187
10291
 
10188
- <xsl:template name="refine_mathml_insteam_object_style">
10189
- </xsl:template> <!-- refine_mathml_insteam_object_style -->
10190
-
10191
10292
  <xsl:template match="mathml:*" mode="mathml_actual_text">
10192
10293
  <!-- <xsl:text>a+b</xsl:text> -->
10193
10294
  <xsl:text>&lt;</xsl:text>
@@ -11027,6 +11128,7 @@
11027
11128
 
11028
11129
  <!-- admonition -->
11029
11130
  <xsl:attribute-set name="admonition-style">
11131
+ <xsl:attribute name="role">Note</xsl:attribute>
11030
11132
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
11031
11133
  <xsl:attribute name="font-weight">bold</xsl:attribute>
11032
11134
  </xsl:attribute-set> <!-- admonition-style -->
@@ -11035,6 +11137,7 @@
11035
11137
  </xsl:template>
11036
11138
 
11037
11139
  <xsl:attribute-set name="admonition-container-style">
11140
+ <xsl:attribute name="role">SKIP</xsl:attribute>
11038
11141
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
11039
11142
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
11040
11143
  </xsl:attribute-set> <!-- admonition-container-style -->
@@ -11043,6 +11146,7 @@
11043
11146
  </xsl:template>
11044
11147
 
11045
11148
  <xsl:attribute-set name="admonition-name-style">
11149
+ <xsl:attribute name="role">Lbl</xsl:attribute>
11046
11150
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
11047
11151
  </xsl:attribute-set> <!-- admonition-name-style -->
11048
11152
 
@@ -11300,8 +11404,10 @@
11300
11404
 
11301
11405
  </xsl:template> <!-- references[not(@normative='true')]/bibitem -->
11302
11406
 
11407
+ <!-- commented 2026-08-06: from https://github.com/metanorma/metanorma-standoc/issues/1140:
11408
+ Presentation XML will no longer contain notes following bibitem, those notes will have been moved in Presentation XML to inside bibitem, and then duplicated to inside formattedref. -->
11303
11409
  <!-- bibitem's notes will be processing in 'processBibitemFollowingNotes' -->
11304
- <xsl:template match="mn:references/mn:note" priority="2"/> <!-- [not(@normative='true')] -->
11410
+ <!-- <xsl:template match="mn:references/mn:note" priority="2"/>--> <!-- [not(@normative='true')] -->
11305
11411
 
11306
11412
  <xsl:template name="insertListItem_Bibitem">
11307
11413
  <xsl:choose>
@@ -11904,9 +12010,9 @@
11904
12010
  <xsl:template name="fo_inline_bookmark">
11905
12011
  <xsl:param name="bookmark_id"/>
11906
12012
  <!-- <fo:inline id="{@id}" font-size="1pt"/> -->
11907
- <fo:inline id="{@id}" font-size="1pt"><xsl:if test="preceding-sibling::node()[self::mn:fmt-annotation-start][@source = $bookmark_id] and following-sibling::node()[self::mn:fmt-annotation-end][@source = $bookmark_id]"><xsl:attribute name="line-height">0.1</xsl:attribute></xsl:if><xsl:value-of select="$hair_space"/></fo:inline>
12013
+ <fo:inline id="{@id}" font-size="1pt" role="SKIP"><xsl:if test="preceding-sibling::node()[self::mn:fmt-annotation-start][@source = $bookmark_id] and following-sibling::node()[self::mn:fmt-annotation-end][@source = $bookmark_id]"><xsl:attribute name="line-height">0.1</xsl:attribute></xsl:if><fo:wrapper role="artifact"><xsl:value-of select="$hair_space"/></fo:wrapper></fo:inline>
11908
12014
  <!-- we need to add zero-width space, otherwise this fo:inline is missing in IF xml -->
11909
- <xsl:if test="not(following-sibling::node()[normalize-space() != ''])"><fo:inline font-size="1pt"> </fo:inline></xsl:if>
12015
+ <xsl:if test="not(following-sibling::node()[normalize-space() != ''])"><fo:inline font-size="1pt" role="SKIP"><fo:wrapper role="artifact"> </fo:wrapper></fo:inline></xsl:if>
11910
12016
  </xsl:template>
11911
12017
  <!-- =================== -->
11912
12018
  <!-- End of Index processing -->
@@ -12000,7 +12106,7 @@
12000
12106
  <xsl:call-template name="set_id_metanorma_form_item">
12001
12107
  <xsl:with-param name="form_item_type" select="$form_item_type"/>
12002
12108
  </xsl:call-template>
12003
- <fo:instream-foreign-object fox:alt-text="Box" baseline-shift="-10%">
12109
+ <fo:instream-foreign-object fox:alt-text="Box" baseline-shift="-10%" fox:placement="Inline">
12004
12110
  <xsl:attribute name="height">3.5mm</xsl:attribute>
12005
12111
  <xsl:attribute name="content-width">100%</xsl:attribute>
12006
12112
  <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
@@ -12027,7 +12133,7 @@
12027
12133
  <xsl:call-template name="set_id_metanorma_form_item">
12028
12134
  <xsl:with-param name="form_item_type" select="$form_item_type"/>
12029
12135
  </xsl:call-template>
12030
- <fo:instream-foreign-object fox:alt-text="Box" baseline-shift="-10%">
12136
+ <fo:instream-foreign-object fox:alt-text="Box" baseline-shift="-10%" fox:placement="Inline">
12031
12137
  <xsl:attribute name="height">3.5mm</xsl:attribute>
12032
12138
  <xsl:attribute name="content-width">100%</xsl:attribute>
12033
12139
  <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
@@ -12074,6 +12180,13 @@
12074
12180
  <!-- End Form's elements processing -->
12075
12181
  <!-- =================== -->
12076
12182
 
12183
+ <xsl:attribute-set name="toc-container-style">
12184
+ <xsl:attribute name="role">Sect</xsl:attribute>
12185
+ </xsl:attribute-set>
12186
+
12187
+ <xsl:template name="refine_toc-container-style">
12188
+ </xsl:template>
12189
+
12077
12190
  <xsl:attribute-set name="toc-style">
12078
12191
  <xsl:attribute name="font-weight">bold</xsl:attribute>
12079
12192
  <xsl:attribute name="line-height">115%</xsl:attribute>
@@ -12296,7 +12409,9 @@
12296
12409
  </xsl:variable>
12297
12410
  <mnx:example id="{@id}" alt-text="{normalize-space($example_name)}">
12298
12411
  <xsl:element name="fmt-name" namespace="{$namespace_full}">
12299
- <xsl:value-of select="mn:fmt-xref-label[@container]"/>
12412
+ <xsl:call-template name="capitalize"><!-- https://github.com/metanorma/metanorma-pdfa/issues/72 -->
12413
+ <xsl:with-param name="str" select="mn:fmt-xref-label[@container]"/>
12414
+ </xsl:call-template>
12300
12415
  <xsl:if test="normalize-space($example_name) != ''">
12301
12416
  <xsl:value-of select="mn:fmt-name/mn:span[@class = 'fmt-caption-delim']"/>
12302
12417
  <xsl:copy-of select="$example_name"/>
@@ -13473,6 +13588,13 @@
13473
13588
  <!-- ===================================== -->
13474
13589
  <!-- ===================================== -->
13475
13590
 
13591
+ <xsl:attribute-set name="annex-style">
13592
+ <xsl:attribute name="role">Sect</xsl:attribute>
13593
+ </xsl:attribute-set>
13594
+
13595
+ <xsl:template name="refine_annex-style">
13596
+ </xsl:template>
13597
+
13476
13598
  <xsl:attribute-set name="annex-title-style">
13477
13599
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
13478
13600
  </xsl:attribute-set> <!-- annex-title-style -->
@@ -13480,6 +13602,40 @@
13480
13602
  <xsl:template name="refine_annex-title-style">
13481
13603
  </xsl:template>
13482
13604
 
13605
+ <xsl:template match="mn:annex[normalize-space() != '']">
13606
+ <xsl:choose>
13607
+ <xsl:when test="@continue = 'true'"> <!-- it's using for figure/table on top level for block span -->
13608
+ <fo:block role="SKIP">
13609
+ <xsl:apply-templates/>
13610
+ </fo:block>
13611
+ </xsl:when>
13612
+ <xsl:otherwise>
13613
+
13614
+ <fo:block break-after="page"/>
13615
+ <xsl:call-template name="setNamedDestination"/>
13616
+
13617
+ <fo:block xsl:use-attribute-sets="annex-style">
13618
+
13619
+ <xsl:call-template name="setId"/>
13620
+
13621
+ <!-- <xsl:if test="$namespace = 'iso'"> -->
13622
+ <xsl:call-template name="addTagElementT"/>
13623
+ <!-- </xsl:if> -->
13624
+
13625
+ <xsl:call-template name="setBlockSpanAll"/>
13626
+
13627
+ <xsl:call-template name="refine_annex-style"/>
13628
+
13629
+ <xsl:apply-templates select="mn:fmt-title[@columns = 1]"/>
13630
+
13631
+ <fo:block role="SKIP">
13632
+ <xsl:apply-templates select="node()[not(self::mn:fmt-title and @columns = 1)]"/>
13633
+ </fo:block>
13634
+ </fo:block>
13635
+ </xsl:otherwise>
13636
+ </xsl:choose>
13637
+ </xsl:template>
13638
+
13483
13639
  <xsl:attribute-set name="p-zzSTDTitle1-style">
13484
13640
  </xsl:attribute-set>
13485
13641
 
@@ -13936,22 +14092,14 @@
13936
14092
  </xsl:attribute-set>
13937
14093
 
13938
14094
  <xsl:attribute-set name="clause-style">
13939
-
14095
+ <xsl:attribute name="role">Sect</xsl:attribute>
13940
14096
  </xsl:attribute-set>
13941
14097
 
13942
14098
  <xsl:template name="refine_clause-style">
13943
- <!-- commented for https://github.com/metanorma/metanorma-ribose/issues/421 -->
13944
- <!-- <xsl:if test="$namespace = 'rsd'">
13945
- <xsl:variable name="level">
13946
- <xsl:call-template name="getLevel">
13947
- <xsl:with-param name="depth" select="mn:fmt-title/@depth"/>
13948
- </xsl:call-template>
13949
- </xsl:variable>
13950
- <xsl:if test="$level &gt;= 4">
13951
- <xsl:attribute name="margin-left">13mm</xsl:attribute>
13952
- </xsl:if>
13953
- </xsl:if> -->
13954
- </xsl:template>
14099
+ <xsl:if test="parent::mn:copyright-statement">
14100
+ <xsl:attribute name="role">SKIP</xsl:attribute>
14101
+ </xsl:if>
14102
+ </xsl:template> <!-- refine_clause-style -->
13955
14103
 
13956
14104
  <!-- main sections -->
13957
14105
  <xsl:template match="/*/mn:sections/*" name="sections_node" priority="2">
@@ -13961,6 +14109,10 @@
13961
14109
 
13962
14110
  <xsl:call-template name="sections_element_style"/>
13963
14111
 
14112
+ <!-- <xsl:if test="$namespace = 'rsd'"> -->
14113
+ <xsl:call-template name="addTagElementT"/>
14114
+ <!-- </xsl:if> -->
14115
+
13964
14116
  <xsl:call-template name="addReviewHelper"/>
13965
14117
 
13966
14118
  <xsl:apply-templates/>
@@ -13998,7 +14150,8 @@
13998
14150
  <xsl:template match="//mn:metanorma/mn:preface/*" priority="2" name="preface_node"> <!-- /*/mn:preface/* -->
13999
14151
  <fo:block break-after="page"/>
14000
14152
  <xsl:call-template name="setNamedDestination"/>
14001
- <fo:block>
14153
+ <fo:block role="Sect">
14154
+ <xsl:call-template name="addTagElementT"/>
14002
14155
  <xsl:call-template name="setId"/>
14003
14156
  <xsl:call-template name="addReviewHelper"/>
14004
14157
  <xsl:apply-templates/>
@@ -14027,16 +14180,15 @@
14027
14180
 
14028
14181
  <xsl:template match="mn:clause[normalize-space() != '' or mn:figure or @id]" name="template_clause"> <!-- if clause isn't empty -->
14029
14182
  <xsl:call-template name="setNamedDestination"/>
14030
- <fo:block>
14031
- <xsl:if test="parent::mn:copyright-statement">
14032
- <xsl:attribute name="role">SKIP</xsl:attribute>
14033
- </xsl:if>
14183
+ <fo:block role="Sect">
14034
14184
 
14035
14185
  <xsl:call-template name="setId"/>
14036
14186
 
14187
+ <xsl:call-template name="addTagElementT"/>
14188
+
14037
14189
  <xsl:call-template name="setBlockSpanAll"/>
14038
14190
 
14039
- <xsl:call-template name="refine_clause_style"/>
14191
+ <xsl:call-template name="refine_clause-style"/>
14040
14192
 
14041
14193
  <xsl:call-template name="addReviewHelper"/>
14042
14194
 
@@ -14044,41 +14196,6 @@
14044
14196
  </fo:block>
14045
14197
  </xsl:template>
14046
14198
 
14047
- <xsl:template name="refine_clause_style">
14048
- </xsl:template> <!-- refine_clause_style -->
14049
-
14050
- <xsl:template match="mn:annex[normalize-space() != '']">
14051
- <xsl:choose>
14052
- <xsl:when test="@continue = 'true'"> <!-- it's using for figure/table on top level for block span -->
14053
- <fo:block>
14054
- <xsl:apply-templates/>
14055
- </fo:block>
14056
- </xsl:when>
14057
- <xsl:otherwise>
14058
-
14059
- <fo:block break-after="page"/>
14060
- <xsl:call-template name="setNamedDestination"/>
14061
-
14062
- <fo:block id="{@id}">
14063
-
14064
- <xsl:call-template name="setBlockSpanAll"/>
14065
-
14066
- <xsl:call-template name="refine_annex_style"/>
14067
-
14068
- </fo:block>
14069
-
14070
- <xsl:apply-templates select="mn:fmt-title[@columns = 1]"/>
14071
-
14072
- <fo:block>
14073
- <xsl:apply-templates select="node()[not(self::mn:fmt-title and @columns = 1)]"/>
14074
- </fo:block>
14075
- </xsl:otherwise>
14076
- </xsl:choose>
14077
- </xsl:template>
14078
-
14079
- <xsl:template name="refine_annex_style">
14080
- </xsl:template>
14081
-
14082
14199
  <xsl:template match="mn:name/text() | mn:fmt-name/text()">
14083
14200
  <!-- 0xA0 to space replacement -->
14084
14201
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
@@ -14123,7 +14240,7 @@
14123
14240
 
14124
14241
  <xsl:template match="mn:blacksquare" name="blacksquare">
14125
14242
  <fo:inline padding-right="2.5mm" baseline-shift="5%">
14126
- <fo:instream-foreign-object content-height="2mm" content-width="2mm" fox:alt-text="Quad">
14243
+ <fo:instream-foreign-object content-height="2mm" content-width="2mm" fox:alt-text="Quad" fox:placement="Inline">
14127
14244
  <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" viewBox="0 0 2 2">
14128
14245
  <rect x="0" y="0" width="2" height="2" fill="black"/>
14129
14246
  </svg>
@@ -14194,6 +14311,13 @@
14194
14311
  <xsl:template name="addTagElementT">
14195
14312
  <xsl:variable name="title_">
14196
14313
  <xsl:apply-templates select="mn:fmt-title"/>
14314
+ <xsl:if test="not(mn:fmt-title) and self::mn:term">
14315
+ <name>
14316
+ <xsl:apply-templates select="mn:fmt-name"/>
14317
+ <xsl:text> </xsl:text>
14318
+ <xsl:apply-templates select="mn:fmt-preferred/node()[1]"/>
14319
+ </name>
14320
+ </xsl:if>
14197
14321
  </xsl:variable>
14198
14322
  <xsl:variable name="title__">
14199
14323
  <xsl:for-each select="xalan:nodeset($title_)/*/node()">
@@ -14203,7 +14327,7 @@
14203
14327
  </xsl:choose>
14204
14328
  </xsl:for-each>
14205
14329
  </xsl:variable>
14206
- <xsl:variable name="title" select="normalize-space($title__)"/>
14330
+ <xsl:variable name="title" select="normalize-space(translate($title__, concat($em_space,' &#8232;'), ' '))"/>
14207
14331
  <xsl:if test="$title != ''">
14208
14332
  <xsl:attribute name="fox:title">
14209
14333
  <xsl:if test="ancestor::mn:sections">
@@ -15072,13 +15196,13 @@
15072
15196
  <xsl:param name="bitmap_width" select="$pageWidth"/>
15073
15197
  <xsl:choose>
15074
15198
  <xsl:when test="*[local-name() = 'svg'] or java:endsWith(java:java.lang.String.new(@src), '.svg')">
15075
- <fo:instream-foreign-object fox:alt-text="Image Front">
15199
+ <fo:instream-foreign-object fox:alt-text="Image Front" fox:placement="Block">
15076
15200
  <xsl:attribute name="content-height"><xsl:value-of select="$svg_content_height"/>mm</xsl:attribute>
15077
15201
  <xsl:call-template name="getSVG"/>
15078
15202
  </fo:instream-foreign-object>
15079
15203
  </xsl:when>
15080
15204
  <xsl:when test="starts-with(@src, 'data:application/pdf;base64')">
15081
- <fo:external-graphic src="{@src}" fox:alt-text="Image Front"/>
15205
+ <fo:external-graphic src="{@src}" fox:alt-text="Image Front" fox:placement="Block"/>
15082
15206
  </xsl:when>
15083
15207
  <xsl:otherwise> <!-- bitmap image -->
15084
15208
  <xsl:variable name="coverimage_src" select="normalize-space(@src)"/>
@@ -15088,7 +15212,7 @@
15088
15212
  <xsl:with-param name="src" select="$coverimage_src"/>
15089
15213
  </xsl:call-template>
15090
15214
  </xsl:variable>
15091
- <fo:external-graphic src="{$coverpage}" width="{$bitmap_width}mm" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Front"/>
15215
+ <fo:external-graphic src="{$coverpage}" width="{$bitmap_width}mm" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Front" fox:placement="Block"/>
15092
15216
  </xsl:if>
15093
15217
  </xsl:otherwise>
15094
15218
  </xsl:choose>