metanorma-itu 2.8.13 → 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.
@@ -757,7 +757,7 @@
757
757
  <xsl:if test="$doctype != 'service-publication'">
758
758
  <fo:block margin-top="3.4mm">
759
759
  <xsl:call-template name="setWritingMode"/>
760
- <fo:instream-foreign-object fox:alt-text="Color bar">
760
+ <fo:instream-foreign-object fox:alt-text="Color bar" fox:placement="Block">
761
761
  <xsl:call-template name="insertImageCoverColorBand">
762
762
  <xsl:with-param name="bureau" select="$bureau"/>
763
763
  <xsl:with-param name="doctype" select="$doctype"/>
@@ -774,7 +774,7 @@
774
774
  <xsl:if test="$lang = 'ar'">
775
775
  <xsl:attribute name="text-align">left</xsl:attribute>
776
776
  </xsl:if>
777
- <fo:instream-foreign-object content-width="20.5mm" fox:alt-text="Image Logo">
777
+ <fo:instream-foreign-object content-width="20.5mm" fox:alt-text="Image Logo" fox:placement="Block">
778
778
  <xsl:call-template name="Image-ITU-Globe-Logo-Blue">
779
779
  <xsl:with-param name="color_cover_itu_logo" select="$color_cover_itu_logo"/>
780
780
  </xsl:call-template>
@@ -1228,7 +1228,7 @@
1228
1228
  <xsl:attribute name="padding-right">0mm</xsl:attribute>
1229
1229
  <xsl:attribute name="padding-left">6mm</xsl:attribute>
1230
1230
  </xsl:if>
1231
- <fo:instream-foreign-object content-height="18.5mm" content-width="16.1mm" fox:alt-text="Image Logo">
1231
+ <fo:instream-foreign-object content-height="18.5mm" content-width="16.1mm" fox:alt-text="Image Logo" fox:placement="Block">
1232
1232
  <xsl:copy-of select="$Image-ITU-Globe-Logo"/>
1233
1233
  </fo:instream-foreign-object>
1234
1234
  </fo:inline>
@@ -1372,11 +1372,11 @@
1372
1372
  <fo:block text-align="right" margin-right="19mm">
1373
1373
  <xsl:choose>
1374
1374
  <xsl:when test="$doctype = 'resolution'">
1375
- <fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Logo_resolution))}" content-height="21mm" content-width="scale-to-fit" scaling="uniform" fox:alt-text="Image Logo"/>
1375
+ <fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Logo_resolution))}" content-height="21mm" content-width="scale-to-fit" scaling="uniform" fox:alt-text="Image Logo" fox:placement="Block"/>
1376
1376
  </xsl:when>
1377
1377
  <xsl:otherwise>
1378
1378
  <!-- <fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Logo))}" content-height="17.7mm" content-width="scale-to-fit" scaling="uniform" fox:alt-text="Image Logo"/> -->
1379
- <fo:instream-foreign-object content-width="24.1mm" fox:alt-text="Image Logo ITU">
1379
+ <fo:instream-foreign-object content-width="24.1mm" fox:alt-text="Image Logo ITU" fox:placement="Block">
1380
1380
  <xsl:call-template name="Image-ITU-Globe-Logo-Blue">
1381
1381
  <xsl:with-param name="color_cover_itu_logo" select="$color_cover_itu_logo"/>
1382
1382
  </xsl:call-template>
@@ -1388,7 +1388,7 @@
1388
1388
 
1389
1389
  <fo:block-container absolute-position="fixed" left="-7mm" top="0" font-size="0">
1390
1390
  <fo:block text-align="left">
1391
- <fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Fond-Rec))}" width="43.6mm" content-height="299.2mm" content-width="scale-to-fit" scaling="uniform" fox:alt-text="Image Cover Page"/>
1391
+ <fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Fond-Rec))}" width="43.6mm" content-height="299.2mm" content-width="scale-to-fit" scaling="uniform" fox:alt-text="Image Cover Page" fox:placement="Block"/>
1392
1392
  </fo:block>
1393
1393
  </fo:block-container>
1394
1394
  <fo:block-container font-family="Arial">
@@ -3203,6 +3203,7 @@
3203
3203
 
3204
3204
  <!-- Characters -->
3205
3205
  <xsl:variable name="linebreak">&#8232;</xsl:variable>
3206
+ <xsl:variable name="em_space"> </xsl:variable>
3206
3207
  <xsl:variable name="tab_zh"> </xsl:variable>
3207
3208
  <xsl:variable name="non_breaking_hyphen">‑</xsl:variable>
3208
3209
  <xsl:variable name="thin_space"> </xsl:variable>
@@ -4013,7 +4014,7 @@
4013
4014
  </xsl:element>
4014
4015
  </xsl:template> -->
4015
4016
 
4016
- <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">
4017
+ <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">
4017
4018
  <xsl:apply-templates mode="update_xml_step1"/>
4018
4019
  </xsl:template>
4019
4020
 
@@ -5072,6 +5073,9 @@
5072
5073
 
5073
5074
  <xsl:template name="refine_sourcecode-style">
5074
5075
  <xsl:call-template name="setKeepAttributes"/>
5076
+ <xsl:if test="ancestor::mn:sourcecode and parent::mn:td">
5077
+ <xsl:attribute name="role">SKIP</xsl:attribute>
5078
+ </xsl:if>
5075
5079
  </xsl:template> <!-- refine_sourcecode-style -->
5076
5080
 
5077
5081
  <xsl:attribute-set name="sourcecode-number-style">
@@ -5398,30 +5402,30 @@
5398
5402
  </xsl:template>
5399
5403
 
5400
5404
  <!-- outer table with line numbers for sourcecode -->
5401
- <xsl:template match="mn:sourcecode[@linenums = 'true']/mn:table" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] | -->
5402
- <fo:block>
5403
- <fo:table width="100%" table-layout="fixed">
5405
+ <xsl:template match="mn:sourcecode[@linenums = 'true']/mn:table" priority="3"> <!-- *[local-name()='table'][@type = 'sourcecode'] | -->
5406
+ <fo:block role="SKIP">
5407
+ <fo:table width="100%" table-layout="fixed" role="SKIP">
5404
5408
  <xsl:copy-of select="@id"/>
5405
5409
  <fo:table-column column-width="8%"/>
5406
5410
  <fo:table-column column-width="92%"/>
5407
- <fo:table-body>
5411
+ <fo:table-body role="SKIP">
5408
5412
  <xsl:apply-templates/>
5409
5413
  </fo:table-body>
5410
5414
  </fo:table>
5411
5415
  </fo:block>
5412
5416
  </xsl:template>
