metanorma-un 0.10.11 → 0.10.13

Sign up to get free protection for your applications and to get access to all the features.
@@ -977,21 +977,32 @@
977
977
  <xsl:variable name="titles_">
978
978
 
979
979
  <!-- These titles of Table of contents renders different than determined in localized-strings -->
980
- <title-toc lang="en">
981
-
980
+ <!-- <title-toc lang="en">
981
+ <xsl:if test="$namespace = 'csd' or $namespace = 'ieee' or $namespace = 'iho' or $namespace = 'mpfd' or $namespace = 'ogc' or $namespace = 'unece-rec'">
982
982
  <xsl:text>Contents</xsl:text>
983
-
984
- </title-toc>
985
- <title-toc lang="fr">
983
+ </xsl:if>
984
+ <xsl:if test="$namespace = 'csa' or $namespace = 'm3d' or $namespace = 'nist-sp' or $namespace = 'ogc-white-paper'">
985
+ <xsl:text>Table of Contents</xsl:text>
986
+ </xsl:if>
987
+ <xsl:if test="$namespace = 'gb'">
988
+ <xsl:text>Table of contents</xsl:text>
989
+ </xsl:if>
990
+ </title-toc> -->
991
+ <title-toc lang="en">Table of contents</title-toc>
992
+ <!-- <title-toc lang="fr">
986
993
  <xsl:text>Sommaire</xsl:text>
987
- </title-toc>
988
- <title-toc lang="zh">
989
-
994
+ </title-toc> -->
995
+ <!-- <title-toc lang="zh">
996
+ <xsl:choose>
997
+ <xsl:when test="$namespace = 'gb'">
998
+ <xsl:text>目次</xsl:text>
999
+ </xsl:when>
1000
+ <xsl:otherwise>
990
1001
  <xsl:text>Contents</xsl:text>
991
-
992
- </title-toc>
993
-
994
- <title-descriptors lang="en">Descriptors</title-descriptors>
1002
+ </xsl:otherwise>
1003
+ </xsl:choose>
1004
+ </title-toc> -->
1005
+ <title-toc lang="zh">目次</title-toc>
995
1006
 
996
1007
  <title-part lang="en">
997
1008
 
@@ -1007,20 +1018,6 @@
1007
1018
  <title-subpart lang="en">Sub-part #</title-subpart>
1008
1019
  <title-subpart lang="fr">Partie de sub #</title-subpart>
1009
1020
 
1010
- <title-list-tables lang="en">List of Tables</title-list-tables>
1011
-
1012
- <title-list-figures lang="en">List of Figures</title-list-figures>
1013
-
1014
- <title-table-figures lang="en">Table of Figures</title-table-figures>
1015
-
1016
- <title-list-recommendations lang="en">List of Recommendations</title-list-recommendations>
1017
-
1018
- <title-summary lang="en">Summary</title-summary>
1019
-
1020
- <title-continued lang="ru">(продолжение)</title-continued>
1021
- <title-continued lang="en">(continued)</title-continued>
1022
- <title-continued lang="fr">(continué)</title-continued>
1023
-
1024
1021
  </xsl:variable>
1025
1022
  <xsl:variable name="titles" select="xalan:nodeset($titles_)"/>
1026
1023
 
@@ -1028,8 +1025,8 @@
1028
1025
  <xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']"/>
1029
1026
  <xsl:value-of select="$toc_table_title"/>
1030
1027
  <xsl:if test="normalize-space($toc_table_title) = ''">
1031
- <xsl:call-template name="getTitle">
1032
- <xsl:with-param name="name" select="'title-list-tables'"/>
1028
+ <xsl:call-template name="getLocalizedString">
1029
+ <xsl:with-param name="key">toc_tables</xsl:with-param>
1033
1030
  </xsl:call-template>
1034
1031
  </xsl:if>
1035
1032
  </xsl:variable>
@@ -1038,8 +1035,8 @@
1038
1035
  <xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']"/>
1039
1036
  <xsl:value-of select="$toc_figure_title"/>
1040
1037
  <xsl:if test="normalize-space($toc_figure_title) = ''">
1041
- <xsl:call-template name="getTitle">
1042
- <xsl:with-param name="name" select="'title-list-figures'"/>
1038
+ <xsl:call-template name="getLocalizedString">
1039
+ <xsl:with-param name="key">toc_figures</xsl:with-param>
1043
1040
  </xsl:call-template>
1044
1041
  </xsl:if>
1045
1042
  </xsl:variable>
