metanorma-iho 0.7.12 → 0.7.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fc89276932179a8f335ed0fd62b779288a60a846e0b1b9cd030d7f6675c7345c
4
- data.tar.gz: 8519cf06a03c92266d81b43136864a6c21ec373a22ddd194447a077e76edbec5
3
+ metadata.gz: 7e27d20ae86209f35cb6af7e706a439b38a896b427f7b81c9f48a2a0de22d765
4
+ data.tar.gz: c901938d5097999b399159c6095c99e5847f830435832aa399223a68d8e33a3d
5
5
  SHA512:
6
- metadata.gz: a3140b1f98fd1dc5ae37d2cc70bd9bb1c7096a9ab775cecdc600abdeb2fc63ab804fb73b04c252d0f957d21a82795654a1d63237970f865e3356ccfb2de2a767
7
- data.tar.gz: caad18f0852baec917dc877473391bb503badc560ab644f8f35c3c4a522a3f2a7a41169e9abe845117be372de48b2e97758cf761bdf964cc078ffceb4aa9131c
6
+ metadata.gz: fb07bf84448e8d7c6b5c5a0b6dcf284e70698d9e517104832a0e8ebe935c5f5990d83cbb73226b93c6057ea4ddf48b8dd40bf542e68db83974eac39aabf634d2
7
+ data.tar.gz: eca0d7f5411f90409085a8454216bc506707a5d5db746cab6af734375dc377e3cd084a49c85d9307a08b4f2d48d62ff7d4eacf2aba506b5cd32238a1d5286f67
@@ -1806,6 +1806,7 @@
1806
1806
  </xsl:attribute-set>
1807
1807
 
1808
1808
  <xsl:attribute-set name="figure-block-style">
1809
+ <xsl:attribute name="role">SKIP</xsl:attribute>
1809
1810
 
1810
1811
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1811
1812
 
@@ -1816,6 +1817,7 @@
1816
1817
  </xsl:attribute-set>
1817
1818
 
1818
1819
  <xsl:attribute-set name="figure-name-style">
1820
+ <xsl:attribute name="role">Caption</xsl:attribute>
1819
1821
 
1820
1822
  <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
1821
1823
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -1861,6 +1863,7 @@
1861
1863
  </xsl:template>
1862
1864
 
1863
1865
  <xsl:attribute-set name="image-style">
1866
+ <xsl:attribute name="role">SKIP</xsl:attribute>
1864
1867
  <xsl:attribute name="text-align">center</xsl:attribute>
1865
1868
 
1866
1869
  </xsl:attribute-set>
@@ -2135,6 +2138,11 @@
2135
2138
 
2136
2139
  </xsl:attribute-set> <!-- bibitem-non-normative-list-style -->
2137
2140
 
2141
+ <xsl:attribute-set name="bibitem-non-normative-list-item-style">
2142
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2143
+
2144
+ </xsl:attribute-set>
2145
+
2138
2146
  <!-- bibitem in bibliography section (references/@normative="false"), list body -->
2139
2147
  <xsl:attribute-set name="bibitem-normative-list-body-style">
2140
2148
 
@@ -2529,14 +2537,14 @@
2529
2537
  <xsl:value-of select="$sep"/><xsl:value-of select="$zero_width_space"/>
2530
2538
  </xsl:when>
2531
2539
  <xsl:otherwise>
2532
- <fo:inline keep-together.within-line="always"><xsl:apply-templates/></fo:inline>
2540
+ <fo:inline keep-together.within-line="always" role="SKIP"><xsl:apply-templates/></fo:inline>
2533
2541
  </xsl:otherwise>
2534
2542
  </xsl:choose>
2535
2543
  </xsl:for-each>
2536
2544
  </xsl:when>
2537
2545
 
2538
2546
  <xsl:otherwise>
2539
- <fo:inline keep-together.within-line="always"><xsl:apply-templates/></fo:inline>
2547
+ <fo:inline keep-together.within-line="always" role="SKIP"><xsl:apply-templates/></fo:inline>
2540
2548
  </xsl:otherwise>
2541
2549
 
2542
2550
  </xsl:choose>
@@ -2546,7 +2554,7 @@
2546
2554
  <!-- Preface boilerplate sections processing -->
2547
2555
  <!-- ================================= -->
2548
2556
  <xsl:template match="*[local-name()='copyright-statement']">
2549
- <fo:block xsl:use-attribute-sets="copyright-statement-style">
2557
+ <fo:block xsl:use-attribute-sets="copyright-statement-style" role="SKIP">
2550
2558
  <xsl:apply-templates/>
2551
2559
  </fo:block>
2552
2560
  </xsl:template> <!-- copyright-statement -->
@@ -2716,7 +2724,7 @@
2716
2724
  </xsl:choose>
2717
2725
  </xsl:variable>
2718
2726
 
2719
- <fo:block-container xsl:use-attribute-sets="table-container-style">
2727
+ <fo:block-container xsl:use-attribute-sets="table-container-style" role="SKIP">
2720
2728
 
2721
2729
  <xsl:call-template name="refine_table-container-style">
2722
2730
  <xsl:with-param name="margin-side" select="$margin-side"/>
@@ -3749,7 +3757,7 @@
3749
3757
  </xsl:choose>
3750
3758
  </xsl:variable>
3751
3759
  <xsl:variable name="footnote_inline">
3752
- <fo:inline>
3760
+ <fo:inline role="Reference">
3753
3761
 
3754
3762
  <xsl:variable name="fn_styles">
3755
3763
  <xsl:choose>
@@ -3772,7 +3780,7 @@
3772
3780
 
3773
3781
  <xsl:call-template name="insert_basic_link">
3774
3782
  <xsl:with-param name="element">
3775
- <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
3783
+ <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}" role="Lbl">
3776
3784
  <xsl:copy-of select="$current_fn_number_text"/>
3777
3785
  </fo:basic-link>
3778
3786
  </xsl:with-param>
@@ -3785,17 +3793,17 @@
3785
3793
  <xsl:copy-of select="$footnote_inline"/>
3786
3794
  </xsl:when>
3787
3795
  <xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false'">
3788
- <fo:footnote xsl:use-attribute-sets="fn-style">
3796
+ <fo:footnote xsl:use-attribute-sets="fn-style" role="SKIP">
3789
3797
  <xsl:copy-of select="$footnote_inline"/>
3790
- <fo:footnote-body>
3798
+ <fo:footnote-body role="Note">
3791
3799
 
3792
- <fo:block-container xsl:use-attribute-sets="fn-container-body-style">
3800
+ <fo:block-container xsl:use-attribute-sets="fn-container-body-style" role="SKIP">
3793
3801
 
3794
- <fo:block xsl:use-attribute-sets="fn-body-style">
3802
+ <fo:block xsl:use-attribute-sets="fn-body-style" role="SKIP">
3795
3803
 
3796
3804
  <xsl:call-template name="refine_fn-body-style"/>
3797
3805
 
3798
- <fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style">
3806
+ <fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style" role="Lbl">
3799
3807
 
3800
3808
  <xsl:call-template name="refine_fn-body-num-style"/>
3801
3809
 
@@ -4057,11 +4065,11 @@
4057
4065
  </xsl:template>
4058
4066
 
4059
4067
  <xsl:template match="*[local-name()='fn']/text()[normalize-space() != '']">
4060
- <fo:inline><xsl:value-of select="."/></fo:inline>
4068
+ <fo:inline role="SKIP"><xsl:value-of select="."/></fo:inline>
4061
4069
  </xsl:template>
4062
4070
 
4063
4071
  <xsl:template match="*[local-name()='fn']//*[local-name()='p']">
4064
- <fo:inline>
4072
+ <fo:inline role="P">
4065
4073
  <xsl:apply-templates/>
4066
4074
  </fo:inline>
4067
4075
  </xsl:template>
@@ -4076,7 +4084,7 @@
4076
4084
  <xsl:variable name="isAdded" select="@added"/>