5413
- <xsl:template match="mn:sourcecode[@linenums = 'true']/mn:table/mn:tbody" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody'] | -->
5417
+ <xsl:template match="mn:sourcecode[@linenums = 'true']/mn:table/mn:tbody" priority="3"> <!-- *[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody'] | -->
5414
5418
  <xsl:apply-templates/>
5415
5419
  </xsl:template>
5416
- <xsl:template match="mn:sourcecode[@linenums = 'true']/mn:table//mn:tr" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr'] | -->
5417
- <fo:table-row>
5420
+ <xsl:template match="mn:sourcecode[@linenums = 'true']/mn:table//mn:tr" priority="3"> <!-- *[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr'] | -->
5421
+ <fo:table-row role="SKIP">
5418
5422
  <xsl:apply-templates/>
5419
5423
  </fo:table-row>
5420
5424
  </xsl:template>
5421
5425
  <!-- first td with line numbers -->
5422
- <xsl:template match="mn:sourcecode[@linenums = 'true']/mn:table//mn:tr/*[local-name() = 'td'][not(preceding-sibling::*)]" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] -->
5423
- <fo:table-cell>
5424
- <fo:block>
5426
+ <xsl:template match="mn:sourcecode[@linenums = 'true']/mn:table//mn:tr/*[local-name() = 'td'][not(preceding-sibling::*)]" priority="3"> <!-- *[local-name()='table'][@type = 'sourcecode'] -->
5427
+ <fo:table-cell role="SKIP">
5428
+ <fo:block role="SKIP">
5425
5429
 
5426
5430
  <!-- set attibutes for line numbers - same as sourcecode -->
5427
5431
  <xsl:variable name="sourcecode_attributes">
@@ -5429,7 +5433,7 @@
5429
5433
  <xsl:call-template name="get_sourcecode_attributes"/>
5430
5434
  </xsl:for-each>
5431
5435
  </xsl:variable>
5432
- <xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@*[not(starts-with(local-name(), 'margin-') or starts-with(local-name(), 'space-'))]">
5436
+ <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'))]">
5433
5437
  <xsl:attribute name="{name()}">
5434
5438
  <xsl:value-of select="."/>
5435
5439
  </xsl:attribute>
@@ -5441,8 +5445,8 @@
5441
5445
  </xsl:template>
5442
5446
 
5443
5447
  <!-- second td with sourcecode -->
5444
- <xsl:template match="mn:sourcecode[@linenums = 'true']/mn:table//mn:tr/*[local-name() = 'td'][preceding-sibling::*]" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] -->
5445
- <fo:table-cell>
5448
+ <xsl:template match="mn:sourcecode[@linenums = 'true']/mn:table//mn:tr/*[local-name() = 'td'][preceding-sibling::*]" priority="3"> <!-- *[local-name()='table'][@type = 'sourcecode'] -->
5449
+ <fo:table-cell role="SKIP">
5446
5450
  <fo:block role="SKIP">
5447
5451
  <xsl:apply-templates/>
5448
5452
  </fo:block>
@@ -6018,7 +6022,7 @@
6018
6022
  <xsl:param name="value"/>
6019
6023
  <xsl:variable name="add_width" select="string-length($value) * 20"/>
6020
6024
  <xsl:variable name="maxwidth" select="60 + $add_width"/>
6021
- <fo:instream-foreign-object fox:alt-text="OpeningTag" baseline-shift="-10%"><!-- alignment-baseline="middle" -->
6025
+ <fo:instream-foreign-object fox:alt-text="OpeningTag" baseline-shift="-10%" fox:placement="Inline"><!-- alignment-baseline="middle" -->
6022
6026
  <xsl:attribute name="height">3.5mm</xsl:attribute> <!-- 5mm -->
6023
6027
  <xsl:attribute name="content-width">100%</xsl:attribute>
6024
6028
  <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
@@ -6247,11 +6251,12 @@
6247
6251
  <xsl:choose>
6248
6252
 
6249
6253
  <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' -->
6254
+ <xsl:attribute name="role">SKIP</xsl:attribute>
6250
6255
  <xsl:if test="ancestor::mn:tr[1]/following-sibling::mn:tr"> <!-- is current tr isn't last -->
6251
6256
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
6252
6257
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
6253
6258
  </xsl:if>
6254
- <fo:instream-foreign-object fox:alt-text="{.}" content-width="95%">
6259
+ <fo:instream-foreign-object fox:alt-text="{.}" content-width="95%" fox:placement="Inline" role="artifact">
6255
6260
  <math xmlns="http://www.w3.org/1998/Math/MathML">
6256
6261
  <mtext><xsl:value-of select="."/></mtext>
6257
6262
  </math>
@@ -6628,7 +6633,15 @@
6628
6633
  <!-- END requirement, recommendation, permission table -->
6629
6634
  <!-- ========== -->
6630
6635
 
6636
+ <xsl:attribute-set name="terms-style">
6637
+ <xsl:attribute name="role">Sect</xsl:attribute>
6638
+ </xsl:attribute-set>
6639
+
6640
+ <xsl:template name="refine_terms-style">
6641
+ </xsl:template>
6642
+
6631
6643
  <xsl:attribute-set name="term-style">
6644
+ <xsl:attribute name="role">Sect</xsl:attribute>
6632
6645
  </xsl:attribute-set> <!-- term-style -->
6633
6646
 
6634
6647
  <xsl:template name="refine_term-style">
@@ -6739,7 +6752,10 @@
6739
6752
  <xsl:template match="mn:terms">
6740
6753
  <!-- <xsl:message>'terms' <xsl:number/> processing...</xsl:message> -->
6741
6754
  <xsl:call-template name="setNamedDestination"/>
6742
- <fo:block id="{@id}">
6755
+ <fo:block id="{@id}" xsl:use-attribute-sets="terms-style">
6756
+ <xsl:call-template name="refine_terms-style"/>
6757
+ <xsl:call-template name="addTagElementT"/>
6758
+
6743
6759
  <xsl:apply-templates/>
6744
6760
  </fo:block>
6745
6761
  </xsl:template>
@@ -6748,6 +6764,7 @@
6748
6764
  <xsl:call-template name="setNamedDestination"/>
6749
6765
  <fo:block id="{@id}" xsl:use-attribute-sets="term-style">
6750
6766
  <xsl:call-template name="refine_term-style"/>
6767
+ <xsl:call-template name="addTagElementT"/>
6751
6768
 
6752
6769
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
6753
6770
  </fo:block>
@@ -6978,7 +6995,9 @@
6978
6995
 
6979
6996
  <xsl:template match="mn:definitions">
6980
6997
  <xsl:call-template name="setNamedDestination"/>
6981
- <fo:block id="{@id}">
6998
+ <fo:block id="{@id}" role="Sect">
6999
+ <xsl:call-template name="addTagElementT"/>
7000
+
6982
7001
  <xsl:apply-templates/>
6983
7002
  </fo:block>
6984
7003
  </xsl:template>
@@ -7053,6 +7072,7 @@
7053
7072
  <xsl:template match="mn:termexample/mn:p">
7054
7073
  <xsl:variable name="element">inline
7055
7074
 
7075
+ <xsl:value-of select="$example_display_in"/>
7056
7076
  </xsl:variable>
7057
7077
  <xsl:choose>
7058
7078
  <xsl:when test="contains($element, 'block')">
@@ -7465,6 +7485,9 @@
7465
7485
  </xsl:attribute-set><!-- table-note-style -->
7466
7486
 
7467
7487
  <xsl:template name="refine_table-note-style">
7488
+ <xsl:if test="self::mn:note">
7489
+ <xsl:attribute name="role">Note</xsl:attribute>
7490
+ </xsl:if>
7468
7491
  </xsl:template> <!-- refine_table-note-style -->
7469
7492
 
7470
7493
  <xsl:attribute-set name="table-fn-style">
@@ -7827,19 +7850,22 @@
7827
7850
  <xsl:if test="normalize-space() != ''">
7828
7851
 
7829
7852
  <fo:block xsl:use-attribute-sets="table-name-style">
7830
-
7831
7853
  <xsl:call-template name="refine_table-name-style">
7832
7854
  <xsl:with-param name="continued" select="$continued"/>
7833
7855
  </xsl:call-template>
7834
7856
 
7835
- <xsl:choose>
7836
- <xsl:when test="$continued = 'true'">
7837
- </xsl:when>
7838
- <xsl:otherwise>
7839
- <xsl:apply-templates/>
7840
- </xsl:otherwise>
7841
- </xsl:choose>
7857
+ <!-- <Caption><P> tags, see https://github.com/metanorma/metanorma-pdfa/issues/81 -->
7858
+ <fo:block role="P">
7859
+
7860
+ <xsl:choose>
7861
+ <xsl:when test="$continued = 'true'">
7862
+ </xsl:when>
7863
+ <xsl:otherwise>
7864
+ <xsl:apply-templates/>
7865
+ </xsl:otherwise>
7866
+ </xsl:choose>
7842
7867
 
7868
+ </fo:block>
7843
7869
  </fo:block>
7844
7870
 