@@ -1048,8 +1045,8 @@
1048
1045
  <xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='requirement']/*[local-name() = 'title']"/>
1049
1046
  <xsl:value-of select="$toc_requirement_title"/>
1050
1047
  <xsl:if test="normalize-space($toc_requirement_title) = ''">
1051
- <xsl:call-template name="getTitle">
1052
- <xsl:with-param name="name" select="'title-list-recommendations'"/>
1048
+ <xsl:call-template name="getLocalizedString">
1049
+ <xsl:with-param name="key">toc_recommendations</xsl:with-param>
1053
1050
  </xsl:call-template>
1054
1051
  </xsl:if>
1055
1052
  </xsl:variable>
@@ -1797,6 +1794,7 @@
1797
1794
  </xsl:attribute-set>
1798
1795
 
1799
1796
  <xsl:attribute-set name="figure-block-style">
1797
+ <xsl:attribute name="role">SKIP</xsl:attribute>
1800
1798
 
1801
1799
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1802
1800
 
@@ -1807,6 +1805,7 @@
1807
1805
  </xsl:attribute-set>
1808
1806
 
1809
1807
  <xsl:attribute-set name="figure-name-style">
1808
+ <xsl:attribute name="role">Caption</xsl:attribute>
1810
1809
 
1811
1810
  <xsl:attribute name="text-align">center</xsl:attribute>
1812
1811
  <xsl:attribute name="font-size">9pt</xsl:attribute>
@@ -1856,6 +1855,7 @@
1856
1855
  </xsl:template>
1857
1856
 
1858
1857
  <xsl:attribute-set name="image-style">
1858
+ <xsl:attribute name="role">SKIP</xsl:attribute>
1859
1859
  <xsl:attribute name="text-align">center</xsl:attribute>
1860
1860
 
1861
1861
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
@@ -2134,6 +2134,11 @@
2134
2134
 
2135
2135
  </xsl:attribute-set> <!-- bibitem-non-normative-list-style -->
2136
2136
 
2137
+ <xsl:attribute-set name="bibitem-non-normative-list-item-style">
2138
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2139
+
2140
+ </xsl:attribute-set>
2141
+
2137
2142
  <!-- bibitem in bibliography section (references/@normative="false"), list body -->
2138
2143
  <xsl:attribute-set name="bibitem-normative-list-body-style">
2139
2144
 
@@ -2525,14 +2530,14 @@
2525
2530
  <xsl:value-of select="$sep"/><xsl:value-of select="$zero_width_space"/>
2526
2531
  </xsl:when>
2527
2532
  <xsl:otherwise>
2528
- <fo:inline keep-together.within-line="always"><xsl:apply-templates/></fo:inline>
2533
+ <fo:inline keep-together.within-line="always" role="SKIP"><xsl:apply-templates/></fo:inline>
2529
2534
  </xsl:otherwise>
2530
2535
  </xsl:choose>
2531
2536
  </xsl:for-each>
2532
2537
  </xsl:when>
2533
2538
 
2534
2539
  <xsl:otherwise>
2535
- <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>
2536
2541
  </xsl:otherwise>
2537
2542
 
2538
2543
  </xsl:choose>
@@ -2542,7 +2547,7 @@
2542
2547
  <!-- Preface boilerplate sections processing -->
2543
2548
  <!-- ================================= -->
2544
2549
  <xsl:template match="*[local-name()='copyright-statement']">
2545
- <fo:block xsl:use-attribute-sets="copyright-statement-style">
2550
+ <fo:block xsl:use-attribute-sets="copyright-statement-style" role="SKIP">
2546
2551
  <xsl:apply-templates/>
2547
2552
  </fo:block>
2548
2553
  </xsl:template> <!-- copyright-statement -->
@@ -2712,7 +2717,7 @@
2712
2717
  </xsl:choose>
2713
2718
  </xsl:variable>
2714
2719
 
2715
- <fo:block-container xsl:use-attribute-sets="table-container-style">
2720
+ <fo:block-container xsl:use-attribute-sets="table-container-style" role="SKIP">
2716
2721
 
2717
2722
  <xsl:call-template name="refine_table-container-style">
2718
2723
  <xsl:with-param name="margin-side" select="$margin-side"/>
@@ -3748,7 +3753,7 @@
3748
3753
  </xsl:choose>
3749
3754
  </xsl:variable>
3750
3755
  <xsl:variable name="footnote_inline">
3751
- <fo:inline>
3756
+ <fo:inline role="Reference">
3752
3757
 
3753
3758
  <xsl:variable name="fn_styles">
3754
3759
  <xsl:choose>
@@ -3771,7 +3776,7 @@
3771
3776
 
3772
3777
  <xsl:call-template name="insert_basic_link">
3773
3778
  <xsl:with-param name="element">
3774
- <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
3779
+ <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}" role="Lbl">
3775
3780
  <xsl:copy-of select="$current_fn_number_text"/>
3776
3781
  </fo:basic-link>
3777
3782
  </xsl:with-param>
@@ -3784,17 +3789,17 @@
3784
3789
  <xsl:copy-of select="$footnote_inline"/>
3785
3790
  </xsl:when>
3786
3791
  <xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false'">
3787
- <fo:footnote xsl:use-attribute-sets="fn-style">
3792
+ <fo:footnote xsl:use-attribute-sets="fn-style" role="SKIP">
3788
3793
  <xsl:copy-of select="$footnote_inline"/>
3789
- <fo:footnote-body>
3794
+ <fo:footnote-body role="Note">
3790
3795
 
3791
- <fo:block-container xsl:use-attribute-sets="fn-container-body-style">
3796
+ <fo:block-container xsl:use-attribute-sets="fn-container-body-style" role="SKIP">
3792
3797
 
3793
- <fo:block xsl:use-attribute-sets="fn-body-style">
3798
+ <fo:block xsl:use-attribute-sets="fn-body-style" role="SKIP">
3794
3799
 
3795
3800
  <xsl:call-template name="refine_fn-body-style"/>
3796
3801
 
3797
- <fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style">
3802
+ <fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style" role="Lbl">
3798
3803
 
3799
3804
  <xsl:call-template name="refine_fn-body-num-style"/>
3800
3805
 
@@ -4056,11 +4061,11 @@
4056
4061
  </xsl:template>
4057
4062
 
4058
4063
  <xsl:template match="*[local-name()='fn']/text()[normalize-space() != '']">
4059
- <fo:inline><xsl:value-of select="."/></fo:inline>
4064
+ <fo:inline role="SKIP"><xsl:value-of select="."/></fo:inline>
4060
4065
  </xsl:template>
4061
4066
 
4062
4067
  <xsl:template match="*[local-name()='fn']//*[local-name()='p']">
4063
- <fo:inline>
4068
+ <fo:inline role="P">
4064
4069
  <xsl:apply-templates/>
4065
4070
  </fo:inline>
4066
4071
  </xsl:template>
@@ -4075,7 +4080,7 @@
4075
4080
  <xsl:variable name="isAdded" select="@added"/>
4076
4081
  <xsl:variable name="isDeleted" select="@deleted"/>
4077
4082
  <!-- <dl><xsl:copy-of select="."/></dl> -->
4078
- <fo:block-container xsl:use-attribute-sets="dl-block-style">
4083
+ <fo:block-container xsl:use-attribute-sets="dl-block-style" role="SKIP">
4079
4084
 
4080
4085
  <xsl:call-template name="setBlockSpanAll"/>
4081
4086
 
@@ -4110,7 +4115,7 @@
4110
4115
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
4111
4116
  </xsl:call-template>
4112
4117
 
4113
- <fo:block-container margin-left="0mm">
4118
+ <fo:block-container margin-left="0mm" role="SKIP">
4114
4119
 
4115
4120
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
4116
4121
 
@@ -4175,7 +4180,7 @@
4175
4180
 
4176
4181
  <!-- a few components -->
4177
4182
  <xsl:if test="$onlyOneComponent = 'false'">
4178
- <fo:block>
4183
+ <fo:block role="SKIP">
4179
4184
 
4180
4185
  <xsl:call-template name="refine_multicomponent_style"/>
4181
4186
 
@@ -4183,7 +4188,7 @@
4183
4188
  <xsl:attribute name="margin-top">0</xsl:attribute>
4184
4189
  </xsl:if>
4185
4190
 
4186
- <fo:block>
4191
+ <fo:block role="SKIP">
4187
4192
 
4188
4193
  <xsl:call-template name="refine_multicomponent_block_style"/>
4189
4194
 
@@ -4778,6 +4783,9 @@
4778
4783
 
4779
4784
  <xsl:template name="refine_strong_style">
4780
4785
 
4786
+ <xsl:if test="ancestor::*['preferred']">
4787
+ <xsl:attribute name="role">SKIP</xsl:attribute>
4788
+ </xsl:if>
4781
4789
  </xsl:template>
4782
4790
 
4783
4791
  <xsl:template match="*[local-name()='padding']">
@@ -4822,7 +4830,7 @@
4822
4830
  <xsl:variable name="regex_url_start">^(http://|https://|www\.)?(.*)</xsl:variable>
4823
4831
  <xsl:template match="*[local-name()='tt']/text()" priority="2">
4824
4832
  <xsl:choose>
4825
- <xsl:when test="java:replaceAll(java:java.lang.String.new(.), '$2', '') != ''">
4833
+ <xsl:when test="java:replaceAll(java:java.lang.String.new(.), $regex_url_start, '$2') != ''">
4826
4834
  <!-- url -->
4827
4835
  <xsl:call-template name="add-zero-spaces-link-java"/>
4828
4836
  </xsl:when>
@@ -5284,10 +5292,13 @@
5284
5292
  </xsl:choose>
5285
5293
  </xsl:variable>
5286
5294
 
5295
+ <!-- replace sequence #x200B to one &#x200B -->
5296
+ <xsl:variable name="text10" select="java:replaceAll(java:java.lang.String.new($text9), '\u200b{2,}', '​')"/>
5297
+
5287
5298
  <!-- replace sequence #x200B and space TO space -->
5288
- <xsl:variable name="text10" select="java:replaceAll(java:java.lang.String.new($text9), '\u200b ', ' ')"/>
5299
+ <xsl:variable name="text11" select="java:replaceAll(java:java.lang.String.new($text10), '\u200b ', ' ')"/>
5289
5300
 
5290
- <xsl:value-of select="$text10"/>
5301
+ <xsl:value-of select="$text11"/>
5291
5302
  </xsl:template>
5292
5303
 
5293
5304
  <xsl:template name="add-zero-spaces-link-java">
@@ -5297,8 +5308,12 @@
5297
5308
  <xsl:variable name="url_continue" select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$2')"/>
5298
5309
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space, comma, slash, @ -->
5299
5310
  <xsl:variable name="url" select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/|@)','$1​')"/>
5311
+
5312
+ <!-- replace sequence #x200B to one &#x200B -->
5313
+ <xsl:variable name="url2" select="java:replaceAll(java:java.lang.String.new($url), '\u200b{2,}', '​')"/>
5314
+
5300
5315
  <!-- remove zero-width space at the end -->
5301
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url), '​$', '')"/>
5316
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url2), '​$', '')"/>
5302
5317
  </xsl:template>
5303
5318
 
5304
5319
  <!-- add zero space after dash character (for table's entries) -->
@@ -5709,6 +5724,18 @@
5709
5724
  </xsl:copy>
5710
5725
  </xsl:template>
5711
5726
 
5727
+ <xsl:variable name="font_main_root_style">
5728
+ <root-style xsl:use-attribute-sets="root-style">
5729
+ </root-style>
5730
+ </xsl:variable>
5731
+ <xsl:variable name="font_main_root_style_font_family" select="xalan:nodeset($font_main_root_style)/root-style/@font-family"/>
5732
+ <xsl:variable name="font_main">
5733
+ <xsl:choose>
5734
+ <xsl:when test="contains($font_main_root_style_font_family, ',')"><xsl:value-of select="substring-before($font_main_root_style_font_family, ',')"/></xsl:when>
5735
+ <xsl:otherwise><xsl:value-of select="$font_main_root_style_font_family"/></xsl:otherwise>
5736
+ </xsl:choose>
5737
+ </xsl:variable>
5738
+
5712
5739
  <xsl:template match="*[local-name()='th' or local-name()='td']" mode="simple-table-id">
5713
5740
  <xsl:param name="id"/>
5714
5741
  <xsl:copy>
@@ -5747,6 +5774,33 @@
5747
5774
 
5748
5775
  <!-- td_text='<xsl:copy-of select="$td_text"/>' -->
5749
5776
 
5777
+ <xsl:variable name="words_with_width">
5778
+ <!-- calculate width for 'word' which contain text only (without formatting tags inside) -->
5779
+ <xsl:for-each select="xalan:nodeset($td_text)//*[local-name() = 'word'][normalize-space() != ''][not(*)]">
5780
+ <xsl:copy>
5781
+ <xsl:copy-of select="@*"/>
5782
+ <xsl:attribute name="width">
5783
+ <xsl:value-of select="java:org.metanorma.fop.Util.getStringWidth(., $font_main)"/> <!-- Example: 'Times New Roman' -->
5784
+ </xsl:attribute>
5785
+ <xsl:copy-of select="node()"/>
5786
+ </xsl:copy>
5787
+ </xsl:for-each>
5788
+ </xsl:variable>
5789
+
5790
+ <xsl:variable name="words_with_width_sorted">
5791
+ <xsl:for-each select="xalan:nodeset($words_with_width)//*[local-name() = 'word']">
5792
+ <xsl:sort select="@width" data-type="number" order="descending"/>
5793
+ <!-- select word maximal width only -->
5794
+ <xsl:if test="position() = 1">
5795
+ <xsl:copy-of select="."/>
5796
+ </xsl:if>
5797
+ </xsl:for-each>
5798
+ <!-- add 'word' with formatting tags inside -->
5799
+ <xsl:for-each select="xalan:nodeset($td_text)//*[local-name() = 'word'][normalize-space() != ''][*]">
5800
+ <xsl:copy-of select="."/>
5801
+ </xsl:for-each>
5802
+ </xsl:variable>
5803
+
5750
5804
  <xsl:variable name="words">
5751
5805
  <xsl:for-each select=".//*[local-name() = 'image' or local-name() = 'stem']">
5752
5806
  <word>
@@ -5754,9 +5808,12 @@
5754
5808
  </word>
5755
5809
  </xsl:for-each>
5756
5810
 
5757
- <xsl:for-each select="xalan:nodeset($td_text)//*[local-name() = 'word'][normalize-space() != '']">
5811
+ <xsl:for-each select="xalan:nodeset($words_with_width_sorted)//*[local-name() = 'word'][normalize-space() != '']">
5758
5812
  <xsl:copy-of select="."/>
5759
5813
  </xsl:for-each>
5814
+ <!-- <xsl:for-each select="xalan:nodeset($td_text)//*[local-name() = 'word'][normalize-space() != '']">
5815
+ <xsl:copy-of select="."/>
5816
+ </xsl:for-each> -->
5760
5817
 
5761
5818
  </xsl:variable>
5762
5819
 
@@ -6217,10 +6274,10 @@
6217
6274
  <xsl:copy>
6218
6275
  <xsl:apply-templates select="@*" mode="mathml"/>
6219
6276
  <xsl:if test="not(@lspace)">
6220
- <xsl:attribute name="lspace">0.4em</xsl:attribute>
6277
+ <xsl:attribute name="lspace">0.2em</xsl:attribute>
6221
6278
  </xsl:if>
6222
- <xsl:if test="not(@rspace)">
6223
- <xsl:attribute name="rspace">0.4em</xsl:attribute>
6279
+ <xsl:if test="not(@rspace) and not(following-sibling::*[1][self::mathml:mo and normalize-space(text()) = '|'])">
6280
+ <xsl:attribute name="rspace">0.2em</xsl:attribute>
6224
6281
  </xsl:if>
6225
6282
  <xsl:apply-templates mode="mathml"/>
6226
6283
  </xsl:copy>
@@ -6237,6 +6294,27 @@
6237
6294
  </xsl:copy>
6238
6295
  </xsl:template>
6239
6296
 
6297
+ <!-- increase space before '(' -->
6298
+ <xsl:template match="mathml:mo[normalize-space(text()) = '(']" mode="mathml">
6299
+ <xsl:copy>
6300
+ <xsl:apply-templates select="@*" mode="mathml"/>
6301
+ <xsl:if test="(preceding-sibling::* and not(preceding-sibling::*[1][self::mathml:mo])) or (../preceding-sibling::* and not(../preceding-sibling::*[1][self::mathml:mo]))">
6302
+ <xsl:if test="not(@lspace)">
6303
+ <xsl:attribute name="lspace">0.4em</xsl:attribute>
6304
+ <xsl:choose>
6305
+ <xsl:when test="preceding-sibling::*[1][self::mathml:mi or self::mathml:mstyle]">
6306
+ <xsl:attribute name="lspace">0.2em</xsl:attribute>
6307
+ </xsl:when>
6308
+ <xsl:when test="../preceding-sibling::*[1][self::mathml:mi or self::mathml:mstyle]">
6309
+ <xsl:attribute name="lspace">0.2em</xsl:attribute>
6310
+ </xsl:when>
6311
+ </xsl:choose>
6312
+ </xsl:if>
6313
+ </xsl:if>
6314
+ <xsl:apply-templates mode="mathml"/>
6315
+ </xsl:copy>
6316
+ </xsl:template>
6317
+
6240
6318
  <!-- Examples:
6241
6319
  <stem type="AsciiMath">x = 1</stem>
6242
6320
  <stem type="AsciiMath"><asciimath>x = 1</asciimath></stem>
@@ -6396,7 +6474,7 @@
6396
6474
  <!-- formula -->
6397
6475
  <!-- ====== -->
6398
6476
  <xsl:template match="*[local-name() = 'formula']" name="formula">
6399
- <fo:block-container margin-left="0mm">
6477
+ <fo:block-container margin-left="0mm" role="SKIP">
6400
6478
  <xsl:if test="parent::*[local-name() = 'note']">
6401
6479
  <xsl:attribute name="margin-left">
6402
6480
  <xsl:choose>
@@ -6406,7 +6484,7 @@
6406
6484
  </xsl:attribute>
6407
6485
 
6408
6486
  </xsl:if>
6409
- <fo:block-container margin-left="0mm">
6487
+ <fo:block-container margin-left="0mm" role="SKIP">
6410
6488
  <fo:block id="{@id}">
6411
6489
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> <!-- formula's number will be process in 'stem' template -->
6412
6490
  </fo:block>
@@ -6486,19 +6564,19 @@
6486
6564
 
6487
6565
  <xsl:template match="*[local-name() = 'note']" name="note">
6488
6566
 
6489
- <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style">
6567
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
6490
6568
 
6491
6569
  <xsl:call-template name="setBlockSpanAll"/>
6492
6570
 
6493
6571
  <xsl:call-template name="refine_note-style"/>
6494
6572
 
6495
- <fo:block-container margin-left="0mm" margin-right="0mm">
6573
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
6496
6574
 
6497
6575
  <fo:block>
6498
6576
 
6499
6577
  <xsl:call-template name="refine_note_block_style"/>
6500
6578
 
6501
- <fo:inline xsl:use-attribute-sets="note-name-style">
6579
+ <fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
6502
6580
 
6503
6581
  <xsl:call-template name="refine_note-name-style"/>
6504
6582
 
@@ -6544,12 +6622,12 @@
6544
6622
  <xsl:variable name="num"><xsl:number/></xsl:variable>
6545
6623
  <xsl:choose>
6546
6624
  <xsl:when test="$num = 1"> <!-- display first NOTE's paragraph in the same line with label NOTE -->
6547
- <fo:inline xsl:use-attribute-sets="note-p-style">
6625
+ <fo:inline xsl:use-attribute-sets="note-p-style" role="SKIP">
6548
6626
  <xsl:apply-templates/>
6549
6627
  </fo:inline>
6550
6628
  </xsl:when>
6551
6629
  <xsl:otherwise>
6552
- <fo:block xsl:use-attribute-sets="note-p-style">
6630
+ <fo:block xsl:use-attribute-sets="note-p-style" role="SKIP">
6553
6631
  <xsl:apply-templates/>
6554
6632
  </fo:block>
6555
6633
  </xsl:otherwise>
@@ -6667,12 +6745,13 @@
6667
6745
 
6668
6746
  <xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']">
6669
6747
  <xsl:if test="normalize-space() != ''">
6670
- <xsl:variable name="level">
6748
+ <!-- <xsl:variable name="level">
6671
6749
  <xsl:call-template name="getLevelTermName"/>
6672
6750
  </xsl:variable>
6673
6751
  <fo:inline role="H{$level}">
6674
- <xsl:apply-templates/>
6675
- </fo:inline>
6752
+ <xsl:apply-templates />
6753
+ </fo:inline> -->
6754
+ <xsl:apply-templates/>
6676
6755
  </xsl:if>
6677
6756
  </xsl:template>
6678
6757
  <!-- ====== -->
@@ -6696,7 +6775,7 @@
6696
6775
  <!-- Example: Dimensions in millimeters -->
6697
6776
  <xsl:apply-templates select="*[local-name() = 'note'][@type = 'units']"/>
6698
6777
 
6699
- <fo:block xsl:use-attribute-sets="figure-style">
6778
+ <fo:block xsl:use-attribute-sets="figure-style" role="SKIP">
6700
6779
  <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note' and @type = 'units')]"/>
6701
6780
  </fo:block>
6702
6781
  <xsl:for-each select="*[local-name() = 'note'][not(@type = 'units')]">
@@ -7830,7 +7909,7 @@
7830
7909
  </xsl:when>
7831
7910
 
7832
7911
  <xsl:otherwise>
7833
- <fo:block-container xsl:use-attribute-sets="sourcecode-container-style">
7912
+ <fo:block-container xsl:use-attribute-sets="sourcecode-container-style" role="SKIP">
7834
7913
 
7835
7914
  <xsl:if test="not(ancestor::*[local-name() = 'li']) or ancestor::*[local-name() = 'example']">
7836
7915
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
@@ -7851,7 +7930,7 @@
7851
7930
  </xsl:attribute>
7852
7931
 
7853
7932
  </xsl:if>
7854
- <fo:block-container margin-left="0mm">
7933
+ <fo:block-container margin-left="0mm" role="SKIP">
7855
7934
 
7856
7935
  <fo:block xsl:use-attribute-sets="sourcecode-style">
7857
7936
 
@@ -8397,11 +8476,11 @@
8397
8476
  <!-- requirement, recommendation, permission table -->
8398
8477
  <!-- ========== -->
8399
8478
  <xsl:template match="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
8400
- <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt">
8479
+ <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt" role="SKIP">
8401
8480
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
8402
8481
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
8403
8482
  </xsl:if>
8404
- <fo:block-container margin-left="0mm" margin-right="0mm">
8483
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
8405
8484
  <fo:table id="{@id}" table-layout="fixed" width="100%"> <!-- border="1pt solid black" -->
8406
8485
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
8407
8486
  <!-- <xsl:attribute name="border">0.5pt solid black</xsl:attribute> -->
@@ -8563,7 +8642,7 @@
8563
8642
  -->
8564
8643
  <xsl:template match="*[local-name() = 'example']">
8565
8644
 
8566
- <fo:block-container id="{@id}" xsl:use-attribute-sets="example-style">
8645
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="example-style" role="SKIP">
8567
8646
 
8568
8647
  <xsl:call-template name="setBlockSpanAll"/>
8569
8648
 
@@ -8574,7 +8653,7 @@
8574
8653
  block
8575
8654
  </xsl:variable>
8576
8655
 
8577
- <fo:block-container margin-left="0mm">
8656
+ <fo:block-container margin-left="0mm" role="SKIP">
8578
8657
 
8579
8658
  <xsl:choose>
8580
8659
 
@@ -8587,8 +8666,8 @@
8587
8666
  </xsl:apply-templates>
8588
8667
  </fo:block>
8589
8668
 
8590
- <fo:block-container xsl:use-attribute-sets="example-body-style">
8591
- <fo:block-container margin-left="0mm" margin-right="0mm">
8669
+ <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
8670
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
8592
8671
  <xsl:apply-templates select="node()[not(local-name() = 'name')]">
8593
8672
  <xsl:with-param name="fo_element" select="$fo_element"/>
8594
8673
  </xsl:apply-templates>
@@ -8641,8 +8720,8 @@
8641
8720
 
8642
8721
  <xsl:if test="*[not(local-name() = 'name')][position() &gt; 1]">
8643
8722
  <!-- display further elements in blocks -->
8644
- <fo:block-container xsl:use-attribute-sets="example-body-style">
8645
- <fo:block-container margin-left="0mm" margin-right="0mm">
8723
+ <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
8724
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
8646
8725
  <xsl:apply-templates select="*[not(local-name() = 'name')][position() &gt; 1]">
8647
8726
  <xsl:with-param name="fo_element" select="'block'"/>
8648
8727
  </xsl:apply-templates>
@@ -8695,7 +8774,7 @@
8695
8774
  </xsl:variable>
8696
8775
  <xsl:choose>
8697
8776
  <xsl:when test="starts-with(normalize-space($element), 'block')">
8698
- <fo:block-container>
8777
+ <fo:block-container role="SKIP">
8699
8778
  <xsl:if test="ancestor::*[local-name() = 'li'] and contains(normalize-space($fo_element), 'block')">
8700
8779
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
8701
8780
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
@@ -8836,7 +8915,7 @@
8836
8915
  <!-- author -->
8837
8916
  <!-- ====== -->
8838
8917
  <xsl:template match="*[local-name() = 'quote']">
8839
- <fo:block-container margin-left="0mm">
8918
+ <fo:block-container margin-left="0mm" role="SKIP">
8840
8919
 
8841
8920
  <xsl:call-template name="setBlockSpanAll"/>
8842
8921
 
@@ -8846,12 +8925,12 @@
8846
8925
  </xsl:if>
8847
8926
  </xsl:if>
8848
8927
 
8849
- <fo:block-container margin-left="0mm">
8850
- <fo:block-container xsl:use-attribute-sets="quote-style">
8928
+ <fo:block-container margin-left="0mm" role="SKIP">
8929
+ <fo:block-container xsl:use-attribute-sets="quote-style" role="SKIP">
8851
8930
 
8852
8931
  <xsl:call-template name="refine_quote-style"/>
8853
8932
 
8854
- <fo:block-container margin-left="0mm" margin-right="0mm">
8933
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
8855
8934
  <fo:block role="BlockQuote">
8856
8935
  <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
8857
8936
  </fo:block>
@@ -9007,10 +9086,10 @@
9007
9086
 
9008
9087
  <xsl:choose>
9009
9088
  <xsl:when test="$lang = 'zh'">
9010
- <fo:inline><xsl:value-of select="$tab_zh"/></fo:inline>
9089
+ <fo:inline role="SKIP"><xsl:value-of select="$tab_zh"/></fo:inline>
9011
9090
  </xsl:when>
9012
9091
  <xsl:when test="../../@inline-header = 'true'">
9013
- <fo:inline font-size="90%">
9092
+ <fo:inline font-size="90%" role="SKIP">
9014
9093
  <xsl:call-template name="insertNonBreakSpaces">
9015
9094
  <xsl:with-param name="count" select="$padding-right"/>
9016
9095
  </xsl:call-template>
@@ -9018,7 +9097,7 @@
9018
9097
  </xsl:when>
9019
9098
  <xsl:otherwise>
9020
9099
  <xsl:variable name="direction"><xsl:if test="$lang = 'ar'"><xsl:value-of select="$RLM"/></xsl:if></xsl:variable>
9021
- <fo:inline padding-right="{$padding-right}mm"><xsl:value-of select="$direction"/>​</fo:inline>
9100
+ <fo:inline padding-right="{$padding-right}mm" role="SKIP"><xsl:value-of select="$direction"/>​</fo:inline>
9022
9101
  </xsl:otherwise>
9023
9102
  </xsl:choose>
9024
9103
 
@@ -9048,12 +9127,12 @@
9048
9127
  <fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="preferred-block-style">
9049
9128
 
9050
9129
  <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'preferred'])"> <!-- if first preffered in term, then display term's name -->
9051
- <fo:block xsl:use-attribute-sets="term-name-style">
9130
+ <fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
9052
9131
  <xsl:apply-templates select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"/>
9053
9132
  </fo:block>
9054
9133
  </xsl:if>
9055
9134
 
9056
- <fo:block xsl:use-attribute-sets="preferred-term-style">
9135
+ <fo:block xsl:use-attribute-sets="preferred-term-style" role="SKIP">
9057
9136
  <xsl:call-template name="setStyle_preferred"/>
9058
9137
  <xsl:apply-templates/>
9059
9138
  </fo:block>
@@ -9094,7 +9173,7 @@
9094
9173
  <!-- definition -->
9095
9174
  <!-- ========== -->
9096
9175
  <xsl:template match="*[local-name() = 'definition']">
9097
- <fo:block xsl:use-attribute-sets="definition-style">
9176
+ <fo:block xsl:use-attribute-sets="definition-style" role="SKIP">
9098
9177
  <xsl:apply-templates/>
9099
9178
  </fo:block>
9100
9179
  </xsl:template>
@@ -9144,6 +9223,10 @@
9144
9223
 
9145
9224
  <xsl:template match="*[local-name() = 'clause']">
9146
9225
  <fo:block>
9226
+ <xsl:if test="parent::*[local-name() = 'copyright-statement']">
9227
+ <xsl:attribute name="role">SKIP</xsl:attribute>
9228
+ </xsl:if>
9229
+
9147
9230
  <xsl:call-template name="setId"/>
9148
9231
 
9149
9232
  <xsl:call-template name="setBlockSpanAll"/>
@@ -9385,7 +9468,7 @@
9385
9468
  <xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
9386
9469
  <xsl:choose>
9387
9470
  <xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
9388
- <fo:block-container>
9471
+ <fo:block-container role="SKIP">
9389
9472
  <xsl:attribute name="margin-left">
9390
9473
  <xsl:choose>
9391
9474
  <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
@@ -9395,7 +9478,7 @@
9395
9478
 
9396
9479
  <xsl:call-template name="refine_list_container_style"/>
9397
9480
 
9398
- <fo:block-container margin-left="0mm">
9481
+ <fo:block-container margin-left="0mm" role="SKIP">
9399
9482
  <fo:block>
9400
9483
  <xsl:apply-templates select="." mode="list"/>
9401
9484
  </fo:block>
@@ -9404,7 +9487,7 @@
9404
9487
  </xsl:when>
9405
9488
  <xsl:otherwise>
9406
9489
 
9407
- <fo:block>
9490
+ <fo:block role="SKIP">
9408
9491
  <xsl:apply-templates select="." mode="list"/>
9409
9492
  </fo:block>
9410
9493
 
@@ -9826,7 +9909,10 @@
9826
9909
  <!-- Reference sections (Normative References and Bibliography) -->
9827
9910
  <!-- ========================================================== -->
9828
9911
  <xsl:template match="*[local-name() = 'references'][@hidden='true']" priority="3"/>
9829
- <xsl:template match="*[local-name() = 'bibitem'][@hidden='true']" priority="3"/>
9912
+ <xsl:template match="*[local-name() = 'bibitem'][@hidden='true']" priority="3">
9913
+ <xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][local-name() = 'bibitem'] and 1 = 1)"/>
9914
+
9915
+ </xsl:template>
9830
9916
  <!-- don't display bibitem with @id starts with '_hidden', that was introduced for references integrity -->
9831
9917
  <xsl:template match="*[local-name() = 'bibitem'][starts-with(@id, 'hidden_bibitem_')]" priority="3"/>
9832
9918
 
@@ -9873,6 +9959,7 @@
9873
9959
 
9874
9960
  <!-- Bibliography (non-normative references) -->
9875
9961
  <xsl:template match="*[local-name() = 'references'][not(@normative='true')]/*[local-name() = 'bibitem']" name="bibitem_non_normative" priority="2">
9962
+ <xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][local-name() = 'bibitem'] and 1 = 1)"/> <!-- current bibiitem is non-first -->
9876
9963
 
9877
9964
  <fo:block id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-style">
9878
9965
  <xsl:call-template name="processBibitem"/>
@@ -9880,6 +9967,35 @@
9880
9967
 
9881
9968
  </xsl:template> <!-- references[not(@normative='true')]/bibitem -->
9882
9969
 
9970
+ <xsl:template name="insertListItem_Bibitem">
9971
+ <xsl:choose>
9972
+ <xsl:when test="@hidden = 'true'"><!-- skip --></xsl:when>
9973
+ <xsl:otherwise>
9974
+ <fo:list-item id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-item-style">
9975
+ <fo:list-item-label end-indent="label-end()">
9976
+ <fo:block role="SKIP">
9977
+ <fo:inline role="SKIP">
9978
+ <xsl:apply-templates select="*[local-name() = 'biblio-tag']">
9979
+ <xsl:with-param name="biblio_tag_part">first</xsl:with-param>
9980
+ </xsl:apply-templates>
9981
+ </fo:inline>
9982
+ </fo:block>
9983
+ </fo:list-item-label>
9984
+ <fo:list-item-body start-indent="body-start()">
9985
+ <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style" role="SKIP">
9986
+ <xsl:call-template name="processBibitem">
9987
+ <xsl:with-param name="biblio_tag_part">last</xsl:with-param>
9988
+ </xsl:call-template>
9989
+ </fo:block>
9990
+ </fo:list-item-body>
9991
+ </fo:list-item>
9992
+ </xsl:otherwise>
9993
+ </xsl:choose>
9994
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'bibitem']">
9995
+ <xsl:with-param name="skip">false</xsl:with-param>
9996
+ </xsl:apply-templates>
9997
+ </xsl:template>
9998
+
9883
9999
  <xsl:template name="processBibitem">
9884
10000
  <xsl:param name="biblio_tag_part">both</xsl:param>
9885
10001
 
@@ -10221,9 +10337,9 @@
10221
10337
  <xsl:call-template name="displayAdmonitionName"/>
10222
10338
  </fo:block>
10223
10339
 
10224
- <fo:block-container xsl:use-attribute-sets="admonition-container-style">
10340
+ <fo:block-container xsl:use-attribute-sets="admonition-container-style" role="SKIP">
10225
10341
 
10226
- <fo:block-container margin-left="0mm" margin-right="0mm">
10342
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
10227
10343
  <fo:block>
10228
10344
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
10229
10345
  </fo:block>