4077
4085
  <xsl:variable name="isDeleted" select="@deleted"/>
4078
4086
  <!-- <dl><xsl:copy-of select="."/></dl> -->
4079
- <fo:block-container xsl:use-attribute-sets="dl-block-style">
4087
+ <fo:block-container xsl:use-attribute-sets="dl-block-style" role="SKIP">
4080
4088
 
4081
4089
  <xsl:call-template name="setBlockSpanAll"/>
4082
4090
 
@@ -4111,7 +4119,7 @@
4111
4119
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
4112
4120
  </xsl:call-template>
4113
4121
 
4114
- <fo:block-container margin-left="0mm">
4122
+ <fo:block-container margin-left="0mm" role="SKIP">
4115
4123
 
4116
4124
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
4117
4125
 
@@ -4176,7 +4184,7 @@
4176
4184
 
4177
4185
  <!-- a few components -->
4178
4186
  <xsl:if test="$onlyOneComponent = 'false'">
4179
- <fo:block>
4187
+ <fo:block role="SKIP">
4180
4188
 
4181
4189
  <xsl:call-template name="refine_multicomponent_style"/>
4182
4190
 
@@ -4184,7 +4192,7 @@
4184
4192
  <xsl:attribute name="margin-top">0</xsl:attribute>
4185
4193
  </xsl:if>
4186
4194
 
4187
- <fo:block>
4195
+ <fo:block role="SKIP">
4188
4196
 
4189
4197
  <xsl:call-template name="refine_multicomponent_block_style"/>
4190
4198
 
@@ -4785,6 +4793,9 @@
4785
4793
 
4786
4794
  <xsl:template name="refine_strong_style">
4787
4795
 
4796
+ <xsl:if test="ancestor::*['preferred']">
4797
+ <xsl:attribute name="role">SKIP</xsl:attribute>
4798
+ </xsl:if>
4788
4799
  </xsl:template>
4789
4800
 
4790
4801
  <xsl:template match="*[local-name()='padding']">
@@ -5788,6 +5799,18 @@
5788
5799
  </xsl:copy>
5789
5800
  </xsl:template>
5790
5801
 
5802
+ <xsl:variable name="font_main_root_style">
5803
+ <root-style xsl:use-attribute-sets="root-style">
5804
+ </root-style>
5805
+ </xsl:variable>
5806
+ <xsl:variable name="font_main_root_style_font_family" select="xalan:nodeset($font_main_root_style)/root-style/@font-family"/>
5807
+ <xsl:variable name="font_main">
5808
+ <xsl:choose>
5809
+ <xsl:when test="contains($font_main_root_style_font_family, ',')"><xsl:value-of select="substring-before($font_main_root_style_font_family, ',')"/></xsl:when>
5810
+ <xsl:otherwise><xsl:value-of select="$font_main_root_style_font_family"/></xsl:otherwise>
5811
+ </xsl:choose>
5812
+ </xsl:variable>
5813
+
5791
5814
  <xsl:template match="*[local-name()='th' or local-name()='td']" mode="simple-table-id">
5792
5815
  <xsl:param name="id"/>
5793
5816
  <xsl:copy>
@@ -5826,6 +5849,33 @@
5826
5849
 
5827
5850
  <!-- td_text='<xsl:copy-of select="$td_text"/>' -->
5828
5851
 
5852
+ <xsl:variable name="words_with_width">
5853
+ <!-- calculate width for 'word' which contain text only (without formatting tags inside) -->
5854
+ <xsl:for-each select="xalan:nodeset($td_text)//*[local-name() = 'word'][normalize-space() != ''][not(*)]">
5855
+ <xsl:copy>
5856
+ <xsl:copy-of select="@*"/>
5857
+ <xsl:attribute name="width">
5858
+ <xsl:value-of select="java:org.metanorma.fop.Util.getStringWidth(., $font_main)"/> <!-- Example: 'Times New Roman' -->
5859
+ </xsl:attribute>
5860
+ <xsl:copy-of select="node()"/>
5861
+ </xsl:copy>
5862
+ </xsl:for-each>
5863
+ </xsl:variable>
5864
+
5865
+ <xsl:variable name="words_with_width_sorted">
5866
+ <xsl:for-each select="xalan:nodeset($words_with_width)//*[local-name() = 'word']">
5867
+ <xsl:sort select="@width" data-type="number" order="descending"/>
5868
+ <!-- select word maximal width only -->
5869
+ <xsl:if test="position() = 1">
5870
+ <xsl:copy-of select="."/>
5871
+ </xsl:if>
5872
+ </xsl:for-each>
5873
+ <!-- add 'word' with formatting tags inside -->
5874
+ <xsl:for-each select="xalan:nodeset($td_text)//*[local-name() = 'word'][normalize-space() != ''][*]">
5875
+ <xsl:copy-of select="."/>
5876
+ </xsl:for-each>
5877
+ </xsl:variable>
5878
+
5829
5879
  <xsl:variable name="words">
5830
5880
  <xsl:for-each select=".//*[local-name() = 'image' or local-name() = 'stem']">
5831
5881
  <word>
@@ -5833,9 +5883,12 @@
5833
5883
  </word>
5834
5884
  </xsl:for-each>
5835
5885
 
5836
- <xsl:for-each select="xalan:nodeset($td_text)//*[local-name() = 'word'][normalize-space() != '']">
5886
+ <xsl:for-each select="xalan:nodeset($words_with_width_sorted)//*[local-name() = 'word'][normalize-space() != '']">
5837
5887
  <xsl:copy-of select="."/>
5838
5888
  </xsl:for-each>
5889
+ <!-- <xsl:for-each select="xalan:nodeset($td_text)//*[local-name() = 'word'][normalize-space() != '']">
5890
+ <xsl:copy-of select="."/>
5891
+ </xsl:for-each> -->
5839
5892
 
5840
5893
  </xsl:variable>
5841
5894
 
@@ -6296,10 +6349,10 @@
6296
6349
  <xsl:copy>
6297
6350
  <xsl:apply-templates select="@*" mode="mathml"/>
6298
6351
  <xsl:if test="not(@lspace)">
6299
- <xsl:attribute name="lspace">0.4em</xsl:attribute>
6352
+ <xsl:attribute name="lspace">0.2em</xsl:attribute>
6300
6353
  </xsl:if>
6301
- <xsl:if test="not(@rspace)">
6302
- <xsl:attribute name="rspace">0.4em</xsl:attribute>
6354
+ <xsl:if test="not(@rspace) and not(following-sibling::*[1][self::mathml:mo and normalize-space(text()) = '|'])">
6355
+ <xsl:attribute name="rspace">0.2em</xsl:attribute>
6303
6356
  </xsl:if>
6304
6357
  <xsl:apply-templates mode="mathml"/>
6305
6358
  </xsl:copy>
@@ -6316,6 +6369,27 @@
6316
6369
  </xsl:copy>
6317
6370
  </xsl:template>
6318
6371
 
6372
+ <!-- increase space before '(' -->
6373
+ <xsl:template match="mathml:mo[normalize-space(text()) = '(']" mode="mathml">
6374
+ <xsl:copy>
6375
+ <xsl:apply-templates select="@*" mode="mathml"/>
6376
+ <xsl:if test="(preceding-sibling::* and not(preceding-sibling::*[1][self::mathml:mo])) or (../preceding-sibling::* and not(../preceding-sibling::*[1][self::mathml:mo]))">
6377
+ <xsl:if test="not(@lspace)">
6378
+ <xsl:attribute name="lspace">0.4em</xsl:attribute>
6379
+ <xsl:choose>
6380
+ <xsl:when test="preceding-sibling::*[1][self::mathml:mi or self::mathml:mstyle]">
6381
+ <xsl:attribute name="lspace">0.2em</xsl:attribute>
6382
+ </xsl:when>
6383
+ <xsl:when test="../preceding-sibling::*[1][self::mathml:mi or self::mathml:mstyle]">
6384
+ <xsl:attribute name="lspace">0.2em</xsl:attribute>
6385
+ </xsl:when>
6386
+ </xsl:choose>
6387
+ </xsl:if>
6388
+ </xsl:if>
6389
+ <xsl:apply-templates mode="mathml"/>
6390
+ </xsl:copy>
6391
+ </xsl:template>
6392
+
6319
6393
  <!-- Examples:
