metanorma-iho 0.7.12 → 0.7.14

Sign up to get free protection for your applications and to get access to all the features.
@@ -980,21 +980,32 @@
980
980
  <xsl:variable name="titles_">
981
981
 
982
982
  <!-- These titles of Table of contents renders different than determined in localized-strings -->
983
- <title-toc lang="en">
984
-
983
+ <!-- <title-toc lang="en">
984
+ <xsl:if test="$namespace = 'csd' or $namespace = 'ieee' or $namespace = 'iho' or $namespace = 'mpfd' or $namespace = 'ogc' or $namespace = 'unece-rec'">
985
985
  <xsl:text>Contents</xsl:text>
986
-
987
- </title-toc>
988
- <title-toc lang="fr">
986
+ </xsl:if>
987
+ <xsl:if test="$namespace = 'csa' or $namespace = 'm3d' or $namespace = 'nist-sp' or $namespace = 'ogc-white-paper'">
988
+ <xsl:text>Table of Contents</xsl:text>
989
+ </xsl:if>
990
+ <xsl:if test="$namespace = 'gb'">
991
+ <xsl:text>Table of contents</xsl:text>
992
+ </xsl:if>
993
+ </title-toc> -->
994
+ <title-toc lang="en">Table of contents</title-toc>
995
+ <!-- <title-toc lang="fr">
989
996
  <xsl:text>Sommaire</xsl:text>
990
- </title-toc>
991
- <title-toc lang="zh">
992
-
997
+ </title-toc> -->
998
+ <!-- <title-toc lang="zh">
999
+ <xsl:choose>
1000
+ <xsl:when test="$namespace = 'gb'">
1001
+ <xsl:text>目次</xsl:text>
1002
+ </xsl:when>
1003
+ <xsl:otherwise>
993
1004
  <xsl:text>Contents</xsl:text>
994
-
995
- </title-toc>
996
-
997
- <title-descriptors lang="en">Descriptors</title-descriptors>
1005
+ </xsl:otherwise>
1006
+ </xsl:choose>
1007
+ </title-toc> -->
1008
+ <title-toc lang="zh">目次</title-toc>
998
1009
 
999
1010
  <title-part lang="en">
1000
1011
 
@@ -1010,20 +1021,6 @@
1010
1021
  <title-subpart lang="en">Sub-part #</title-subpart>
1011
1022
  <title-subpart lang="fr">Partie de sub #</title-subpart>
1012
1023
 
1013
- <title-list-tables lang="en">List of Tables</title-list-tables>
1014
-
1015
- <title-list-figures lang="en">List of Figures</title-list-figures>
1016
-
1017
- <title-table-figures lang="en">Table of Figures</title-table-figures>
1018
-
1019
- <title-list-recommendations lang="en">List of Recommendations</title-list-recommendations>
1020
-
1021
- <title-summary lang="en">Summary</title-summary>
1022
-
1023
- <title-continued lang="ru">(продолжение)</title-continued>
1024
- <title-continued lang="en">(continued)</title-continued>
1025
- <title-continued lang="fr">(continué)</title-continued>
1026
-
1027
1024
  </xsl:variable>
1028
1025
  <xsl:variable name="titles" select="xalan:nodeset($titles_)"/>
1029
1026
 
@@ -1031,8 +1028,8 @@
1031
1028
  <xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']"/>
1032
1029
  <xsl:value-of select="$toc_table_title"/>
1033
1030
  <xsl:if test="normalize-space($toc_table_title) = ''">
1034
- <xsl:call-template name="getTitle">
1035
- <xsl:with-param name="name" select="'title-list-tables'"/>
1031
+ <xsl:call-template name="getLocalizedString">
1032
+ <xsl:with-param name="key">toc_tables</xsl:with-param>
1036
1033
  </xsl:call-template>
1037
1034
  </xsl:if>
1038
1035
  </xsl:variable>
@@ -1041,8 +1038,8 @@
1041
1038
  <xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']"/>
1042
1039
  <xsl:value-of select="$toc_figure_title"/>
1043
1040
  <xsl:if test="normalize-space($toc_figure_title) = ''">
1044
- <xsl:call-template name="getTitle">
1045
- <xsl:with-param name="name" select="'title-list-figures'"/>
1041
+ <xsl:call-template name="getLocalizedString">
1042
+ <xsl:with-param name="key">toc_figures</xsl:with-param>
1046
1043
  </xsl:call-template>
1047
1044
  </xsl:if>
1048
1045
  </xsl:variable>