7845
7871
  <!-- <xsl:if test="$namespace = 'bsi' or $namespace = 'pas' or $namespace = 'iec' or $namespace = 'iso'"> -->
@@ -8323,7 +8349,7 @@
8323
8349
 
8324
8350
  <xsl:variable name="tableWithNotesAndFootnotes">
8325
8351
 
8326
- <fo:table keep-with-previous="always" role="SKIP">
8352
+ <fo:table keep-with-previous="always" role="TFoot">
8327
8353
  <xsl:for-each select="xalan:nodeset($table_attributes)/table_attributes/@*">
8328
8354
  <xsl:variable name="name" select="local-name()"/>
8329
8355
  <xsl:choose>
@@ -8367,14 +8393,14 @@
8367
8393
  </xsl:choose>
8368
8394
 
8369
8395
  <fo:table-body role="SKIP">
8370
- <fo:table-row role="SKIP">
8396
+ <fo:table-row>
8371
8397
  <xsl:for-each select="ancestor::mn:table[1]">
8372
8398
  <xsl:call-template name="setTableStyles">
8373
8399
  <xsl:with-param name="scope">ancestor_table</xsl:with-param>
8374
8400
  </xsl:call-template>
8375
8401
  </xsl:for-each>
8376
8402
 
8377
- <fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}" role="SKIP">
8403
+ <fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}">
8378
8404
 
8379
8405
  <xsl:call-template name="refine_table-footer-cell-style"/>
8380
8406
 
@@ -8790,7 +8816,7 @@
8790
8816
  </xsl:template> <!-- table/note -->
8791
8817
 
8792
8818
  <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">
8793
- <xsl:apply-templates/>
8819
+ <fo:inline role="P"><xsl:apply-templates/></fo:inline>
8794
8820
  </xsl:template>
8795
8821
 
8796
8822
  <!-- ============================ -->
@@ -9720,6 +9746,7 @@
9720
9746
  <!-- ========================== -->
9721
9747
 
9722
9748
  <xsl:attribute-set name="dl-block-style">
9749
+ <xsl:attribute name="role">SKIP</xsl:attribute>
9723
9750
  </xsl:attribute-set>
9724
9751
 
9725
9752
  <xsl:template name="refine_dl-block-style">
@@ -9729,12 +9756,14 @@
9729
9756
  </xsl:template>
9730
9757
 
9731
9758
  <xsl:attribute-set name="dt-row-style">
9759
+ <xsl:attribute name="role">LI</xsl:attribute>
9732
9760
  </xsl:attribute-set>
9733
9761
 
9734
9762
  <xsl:template name="refine_dt-row-style">
9735
9763
  </xsl:template>
9736
9764
 
9737
9765
  <xsl:attribute-set name="dt-cell-style">
9766
+ <xsl:attribute name="role">Lbl</xsl:attribute>
9738
9767
  </xsl:attribute-set>
9739
9768
 
9740
9769
  <xsl:template name="refine_dt-cell-style">
@@ -9744,6 +9773,7 @@
9744
9773
  </xsl:template> <!-- refine_dt-cell-style -->
9745
9774
 
9746
9775
  <xsl:attribute-set name="dt-block-style">
9776
+ <xsl:attribute name="role">SKIP</xsl:attribute>
9747
9777
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
9748
9778
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
9749
9779
  </xsl:attribute-set>
@@ -9764,6 +9794,7 @@
9764
9794
  </xsl:template>
9765
9795
 
9766
9796
  <xsl:attribute-set name="dd-cell-style">
9797
+ <xsl:attribute name="role">LBody</xsl:attribute>
9767
9798
  <xsl:attribute name="padding-left">2mm</xsl:attribute>
9768
9799
  </xsl:attribute-set>
9769
9800
 
@@ -9832,7 +9863,7 @@
9832
9863
  <xsl:variable name="isAdded" select="@added"/>
9833
9864
  <xsl:variable name="isDeleted" select="@deleted"/>
9834
9865
  <!-- <dl><xsl:copy-of select="."/></dl> -->
9835
- <fo:block-container xsl:use-attribute-sets="dl-block-style" role="SKIP">
9866
+ <fo:block-container xsl:use-attribute-sets="dl-block-style">
9836
9867
 
9837
9868
  <xsl:call-template name="refine_dl-block-style"/>
9838
9869
 
@@ -9952,7 +9983,7 @@
9952
9983
  <fo:block id="{concat('table_if_start_',@id)}" keep-with-next="always" font-size="1pt">Start table '<xsl:value-of select="@id"/>'.</fo:block>
9953
9984
  </xsl:if>
9954
9985
 
9955
- <fo:table width="95%" table-layout="fixed">
9986
+ <fo:table width="95%" table-layout="fixed" role="L">
9956
9987
 
9957
9988
  <xsl:if test="$isGenerateTableIF = 'true'">
9958
9989
  <xsl:attribute name="wrap-option">no-wrap</xsl:attribute>
@@ -10020,7 +10051,7 @@
10020
10051
  <xsl:with-param name="table_or_dl">dl</xsl:with-param>
10021
10052
  </xsl:apply-templates>
10022
10053
 
10023
- </xsl:when>
10054
+ </xsl:when> <!-- $isGenerateTableIF = 'true' -->
10024
10055
  <xsl:otherwise>
10025
10056
 
10026
10057
  <xsl:variable name="simple-table">
@@ -10075,7 +10106,7 @@
10075
10106
  <xsl:with-param name="isContainsKeepTogetherTag" select="$isContainsKeepTogetherTag"/>
10076
10107
  </xsl:call-template>
10077
10108
 
10078
- <fo:table-body>
10109
+ <fo:table-body role="SKIP">
10079
10110
 
10080
10111
  <!-- DEBUG -->
10081
10112
  <xsl:if test="$table_if_debug = 'true'">
@@ -10288,8 +10319,8 @@
10288
10319
  <td number-columns-spanned="2">NOTE <xsl:apply-templates /> </td>
10289
10320
  </tr>
10290
10321
  -->
10291
- <fo:table-row>
10292
- <fo:table-cell number-columns-spanned="2">
10322
+ <fo:table-row role="SKIP">
10323
+ <fo:table-cell number-columns-spanned="2" role="SKIP">
10293
10324
  <fo:block role="SKIP">
10294
10325
  <xsl:call-template name="note"/>
10295
10326
  </fo:block>
@@ -10353,7 +10384,7 @@
10353
10384
  <xsl:call-template name="refine_dt-cell-style"/>
10354
10385
 
10355
10386
  <xsl:call-template name="setNamedDestination"/>
10356
- <fo:block xsl:use-attribute-sets="dt-block-style" role="SKIP">
10387
+ <fo:block xsl:use-attribute-sets="dt-block-style">
10357
10388
 
10358
10389
  <xsl:choose>
10359
10390
  <xsl:when test="$isGenerateTableIF = 'true'">
@@ -10443,7 +10474,7 @@
10443
10474
  </xsl:variable>
10444
10475
  <xsl:choose>
10445
10476
  <xsl:when test="$is_inline_element_after_where = 'true'">
10446
- <fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
10477
+ <fo:inline role="SKIP"><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
10447
10478
  </xsl:when>
10448
10479
  <xsl:otherwise>
10449
10480
  <xsl:apply-templates select="."/>
@@ -10720,6 +10751,7 @@
10720
10751
  <!-- ====== -->
10721
10752
 
10722
10753
  <xsl:attribute-set name="note-style">
10754
+ <xsl:attribute name="role">Note</xsl:attribute>
10723
10755
  <xsl:attribute name="font-size">11pt</xsl:attribute>
10724
10756
  <xsl:attribute name="space-before">4pt</xsl:attribute>
10725
10757
  <xsl:attribute name="text-align">justify</xsl:attribute>
@@ -10728,10 +10760,21 @@
10728
10760
  <xsl:template name="refine_note-style">
10729
10761
  </xsl:template> <!-- refine_note-style -->