6320
6394
  <stem type="AsciiMath">x = 1</stem>
6321
6395
  <stem type="AsciiMath"><asciimath>x = 1</asciimath></stem>
@@ -6475,7 +6549,7 @@
6475
6549
  <!-- formula -->
6476
6550
  <!-- ====== -->
6477
6551
  <xsl:template match="*[local-name() = 'formula']" name="formula">
6478
- <fo:block-container margin-left="0mm">
6552
+ <fo:block-container margin-left="0mm" role="SKIP">
6479
6553
  <xsl:if test="parent::*[local-name() = 'note']">
6480
6554
  <xsl:attribute name="margin-left">
6481
6555
  <xsl:choose>
@@ -6485,7 +6559,7 @@
6485
6559
  </xsl:attribute>
6486
6560
 
6487
6561
  </xsl:if>
6488
- <fo:block-container margin-left="0mm">
6562
+ <fo:block-container margin-left="0mm" role="SKIP">
6489
6563
  <fo:block id="{@id}">
6490
6564
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> <!-- formula's number will be process in 'stem' template -->
6491
6565
  </fo:block>
@@ -6565,13 +6639,13 @@
6565
6639
 
6566
6640
  <xsl:template match="*[local-name() = 'note']" name="note">
6567
6641
 
6568
- <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style">
6642
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
6569
6643
 
6570
6644
  <xsl:call-template name="setBlockSpanAll"/>
6571
6645
 
6572
6646
  <xsl:call-template name="refine_note-style"/>
6573
6647
 
6574
- <fo:block-container margin-left="0mm" margin-right="0mm">
6648
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
6575
6649
 
6576
6650
  <fo:block>
6577
6651
 
@@ -6735,12 +6809,13 @@
6735
6809
 
6736
6810
  <xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']">
6737
6811
  <xsl:if test="normalize-space() != ''">
6738
- <xsl:variable name="level">
6812
+ <!-- <xsl:variable name="level">
6739
6813
  <xsl:call-template name="getLevelTermName"/>
6740
6814
  </xsl:variable>
6741
6815
  <fo:inline role="H{$level}">
6742
- <xsl:apply-templates/>
6743
- </fo:inline>
6816
+ <xsl:apply-templates />
6817
+ </fo:inline> -->
6818
+ <xsl:apply-templates/>
6744
6819
  </xsl:if>
6745
6820
  </xsl:template>
6746
6821
  <!-- ====== -->
@@ -6764,7 +6839,7 @@
6764
6839
  <!-- Example: Dimensions in millimeters -->
6765
6840
  <xsl:apply-templates select="*[local-name() = 'note'][@type = 'units']"/>
6766
6841
 
6767
- <fo:block xsl:use-attribute-sets="figure-style">
6842
+ <fo:block xsl:use-attribute-sets="figure-style" role="SKIP">
6768
6843
  <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note' and @type = 'units')]"/>
6769
6844
  </fo:block>
6770
6845
  <xsl:for-each select="*[local-name() = 'note'][not(@type = 'units')]">
@@ -7898,7 +7973,7 @@
7898
7973
  </xsl:when>
7899
7974
 
7900
7975
  <xsl:otherwise>
7901
- <fo:block-container xsl:use-attribute-sets="sourcecode-container-style">
7976
+ <fo:block-container xsl:use-attribute-sets="sourcecode-container-style" role="SKIP">
7902
7977
 
7903
7978
  <xsl:if test="not(ancestor::*[local-name() = 'li']) or ancestor::*[local-name() = 'example']">
7904
7979
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
@@ -7919,7 +7994,7 @@
7919
7994
  </xsl:attribute>
7920
7995
 
7921
7996
  </xsl:if>
7922
- <fo:block-container margin-left="0mm">
7997
+ <fo:block-container margin-left="0mm" role="SKIP">
7923
7998
 
7924
7999
  <fo:block xsl:use-attribute-sets="sourcecode-style">
7925
8000
 
@@ -8465,11 +8540,11 @@
8465
8540
  <!-- requirement, recommendation, permission table -->
8466
8541
  <!-- ========== -->
8467
8542
  <xsl:template match="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
8468
- <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt">
8543
+ <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt" role="SKIP">
8469
8544
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
8470
8545
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
8471
8546
  </xsl:if>
8472
- <fo:block-container margin-left="0mm" margin-right="0mm">
8547
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
8473
8548
  <fo:table id="{@id}" table-layout="fixed" width="100%"> <!-- border="1pt solid black" -->
8474
8549
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
8475
8550
  <!-- <xsl:attribute name="border">0.5pt solid black</xsl:attribute> -->
@@ -8631,7 +8706,7 @@
8631
8706
  -->
8632
8707
  <xsl:template match="*[local-name() = 'example']">
8633
8708
 
8634
- <fo:block-container id="{@id}" xsl:use-attribute-sets="example-style">
8709
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="example-style" role="SKIP">
8635
8710
 
8636
8711
  <xsl:call-template name="setBlockSpanAll"/>
8637
8712
 
@@ -8642,7 +8717,7 @@
8642
8717
  inline
8643
8718
  </xsl:variable>
8644
8719
 
8645
- <fo:block-container margin-left="0mm">
8720
+ <fo:block-container margin-left="0mm" role="SKIP">
8646
8721
 
8647
8722
  <xsl:choose>
8648
8723
 
@@ -8655,8 +8730,8 @@
8655
8730
  </xsl:apply-templates>
8656
8731
  </fo:block>
8657
8732
 
8658
- <fo:block-container xsl:use-attribute-sets="example-body-style">
8659
- <fo:block-container margin-left="0mm" margin-right="0mm">
8733
+ <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
8734
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
8660
8735
  <xsl:apply-templates select="node()[not(local-name() = 'name')]">
8661
8736
  <xsl:with-param name="fo_element" select="$fo_element"/>
8662
8737
  </xsl:apply-templates>
@@ -8709,8 +8784,8 @@
8709
8784
 
8710
8785
  <xsl:if test="*[not(local-name() = 'name')][position() &gt; 1]">
8711
8786
  <!-- display further elements in blocks -->
8712
- <fo:block-container xsl:use-attribute-sets="example-body-style">
8713
- <fo:block-container margin-left="0mm" margin-right="0mm">
8787
+ <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
8788
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
8714
8789
  <xsl:apply-templates select="*[not(local-name() = 'name')][position() &gt; 1]">
8715
8790
  <xsl:with-param name="fo_element" select="'block'"/>
8716
8791
  </xsl:apply-templates>
@@ -8763,7 +8838,7 @@
8763
8838
  </xsl:variable>
8764
8839
  <xsl:choose>
8765
8840
  <xsl:when test="starts-with(normalize-space($element), 'block')">
8766
- <fo:block-container>
8841
+ <fo:block-container role="SKIP">
8767
8842
  <xsl:if test="ancestor::*[local-name() = 'li'] and contains(normalize-space($fo_element), 'block')">
8768
8843
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
8769
8844
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
@@ -8904,7 +8979,7 @@
8904
8979
  <!-- author -->
8905
8980
  <!-- ====== -->
8906
8981
  <xsl:template match="*[local-name() = 'quote']">
8907
- <fo:block-container margin-left="0mm">
8982
+ <fo:block-container margin-left="0mm" role="SKIP">
8908
8983
 
8909
8984
  <xsl:call-template name="setBlockSpanAll"/>
8910
8985
 
@@ -8914,12 +8989,12 @@
8914
8989
  </xsl:if>
8915
8990
  </xsl:if>
8916
8991
 