@@ -1051,8 +1048,8 @@
1051
1048
  <xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='requirement']/*[local-name() = 'title']"/>
1052
1049
  <xsl:value-of select="$toc_requirement_title"/>
1053
1050
  <xsl:if test="normalize-space($toc_requirement_title) = ''">
1054
- <xsl:call-template name="getTitle">
1055
- <xsl:with-param name="name" select="'title-list-recommendations'"/>
1051
+ <xsl:call-template name="getLocalizedString">
1052
+ <xsl:with-param name="key">toc_recommendations</xsl:with-param>
1056
1053
  </xsl:call-template>
1057
1054
  </xsl:if>
1058
1055
  </xsl:variable>
@@ -1806,6 +1803,7 @@
1806
1803
  </xsl:attribute-set>
1807
1804
 
1808
1805
  <xsl:attribute-set name="figure-block-style">
1806
+ <xsl:attribute name="role">SKIP</xsl:attribute>
1809
1807
 
1810
1808
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1811
1809
 
@@ -1816,6 +1814,7 @@
1816
1814
  </xsl:attribute-set>
1817
1815
 
1818
1816
  <xsl:attribute-set name="figure-name-style">
1817
+ <xsl:attribute name="role">Caption</xsl:attribute>
1819
1818
 
1820
1819
  <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
1821
1820
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -1861,6 +1860,7 @@
1861
1860
  </xsl:template>
1862
1861
 
1863
1862
  <xsl:attribute-set name="image-style">
1863
+ <xsl:attribute name="role">SKIP</xsl:attribute>
1864
1864
  <xsl:attribute name="text-align">center</xsl:attribute>
1865
1865
 
1866
1866
  </xsl:attribute-set>
@@ -2135,6 +2135,11 @@
2135
2135
 
2136
2136
  </xsl:attribute-set> <!-- bibitem-non-normative-list-style -->
2137
2137
 
2138
+ <xsl:attribute-set name="bibitem-non-normative-list-item-style">
2139
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2140
+
2141
+ </xsl:attribute-set>
2142
+
2138
2143
  <!-- bibitem in bibliography section (references/@normative="false"), list body -->
2139
2144
  <xsl:attribute-set name="bibitem-normative-list-body-style">
2140
2145
 
@@ -2529,14 +2534,14 @@
2529
2534
  <xsl:value-of select="$sep"/><xsl:value-of select="$zero_width_space"/>
2530
2535
  </xsl:when>
2531
2536
  <xsl:otherwise>
2532
- <fo:inline keep-together.within-line="always"><xsl:apply-templates/></fo:inline>
2537
+ <fo:inline keep-together.within-line="always" role="SKIP"><xsl:apply-templates/></fo:inline>
2533
2538
  </xsl:otherwise>
2534
2539
  </xsl:choose>
2535
2540
  </xsl:for-each>
2536
2541
  </xsl:when>
2537
2542
 
2538
2543
  <xsl:otherwise>
2539
- <fo:inline keep-together.within-line="always"><xsl:apply-templates/></fo:inline>
2544
+ <fo:inline keep-together.within-line="always" role="SKIP"><xsl:apply-templates/></fo:inline>
2540
2545
  </xsl:otherwise>
2541
2546
 
2542
2547
  </xsl:choose>
@@ -2546,7 +2551,7 @@
2546
2551
  <!-- Preface boilerplate sections processing -->
2547
2552
  <!-- ================================= -->
2548
2553
  <xsl:template match="*[local-name()='copyright-statement']">
2549
- <fo:block xsl:use-attribute-sets="copyright-statement-style">
2554
+ <fo:block xsl:use-attribute-sets="copyright-statement-style" role="SKIP">
2550
2555
  <xsl:apply-templates/>
2551
2556
  </fo:block>
2552
2557
  </xsl:template> <!-- copyright-statement -->
@@ -2716,7 +2721,7 @@
2716
2721
  </xsl:choose>
2717
2722
  </xsl:variable>
2718
2723
 
2719
- <fo:block-container xsl:use-attribute-sets="table-container-style">
2724
+ <fo:block-container xsl:use-attribute-sets="table-container-style" role="SKIP">
2720
2725
 
2721
2726
  <xsl:call-template name="refine_table-container-style">
2722
2727
  <xsl:with-param name="margin-side" select="$margin-side"/>
@@ -3749,7 +3754,7 @@
3749
3754
  </xsl:choose>
3750
3755
  </xsl:variable>
3751
3756
  <xsl:variable name="footnote_inline">
3752
- <fo:inline>
3757
+ <fo:inline role="Reference">
3753
3758
 
3754
3759
  <xsl:variable name="fn_styles">
3755
3760
  <xsl:choose>
@@ -3772,7 +3777,7 @@
3772
3777
 
3773
3778
  <xsl:call-template name="insert_basic_link">
3774
3779
  <xsl:with-param name="element">
3775
- <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
3780
+ <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}" role="Lbl">
3776
3781
  <xsl:copy-of select="$current_fn_number_text"/>
3777
3782
  </fo:basic-link>
3778
3783
  </xsl:with-param>
@@ -3785,17 +3790,17 @@
3785
3790
  <xsl:copy-of select="$footnote_inline"/>
3786
3791
  </xsl:when>
3787
3792
  <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">
3793
+ <fo:footnote xsl:use-attribute-sets="fn-style" role="SKIP">
3789
3794
  <xsl:copy-of select="$footnote_inline"/>
3790
- <fo:footnote-body>
3795
+ <fo:footnote-body role="Note">
3791
3796
 
3792
- <fo:block-container xsl:use-attribute-sets="fn-container-body-style">
3797
+ <fo:block-container xsl:use-attribute-sets="fn-container-body-style" role="SKIP">
3793
3798
 
3794
- <fo:block xsl:use-attribute-sets="fn-body-style">
3799
+ <fo:block xsl:use-attribute-sets="fn-body-style" role="SKIP">
3795
3800
 
3796
3801
  <xsl:call-template name="refine_fn-body-style"/>
3797
3802
 
3798
- <fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style">
3803
+ <fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style" role="Lbl">
3799
3804
 
3800
3805
  <xsl:call-template name="refine_fn-body-num-style"/>
3801
3806
 
@@ -4057,11 +4062,11 @@
4057
4062
  </xsl:template>
4058
4063
 
4059
4064
  <xsl:template match="*[local-name()='fn']/text()[normalize-space() != '']">
4060
- <fo:inline><xsl:value-of select="."/></fo:inline>
4065
+ <fo:inline role="SKIP"><xsl:value-of select="."/></fo:inline>
4061
4066
  </xsl:template>
4062
4067
 
4063
4068
  <xsl:template match="*[local-name()='fn']//*[local-name()='p']">
4064
- <fo:inline>
4069
+ <fo:inline role="P">
4065
4070
  <xsl:apply-templates/>
4066
4071
  </fo:inline>
4067
4072
  </xsl:template>
@@ -4076,7 +4081,7 @@
4076
4081
  <xsl:variable name="isAdded" select="@added"/>
4077
4082
  <xsl:variable name="isDeleted" select="@deleted"/>
4078
4083
  <!-- <dl><xsl:copy-of select="."/></dl> -->
4079
- <fo:block-container xsl:use-attribute-sets="dl-block-style">
4084
+ <fo:block-container xsl:use-attribute-sets="dl-block-style" role="SKIP">
4080
4085
 
4081
4086
  <xsl:call-template name="setBlockSpanAll"/>
4082
4087
 
@@ -4111,7 +4116,7 @@
4111
4116
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
4112
4117
  </xsl:call-template>
4113
4118
 
4114
- <fo:block-container margin-left="0mm">
4119
+ <fo:block-container margin-left="0mm" role="SKIP">
4115
4120
 
4116
4121
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
4117
4122
 
@@ -4176,7 +4181,7 @@
4176
4181
 
4177
4182
  <!-- a few components -->
4178
4183
  <xsl:if test="$onlyOneComponent = 'false'">
4179
- <fo:block>
4184
+ <fo:block role="SKIP">
4180
4185
 
4181
4186
  <xsl:call-template name="refine_multicomponent_style"/>
4182
4187
 
@@ -4184,7 +4189,7 @@
4184
4189
  <xsl:attribute name="margin-top">0</xsl:attribute>
4185
4190
  </xsl:if>
4186
4191
 
4187
- <fo:block>
4192
+ <fo:block role="SKIP">
4188
4193
 
4189
4194
  <xsl:call-template name="refine_multicomponent_block_style"/>
4190
4195
 
@@ -4785,6 +4790,9 @@
4785
4790
 
4786
4791
  <xsl:template name="refine_strong_style">
4787
4792
 
4793
+ <xsl:if test="ancestor::*['preferred']">
4794
+ <xsl:attribute name="role">SKIP</xsl:attribute>
4795
+ </xsl:if>
4788
4796
  </xsl:template>
4789
4797
 
4790
4798
  <xsl:template match="*[local-name()='padding']">
@@ -4830,7 +4838,7 @@
4830
4838
  <xsl:variable name="regex_url_start">^(http://|https://|www\.)?(.*)</xsl:variable>
4831
4839
  <xsl:template match="*[local-name()='tt']/text()" priority="2">
4832
4840
  <xsl:choose>
4833
- <xsl:when test="java:replaceAll(java:java.lang.String.new(.), '$2', '') != ''">
4841
+ <xsl:when test="java:replaceAll(java:java.lang.String.new(.), $regex_url_start, '$2') != ''">
4834
4842
  <!-- url -->
4835
4843
  <xsl:call-template name="add-zero-spaces-link-java"/>
4836
4844
  </xsl:when>
@@ -5363,10 +5371,13 @@
5363
5371
  </xsl:choose>
5364
5372
  </xsl:variable>
5365
5373
 
5374
+ <!-- replace sequence #x200B to one &#x200B -->
5375
+ <xsl:variable name="text10" select="java:replaceAll(java:java.lang.String.new($text9), '\u200b{2,}', '​')"/>
5376
+
5366
5377
  <!-- replace sequence #x200B and space TO space -->
5367
- <xsl:variable name="text10" select="java:replaceAll(java:java.lang.String.new($text9), '\u200b ', ' ')"/>
5378
+ <xsl:variable name="text11" select="java:replaceAll(java:java.lang.String.new($text10), '\u200b ', ' ')"/>
5368
5379
 
5369
- <xsl:value-of select="$text10"/>
5380
+ <xsl:value-of select="$text11"/>
5370
5381
  </xsl:template>
5371
5382
 
5372
5383
  <xsl:template name="add-zero-spaces-link-java">
@@ -5376,8 +5387,12 @@
5376
5387
  <xsl:variable name="url_continue" select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$2')"/>
5377
5388
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space, comma, slash, @ -->
5378
5389
  <xsl:variable name="url" select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/|@)','$1​')"/>
5390
+
5391
+ <!-- replace sequence #x200B to one &#x200B -->
5392
+ <xsl:variable name="url2" select="java:replaceAll(java:java.lang.String.new($url), '\u200b{2,}', '​')"/>
5393
+
5379
5394
  <!-- remove zero-width space at the end -->
5380
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url), '​$', '')"/>
5395
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url2), '​$', '')"/>
5381
5396
  </xsl:template>
5382
5397
 
5383
5398
  <!-- add zero space after dash character (for table's entries) -->
@@ -5788,6 +5803,18 @@
5788
5803
  </xsl:copy>
5789
5804
  </xsl:template>
5790
5805
 
5806
+ <xsl:variable name="font_main_root_style">
5807
+ <root-style xsl:use-attribute-sets="root-style">
5808
+ </root-style>
5809
+ </xsl:variable>
5810
+ <xsl:variable name="font_main_root_style_font_family" select="xalan:nodeset($font_main_root_style)/root-style/@font-family"/>
5811
+ <xsl:variable name="font_main">
5812
+ <xsl:choose>
5813
+ <xsl:when test="contains($font_main_root_style_font_family, ',')"><xsl:value-of select="substring-before($font_main_root_style_font_family, ',')"/></xsl:when>
5814
+ <xsl:otherwise><xsl:value-of select="$font_main_root_style_font_family"/></xsl:otherwise>
5815
+ </xsl:choose>
5816
+ </xsl:variable>
5817
+
5791
5818
  <xsl:template match="*[local-name()='th' or local-name()='td']" mode="simple-table-id">
5792
5819
  <xsl:param name="id"/>
5793
5820
  <xsl:copy>
@@ -5826,6 +5853,33 @@
5826
5853
 
5827
5854
  <!-- td_text='<xsl:copy-of select="$td_text"/>' -->
5828
5855
 
5856
+ <xsl:variable name="words_with_width">
5857
+ <!-- calculate width for 'word' which contain text only (without formatting tags inside) -->
5858
+ <xsl:for-each select="xalan:nodeset($td_text)//*[local-name() = 'word'][normalize-space() != ''][not(*)]">
5859
+ <xsl:copy>
5860
+ <xsl:copy-of select="@*"/>
5861
+ <xsl:attribute name="width">
5862
+ <xsl:value-of select="java:org.metanorma.fop.Util.getStringWidth(., $font_main)"/> <!-- Example: 'Times New Roman' -->
5863
+ </xsl:attribute>
5864
+ <xsl:copy-of select="node()"/>
5865
+ </xsl:copy>
5866
+ </xsl:for-each>
5867
+ </xsl:variable>
5868
+
5869
+ <xsl:variable name="words_with_width_sorted">
5870
+ <xsl:for-each select="xalan:nodeset($words_with_width)//*[local-name() = 'word']">
5871
+ <xsl:sort select="@width" data-type="number" order="descending"/>
5872
+ <!-- select word maximal width only -->
5873
+ <xsl:if test="position() = 1">
5874
+ <xsl:copy-of select="."/>
5875
+ </xsl:if>
5876
+ </xsl:for-each>
5877
+ <!-- add 'word' with formatting tags inside -->
5878
+ <xsl:for-each select="xalan:nodeset($td_text)//*[local-name() = 'word'][normalize-space() != ''][*]">
5879
+ <xsl:copy-of select="."/>
5880
+ </xsl:for-each>
5881
+ </xsl:variable>
5882
+
5829
5883
  <xsl:variable name="words">
5830
5884
  <xsl:for-each select=".//*[local-name() = 'image' or local-name() = 'stem']">
5831
5885
  <word>
@@ -5833,9 +5887,12 @@
5833
5887
  </word>
5834
5888
  </xsl:for-each>
5835
5889
 
5836
- <xsl:for-each select="xalan:nodeset($td_text)//*[local-name() = 'word'][normalize-space() != '']">
5890
+ <xsl:for-each select="xalan:nodeset($words_with_width_sorted)//*[local-name() = 'word'][normalize-space() != '']">
5837
5891
  <xsl:copy-of select="."/>
5838
5892
  </xsl:for-each>
5893
+ <!-- <xsl:for-each select="xalan:nodeset($td_text)//*[local-name() = 'word'][normalize-space() != '']">
5894
+ <xsl:copy-of select="."/>
5895
+ </xsl:for-each> -->
5839
5896
 
5840
5897
  </xsl:variable>
5841
5898
 
@@ -6296,10 +6353,10 @@
6296
6353
  <xsl:copy>
6297
6354
  <xsl:apply-templates select="@*" mode="mathml"/>
6298
6355
  <xsl:if test="not(@lspace)">
6299
- <xsl:attribute name="lspace">0.4em</xsl:attribute>
6356
+ <xsl:attribute name="lspace">0.2em</xsl:attribute>
6300
6357
  </xsl:if>
6301
- <xsl:if test="not(@rspace)">
6302
- <xsl:attribute name="rspace">0.4em</xsl:attribute>
6358
+ <xsl:if test="not(@rspace) and not(following-sibling::*[1][self::mathml:mo and normalize-space(text()) = '|'])">
6359
+ <xsl:attribute name="rspace">0.2em</xsl:attribute>
6303
6360
  </xsl:if>
6304
6361
  <xsl:apply-templates mode="mathml"/>
6305
6362
  </xsl:copy>
@@ -6316,6 +6373,27 @@
6316
6373
  </xsl:copy>
6317
6374
  </xsl:template>
6318
6375
 
6376
+ <!-- increase space before '(' -->
6377
+ <xsl:template match="mathml:mo[normalize-space(text()) = '(']" mode="mathml">
6378
+ <xsl:copy>
6379
+ <xsl:apply-templates select="@*" mode="mathml"/>
6380
+ <xsl:if test="(preceding-sibling::* and not(preceding-sibling::*[1][self::mathml:mo])) or (../preceding-sibling::* and not(../preceding-sibling::*[1][self::mathml:mo]))">
6381
+ <xsl:if test="not(@lspace)">
6382
+ <xsl:attribute name="lspace">0.4em</xsl:attribute>
6383
+ <xsl:choose>
6384
+ <xsl:when test="preceding-sibling::*[1][self::mathml:mi or self::mathml:mstyle]">
6385
+ <xsl:attribute name="lspace">0.2em</xsl:attribute>
6386
+ </xsl:when>
6387
+ <xsl:when test="../preceding-sibling::*[1][self::mathml:mi or self::mathml:mstyle]">
6388
+ <xsl:attribute name="lspace">0.2em</xsl:attribute>
6389
+ </xsl:when>
6390
+ </xsl:choose>
6391
+ </xsl:if>
6392
+ </xsl:if>
6393
+ <xsl:apply-templates mode="mathml"/>
6394
+ </xsl:copy>
6395
+ </xsl:template>
6396
+
6319
6397
  <!-- Examples:
6320
6398
  <stem type="AsciiMath">x = 1</stem>
6321
6399
  <stem type="AsciiMath"><asciimath>x = 1</asciimath></stem>
@@ -6475,7 +6553,7 @@
6475
6553
  <!-- formula -->
6476
6554
  <!-- ====== -->
6477
6555
  <xsl:template match="*[local-name() = 'formula']" name="formula">
6478
- <fo:block-container margin-left="0mm">
6556
+ <fo:block-container margin-left="0mm" role="SKIP">
6479
6557
  <xsl:if test="parent::*[local-name() = 'note']">
6480
6558
  <xsl:attribute name="margin-left">
6481
6559
  <xsl:choose>
@@ -6485,7 +6563,7 @@
6485
6563
  </xsl:attribute>
6486
6564
 
6487
6565
  </xsl:if>
6488
- <fo:block-container margin-left="0mm">
6566
+ <fo:block-container margin-left="0mm" role="SKIP">
6489
6567
  <fo:block id="{@id}">
6490
6568
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> <!-- formula's number will be process in 'stem' template -->
6491
6569
  </fo:block>
@@ -6565,19 +6643,19 @@
6565
6643
 
6566
6644
  <xsl:template match="*[local-name() = 'note']" name="note">
6567
6645
 
6568
- <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style">
6646
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
6569
6647
 
6570
6648
  <xsl:call-template name="setBlockSpanAll"/>
6571
6649
 
6572
6650
  <xsl:call-template name="refine_note-style"/>
6573
6651
 
6574
- <fo:block-container margin-left="0mm" margin-right="0mm">
6652
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
6575
6653
 
6576
6654
  <fo:block>
6577
6655
 
6578
6656
  <xsl:call-template name="refine_note_block_style"/>
6579
6657
 
6580
- <fo:inline xsl:use-attribute-sets="note-name-style">
6658
+ <fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
6581
6659
 
6582
6660
  <xsl:call-template name="refine_note-name-style"/>
6583
6661
 
@@ -6614,12 +6692,12 @@
6614
6692
  <xsl:variable name="num"><xsl:number/></xsl:variable>
6615
6693
  <xsl:choose>
6616
6694
  <xsl:when test="$num = 1"> <!-- display first NOTE's paragraph in the same line with label NOTE -->
6617
- <fo:inline xsl:use-attribute-sets="note-p-style">
6695
+ <fo:inline xsl:use-attribute-sets="note-p-style" role="SKIP">
6618
6696
  <xsl:apply-templates/>
6619
6697
  </fo:inline>
6620
6698
  </xsl:when>
6621
6699
  <xsl:otherwise>
6622
- <fo:block xsl:use-attribute-sets="note-p-style">
6700
+ <fo:block xsl:use-attribute-sets="note-p-style" role="SKIP">
6623
6701
  <xsl:apply-templates/>
6624
6702
  </fo:block>
6625
6703
  </xsl:otherwise>
@@ -6735,12 +6813,13 @@
6735
6813
 
6736
6814
  <xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']">
6737
6815
  <xsl:if test="normalize-space() != ''">
6738
- <xsl:variable name="level">
6816
+ <!-- <xsl:variable name="level">
6739
6817
  <xsl:call-template name="getLevelTermName"/>
6740
6818
  </xsl:variable>
6741
6819
  <fo:inline role="H{$level}">
6742
- <xsl:apply-templates/>
6743
- </fo:inline>
6820
+ <xsl:apply-templates />
6821
+ </fo:inline> -->
6822
+ <xsl:apply-templates/>
6744
6823
  </xsl:if>
6745
6824
  </xsl:template>
6746
6825
  <!-- ====== -->
@@ -6764,7 +6843,7 @@
6764
6843
  <!-- Example: Dimensions in millimeters -->
6765
6844
  <xsl:apply-templates select="*[local-name() = 'note'][@type = 'units']"/>
6766
6845
 
6767
- <fo:block xsl:use-attribute-sets="figure-style">
6846
+ <fo:block xsl:use-attribute-sets="figure-style" role="SKIP">
6768
6847
  <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note' and @type = 'units')]"/>
6769
6848
  </fo:block>
6770
6849
  <xsl:for-each select="*[local-name() = 'note'][not(@type = 'units')]">
@@ -7898,7 +7977,7 @@
7898
7977
  </xsl:when>
7899
7978
 
7900
7979
  <xsl:otherwise>
7901
- <fo:block-container xsl:use-attribute-sets="sourcecode-container-style">
7980
+ <fo:block-container xsl:use-attribute-sets="sourcecode-container-style" role="SKIP">
7902
7981
 
7903
7982
  <xsl:if test="not(ancestor::*[local-name() = 'li']) or ancestor::*[local-name() = 'example']">
7904
7983
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
@@ -7919,7 +7998,7 @@
7919
7998
  </xsl:attribute>
7920
7999
 
7921
8000
  </xsl:if>
7922
- <fo:block-container margin-left="0mm">
8001
+ <fo:block-container margin-left="0mm" role="SKIP">
7923
8002
 
7924
8003
  <fo:block xsl:use-attribute-sets="sourcecode-style">
7925
8004
 
@@ -8465,11 +8544,11 @@
8465
8544
  <!-- requirement, recommendation, permission table -->
8466
8545
  <!-- ========== -->
8467
8546
  <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">
8547
+ <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt" role="SKIP">
8469
8548
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
8470
8549
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
8471
8550
  </xsl:if>
8472
- <fo:block-container margin-left="0mm" margin-right="0mm">
8551
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
8473
8552
  <fo:table id="{@id}" table-layout="fixed" width="100%"> <!-- border="1pt solid black" -->
8474
8553
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
8475
8554
  <!-- <xsl:attribute name="border">0.5pt solid black</xsl:attribute> -->
@@ -8631,7 +8710,7 @@
8631
8710
  -->
8632
8711
  <xsl:template match="*[local-name() = 'example']">
8633
8712
 
8634
- <fo:block-container id="{@id}" xsl:use-attribute-sets="example-style">
8713
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="example-style" role="SKIP">
8635
8714
 
8636
8715
  <xsl:call-template name="setBlockSpanAll"/>
8637
8716
 
@@ -8642,7 +8721,7 @@
8642
8721
  inline
8643
8722
  </xsl:variable>
8644
8723
 
8645
- <fo:block-container margin-left="0mm">
8724
+ <fo:block-container margin-left="0mm" role="SKIP">
8646
8725
 
8647
8726
  <xsl:choose>
8648
8727
 
@@ -8655,8 +8734,8 @@
8655
8734
  </xsl:apply-templates>
8656
8735
  </fo:block>
8657
8736
 
8658
- <fo:block-container xsl:use-attribute-sets="example-body-style">
8659
- <fo:block-container margin-left="0mm" margin-right="0mm">
8737
+ <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
8738
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
8660
8739
  <xsl:apply-templates select="node()[not(local-name() = 'name')]">
8661
8740
  <xsl:with-param name="fo_element" select="$fo_element"/>
8662
8741
  </xsl:apply-templates>
@@ -8709,8 +8788,8 @@
8709
8788
 
8710
8789
  <xsl:if test="*[not(local-name() = 'name')][position() &gt; 1]">
8711
8790
  <!-- 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">
8791
+ <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
8792
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
8714
8793
  <xsl:apply-templates select="*[not(local-name() = 'name')][position() &gt; 1]">
8715
8794
  <xsl:with-param name="fo_element" select="'block'"/>
8716
8795
  </xsl:apply-templates>
@@ -8763,7 +8842,7 @@
8763
8842
  </xsl:variable>
8764
8843
  <xsl:choose>
8765
8844
  <xsl:when test="starts-with(normalize-space($element), 'block')">
8766
- <fo:block-container>
8845
+ <fo:block-container role="SKIP">
8767
8846
  <xsl:if test="ancestor::*[local-name() = 'li'] and contains(normalize-space($fo_element), 'block')">
8768
8847
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
8769
8848
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
@@ -8904,7 +8983,7 @@
8904
8983
  <!-- author -->
8905
8984
  <!-- ====== -->
8906
8985
  <xsl:template match="*[local-name() = 'quote']">
8907
- <fo:block-container margin-left="0mm">
8986
+ <fo:block-container margin-left="0mm" role="SKIP">
8908
8987
 
8909
8988
  <xsl:call-template name="setBlockSpanAll"/>
8910
8989
 
@@ -8914,12 +8993,12 @@
8914
8993
  </xsl:if>
8915
8994
  </xsl:if>
8916
8995
 
8917
- <fo:block-container margin-left="0mm">
8918
- <fo:block-container xsl:use-attribute-sets="quote-style">
8996
+ <fo:block-container margin-left="0mm" role="SKIP">
8997
+ <fo:block-container xsl:use-attribute-sets="quote-style" role="SKIP">
8919
8998
 
8920
8999
  <xsl:call-template name="refine_quote-style"/>
8921
9000
 
8922
- <fo:block-container margin-left="0mm" margin-right="0mm">
9001
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
8923
9002
  <fo:block role="BlockQuote">
8924
9003
  <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
8925
9004
  </fo:block>
@@ -9079,10 +9158,10 @@
9079
9158
 
9080
9159
  <xsl:choose>
9081
9160
  <xsl:when test="$lang = 'zh'">
9082
- <fo:inline><xsl:value-of select="$tab_zh"/></fo:inline>
9161
+ <fo:inline role="SKIP"><xsl:value-of select="$tab_zh"/></fo:inline>
9083
9162
  </xsl:when>
9084
9163
  <xsl:when test="../../@inline-header = 'true'">
9085
- <fo:inline font-size="90%">
9164
+ <fo:inline font-size="90%" role="SKIP">
9086
9165
  <xsl:call-template name="insertNonBreakSpaces">
9087
9166
  <xsl:with-param name="count" select="$padding-right"/>
9088
9167
  </xsl:call-template>
@@ -9090,7 +9169,7 @@
9090
9169
  </xsl:when>
9091
9170
  <xsl:otherwise>
9092
9171
  <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>
9172
+ <fo:inline padding-right="{$padding-right}mm" role="SKIP"><xsl:value-of select="$direction"/>​</fo:inline>
9094
9173
  </xsl:otherwise>
9095
9174
  </xsl:choose>
9096
9175
 
@@ -9120,12 +9199,12 @@
9120
9199
  <fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="preferred-block-style">
9121
9200
 
9122
9201
  <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">
9202
+ <fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
9124
9203
  <xsl:apply-templates select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"/>
9125
9204
  </fo:block>
9126
9205
  </xsl:if>
9127
9206
 
9128
- <fo:block xsl:use-attribute-sets="preferred-term-style">
9207
+ <fo:block xsl:use-attribute-sets="preferred-term-style" role="SKIP">
9129
9208
  <xsl:call-template name="setStyle_preferred"/>
9130
9209
  <xsl:apply-templates/>
9131
9210
  </fo:block>
@@ -9166,7 +9245,7 @@
9166
9245
  <!-- definition -->
9167
9246
  <!-- ========== -->
9168
9247
  <xsl:template match="*[local-name() = 'definition']">
9169
- <fo:block xsl:use-attribute-sets="definition-style">
9248
+ <fo:block xsl:use-attribute-sets="definition-style" role="SKIP">
9170
9249
  <xsl:apply-templates/>
9171
9250
  </fo:block>
9172
9251
  </xsl:template>
@@ -9209,6 +9288,10 @@
9209
9288
 
9210
9289
  <xsl:template match="*[local-name() = 'clause']">
9211
9290
  <fo:block>
9291
+ <xsl:if test="parent::*[local-name() = 'copyright-statement']">
9292
+ <xsl:attribute name="role">SKIP</xsl:attribute>
9293
+ </xsl:if>
9294
+
9212
9295
  <xsl:call-template name="setId"/>
9213
9296
 
9214
9297
  <xsl:call-template name="setBlockSpanAll"/>
@@ -9448,7 +9531,7 @@
9448
9531
  <xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
9449
9532
  <xsl:choose>
9450
9533
  <xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
9451
- <fo:block-container>
9534
+ <fo:block-container role="SKIP">
9452
9535
  <xsl:attribute name="margin-left">
9453
9536
  <xsl:choose>
9454
9537
  <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
@@ -9458,7 +9541,7 @@
9458
9541
 
9459
9542
  <xsl:call-template name="refine_list_container_style"/>
9460
9543
 
9461
- <fo:block-container margin-left="0mm">
9544
+ <fo:block-container margin-left="0mm" role="SKIP">
9462
9545
  <fo:block>
9463
9546
  <xsl:apply-templates select="." mode="list"/>
9464
9547
  </fo:block>
@@ -9467,7 +9550,7 @@
9467
9550
  </xsl:when>
9468
9551
  <xsl:otherwise>
9469
9552
 
9470
- <fo:block>
9553
+ <fo:block role="SKIP">
9471
9554
  <xsl:apply-templates select="." mode="list"/>
9472
9555
  </fo:block>
9473
9556
 
@@ -9885,7 +9968,10 @@
9885
9968
  <!-- Reference sections (Normative References and Bibliography) -->
9886
9969
  <!-- ========================================================== -->
9887
9970
  <xsl:template match="*[local-name() = 'references'][@hidden='true']" priority="3"/>
9888
- <xsl:template match="*[local-name() = 'bibitem'][@hidden='true']" priority="3"/>
9971
+ <xsl:template match="*[local-name() = 'bibitem'][@hidden='true']" priority="3">
9972
+ <xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][local-name() = 'bibitem'] and 1 = 1)"/>
9973
+
9974
+ </xsl:template>
9889
9975
  <!-- don't display bibitem with @id starts with '_hidden', that was introduced for references integrity -->
9890
9976
  <xsl:template match="*[local-name() = 'bibitem'][starts-with(@id, 'hidden_bibitem_')]" priority="3"/>
9891
9977
 
@@ -9963,11 +10049,41 @@
9963
10049
 
9964
10050
  <!-- Bibliography (non-normative references) -->
9965
10051
  <xsl:template match="*[local-name() = 'references'][not(@normative='true')]/*[local-name() = 'bibitem']" name="bibitem_non_normative" priority="2">
10052
+ <xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][local-name() = 'bibitem'] and 1 = 1)"/> <!-- current bibiitem is non-first -->
9966
10053
 
9967
10054
  <xsl:call-template name="bibitem"/>
9968
10055
 
9969
10056
  </xsl:template> <!-- references[not(@normative='true')]/bibitem -->
9970
10057
 
10058
+ <xsl:template name="insertListItem_Bibitem">
10059
+ <xsl:choose>
10060
+ <xsl:when test="@hidden = 'true'"><!-- skip --></xsl:when>
10061
+ <xsl:otherwise>
10062
+ <fo:list-item id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-item-style">
10063
+ <fo:list-item-label end-indent="label-end()">
10064
+ <fo:block role="SKIP">
10065
+ <fo:inline role="SKIP">
10066
+ <xsl:apply-templates select="*[local-name() = 'biblio-tag']">
10067
+ <xsl:with-param name="biblio_tag_part">first</xsl:with-param>
10068
+ </xsl:apply-templates>
10069
+ </fo:inline>
10070
+ </fo:block>
10071
+ </fo:list-item-label>
10072
+ <fo:list-item-body start-indent="body-start()">
10073
+ <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style" role="SKIP">
10074
+ <xsl:call-template name="processBibitem">
10075
+ <xsl:with-param name="biblio_tag_part">last</xsl:with-param>
10076
+ </xsl:call-template>
10077
+ </fo:block>
10078
+ </fo:list-item-body>
10079
+ </fo:list-item>
10080
+ </xsl:otherwise>
10081
+ </xsl:choose>
10082
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'bibitem']">
10083
+ <xsl:with-param name="skip">false</xsl:with-param>
10084
+ </xsl:apply-templates>
10085
+ </xsl:template>
10086
+
9971
10087
  <xsl:template name="processBibitem">
9972
10088
  <xsl:param name="biblio_tag_part">both</xsl:param>
9973
10089
 
@@ -10301,7 +10417,7 @@
10301
10417
 
10302
10418
  <xsl:call-template name="setBlockSpanAll"/>
10303
10419
 
10304
- <fo:block-container xsl:use-attribute-sets="admonition-container-style">
10420
+ <fo:block-container xsl:use-attribute-sets="admonition-container-style" role="SKIP">
10305
10421
 
10306
10422
  <fo:block xsl:use-attribute-sets="admonition-name-style">
10307
10423
  <xsl:call-template name="displayAdmonitionName"/>