10730
10762
 
10763
+ <xsl:attribute-set name="note-block-style">
10764
+ <xsl:attribute name="role">SKIP</xsl:attribute>
10765
+ </xsl:attribute-set> <!-- note-block-style -->
10766
+
10767
+ <xsl:template name="refine_note-block-style">
10768
+ <xsl:if test="ancestor::mn:figure">
10769
+ <xsl:attribute name="keep-with-previous">always</xsl:attribute>
10770
+ </xsl:if>
10771
+ </xsl:template> <!-- refine_note-block-style -->
10772
+
10731
10773
  <xsl:variable name="note-body-indent">10mm</xsl:variable>
10732
10774
  <xsl:variable name="note-body-indent-table">5mm</xsl:variable>
10733
10775
 
10734
10776
  <xsl:attribute-set name="note-name-style">
10777
+ <xsl:attribute name="role">Lbl</xsl:attribute>
10735
10778
  </xsl:attribute-set> <!-- note-name-style -->
10736
10779
 
10737
10780
  <xsl:template name="refine_note-name-style">
@@ -10742,9 +10785,13 @@
10742
10785
  </xsl:attribute-set>
10743
10786
 
10744
10787
  <xsl:template name="refine_table-note-name-style">
10788
+ <xsl:if test="self::mn:note">
10789
+ <xsl:attribute name="role">Lbl</xsl:attribute>
10790
+ </xsl:if>
10745
10791
  </xsl:template> <!-- refine_table-note-name-style -->
10746
10792
 
10747
10793
  <xsl:attribute-set name="note-p-style">
10794
+ <xsl:attribute name="role">P</xsl:attribute>
10748
10795
  <xsl:attribute name="space-before">4pt</xsl:attribute>
10749
10796
  </xsl:attribute-set> <!-- note-p-style -->
10750
10797
 
@@ -10752,6 +10799,7 @@
10752
10799
  </xsl:template>
10753
10800
 
10754
10801
  <xsl:attribute-set name="termnote-style">
10802
+ <xsl:attribute name="role">Note</xsl:attribute>
10755
10803
  <xsl:attribute name="margin-top">4pt</xsl:attribute>
10756
10804
  </xsl:attribute-set> <!-- termnote-style -->
10757
10805
 
@@ -10759,12 +10807,14 @@
10759
10807
  </xsl:template> <!-- refine_termnote-style -->
10760
10808
 
10761
10809
  <xsl:attribute-set name="termnote-name-style">
10810
+ <xsl:attribute name="role">Lbl</xsl:attribute>
10762
10811
  </xsl:attribute-set> <!-- termnote-name-style -->
10763
10812
 
10764
10813
  <xsl:template name="refine_termnote-name-style">
10765
10814
  </xsl:template>
10766
10815
 
10767
10816
  <xsl:attribute-set name="termnote-p-style">
10817
+ <xsl:attribute name="role">P</xsl:attribute>
10768
10818
  </xsl:attribute-set>
10769
10819
 
10770
10820
  <xsl:template name="refine_termnote-p-style">
@@ -10779,7 +10829,7 @@
10779
10829
 
10780
10830
  <xsl:call-template name="setNamedDestination"/>
10781
10831
 
10782
- <fo:block-container xsl:use-attribute-sets="note-style" role="SKIP">
10832
+ <fo:block-container xsl:use-attribute-sets="note-style">
10783
10833
  <xsl:if test="not(parent::mn:references)">
10784
10834
  <xsl:copy-of select="@id"/>
10785
10835
  </xsl:if>
@@ -10789,11 +10839,11 @@
10789
10839
  <xsl:call-template name="refine_note-style"/>
10790
10840
 
10791
10841
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
10792
- <fo:block>
10842
+ <fo:block xsl:use-attribute-sets="note-block-style">
10793
10843
 
10794
- <xsl:call-template name="refine_note_block_style"/>
10844
+ <xsl:call-template name="refine_note-block-style"/>
10795
10845
 
10796
- <fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
10846
+ <fo:inline xsl:use-attribute-sets="note-name-style">
10797
10847
 
10798
10848
  <xsl:apply-templates select="mn:fmt-name/mn:tab" mode="tab"/>
10799
10849
 
@@ -10816,29 +10866,31 @@
10816
10866
 
10817
10867
  </fo:inline>
10818
10868
 
10819
- <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
10869
+ <xsl:choose>
10870
+ <xsl:when test="parent::mn:formattedref and ancestor::mn:bibitem">
10871
+ <fo:inline role="P"><xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/></fo:inline>
10872
+ </xsl:when>
10873
+ <xsl:otherwise>
10874
+ <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
10875
+ </xsl:otherwise>
10876
+ </xsl:choose>
10877
+
10820
10878
  </fo:block>
10821
10879
  </fo:block-container>
10822
10880
  </fo:block-container>
10823
10881
  </xsl:template>
10824
10882
 
10825
- <xsl:template name="refine_note_block_style">
10826
- <xsl:if test="ancestor::mn:figure">
10827
- <xsl:attribute name="keep-with-previous">always</xsl:attribute>
10828
- </xsl:if>
10829
- </xsl:template> <!-- refine_note_block_style -->
10830
-
10831
10883
  <xsl:template match="mn:note/mn:p">
10832
10884
  <xsl:variable name="num"><xsl:number/></xsl:variable>
10833
10885
  <xsl:choose>
10834
10886
  <xsl:when test="$num = 1"> <!-- display first NOTE's paragraph in the same line with label NOTE -->
10835
- <fo:inline xsl:use-attribute-sets="note-p-style" role="SKIP">
10887
+ <fo:inline xsl:use-attribute-sets="note-p-style">
10836
10888
  <xsl:call-template name="refine_note-p-style"/>
10837
10889
  <xsl:apply-templates/>
10838
10890
  </fo:inline>
10839
10891
  </xsl:when>
10840
10892
  <xsl:otherwise>
10841
- <fo:block xsl:use-attribute-sets="note-p-style" role="SKIP">
10893
+ <fo:block xsl:use-attribute-sets="note-p-style">
10842
10894
  <xsl:call-template name="refine_note-p-style"/>
10843
10895
  <xsl:apply-templates/>
10844
10896
  </fo:block>
@@ -10948,9 +11000,9 @@
10948
11000
  <!-- ====== -->
10949
11001
 
10950
11002
  <xsl:attribute-set name="quote-container-style">
11003
+ <xsl:attribute name="role">BlockQuote</xsl:attribute>
10951
11004
  <xsl:attribute name="margin-left">12mm</xsl:attribute>
10952
11005
  <xsl:attribute name="margin-right">12mm</xsl:attribute>
10953
- <xsl:attribute name="role">SKIP</xsl:attribute>
10954
11006
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
10955
11007
  </xsl:attribute-set>
10956
11008
 
@@ -10973,6 +11025,7 @@
10973
11025
  </xsl:template> <!-- refine_quote-style -->
10974
11026
 
10975
11027
  <xsl:attribute-set name="quote-source-style">
11028
+ <xsl:attribute name="role">Caption</xsl:attribute>
10976
11029
  <xsl:attribute name="text-align">right</xsl:attribute>
10977
11030
  <xsl:attribute name="margin-right">-12mm</xsl:attribute>
10978
11031
  </xsl:attribute-set> <!-- quote-source-style -->
@@ -11005,7 +11058,7 @@
11005
11058
  <xsl:call-template name="refine_quote-style"/>
11006
11059
 
11007
11060
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
11008
- <fo:block role="BlockQuote">
11061
+ <fo:block role="SKIP"> <!-- BlockQuote -->
11009
11062
  <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 -->
11010
11063
  </fo:block>
11011
11064
  </fo:block-container>
@@ -11014,11 +11067,15 @@
11014
11067
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
11015
11068
  <fo:block xsl:use-attribute-sets="quote-source-style">
11016
11069
  <xsl:call-template name="refine_quote-source-style"/>