8917
- <fo:block-container margin-left="0mm">
8918
- <fo:block-container xsl:use-attribute-sets="quote-style">
8992
+ <fo:block-container margin-left="0mm" role="SKIP">
8993
+ <fo:block-container xsl:use-attribute-sets="quote-style" role="SKIP">
8919
8994
 
8920
8995
  <xsl:call-template name="refine_quote-style"/>
8921
8996
 
8922
- <fo:block-container margin-left="0mm" margin-right="0mm">
8997
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
8923
8998
  <fo:block role="BlockQuote">
8924
8999
  <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
8925
9000
  </fo:block>
@@ -9079,10 +9154,10 @@
9079
9154
 
9080
9155
  <xsl:choose>
9081
9156
  <xsl:when test="$lang = 'zh'">
9082
- <fo:inline><xsl:value-of select="$tab_zh"/></fo:inline>
9157
+ <fo:inline role="SKIP"><xsl:value-of select="$tab_zh"/></fo:inline>
9083
9158
  </xsl:when>
9084
9159
  <xsl:when test="../../@inline-header = 'true'">
9085
- <fo:inline font-size="90%">
9160
+ <fo:inline font-size="90%" role="SKIP">
9086
9161
  <xsl:call-template name="insertNonBreakSpaces">
9087
9162
  <xsl:with-param name="count" select="$padding-right"/>
9088
9163
  </xsl:call-template>
@@ -9090,7 +9165,7 @@
9090
9165
  </xsl:when>
9091
9166
  <xsl:otherwise>
9092
9167
  <xsl:variable name="direction"><xsl:if test="$lang = 'ar'"><xsl:value-of select="$RLM"/></xsl:if></xsl:variable>
9093
- <fo:inline padding-right="{$padding-right}mm"><xsl:value-of select="$direction"/>​</fo:inline>
9168
+ <fo:inline padding-right="{$padding-right}mm" role="SKIP"><xsl:value-of select="$direction"/>​</fo:inline>
9094
9169
  </xsl:otherwise>
9095
9170
  </xsl:choose>
9096
9171
 
@@ -9120,12 +9195,12 @@
9120
9195
  <fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="preferred-block-style">
9121
9196
 
9122
9197
  <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'preferred'])"> <!-- if first preffered in term, then display term's name -->
9123
- <fo:block xsl:use-attribute-sets="term-name-style">
9198
+ <fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
9124
9199
  <xsl:apply-templates select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"/>
9125
9200
  </fo:block>
9126
9201
  </xsl:if>
9127
9202
 
9128
- <fo:block xsl:use-attribute-sets="preferred-term-style">
9203
+ <fo:block xsl:use-attribute-sets="preferred-term-style" role="SKIP">
9129
9204
  <xsl:call-template name="setStyle_preferred"/>
9130
9205
  <xsl:apply-templates/>
9131
9206
  </fo:block>
@@ -9166,7 +9241,7 @@
9166
9241
  <!-- definition -->
9167
9242
  <!-- ========== -->
9168
9243
  <xsl:template match="*[local-name() = 'definition']">
9169
- <fo:block xsl:use-attribute-sets="definition-style">
9244
+ <fo:block xsl:use-attribute-sets="definition-style" role="SKIP">
9170
9245
  <xsl:apply-templates/>
9171
9246
  </fo:block>
9172
9247
  </xsl:template>
@@ -9209,6 +9284,10 @@
9209
9284
 
9210
9285
  <xsl:template match="*[local-name() = 'clause']">
9211
9286
  <fo:block>
9287
+ <xsl:if test="parent::*[local-name() = 'copyright-statement']">
9288
+ <xsl:attribute name="role">SKIP</xsl:attribute>
9289
+ </xsl:if>
9290
+
9212
9291
  <xsl:call-template name="setId"/>
9213
9292
 
9214
9293
  <xsl:call-template name="setBlockSpanAll"/>
@@ -9448,7 +9527,7 @@
9448
9527
  <xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
9449
9528
  <xsl:choose>
9450
9529
  <xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
9451
- <fo:block-container>
9530
+ <fo:block-container role="SKIP">
9452
9531
  <xsl:attribute name="margin-left">
9453
9532
  <xsl:choose>
9454
9533
  <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
@@ -9458,7 +9537,7 @@
9458
9537
 
9459
9538
  <xsl:call-template name="refine_list_container_style"/>
9460
9539
 
9461
- <fo:block-container margin-left="0mm">
9540
+ <fo:block-container margin-left="0mm" role="SKIP">
9462
9541
  <fo:block>
9463
9542
  <xsl:apply-templates select="." mode="list"/>
9464
9543
  </fo:block>
@@ -9467,7 +9546,7 @@
9467
9546
  </xsl:when>
9468
9547
  <xsl:otherwise>
9469
9548
 
9470
- <fo:block>
9549
+ <fo:block role="SKIP">
9471
9550
  <xsl:apply-templates select="." mode="list"/>
9472
9551
  </fo:block>
9473
9552
 
@@ -9885,7 +9964,10 @@
9885
9964
  <!-- Reference sections (Normative References and Bibliography) -->
9886
9965
  <!-- ========================================================== -->
9887
9966
  <xsl:template match="*[local-name() = 'references'][@hidden='true']" priority="3"/>
9888
- <xsl:template match="*[local-name() = 'bibitem'][@hidden='true']" priority="3"/>
9967
+ <xsl:template match="*[local-name() = 'bibitem'][@hidden='true']" priority="3">
9968
+ <xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][local-name() = 'bibitem'] and 1 = 1)"/>
9969
+
9970
+ </xsl:template>
9889
9971
  <!-- don't display bibitem with @id starts with '_hidden', that was introduced for references integrity -->
9890
9972
  <xsl:template match="*[local-name() = 'bibitem'][starts-with(@id, 'hidden_bibitem_')]" priority="3"/>
9891
9973
 
@@ -9963,11 +10045,41 @@
9963
10045
 
9964
10046
  <!-- Bibliography (non-normative references) -->
9965
10047
  <xsl:template match="*[local-name() = 'references'][not(@normative='true')]/*[local-name() = 'bibitem']" name="bibitem_non_normative" priority="2">
10048
+ <xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][local-name() = 'bibitem'] and 1 = 1)"/> <!-- current bibiitem is non-first -->
9966
10049
 
9967
10050
  <xsl:call-template name="bibitem"/>
9968
10051
 
9969
10052
  </xsl:template> <!-- references[not(@normative='true')]/bibitem -->
9970
10053
 
10054
+ <xsl:template name="insertListItem_Bibitem">
10055
+ <xsl:choose>
10056
+ <xsl:when test="@hidden = 'true'"><!-- skip --></xsl:when>
10057
+ <xsl:otherwise>
10058
+ <fo:list-item id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-item-style">
10059
+ <fo:list-item-label end-indent="label-end()">
10060
+ <fo:block role="SKIP">
10061
+ <fo:inline role="SKIP">
10062
+ <xsl:apply-templates select="*[local-name() = 'biblio-tag']">
10063
+ <xsl:with-param name="biblio_tag_part">first</xsl:with-param>
10064
+ </xsl:apply-templates>
10065
+ </fo:inline>
10066
+ </fo:block>
10067
+ </fo:list-item-label>
10068
+ <fo:list-item-body start-indent="body-start()">
10069
+ <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style" role="SKIP">
10070
+ <xsl:call-template name="processBibitem">
10071
+ <xsl:with-param name="biblio_tag_part">last</xsl:with-param>
10072
+ </xsl:call-template>
10073
+ </fo:block>
10074
+ </fo:list-item-body>
10075
+ </fo:list-item>
10076
+ </xsl:otherwise>
10077
+ </xsl:choose>
10078
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'bibitem']">
10079
+ <xsl:with-param name="skip">false</xsl:with-param>
10080
+ </xsl:apply-templates>
10081
+ </xsl:template>
10082
+
9971
10083
  <xsl:template name="processBibitem">