11017
- <!-- — ISO, ISO 7301:2011, Clause 1 -->
11018
- <xsl:apply-templates select="mn:author"/>
11019
- <xsl:apply-templates select="mn:fmt-source"/>
11020
- <!-- added for https://github.com/metanorma/isodoc/issues/607 -->
11021
- <xsl:apply-templates select="mn:attribution/mn:p/node()"/>
11070
+
11071
+ <!-- <Caption><P> tags, see https://github.com/metanorma/metanorma-pdfa/issues/81 -->
11072
+ <fo:block role="P">
11073
+ <!-- — ISO, ISO 7301:2011, Clause 1 -->
11074
+ <xsl:apply-templates select="mn:author"/>
11075
+ <xsl:apply-templates select="mn:fmt-source"/>
11076
+ <!-- added for https://github.com/metanorma/isodoc/issues/607 -->
11077
+ <xsl:apply-templates select="mn:attribution/mn:p/node()"/>
11078
+ </fo:block>
11022
11079
  </fo:block>
11023
11080
  </fo:block-container>
11024
11081
  </xsl:if>
@@ -11488,7 +11545,8 @@
11488
11545
 
11489
11546
  <!-- debug scale='<xsl:value-of select="$scale"/>', indent='<xsl:value-of select="$indent"/>' -->
11490
11547
 
11491
- <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" vertical-align="middle">
11548
+ <fo:external-graphic src="{$src}" vertical-align="middle" fox:placement="Inline">
11549
+ <xsl:call-template name="addAltText"/>
11492
11550
 
11493
11551
  <xsl:if test="parent::mn:logo"> <!-- publisher's logo -->
11494
11552
  <xsl:attribute name="scaling">uniform</xsl:attribute>
@@ -11552,11 +11610,12 @@
11552
11610
  <xsl:choose>
11553
11611
  <xsl:when test="$isDeleted = 'true'">
11554
11612
  <!-- enclose in svg -->
11555
- <fo:instream-foreign-object fox:alt-text="Image {@alt}">
11613
+ <fo:instream-foreign-object fox:placement="Block">
11556
11614
  <xsl:attribute name="width">100%</xsl:attribute>
11557
11615
  <xsl:attribute name="content-height">100%</xsl:attribute>
11558
11616
  <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
11559
11617
  <xsl:attribute name="scaling">uniform</xsl:attribute>
11618
+ <xsl:call-template name="addAltText"/>
11560
11619
 
11561
11620
  <xsl:apply-templates select="." mode="cross_image"/>
11562
11621
 
@@ -11572,7 +11631,8 @@
11572
11631
  <xsl:value-of select="concat('scale=', $scale,', indent=', $indent)"/>
11573
11632
  </fo:block> -->
11574
11633
 
11575
- <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}">
11634
+ <fo:external-graphic src="{$src}" fox:placement="Block">
11635
+ <xsl:call-template name="addAltText"/>
11576
11636
 
11577
11637
  <xsl:choose>
11578
11638
  <!-- default -->
@@ -11632,6 +11692,25 @@
11632
11692
  </xsl:choose>
11633
11693
  </xsl:template>
11634
11694
 
11695
+ <xsl:template name="addAltText">
11696
+ <xsl:param name="name">Image</xsl:param>
11697
+ <xsl:variable name="alt-text">
11698
+ <xsl:choose>
11699
+ <xsl:when test="self::mn:image and normalize-space(@alt) != ''">
11700
+ <xsl:value-of select="@alt"/>
11701
+ </xsl:when>
11702
+ <xsl:when test="normalize-space(../@alt) != ''">
11703
+ <xsl:value-of select="../@alt"/>
11704
+ </xsl:when>
11705
+ <xsl:when test="normalize-space(../mn:fmt-name) != ''">
11706
+ <xsl:value-of select="../mn:fmt-name"/>
11707
+ </xsl:when>
11708
+ <xsl:otherwise><xsl:value-of select="$name"/></xsl:otherwise>
11709
+ </xsl:choose>
11710
+ </xsl:variable>
11711
+ <xsl:attribute name="fox:alt-text"><xsl:value-of select="$alt-text"/></xsl:attribute>
11712
+ </xsl:template>
11713
+
11635
11714
  <xsl:template name="setImageWidth">
11636
11715
  <xsl:if test="@width != '' and @width != 'auto' and @width != 'text-width' and @width != 'full-page-width' and @width != 'narrow'">
11637
11716
  <xsl:value-of select="@width"/>
@@ -11820,6 +11899,9 @@
11820
11899
 
11821
11900
  <xsl:variable name="alt-text">
11822
11901
  <xsl:choose>
11902
+ <xsl:when test="normalize-space(../@alt) != ''">
11903
+ <xsl:value-of select="../@alt"/>
11904
+ </xsl:when>
11823
11905
  <xsl:when test="normalize-space(../mn:fmt-name) != ''">
11824
11906
  <xsl:value-of select="../mn:fmt-name"/>
11825
11907
  </xsl:when>
@@ -11888,7 +11970,7 @@
11888
11970
  </xsl:if>
11889
11971
  <fo:block text-depth="0" line-height="0" font-size="0">
11890
11972
 
11891
- <fo:instream-foreign-object fox:alt-text="{$alt-text}">
11973
+ <fo:instream-foreign-object fox:alt-text="{$alt-text}" fox:placement="Block">
11892
11974
  <xsl:attribute name="width">100%</xsl:attribute>
11893
11975
  <xsl:attribute name="content-height">100%</xsl:attribute>
11894
11976
  <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
@@ -11937,7 +12019,7 @@
11937
12019
  <xsl:copy>
11938
12020
  <xsl:copy-of select="@*"/>
11939
12021
  <!-- <fo:block xsl:use-attribute-sets="image-style"> -->
11940
- <fo:instream-foreign-object fox:alt-text="{$alt-text}">
12022
+ <fo:instream-foreign-object fox:alt-text="{$alt-text}" fox:placement="Block">
11941
12023
 
11942
12024
  <xsl:choose>
11943
12025
  <xsl:when test="$image_class = 'corrigenda-tag'">
@@ -12002,6 +12084,10 @@
12002
12084
  <xsl:attribute name="content-height"><xsl:value-of select="round($scale_x * $scale_y * 100)"/>%</xsl:attribute>
12003
12085
  </xsl:if>
12004
12086
 
12087
+ <xsl:if test="self::fo:inline">
12088
+ <xsl:attribute name="fox:placement">Inline</xsl:attribute>
12089
+ </xsl:if>
12090
+
12005
12091
  <xsl:copy-of select="$svg_content"/>
12006
12092
 
12007
12093
  <!-- <debug>
@@ -12277,10 +12363,12 @@
12277
12363
  <xsl:template match="mn:figure/mn:fmt-name | mn:image/mn:fmt-name">
12278
12364
  <xsl:if test="normalize-space() != ''">
12279
12365
  <fo:block xsl:use-attribute-sets="figure-name-style">
12280
-
12281
12366
  <xsl:call-template name="refine_figure-name-style"/>
12282
12367
 
12283
- <xsl:apply-templates/>
12368
+ <!-- <Caption><P> tags, see https://github.com/metanorma/metanorma-pdfa/issues/81 -->
12369
+ <fo:block role="P">
12370
+ <xsl:apply-templates/>
12371
+ </fo:block>
12284
12372
  </fo:block>
12285
12373
  </xsl:if>
12286
12374
  </xsl:template>
@@ -12302,6 +12390,7 @@
12302
12390
 
12303
12391
  <!-- Formula's styles -->
12304
12392
  <xsl:attribute-set name="formula-style">
12393
+ <xsl:attribute name="role">P</xsl:attribute>
12305
12394
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
12306
12395
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
12307
12396
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
@@ -12311,6 +12400,7 @@
12311
12400
  </xsl:template>
12312
12401
 
12313
12402
  <xsl:attribute-set name="formula-stem-block-style">
12403
+ <xsl:attribute name="role">SKIP</xsl:attribute>
12314
12404
  <xsl:attribute name="text-align">center</xsl:attribute>
12315
12405
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
12316
12406
  </xsl:attribute-set> <!-- formula-stem-block-style -->
@@ -12319,6 +12409,7 @@
12319
12409
  </xsl:template> <!-- refine_formula-stem-block-style -->
12320
12410
 
12321
12411
  <xsl:attribute-set name="formula-stem-number-style">
12412
+ <xsl:attribute name="role">Span</xsl:attribute>
12322
12413
  <xsl:attribute name="text-align">right</xsl:attribute>
12323
12414
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
12324
12415
  </xsl:attribute-set> <!-- formula-stem-number-style -->
@@ -12328,6 +12419,7 @@
12328
12419
  </xsl:template>
12329
12420
 
12330
12421
  <xsl:attribute-set name="mathml-style">
12422
+ <xsl:attribute name="role">Formula</xsl:attribute>
12331
12423
  <xsl:attribute name="font-family">STIX Two Math</xsl:attribute>
12332
12424
  <xsl:attribute name="font-size">11pt</xsl:attribute>
12333
12425
  </xsl:attribute-set>
@@ -12335,6 +12427,18 @@
12335
12427
  <xsl:template name="refine_mathml-style">
12336
12428
  </xsl:template>
12337
12429
 
12430
+ <xsl:attribute-set name="mathml-instream-foreign-object-style">
12431
+ <xsl:attribute name="fox:alt-text">Math</xsl:attribute>
12432
+ <xsl:attribute name="fox:actual-text">Math</xsl:attribute>
12433
+ <xsl:attribute name="fox:placement">Inline</xsl:attribute>
12434
+ </xsl:attribute-set> <!-- mathml-instream-foreign-object-style -->
12435
+
12436
+ <xsl:template name="refine_mathml-instream-foreign-object-style">
12437
+ <xsl:if test="ancestor::mn:formula">
12438
+ <xsl:attribute name="fox:placement">Block</xsl:attribute>
12439
+ </xsl:if>
12440
+ </xsl:template> <!-- refine_mathml-instream-foreign-object-style -->
12441
+
12338
12442
  <!-- ====== -->
12339
12443
  <!-- formula -->
12340
12444
  <!-- ====== -->
@@ -12350,7 +12454,7 @@
12350
12454
  </xsl:if>
12351
12455
  <fo:block-container margin-left="0mm" role="SKIP">
12352
12456
  <xsl:call-template name="setNamedDestination"/>
12353
- <fo:block id="{@id}">
12457
+ <fo:block id="{@id}" role="SKIP">
12354
12458
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/> <!-- formula's number will be process in 'stem' template -->
12355
12459
  </fo:block>
12356
12460
  </fo:block-container>
@@ -12383,22 +12487,22 @@
12383
12487
 
12384
12488
  <xsl:call-template name="refine_formula-style"/>
12385
12489
 
12386
- <fo:table table-layout="fixed" width="100%">
12490
+ <fo:table table-layout="fixed" width="100%" role="SKIP">
12387
12491
  <fo:table-column column-width="95%"/>
12388
12492
  <fo:table-column column-width="5%"/>
12389
- <fo:table-body>
12390
- <fo:table-row>
12391
- <fo:table-cell display-align="center">
12392
- <fo:block xsl:use-attribute-sets="formula-stem-block-style" role="SKIP">
12493
+ <fo:table-body role="SKIP">
12494
+ <fo:table-row role="SKIP">
12495
+ <fo:table-cell display-align="center" role="SKIP">
12496
+ <fo:block xsl:use-attribute-sets="formula-stem-block-style">
12393
12497
 
12394
12498
  <xsl:call-template name="refine_formula-stem-block-style"/>
12395
12499
 
12396
12500
  <xsl:apply-templates/>
12397
12501
  </fo:block>
12398
12502
  </fo:table-cell>
12399
- <fo:table-cell display-align="center">
12503
+ <fo:table-cell display-align="center" role="SKIP">
12400
12504
 
12401
- <fo:block xsl:use-attribute-sets="formula-stem-number-style" role="SKIP">
12505
+ <fo:block xsl:use-attribute-sets="formula-stem-number-style">
12402
12506
 
12403
12507
  <xsl:for-each select="../mn:fmt-name">
12404
12508
  <xsl:call-template name="setIDforNamedDestination"/>
@@ -12546,9 +12650,9 @@
12546
12650
  <xsl:apply-templates select="." mode="mathml"/>
12547
12651
  </xsl:variable>
12548
12652
 
12549
- <fo:instream-foreign-object fox:alt-text="Math" fox:actual-text="Math">
12653
+ <fo:instream-foreign-object xsl:use-attribute-sets="mathml-instream-foreign-object-style">
12550
12654
 
12551
- <xsl:call-template name="refine_mathml_insteam_object_style"/>
12655
+ <xsl:call-template name="refine_mathml-instream-foreign-object-style"/>
12552
12656
 
12553
12657
  <xsl:if test="$isGenerateTableIF = 'false'">
12554
12658
  <!-- put MathML in Actual Text -->
@@ -12572,9 +12676,6 @@
12572
12676
  </fo:instream-foreign-object>
12573
12677
  </xsl:template>
12574
12678
 
12575
- <xsl:template name="refine_mathml_insteam_object_style">
12576
- </xsl:template> <!-- refine_mathml_insteam_object_style -->
12577
-
12578
12679
  <xsl:template match="mathml:*" mode="mathml_actual_text">
12579
12680
  <!-- <xsl:text>a+b</xsl:text> -->
12580
12681
  <xsl:text>&lt;</xsl:text>
@@ -13419,6 +13520,7 @@
13419
13520
 
13420
13521
  <!-- admonition -->
13421
13522
  <xsl:attribute-set name="admonition-style">
13523
+ <xsl:attribute name="role">Note</xsl:attribute>
13422
13524
  <xsl:attribute name="border">0.5pt solid black</xsl:attribute>
13423
13525
  <xsl:attribute name="space-before">12pt</xsl:attribute>
13424
13526
  <xsl:attribute name="space-after">12pt</xsl:attribute>
@@ -13428,6 +13530,7 @@
13428
13530
  </xsl:template>
13429
13531
 
13430
13532
  <xsl:attribute-set name="admonition-container-style">
13533
+ <xsl:attribute name="role">SKIP</xsl:attribute>
13431
13534
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
13432
13535
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
13433
13536
  <xsl:attribute name="padding">2mm</xsl:attribute>
@@ -13438,6 +13541,7 @@
13438
13541
  </xsl:template>
13439
13542
 
13440
13543
  <xsl:attribute-set name="admonition-name-style">
13544
+ <xsl:attribute name="role">Lbl</xsl:attribute>
13441
13545
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
13442
13546
  <xsl:attribute name="text-align">center</xsl:attribute>
13443
13547
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
@@ -13465,7 +13569,7 @@
13465
13569
  <xsl:call-template name="refine_admonition-style"/>
13466
13570
 
13467
13571
  <xsl:call-template name="setBlockSpanAll"/>
13468
- <fo:block-container xsl:use-attribute-sets="admonition-container-style" role="SKIP">
13572
+ <fo:block-container xsl:use-attribute-sets="admonition-container-style">
13469
13573
 
13470
13574
  <xsl:call-template name="refine_admonition-container-style"/>
13471
13575
  <fo:block xsl:use-attribute-sets="admonition-name-style">
@@ -13704,8 +13808,10 @@
13704
13808
 
13705
13809
  </xsl:template> <!-- references[not(@normative='true')]/bibitem -->
13706
13810
 
13811
+ <!-- commented 2026-08-06: from https://github.com/metanorma/metanorma-standoc/issues/1140:
13812
+ 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. -->
13707
13813
  <!-- bibitem's notes will be processing in 'processBibitemFollowingNotes' -->