9972
10084
  <xsl:param name="biblio_tag_part">both</xsl:param>
9973
10085
 
@@ -10301,7 +10413,7 @@
10301
10413
 
10302
10414
  <xsl:call-template name="setBlockSpanAll"/>
10303
10415
 
10304
- <fo:block-container xsl:use-attribute-sets="admonition-container-style">
10416
+ <fo:block-container xsl:use-attribute-sets="admonition-container-style" role="SKIP">
10305
10417
 
10306
10418
  <fo:block xsl:use-attribute-sets="admonition-name-style">
10307
10419
  <xsl:call-template name="displayAdmonitionName"/>
@@ -1806,6 +1806,7 @@
1806
1806
  </xsl:attribute-set>
1807
1807
 
1808
1808
  <xsl:attribute-set name="figure-block-style">
1809
+ <xsl:attribute name="role">SKIP</xsl:attribute>
1809
1810
 
1810
1811
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1811
1812
 
@@ -1816,6 +1817,7 @@
1816
1817
  </xsl:attribute-set>
1817
1818
 
1818
1819
  <xsl:attribute-set name="figure-name-style">
1820
+ <xsl:attribute name="role">Caption</xsl:attribute>
1819
1821
 
1820
1822
  <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
1821
1823
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -1861,6 +1863,7 @@
1861
1863
  </xsl:template>
1862
1864
 
1863
1865
  <xsl:attribute-set name="image-style">
1866
+ <xsl:attribute name="role">SKIP</xsl:attribute>
1864
1867
  <xsl:attribute name="text-align">center</xsl:attribute>
1865
1868
 
1866
1869
  </xsl:attribute-set>
@@ -2135,6 +2138,11 @@
2135
2138
 
2136
2139
  </xsl:attribute-set> <!-- bibitem-non-normative-list-style -->
2137
2140
 
2141
+ <xsl:attribute-set name="bibitem-non-normative-list-item-style">
2142
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2143
+
2144
+ </xsl:attribute-set>
2145
+
2138
2146
  <!-- bibitem in bibliography section (references/@normative="false"), list body -->
2139
2147
  <xsl:attribute-set name="bibitem-normative-list-body-style">
2140
2148
 
@@ -2529,14 +2537,14 @@
2529
2537
  <xsl:value-of select="$sep"/><xsl:value-of select="$zero_width_space"/>
2530
2538
  </xsl:when>
2531
2539
  <xsl:otherwise>
2532
- <fo:inline keep-together.within-line="always"><xsl:apply-templates/></fo:inline>
2540
+ <fo:inline keep-together.within-line="always" role="SKIP"><xsl:apply-templates/></fo:inline>
2533
2541
  </xsl:otherwise>
2534
2542
  </xsl:choose>
2535
2543
  </xsl:for-each>
2536
2544
  </xsl:when>
2537
2545
 
2538
2546
  <xsl:otherwise>
2539
- <fo:inline keep-together.within-line="always"><xsl:apply-templates/></fo:inline>
2547
+ <fo:inline keep-together.within-line="always" role="SKIP"><xsl:apply-templates/></fo:inline>
2540
2548
  </xsl:otherwise>
2541
2549
 
2542
2550
  </xsl:choose>
@@ -2546,7 +2554,7 @@
2546
2554
  <!-- Preface boilerplate sections processing -->
2547
2555
  <!-- ================================= -->
2548
2556
  <xsl:template match="*[local-name()='copyright-statement']">
2549
- <fo:block xsl:use-attribute-sets="copyright-statement-style">
2557
+ <fo:block xsl:use-attribute-sets="copyright-statement-style" role="SKIP">
2550
2558
  <xsl:apply-templates/>
2551
2559
  </fo:block>
2552
2560
  </xsl:template> <!-- copyright-statement -->
@@ -2716,7 +2724,7 @@
2716
2724
  </xsl:choose>
2717
2725
  </xsl:variable>
2718
2726
 
2719
- <fo:block-container xsl:use-attribute-sets="table-container-style">
2727
+ <fo:block-container xsl:use-attribute-sets="table-container-style" role="SKIP">
2720
2728
 
2721
2729
  <xsl:call-template name="refine_table-container-style">
2722
2730
  <xsl:with-param name="margin-side" select="$margin-side"/>
@@ -3749,7 +3757,7 @@
3749
3757
  </xsl:choose>
3750
3758
  </xsl:variable>
3751
3759
  <xsl:variable name="footnote_inline">
3752
- <fo:inline>
3760
+ <fo:inline role="Reference">
3753
3761
 
3754
3762
  <xsl:variable name="fn_styles">
3755
3763
  <xsl:choose>
@@ -3772,7 +3780,7 @@
3772
3780
 
3773
3781
  <xsl:call-template name="insert_basic_link">
3774
3782
  <xsl:with-param name="element">
3775
- <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
3783
+ <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}" role="Lbl">
3776
3784
  <xsl:copy-of select="$current_fn_number_text"/>
3777
3785
  </fo:basic-link>
3778
3786
  </xsl:with-param>
@@ -3785,17 +3793,17 @@
3785
3793
  <xsl:copy-of select="$footnote_inline"/>
3786
3794
  </xsl:when>
3787
3795
  <xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false'">
3788
- <fo:footnote xsl:use-attribute-sets="fn-style">
3796
+ <fo:footnote xsl:use-attribute-sets="fn-style" role="SKIP">
3789
3797
  <xsl:copy-of select="$footnote_inline"/>
3790
- <fo:footnote-body>
3798
+ <fo:footnote-body role="Note">
3791
3799
 
3792
- <fo:block-container xsl:use-attribute-sets="fn-container-body-style">
3800
+ <fo:block-container xsl:use-attribute-sets="fn-container-body-style" role="SKIP">
3793
3801
 
3794
- <fo:block xsl:use-attribute-sets="fn-body-style">
3802
+ <fo:block xsl:use-attribute-sets="fn-body-style" role="SKIP">
3795
3803
 
3796
3804
  <xsl:call-template name="refine_fn-body-style"/>
3797
3805
 
3798
- <fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style">
3806
+ <fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style" role="Lbl">
3799
3807
 
3800
3808
  <xsl:call-template name="refine_fn-body-num-style"/>
3801
3809
 
@@ -4057,11 +4065,11 @@
4057
4065
  </xsl:template>
4058
4066
 
4059
4067
  <xsl:template match="*[local-name()='fn']/text()[normalize-space() != '']">
4060
- <fo:inline><xsl:value-of select="."/></fo:inline>
4068
+ <fo:inline role="SKIP"><xsl:value-of select="."/></fo:inline>
4061
4069
  </xsl:template>
4062
4070
 
4063
4071
  <xsl:template match="*[local-name()='fn']//*[local-name()='p']">
4064
- <fo:inline>
4072
+ <fo:inline role="P">
4065
4073
  <xsl:apply-templates/>
4066
4074
  </fo:inline>
4067
4075
  </xsl:template>
@@ -4076,7 +4084,7 @@
4076
4084
  <xsl:variable name="isAdded" select="@added"/>
4077
4085
  <xsl:variable name="isDeleted" select="@deleted"/>
4078
4086
  <!-- <dl><xsl:copy-of select="."/></dl> -->
4079
- <fo:block-container xsl:use-attribute-sets="dl-block-style">
4087
+ <fo:block-container xsl:use-attribute-sets="dl-block-style" role="SKIP">
4080
4088
 
4081
4089
  <xsl:call-template name="setBlockSpanAll"/>
4082
4090
 
@@ -4111,7 +4119,7 @@
4111
4119
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
4112
4120
  </xsl:call-template>
4113
4121
 
4114
- <fo:block-container margin-left="0mm">
4122
+ <fo:block-container margin-left="0mm" role="SKIP">
4115
4123
 
4116
4124
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
4117
4125
 
@@ -4176,7 +4184,7 @@
4176
4184
 
4177
4185
  <!-- a few components -->