13708
- <xsl:template match="mn:references/mn:note" priority="2"/> <!-- [not(@normative='true')] -->
13814
+ <!-- <xsl:template match="mn:references/mn:note" priority="2"/>--> <!-- [not(@normative='true')] -->
13709
13815
 
13710
13816
  <xsl:template name="insertListItem_Bibitem">
13711
13817
  <xsl:choose>
@@ -14359,9 +14465,9 @@
14359
14465
  <xsl:template name="fo_inline_bookmark">
14360
14466
  <xsl:param name="bookmark_id"/>
14361
14467
  <!-- <fo:inline id="{@id}" font-size="1pt"/> -->
14362
- <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>
14468
+ <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>
14363
14469
  <!-- we need to add zero-width space, otherwise this fo:inline is missing in IF xml -->
14364
- <xsl:if test="not(following-sibling::node()[normalize-space() != ''])"><fo:inline font-size="1pt"> </fo:inline></xsl:if>
14470
+ <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>
14365
14471
  </xsl:template>
14366
14472
  <!-- =================== -->
14367
14473
  <!-- End of Index processing -->
@@ -14455,7 +14561,7 @@
14455
14561
  <xsl:call-template name="set_id_metanorma_form_item">
14456
14562
  <xsl:with-param name="form_item_type" select="$form_item_type"/>
14457
14563
  </xsl:call-template>
14458
- <fo:instream-foreign-object fox:alt-text="Box" baseline-shift="-10%">
14564
+ <fo:instream-foreign-object fox:alt-text="Box" baseline-shift="-10%" fox:placement="Inline">
14459
14565
  <xsl:attribute name="height">3.5mm</xsl:attribute>
14460
14566
  <xsl:attribute name="content-width">100%</xsl:attribute>
14461
14567
  <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
@@ -14482,7 +14588,7 @@
14482
14588
  <xsl:call-template name="set_id_metanorma_form_item">
14483
14589
  <xsl:with-param name="form_item_type" select="$form_item_type"/>
14484
14590
  </xsl:call-template>
14485
- <fo:instream-foreign-object fox:alt-text="Box" baseline-shift="-10%">
14591
+ <fo:instream-foreign-object fox:alt-text="Box" baseline-shift="-10%" fox:placement="Inline">
14486
14592
  <xsl:attribute name="height">3.5mm</xsl:attribute>
14487
14593
  <xsl:attribute name="content-width">100%</xsl:attribute>
14488
14594
  <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
@@ -14529,6 +14635,13 @@
14529
14635
  <!-- End Form's elements processing -->
14530
14636
  <!-- =================== -->
14531
14637
 
14638
+ <xsl:attribute-set name="toc-container-style">
14639
+ <xsl:attribute name="role">Sect</xsl:attribute>
14640
+ </xsl:attribute-set>
14641
+
14642
+ <xsl:template name="refine_toc-container-style">
14643
+ </xsl:template>
14644
+
14532
14645
  <xsl:attribute-set name="toc-style">
14533
14646
  </xsl:attribute-set>
14534
14647
 
@@ -14754,7 +14867,9 @@
14754
14867
  </xsl:variable>
14755
14868
  <mnx:example id="{@id}" alt-text="{normalize-space($example_name)}">
14756
14869
  <xsl:element name="fmt-name" namespace="{$namespace_full}">
14757
- <xsl:value-of select="mn:fmt-xref-label[@container]"/>
14870
+ <xsl:call-template name="capitalize"><!-- https://github.com/metanorma/metanorma-pdfa/issues/72 -->
14871
+ <xsl:with-param name="str" select="mn:fmt-xref-label[@container]"/>
14872
+ </xsl:call-template>
14758
14873
  <xsl:if test="normalize-space($example_name) != ''">
14759
14874
  <xsl:value-of select="mn:fmt-name/mn:span[@class = 'fmt-caption-delim']"/>
14760
14875
  <xsl:copy-of select="$example_name"/>
@@ -15932,6 +16047,13 @@
15932
16047
  <!-- ===================================== -->
15933
16048
  <!-- ===================================== -->
15934
16049
 
16050
+ <xsl:attribute-set name="annex-style">
16051
+ <xsl:attribute name="role">Sect</xsl:attribute>
16052
+ </xsl:attribute-set>
16053
+
16054
+ <xsl:template name="refine_annex-style">
16055
+ </xsl:template>
16056
+
15935
16057
  <xsl:attribute-set name="annex-title-style">
15936
16058
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
15937
16059
  <xsl:attribute name="font-size">14pt</xsl:attribute>
@@ -15945,6 +16067,40 @@
15945
16067
  <xsl:template name="refine_annex-title-style">
15946
16068
  </xsl:template>
15947
16069
 
16070
+ <xsl:template match="mn:annex[normalize-space() != '']">
16071
+ <xsl:choose>
16072
+ <xsl:when test="@continue = 'true'"> <!-- it's using for figure/table on top level for block span -->
16073
+ <fo:block role="SKIP">
16074
+ <xsl:apply-templates/>
16075
+ </fo:block>
16076
+ </xsl:when>
16077
+ <xsl:otherwise>
16078
+
16079
+ <fo:block break-after="page"/>
16080
+ <xsl:call-template name="setNamedDestination"/>
16081
+
16082
+ <fo:block xsl:use-attribute-sets="annex-style">
16083
+
16084
+ <xsl:call-template name="setId"/>
16085
+
16086
+ <!-- <xsl:if test="$namespace = 'iso'"> -->
16087
+ <xsl:call-template name="addTagElementT"/>
16088
+ <!-- </xsl:if> -->
16089
+
16090
+ <xsl:call-template name="setBlockSpanAll"/>
16091
+
16092
+ <xsl:call-template name="refine_annex-style"/>
16093
+
16094
+ <xsl:apply-templates select="mn:fmt-title[@columns = 1]"/>
16095
+
16096
+ <fo:block role="SKIP">
16097
+ <xsl:apply-templates select="node()[not(self::mn:fmt-title and @columns = 1)]"/>
16098
+ </fo:block>
16099
+ </fo:block>
16100
+ </xsl:otherwise>
16101
+ </xsl:choose>
16102
+ </xsl:template>
16103
+
15948
16104
  <xsl:attribute-set name="p-zzSTDTitle1-style">
15949
16105
  </xsl:attribute-set>
15950
16106
 
@@ -16473,22 +16629,17 @@
16473
16629
  </xsl:attribute-set>
16474
16630
 
16475
16631
  <xsl:attribute-set name="clause-style">
16476
-
16632
+ <xsl:attribute name="role">Sect</xsl:attribute>
16477
16633
  </xsl:attribute-set>
16478
16634
 
16479
16635
  <xsl:template name="refine_clause-style">
16480
- <!-- commented for https://github.com/metanorma/metanorma-ribose/issues/421 -->
16481
- <!-- <xsl:if test="$namespace = 'rsd'">
16482
- <xsl:variable name="level">
16483
- <xsl:call-template name="getLevel">
16484
- <xsl:with-param name="depth" select="mn:fmt-title/@depth"/>
16485
- </xsl:call-template>
16486
- </xsl:variable>
16487
- <xsl:if test="$level &gt;= 4">
16488
- <xsl:attribute name="margin-left">13mm</xsl:attribute>
16489
- </xsl:if>
16490
- </xsl:if> -->
16491
- </xsl:template>
16636
+ <xsl:if test="parent::mn:copyright-statement">
16637
+ <xsl:attribute name="role">SKIP</xsl:attribute>
16638
+ </xsl:if>
16639
+ <xsl:if test="@inline-header='true'">
16640
+ <xsl:attribute name="text-align">justify</xsl:attribute>
16641
+ </xsl:if>
16642
+ </xsl:template> <!-- refine_clause-style -->
16492
16643
 
16493
16644
  <!-- main sections -->