4178
4186
  <xsl:if test="$onlyOneComponent = 'false'">
4179
- <fo:block>
4187
+ <fo:block role="SKIP">
4180
4188
 
4181
4189
  <xsl:call-template name="refine_multicomponent_style"/>
4182
4190
 
@@ -4184,7 +4192,7 @@
4184
4192
  <xsl:attribute name="margin-top">0</xsl:attribute>
4185
4193
  </xsl:if>
4186
4194
 
4187
- <fo:block>
4195
+ <fo:block role="SKIP">
4188
4196
 
4189
4197
  <xsl:call-template name="refine_multicomponent_block_style"/>
4190
4198
 
@@ -4785,6 +4793,9 @@
4785
4793
 
4786
4794
  <xsl:template name="refine_strong_style">
4787
4795
 
4796
+ <xsl:if test="ancestor::*['preferred']">
4797
+ <xsl:attribute name="role">SKIP</xsl:attribute>
4798
+ </xsl:if>
4788
4799
  </xsl:template>
4789
4800
 
4790
4801
  <xsl:template match="*[local-name()='padding']">
@@ -5788,6 +5799,18 @@
5788
5799
  </xsl:copy>
5789
5800
  </xsl:template>
5790
5801
 
5802
+ <xsl:variable name="font_main_root_style">
5803
+ <root-style xsl:use-attribute-sets="root-style">
5804
+ </root-style>
5805
+ </xsl:variable>
5806
+ <xsl:variable name="font_main_root_style_font_family" select="xalan:nodeset($font_main_root_style)/root-style/@font-family"/>
5807
+ <xsl:variable name="font_main">
5808
+ <xsl:choose>
5809
+ <xsl:when test="contains($font_main_root_style_font_family, ',')"><xsl:value-of select="substring-before($font_main_root_style_font_family, ',')"/></xsl:when>
5810
+ <xsl:otherwise><xsl:value-of select="$font_main_root_style_font_family"/></xsl:otherwise>
5811
+ </xsl:choose>
5812
+ </xsl:variable>
5813
+
5791
5814
  <xsl:template match="*[local-name()='th' or local-name()='td']" mode="simple-table-id">
5792
5815
  <xsl:param name="id"/>
5793
5816
  <xsl:copy>
@@ -5826,6 +5849,33 @@
5826
5849
 
5827
5850
  <!-- td_text='<xsl:copy-of select="$td_text"/>' -->
5828
5851
 
5852
+ <xsl:variable name="words_with_width">
5853
+ <!-- calculate width for 'word' which contain text only (without formatting tags inside) -->
5854
+ <xsl:for-each select="xalan:nodeset($td_text)//*[local-name() = 'word'][normalize-space() != ''][not(*)]">
5855
+ <xsl:copy>
5856
+ <xsl:copy-of select="@*"/>
5857
+ <xsl:attribute name="width">
5858
+ <xsl:value-of select="java:org.metanorma.fop.Util.getStringWidth(., $font_main)"/> <!-- Example: 'Times New Roman' -->
5859
+ </xsl:attribute>
5860
+ <xsl:copy-of select="node()"/>
5861
+ </xsl:copy>
5862
+ </xsl:for-each>
5863
+ </xsl:variable>
5864
+
5865
+ <xsl:variable name="words_with_width_sorted">
5866
+ <xsl:for-each select="xalan:nodeset($words_with_width)//*[local-name() = 'word']">
5867
+ <xsl:sort select="@width" data-type="number" order="descending"/>
5868
+ <!-- select word maximal width only -->
5869
+ <xsl:if test="position() = 1">
5870
+ <xsl:copy-of select="."/>
5871
+ </xsl:if>
5872
+ </xsl:for-each>
5873
+ <!-- add 'word' with formatting tags inside -->
5874
+ <xsl:for-each select="xalan:nodeset($td_text)//*[local-name() = 'word'][normalize-space() != ''][*]">
5875
+ <xsl:copy-of select="."/>
5876
+ </xsl:for-each>
5877
+ </xsl:variable>
5878
+
5829
5879
  <xsl:variable name="words">
5830
5880
  <xsl:for-each select=".//*[local-name() = 'image' or local-name() = 'stem']">
5831
5881
  <word>
@@ -5833,9 +5883,12 @@
5833
5883
  </word>
5834
5884
  </xsl:for-each>
5835
5885
 
5836
- <xsl:for-each select="xalan:nodeset($td_text)//*[local-name() = 'word'][normalize-space() != '']">
5886
+ <xsl:for-each select="xalan:nodeset($words_with_width_sorted)//*[local-name() = 'word'][normalize-space() != '']">
5837
5887
  <xsl:copy-of select="."/>
5838
5888
  </xsl:for-each>
5889
+ <!-- <xsl:for-each select="xalan:nodeset($td_text)//*[local-name() = 'word'][normalize-space() != '']">
5890
+ <xsl:copy-of select="."/>
5891
+ </xsl:for-each> -->
5839
5892
 
5840
5893
  </xsl:variable>
5841
5894
 
@@ -6296,10 +6349,10 @@
6296
6349
  <xsl:copy>
6297
6350
  <xsl:apply-templates select="@*" mode="mathml"/>
6298
6351
  <xsl:if test="not(@lspace)">
6299
- <xsl:attribute name="lspace">0.4em</xsl:attribute>
6352
+ <xsl:attribute name="lspace">0.2em</xsl:attribute>
6300
6353
  </xsl:if>
6301
- <xsl:if test="not(@rspace)">
6302
- <xsl:attribute name="rspace">0.4em</xsl:attribute>
6354
+ <xsl:if test="not(@rspace) and not(following-sibling::*[1][self::mathml:mo and normalize-space(text()) = '|'])">
6355
+ <xsl:attribute name="rspace">0.2em</xsl:attribute>
6303
6356
  </xsl:if>
6304
6357
  <xsl:apply-templates mode="mathml"/>
6305
6358
  </xsl:copy>
@@ -6316,6 +6369,27 @@
6316
6369
  </xsl:copy>
6317
6370
  </xsl:template>
6318
6371
 
6372
+ <!-- increase space before '(' -->
6373
+ <xsl:template match="mathml:mo[normalize-space(text()) = '(']" mode="mathml">
6374
+ <xsl:copy>
6375
+ <xsl:apply-templates select="@*" mode="mathml"/>
6376
+ <xsl:if test="(preceding-sibling::* and not(preceding-sibling::*[1][self::mathml:mo])) or (../preceding-sibling::* and not(../preceding-sibling::*[1][self::mathml:mo]))">
6377
+ <xsl:if test="not(@lspace)">
6378
+ <xsl:attribute name="lspace">0.4em</xsl:attribute>
6379
+ <xsl:choose>
6380
+ <xsl:when test="preceding-sibling::*[1][self::mathml:mi or self::mathml:mstyle]">
6381
+ <xsl:attribute name="lspace">0.2em</xsl:attribute>
6382
+ </xsl:when>
6383
+ <xsl:when test="../preceding-sibling::*[1][self::mathml:mi or self::mathml:mstyle]">
6384
+ <xsl:attribute name="lspace">0.2em</xsl:attribute>
6385
+ </xsl:when>
6386
+ </xsl:choose>
6387
+ </xsl:if>
6388
+ </xsl:if>
6389
+ <xsl:apply-templates mode="mathml"/>
6390
+ </xsl:copy>
6391
+ </xsl:template>
6392
+
6319
6393
  <!-- Examples:
6320
6394
  <stem type="AsciiMath">x = 1</stem>
6321
6395
  <stem type="AsciiMath"><asciimath>x = 1</asciimath></stem>
@@ -6475,7 +6549,7 @@
6475
6549
  <!-- formula -->
6476
6550
  <!-- ====== -->
6477
6551
  <xsl:template match="*[local-name() = 'formula']" name="formula">