16494
16645
  <xsl:template match="/*/mn:sections/*" name="sections_node" priority="2">
@@ -16498,6 +16649,10 @@
16498
16649
 
16499
16650
  <xsl:call-template name="sections_element_style"/>
16500
16651
 
16652
+ <!-- <xsl:if test="$namespace = 'rsd'"> -->
16653
+ <xsl:call-template name="addTagElementT"/>
16654
+ <!-- </xsl:if> -->
16655
+
16501
16656
  <xsl:call-template name="addReviewHelper"/>
16502
16657
 
16503
16658
  <xsl:apply-templates/>
@@ -16536,7 +16691,8 @@
16536
16691
 
16537
16692
  <xsl:template match="//mn:metanorma/mn:preface/*" priority="2" name="preface_node"> <!-- /*/mn:preface/* -->
16538
16693
  <xsl:call-template name="setNamedDestination"/>
16539
- <fo:block>
16694
+ <fo:block role="Sect">
16695
+ <xsl:call-template name="addTagElementT"/>
16540
16696
  <xsl:call-template name="setId"/>
16541
16697
  <xsl:call-template name="addReviewHelper"/>
16542
16698
  <xsl:apply-templates/>
@@ -16565,16 +16721,15 @@
16565
16721
 
16566
16722
  <xsl:template match="mn:clause[normalize-space() != '' or mn:figure or @id]" name="template_clause"> <!-- if clause isn't empty -->
16567
16723
  <xsl:call-template name="setNamedDestination"/>
16568
- <fo:block>
16569
- <xsl:if test="parent::mn:copyright-statement">
16570
- <xsl:attribute name="role">SKIP</xsl:attribute>
16571
- </xsl:if>
16724
+ <fo:block role="Sect">
16572
16725
 
16573
16726
  <xsl:call-template name="setId"/>
16574
16727
 
16728
+ <xsl:call-template name="addTagElementT"/>
16729
+
16575
16730
  <xsl:call-template name="setBlockSpanAll"/>
16576
16731
 
16577
- <xsl:call-template name="refine_clause_style"/>
16732
+ <xsl:call-template name="refine_clause-style"/>
16578
16733
 
16579
16734
  <xsl:call-template name="addReviewHelper"/>
16580
16735
 
@@ -16582,44 +16737,6 @@
16582
16737
  </fo:block>
16583
16738
  </xsl:template>
16584
16739
 
16585
- <xsl:template name="refine_clause_style">
16586
- <xsl:if test="@inline-header='true'">
16587
- <xsl:attribute name="text-align">justify</xsl:attribute>
16588
- </xsl:if>
16589
- </xsl:template> <!-- refine_clause_style -->
16590
-
16591
- <xsl:template match="mn:annex[normalize-space() != '']">
16592
- <xsl:choose>
16593
- <xsl:when test="@continue = 'true'"> <!-- it's using for figure/table on top level for block span -->
16594
- <fo:block>
16595
- <xsl:apply-templates/>
16596
- </fo:block>
16597
- </xsl:when>
16598
- <xsl:otherwise>
16599
-
16600
- <fo:block break-after="page"/>
16601
- <xsl:call-template name="setNamedDestination"/>
16602
-
16603
- <fo:block id="{@id}">
16604
-
16605
- <xsl:call-template name="setBlockSpanAll"/>
16606
-
16607
- <xsl:call-template name="refine_annex_style"/>
16608
-
16609
- </fo:block>
16610
-
16611
- <xsl:apply-templates select="mn:fmt-title[@columns = 1]"/>
16612
-
16613
- <fo:block>
16614
- <xsl:apply-templates select="node()[not(self::mn:fmt-title and @columns = 1)]"/>
16615
- </fo:block>
16616
- </xsl:otherwise>
16617
- </xsl:choose>
16618
- </xsl:template>
16619
-
16620
- <xsl:template name="refine_annex_style">
16621
- </xsl:template>
16622
-
16623
16740
  <xsl:template match="mn:name/text() | mn:fmt-name/text()">
16624
16741
  <!-- 0xA0 to space replacement -->
16625
16742
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
@@ -16664,7 +16781,7 @@
16664
16781
 
16665
16782
  <xsl:template match="mn:blacksquare" name="blacksquare">
16666
16783
  <fo:inline padding-right="2.5mm" baseline-shift="5%">
16667
- <fo:instream-foreign-object content-height="2mm" content-width="2mm" fox:alt-text="Quad">
16784
+ <fo:instream-foreign-object content-height="2mm" content-width="2mm" fox:alt-text="Quad" fox:placement="Inline">
16668
16785
  <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" viewBox="0 0 2 2">
16669
16786
  <rect x="0" y="0" width="2" height="2" fill="black"/>
16670
16787
  </svg>
@@ -16735,6 +16852,13 @@
16735
16852
  <xsl:template name="addTagElementT">
16736
16853
  <xsl:variable name="title_">
16737
16854
  <xsl:apply-templates select="mn:fmt-title"/>
16855
+ <xsl:if test="not(mn:fmt-title) and self::mn:term">
16856
+ <name>
16857
+ <xsl:apply-templates select="mn:fmt-name"/>
16858
+ <xsl:text> </xsl:text>
16859
+ <xsl:apply-templates select="mn:fmt-preferred/node()[1]"/>
16860
+ </name>
16861
+ </xsl:if>
16738
16862
  </xsl:variable>
16739
16863
  <xsl:variable name="title__">
16740
16864
  <xsl:for-each select="xalan:nodeset($title_)/*/node()">
@@ -16744,7 +16868,7 @@
16744
16868
  </xsl:choose>
16745
16869
  </xsl:for-each>
16746
16870
  </xsl:variable>
16747
- <xsl:variable name="title" select="normalize-space($title__)"/>
16871
+ <xsl:variable name="title" select="normalize-space(translate($title__, concat($em_space,' &#8232;'), ' '))"/>
16748
16872
  <xsl:if test="$title != ''">
16749
16873
  <xsl:attribute name="fox:title">
16750
16874
  <xsl:if test="ancestor::mn:sections">
@@ -17613,13 +17737,13 @@
17613
17737
  <xsl:param name="bitmap_width" select="$pageWidth"/>
17614
17738
  <xsl:choose>
17615
17739
  <xsl:when test="*[local-name() = 'svg'] or java:endsWith(java:java.lang.String.new(@src), '.svg')">
17616
- <fo:instream-foreign-object fox:alt-text="Image Front">
17740
+ <fo:instream-foreign-object fox:alt-text="Image Front" fox:placement="Block">
17617
17741
  <xsl:attribute name="content-height"><xsl:value-of select="$svg_content_height"/>mm</xsl:attribute>
17618
17742
  <xsl:call-template name="getSVG"/>
17619
17743
  </fo:instream-foreign-object>
17620
17744
  </xsl:when>
17621
17745
  <xsl:when test="starts-with(@src, 'data:application/pdf;base64')">
17622
- <fo:external-graphic src="{@src}" fox:alt-text="Image Front"/>
17746
+ <fo:external-graphic src="{@src}" fox:alt-text="Image Front" fox:placement="Block"/>
17623
17747
  </xsl:when>
17624
17748
  <xsl:otherwise> <!-- bitmap image -->
17625
17749
  <xsl:variable name="coverimage_src" select="normalize-space(@src)"/>
@@ -17629,7 +17753,7 @@
17629
17753
  <xsl:with-param name="src" select="$coverimage_src"/>
17630
17754
  </xsl:call-template>
17631
17755
  </xsl:variable>
17632
- <fo:external-graphic src="{$coverpage}" width="{$bitmap_width}mm" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Front"/>
17756
+ <fo:external-graphic src="{$coverpage}" width="{$bitmap_width}mm" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Front" fox:placement="Block"/>
17633
17757
  </xsl:if>
17634
17758
  </xsl:otherwise>
17635
17759
  </xsl:choose>