6478
- <fo:block-container margin-left="0mm">
6552
+ <fo:block-container margin-left="0mm" role="SKIP">
6479
6553
  <xsl:if test="parent::*[local-name() = 'note']">
6480
6554
  <xsl:attribute name="margin-left">
6481
6555
  <xsl:choose>
@@ -6485,7 +6559,7 @@
6485
6559
  </xsl:attribute>
6486
6560
 
6487
6561
  </xsl:if>
6488
- <fo:block-container margin-left="0mm">
6562
+ <fo:block-container margin-left="0mm" role="SKIP">
6489
6563
  <fo:block id="{@id}">
6490
6564
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> <!-- formula's number will be process in 'stem' template -->
6491
6565
  </fo:block>
@@ -6565,13 +6639,13 @@
6565
6639
 
6566
6640
  <xsl:template match="*[local-name() = 'note']" name="note">
6567
6641
 
6568
- <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style">
6642
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
6569
6643
 
6570
6644
  <xsl:call-template name="setBlockSpanAll"/>
6571
6645
 
6572
6646
  <xsl:call-template name="refine_note-style"/>
6573
6647
 
6574
- <fo:block-container margin-left="0mm" margin-right="0mm">
6648
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
6575
6649
 
6576
6650
  <fo:block>
6577
6651
 
@@ -6735,12 +6809,13 @@
6735
6809
 
6736
6810
  <xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']">
6737
6811
  <xsl:if test="normalize-space() != ''">
6738
- <xsl:variable name="level">
6812
+ <!-- <xsl:variable name="level">
6739
6813
  <xsl:call-template name="getLevelTermName"/>
6740
6814
  </xsl:variable>
6741
6815
  <fo:inline role="H{$level}">
6742
- <xsl:apply-templates/>
6743
- </fo:inline>
6816
+ <xsl:apply-templates />
6817
+ </fo:inline> -->
6818
+ <xsl:apply-templates/>
6744
6819
  </xsl:if>
6745
6820
  </xsl:template>
6746
6821
  <!-- ====== -->
@@ -6764,7 +6839,7 @@
6764
6839
  <!-- Example: Dimensions in millimeters -->
6765
6840
  <xsl:apply-templates select="*[local-name() = 'note'][@type = 'units']"/>
6766
6841
 
6767
- <fo:block xsl:use-attribute-sets="figure-style">
6842
+ <fo:block xsl:use-attribute-sets="figure-style" role="SKIP">
6768
6843
  <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note' and @type = 'units')]"/>
6769
6844
  </fo:block>
6770
6845
  <xsl:for-each select="*[local-name() = 'note'][not(@type = 'units')]">
@@ -7898,7 +7973,7 @@
7898
7973
  </xsl:when>
7899
7974
 
7900
7975
  <xsl:otherwise>
7901
- <fo:block-container xsl:use-attribute-sets="sourcecode-container-style">
7976
+ <fo:block-container xsl:use-attribute-sets="sourcecode-container-style" role="SKIP">
7902
7977
 
7903
7978
  <xsl:if test="not(ancestor::*[local-name() = 'li']) or ancestor::*[local-name() = 'example']">
7904
7979
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
@@ -7919,7 +7994,7 @@
7919
7994
  </xsl:attribute>
7920
7995
 
7921
7996
  </xsl:if>
7922
- <fo:block-container margin-left="0mm">
7997
+ <fo:block-container margin-left="0mm" role="SKIP">
7923
7998
 
7924
7999
  <fo:block xsl:use-attribute-sets="sourcecode-style">
7925
8000
 
@@ -8465,11 +8540,11 @@
8465
8540
  <!-- requirement, recommendation, permission table -->
8466
8541
  <!-- ========== -->
8467
8542
  <xsl:template match="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
8468
- <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt">
8543
+ <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt" role="SKIP">
8469
8544
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
8470
8545
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
8471
8546
  </xsl:if>
8472
- <fo:block-container margin-left="0mm" margin-right="0mm">
8547
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
8473
8548
  <fo:table id="{@id}" table-layout="fixed" width="100%"> <!-- border="1pt solid black" -->
8474
8549
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
8475
8550
  <!-- <xsl:attribute name="border">0.5pt solid black</xsl:attribute> -->
@@ -8631,7 +8706,7 @@
8631
8706
  -->
8632
8707
  <xsl:template match="*[local-name() = 'example']">
8633
8708
 
8634
- <fo:block-container id="{@id}" xsl:use-attribute-sets="example-style">
8709
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="example-style" role="SKIP">
8635
8710
 
8636
8711
  <xsl:call-template name="setBlockSpanAll"/>
8637
8712
 
@@ -8642,7 +8717,7 @@
8642
8717
  inline
8643
8718
  </xsl:variable>
8644
8719
 
8645
- <fo:block-container margin-left="0mm">
8720
+ <fo:block-container margin-left="0mm" role="SKIP">
8646
8721
 
8647
8722
  <xsl:choose>
8648
8723
 
@@ -8655,8 +8730,8 @@
8655
8730
  </xsl:apply-templates>
8656
8731
  </fo:block>
8657
8732
 
8658
- <fo:block-container xsl:use-attribute-sets="example-body-style">
8659
- <fo:block-container margin-left="0mm" margin-right="0mm">
8733
+ <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
8734
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
8660
8735
  <xsl:apply-templates select="node()[not(local-name() = 'name')]">
8661
8736
  <xsl:with-param name="fo_element" select="$fo_element"/>
8662
8737
  </xsl:apply-templates>
@@ -8709,8 +8784,8 @@
8709
8784
 
8710
8785
  <xsl:if test="*[not(local-name() = 'name')][position() &gt; 1]">
8711
8786
  <!-- display further elements in blocks -->
8712
- <fo:block-container xsl:use-attribute-sets="example-body-style">
8713
- <fo:block-container margin-left="0mm" margin-right="0mm">
8787
+ <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
8788
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
8714
8789
  <xsl:apply-templates select="*[not(local-name() = 'name')][position() &gt; 1]">
8715
8790
  <xsl:with-param name="fo_element" select="'block'"/>
8716
8791
  </xsl:apply-templates>
@@ -8763,7 +8838,7 @@
8763
8838
  </xsl:variable>
8764
8839
  <xsl:choose>
8765
8840
  <xsl:when test="starts-with(normalize-space($element), 'block')">
8766
- <fo:block-container>
8841
+ <fo:block-container role="SKIP">
8767
8842
  <xsl:if test="ancestor::*[local-name() = 'li'] and contains(normalize-space($fo_element), 'block')">
8768
8843
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
8769
8844
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
@@ -8904,7 +8979,7 @@
8904
8979
  <!-- author -->
8905
8980
  <!-- ====== -->
8906
8981
  <xsl:template match="*[local-name() = 'quote']">
8907
- <fo:block-container margin-left="0mm">
8982
+ <fo:block-container margin-left="0mm" role="SKIP">
8908
8983
 
8909
8984
  <xsl:call-template name="setBlockSpanAll"/>
8910
8985
 
@@ -8914,12 +8989,12 @@
8914
8989
  </xsl:if>
8915
8990
  </xsl:if>
8916
8991
 
8917
- <fo:block-container margin-left="0mm">
8918
- <fo:block-container xsl:use-attribute-sets="quote-style">
8992
+ <fo:block-container margin-left="0mm" role="SKIP">
8993
+ <fo:block-container xsl:use-attribute-sets="quote-style" role="SKIP">
8919
8994
 
8920
8995
  <xsl:call-template name="refine_quote-style"/>
8921
8996
 
8922
- <fo:block-container margin-left="0mm" margin-right="0mm">
8997
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
8923
8998
  <fo:block role="BlockQuote">
8924
8999
  <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
8925
9000
  </fo:block>
@@ -9079,10 +9154,10 @@
9079
9154
 
9080
9155
  <xsl:choose>
9081
9156
  <xsl:when test="$lang = 'zh'">
9082
- <fo:inline><xsl:value-of select="$tab_zh"/></fo:inline>
9157
+ <fo:inline role="SKIP"><xsl:value-of select="$tab_zh"/></fo:inline>
9083
9158
  </xsl:when>
9084
9159
  <xsl:when test="../../@inline-header = 'true'">
9085
- <fo:inline font-size="90%">
9160
+ <fo:inline font-size="90%" role="SKIP">
9086
9161
  <xsl:call-template name="insertNonBreakSpaces">
9087
9162
  <xsl:with-param name="count" select="$padding-right"/>
9088
9163
  </xsl:call-template>
@@ -9090,7 +9165,7 @@
9090
9165
  </xsl:when>
9091
9166
  <xsl:otherwise>
9092
9167
  <xsl:variable name="direction"><xsl:if test="$lang = 'ar'"><xsl:value-of select="$RLM"/></xsl:if></xsl:variable>
9093
- <fo:inline padding-right="{$padding-right}mm"><xsl:value-of select="$direction"/>​</fo:inline>
9168
+ <fo:inline padding-right="{$padding-right}mm" role="SKIP"><xsl:value-of select="$direction"/>​</fo:inline>
9094
9169
  </xsl:otherwise>
9095
9170
  </xsl:choose>
9096
9171
 
@@ -9120,12 +9195,12 @@
9120
9195
  <fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="preferred-block-style">
9121
9196
 
9122
9197
  <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'preferred'])"> <!-- if first preffered in term, then display term's name -->
9123
- <fo:block xsl:use-attribute-sets="term-name-style">
9198
+ <fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
9124
9199
  <xsl:apply-templates select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"/>
9125
9200
  </fo:block>
9126
9201
  </xsl:if>
9127
9202
 
9128
- <fo:block xsl:use-attribute-sets="preferred-term-style">
9203
+ <fo:block xsl:use-attribute-sets="preferred-term-style" role="SKIP">
9129
9204
  <xsl:call-template name="setStyle_preferred"/>
9130
9205
  <xsl:apply-templates/>
9131
9206
  </fo:block>
@@ -9166,7 +9241,7 @@
9166
9241
  <!-- definition -->
9167
9242
  <!-- ========== -->
9168
9243
  <xsl:template match="*[local-name() = 'definition']">
9169
- <fo:block xsl:use-attribute-sets="definition-style">
9244
+ <fo:block xsl:use-attribute-sets="definition-style" role="SKIP">
9170
9245
  <xsl:apply-templates/>
9171
9246
  </fo:block>
9172
9247
  </xsl:template>
@@ -9209,6 +9284,10 @@
9209
9284
 
9210
9285
  <xsl:template match="*[local-name() = 'clause']">
9211
9286
  <fo:block>
9287
+ <xsl:if test="parent::*[local-name() = 'copyright-statement']">
9288
+ <xsl:attribute name="role">SKIP</xsl:attribute>
9289
+ </xsl:if>
9290
+
9212
9291
  <xsl:call-template name="setId"/>
9213
9292
 
9214
9293
  <xsl:call-template name="setBlockSpanAll"/>
@@ -9448,7 +9527,7 @@
9448
9527
  <xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
9449
9528
  <xsl:choose>
9450
9529
  <xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
9451
- <fo:block-container>
9530
+ <fo:block-container role="SKIP">
9452
9531
  <xsl:attribute name="margin-left">
9453
9532
  <xsl:choose>
9454
9533
  <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
@@ -9458,7 +9537,7 @@
9458
9537
 
9459
9538
  <xsl:call-template name="refine_list_container_style"/>
9460
9539
 
9461
- <fo:block-container margin-left="0mm">
9540
+ <fo:block-container margin-left="0mm" role="SKIP">
9462
9541
  <fo:block>
9463
9542
  <xsl:apply-templates select="." mode="list"/>
9464
9543
  </fo:block>
@@ -9467,7 +9546,7 @@
9467
9546
  </xsl:when>
9468
9547
  <xsl:otherwise>
9469
9548
 
9470
- <fo:block>
9549
+ <fo:block role="SKIP">
9471
9550
  <xsl:apply-templates select="." mode="list"/>
9472
9551
  </fo:block>
9473
9552
 
@@ -9885,7 +9964,10 @@
9885
9964
  <!-- Reference sections (Normative References and Bibliography) -->
9886
9965
  <!-- ========================================================== -->
9887
9966
  <xsl:template match="*[local-name() = 'references'][@hidden='true']" priority="3"/>
9888
- <xsl:template match="*[local-name() = 'bibitem'][@hidden='true']" priority="3"/>
9967
+ <xsl:template match="*[local-name() = 'bibitem'][@hidden='true']" priority="3">
9968
+ <xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][local-name() = 'bibitem'] and 1 = 1)"/>
9969
+
9970
+ </xsl:template>
9889
9971
  <!-- don't display bibitem with @id starts with '_hidden', that was introduced for references integrity -->
9890
9972
  <xsl:template match="*[local-name() = 'bibitem'][starts-with(@id, 'hidden_bibitem_')]" priority="3"/>
9891
9973
 
@@ -9963,11 +10045,41 @@
9963
10045
 
9964
10046
  <!-- Bibliography (non-normative references) -->
9965
10047
  <xsl:template match="*[local-name() = 'references'][not(@normative='true')]/*[local-name() = 'bibitem']" name="bibitem_non_normative" priority="2">
10048
+ <xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][local-name() = 'bibitem'] and 1 = 1)"/> <!-- current bibiitem is non-first -->
9966
10049
 
9967
10050
  <xsl:call-template name="bibitem"/>
9968
10051
 
9969
10052
  </xsl:template> <!-- references[not(@normative='true')]/bibitem -->
9970
10053
 
10054
+ <xsl:template name="insertListItem_Bibitem">
10055
+ <xsl:choose>
10056
+ <xsl:when test="@hidden = 'true'"><!-- skip --></xsl:when>
10057
+ <xsl:otherwise>
10058
+ <fo:list-item id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-item-style">
10059
+ <fo:list-item-label end-indent="label-end()">
10060
+ <fo:block role="SKIP">
10061
+ <fo:inline role="SKIP">
10062
+ <xsl:apply-templates select="*[local-name() = 'biblio-tag']">
10063
+ <xsl:with-param name="biblio_tag_part">first</xsl:with-param>
10064
+ </xsl:apply-templates>
10065
+ </fo:inline>
10066
+ </fo:block>
10067
+ </fo:list-item-label>
10068
+ <fo:list-item-body start-indent="body-start()">
10069
+ <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style" role="SKIP">
10070
+ <xsl:call-template name="processBibitem">
10071
+ <xsl:with-param name="biblio_tag_part">last</xsl:with-param>
10072
+ </xsl:call-template>
10073
+ </fo:block>
10074
+ </fo:list-item-body>
10075
+ </fo:list-item>
10076
+ </xsl:otherwise>
10077
+ </xsl:choose>
10078
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'bibitem']">
10079
+ <xsl:with-param name="skip">false</xsl:with-param>
10080
+ </xsl:apply-templates>
10081
+ </xsl:template>
10082
+
9971
10083
  <xsl:template name="processBibitem">
9972
10084
  <xsl:param name="biblio_tag_part">both</xsl:param>
9973
10085
 
@@ -10301,7 +10413,7 @@
10301
10413
 
10302
10414
  <xsl:call-template name="setBlockSpanAll"/>
10303
10415
 
10304
- <fo:block-container xsl:use-attribute-sets="admonition-container-style">
10416
+ <fo:block-container xsl:use-attribute-sets="admonition-container-style" role="SKIP">
10305
10417
 
10306
10418
  <fo:block xsl:use-attribute-sets="admonition-name-style">
10307
10419
  <xsl:call-template name="displayAdmonitionName"/>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module IHO
3
- VERSION = "0.7.12".freeze
3
+ VERSION = "0.7.13".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iho
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.12
4
+ version: 0.7.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-06-19 00:00:00.000000000 Z
11
+ date: 2023-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic