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.
@@ -871,19 +871,32 @@
871
871
  <xsl:variable name="titles_">
872
872
 
873
873
  <!-- These titles of Table of contents renders different than determined in localized-strings -->
874
- <title-toc lang="en">
875
-
876
- </title-toc>
877
- <title-toc lang="fr">
874
+ <!-- <title-toc lang="en">
875
+ <xsl:if test="$namespace = 'csd' or $namespace = 'ieee' or $namespace = 'iho' or $namespace = 'mpfd' or $namespace = 'ogc' or $namespace = 'unece-rec'">
876
+ <xsl:text>Contents</xsl:text>
877
+ </xsl:if>
878
+ <xsl:if test="$namespace = 'csa' or $namespace = 'm3d' or $namespace = 'nist-sp' or $namespace = 'ogc-white-paper'">
879
+ <xsl:text>Table of Contents</xsl:text>
880
+ </xsl:if>
881
+ <xsl:if test="$namespace = 'gb'">
882
+ <xsl:text>Table of contents</xsl:text>
883
+ </xsl:if>
884
+ </title-toc> -->
885
+ <title-toc lang="en">Table of contents</title-toc>
886
+ <!-- <title-toc lang="fr">
878
887
  <xsl:text>Sommaire</xsl:text>
879
- </title-toc>
880
- <title-toc lang="zh">
881
-
888
+ </title-toc> -->
889
+ <!-- <title-toc lang="zh">
890
+ <xsl:choose>
891
+ <xsl:when test="$namespace = 'gb'">
892
+ <xsl:text>目次</xsl:text>
893
+ </xsl:when>
894
+ <xsl:otherwise>
882
895
  <xsl:text>Contents</xsl:text>
883
-
884
- </title-toc>
885
-
886
- <title-descriptors lang="en">Descriptors</title-descriptors>
896
+ </xsl:otherwise>
897
+ </xsl:choose>
898
+ </title-toc> -->
899
+ <title-toc lang="zh">目次</title-toc>
887
900
 
888
901
  <title-part lang="en">
889
902
 
@@ -899,20 +912,6 @@
899
912
  <title-subpart lang="en">Sub-part #</title-subpart>
900
913
  <title-subpart lang="fr">Partie de sub #</title-subpart>
901
914
 
902
- <title-list-tables lang="en">List of Tables</title-list-tables>
903
-
904
- <title-list-figures lang="en">List of Figures</title-list-figures>
905
-
906
- <title-table-figures lang="en">Table of Figures</title-table-figures>
907
-
908
- <title-list-recommendations lang="en">List of Recommendations</title-list-recommendations>
909
-
910
- <title-summary lang="en">Summary</title-summary>
911
-
912
- <title-continued lang="ru">(продолжение)</title-continued>
913
- <title-continued lang="en">(continued)</title-continued>
914
- <title-continued lang="fr">(continué)</title-continued>
915
-
916
915
  </xsl:variable>
917
916
  <xsl:variable name="titles" select="xalan:nodeset($titles_)"/>
918
917
 
@@ -920,8 +919,8 @@
920
919
  <xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']"/>
921
920
  <xsl:value-of select="$toc_table_title"/>
922
921
  <xsl:if test="normalize-space($toc_table_title) = ''">
923
- <xsl:call-template name="getTitle">
924
- <xsl:with-param name="name" select="'title-list-tables'"/>
922
+ <xsl:call-template name="getLocalizedString">
923
+ <xsl:with-param name="key">toc_tables</xsl:with-param>
925
924
  </xsl:call-template>
926
925
  </xsl:if>
927
926
  </xsl:variable>
@@ -930,8 +929,8 @@
930
929
  <xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']"/>
931
930
  <xsl:value-of select="$toc_figure_title"/>
932
931
  <xsl:if test="normalize-space($toc_figure_title) = ''">
933
- <xsl:call-template name="getTitle">
934
- <xsl:with-param name="name" select="'title-list-figures'"/>
932
+ <xsl:call-template name="getLocalizedString">
933
+ <xsl:with-param name="key">toc_figures</xsl:with-param>
935
934
  </xsl:call-template>
936
935
  </xsl:if>
937
936
  </xsl:variable>
@@ -940,8 +939,8 @@
940
939
  <xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='requirement']/*[local-name() = 'title']"/>
941
940
  <xsl:value-of select="$toc_requirement_title"/>
942
941
  <xsl:if test="normalize-space($toc_requirement_title) = ''">
943
- <xsl:call-template name="getTitle">
944
- <xsl:with-param name="name" select="'title-list-recommendations'"/>
942
+ <xsl:call-template name="getLocalizedString">
943
+ <xsl:with-param name="key">toc_recommendations</xsl:with-param>
945
944
  </xsl:call-template>
946
945
  </xsl:if>
947
946
  </xsl:variable>
@@ -1672,6 +1671,7 @@
1672
1671
  </xsl:attribute-set>
1673
1672
 
1674
1673
  <xsl:attribute-set name="figure-block-style">
1674
+ <xsl:attribute name="role">SKIP</xsl:attribute>
1675
1675
 
1676
1676
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1677
1677
 
@@ -1682,6 +1682,7 @@
1682
1682
  </xsl:attribute-set>
1683
1683
 
1684
1684
  <xsl:attribute-set name="figure-name-style">
1685
+ <xsl:attribute name="role">Caption</xsl:attribute>
1685
1686
 
1686
1687
  <xsl:attribute name="text-align">center</xsl:attribute>
1687
1688
  <xsl:attribute name="space-after">6pt</xsl:attribute>
@@ -1729,6 +1730,7 @@
1729
1730
  </xsl:template>
1730
1731
 
1731
1732
  <xsl:attribute-set name="image-style">
1733
+ <xsl:attribute name="role">SKIP</xsl:attribute>
1732
1734
  <xsl:attribute name="text-align">center</xsl:attribute>
1733
1735
 
1734
1736
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
@@ -2001,6 +2003,11 @@
2001
2003
 
2002
2004
  </xsl:attribute-set> <!-- bibitem-non-normative-list-style -->
2003
2005
 
2006
+ <xsl:attribute-set name="bibitem-non-normative-list-item-style">
2007
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2008
+
2009
+ </xsl:attribute-set>
2010
+
2004
2011
  <!-- bibitem in bibliography section (references/@normative="false"), list body -->
2005
2012
  <xsl:attribute-set name="bibitem-normative-list-body-style">
2006
2013
 
@@ -2392,14 +2399,14 @@
2392
2399
  <xsl:value-of select="$sep"/><xsl:value-of select="$zero_width_space"/>
2393
2400
  </xsl:when>
2394
2401
  <xsl:otherwise>
2395
- <fo:inline keep-together.within-line="always"><xsl:apply-templates/></fo:inline>
2402
+ <fo:inline keep-together.within-line="always" role="SKIP"><xsl:apply-templates/></fo:inline>
2396
2403
  </xsl:otherwise>
2397
2404
  </xsl:choose>
2398
2405
  </xsl:for-each>
2399
2406
  </xsl:when>
2400
2407
 
2401
2408
  <xsl:otherwise>
2402
- <fo:inline keep-together.within-line="always"><xsl:apply-templates/></fo:inline>
2409
+ <fo:inline keep-together.within-line="always" role="SKIP"><xsl:apply-templates/></fo:inline>
2403
2410
  </xsl:otherwise>
2404
2411
 
2405
2412
  </xsl:choose>
@@ -2409,7 +2416,7 @@
2409
2416
  <!-- Preface boilerplate sections processing -->
2410
2417
  <!-- ================================= -->
2411
2418
  <xsl:template match="*[local-name()='copyright-statement']">
2412
- <fo:block xsl:use-attribute-sets="copyright-statement-style">
2419
+ <fo:block xsl:use-attribute-sets="copyright-statement-style" role="SKIP">
2413
2420
  <xsl:apply-templates/>
2414
2421
  </fo:block>
2415
2422
  </xsl:template> <!-- copyright-statement -->
@@ -2579,7 +2586,7 @@
2579
2586
  </xsl:choose>
2580
2587
  </xsl:variable>
2581
2588
 
2582
- <fo:block-container xsl:use-attribute-sets="table-container-style">
2589
+ <fo:block-container xsl:use-attribute-sets="table-container-style" role="SKIP">
2583
2590
 
2584
2591
  <xsl:call-template name="refine_table-container-style">
2585
2592
  <xsl:with-param name="margin-side" select="$margin-side"/>
@@ -3619,7 +3626,7 @@
3619
3626
  </xsl:choose>
3620
3627
  </xsl:variable>
3621
3628
  <xsl:variable name="footnote_inline">
3622
- <fo:inline>
3629
+ <fo:inline role="Reference">
3623
3630
 
3624
3631
  <xsl:variable name="fn_styles">
3625
3632
  <xsl:choose>
@@ -3642,7 +3649,7 @@
3642
3649
 
3643
3650
  <xsl:call-template name="insert_basic_link">
3644
3651
  <xsl:with-param name="element">
3645
- <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
3652
+ <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}" role="Lbl">
3646
3653
  <xsl:copy-of select="$current_fn_number_text"/>
3647
3654
  </fo:basic-link>
3648
3655
  </xsl:with-param>
@@ -3655,17 +3662,17 @@
3655
3662
  <xsl:copy-of select="$footnote_inline"/>
3656
3663
  </xsl:when>
3657
3664
  <xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false'">
3658
- <fo:footnote xsl:use-attribute-sets="fn-style">
3665
+ <fo:footnote xsl:use-attribute-sets="fn-style" role="SKIP">
3659
3666
  <xsl:copy-of select="$footnote_inline"/>
3660
- <fo:footnote-body>
3667
+ <fo:footnote-body role="Note">
3661
3668
 
3662
- <fo:block-container xsl:use-attribute-sets="fn-container-body-style">
3669
+ <fo:block-container xsl:use-attribute-sets="fn-container-body-style" role="SKIP">
3663
3670
 
3664
- <fo:block xsl:use-attribute-sets="fn-body-style">
3671
+ <fo:block xsl:use-attribute-sets="fn-body-style" role="SKIP">
3665
3672
 
3666
3673
  <xsl:call-template name="refine_fn-body-style"/>
3667
3674
 
3668
- <fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style">
3675
+ <fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style" role="Lbl">
3669
3676
 
3670
3677
  <xsl:call-template name="refine_fn-body-num-style"/>
3671
3678
 
@@ -3927,11 +3934,11 @@
3927
3934
  </xsl:template>
3928
3935
 
3929
3936
  <xsl:template match="*[local-name()='fn']/text()[normalize-space() != '']">
3930
- <fo:inline><xsl:value-of select="."/></fo:inline>
3937
+ <fo:inline role="SKIP"><xsl:value-of select="."/></fo:inline>
3931
3938
  </xsl:template>
3932
3939
 
3933
3940
  <xsl:template match="*[local-name()='fn']//*[local-name()='p']">
3934
- <fo:inline>
3941
+ <fo:inline role="P">
3935
3942
  <xsl:apply-templates/>
3936
3943
  </fo:inline>
3937
3944
  </xsl:template>
@@ -3946,7 +3953,7 @@
3946
3953
  <xsl:variable name="isAdded" select="@added"/>
3947
3954
  <xsl:variable name="isDeleted" select="@deleted"/>
3948
3955
  <!-- <dl><xsl:copy-of select="."/></dl> -->
3949
- <fo:block-container xsl:use-attribute-sets="dl-block-style">
3956
+ <fo:block-container xsl:use-attribute-sets="dl-block-style" role="SKIP">
3950
3957
 
3951
3958
  <xsl:call-template name="setBlockSpanAll"/>
3952
3959
 
@@ -3981,7 +3988,7 @@
3981
3988
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
3982
3989
  </xsl:call-template>
3983
3990
 
3984
- <fo:block-container margin-left="0mm">
3991
+ <fo:block-container margin-left="0mm" role="SKIP">
3985
3992
 
3986
3993
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
3987
3994
 
@@ -4046,7 +4053,7 @@
4046
4053
 
4047
4054
  <!-- a few components -->
4048
4055
  <xsl:if test="$onlyOneComponent = 'false'">
4049
- <fo:block>
4056
+ <fo:block role="SKIP">
4050
4057
 
4051
4058
  <xsl:call-template name="refine_multicomponent_style"/>
4052
4059
 
@@ -4054,7 +4061,7 @@
4054
4061
  <xsl:attribute name="margin-top">0</xsl:attribute>
4055
4062
  </xsl:if>
4056
4063
 
4057
- <fo:block>
4064
+ <fo:block role="SKIP">
4058
4065
 
4059
4066
  <xsl:call-template name="refine_multicomponent_block_style"/>
4060
4067
 
@@ -4649,6 +4656,9 @@
4649
4656
 
4650
4657
  <xsl:template name="refine_strong_style">
4651
4658
 
4659
+ <xsl:if test="ancestor::*['preferred']">
4660
+ <xsl:attribute name="role">SKIP</xsl:attribute>
4661
+ </xsl:if>
4652
4662
  </xsl:template>
4653
4663
 
4654
4664
  <xsl:template match="*[local-name()='padding']">
@@ -4693,7 +4703,7 @@
4693
4703
  <xsl:variable name="regex_url_start">^(http://|https://|www\.)?(.*)</xsl:variable>
4694
4704
  <xsl:template match="*[local-name()='tt']/text()" priority="2">
4695
4705
  <xsl:choose>
4696
- <xsl:when test="java:replaceAll(java:java.lang.String.new(.), '$2', '') != ''">
4706
+ <xsl:when test="java:replaceAll(java:java.lang.String.new(.), $regex_url_start, '$2') != ''">
4697
4707
  <!-- url -->
4698
4708
  <xsl:call-template name="add-zero-spaces-link-java"/>
4699
4709
  </xsl:when>
@@ -5155,10 +5165,13 @@
5155
5165
  </xsl:choose>
5156
5166
  </xsl:variable>
5157
5167
 
5168
+ <!-- replace sequence #x200B to one &#x200B -->
5169
+ <xsl:variable name="text10" select="java:replaceAll(java:java.lang.String.new($text9), '\u200b{2,}', '​')"/>
5170
+
5158
5171
  <!-- replace sequence #x200B and space TO space -->
5159
- <xsl:variable name="text10" select="java:replaceAll(java:java.lang.String.new($text9), '\u200b ', ' ')"/>
5172
+ <xsl:variable name="text11" select="java:replaceAll(java:java.lang.String.new($text10), '\u200b ', ' ')"/>
5160
5173
 
5161
- <xsl:value-of select="$text10"/>
5174
+ <xsl:value-of select="$text11"/>
5162
5175
  </xsl:template>
5163
5176
 
5164
5177
  <xsl:template name="add-zero-spaces-link-java">
@@ -5168,8 +5181,12 @@
5168
5181
  <xsl:variable name="url_continue" select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$2')"/>
5169
5182
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space, comma, slash, @ -->
5170
5183
  <xsl:variable name="url" select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/|@)','$1​')"/>
5184
+
5185
+ <!-- replace sequence #x200B to one &#x200B -->
5186
+ <xsl:variable name="url2" select="java:replaceAll(java:java.lang.String.new($url), '\u200b{2,}', '​')"/>
5187
+
5171
5188
  <!-- remove zero-width space at the end -->
5172
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url), '​$', '')"/>
5189
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url2), '​$', '')"/>
5173
5190
  </xsl:template>
5174
5191
 
5175
5192
  <!-- add zero space after dash character (for table's entries) -->
@@ -5580,6 +5597,18 @@
5580
5597
  </xsl:copy>
5581
5598
  </xsl:template>
5582
5599
 
5600
+ <xsl:variable name="font_main_root_style">
5601
+ <root-style xsl:use-attribute-sets="root-style">
5602
+ </root-style>
5603
+ </xsl:variable>
5604
+ <xsl:variable name="font_main_root_style_font_family" select="xalan:nodeset($font_main_root_style)/root-style/@font-family"/>
5605
+ <xsl:variable name="font_main">
5606
+ <xsl:choose>
5607
+ <xsl:when test="contains($font_main_root_style_font_family, ',')"><xsl:value-of select="substring-before($font_main_root_style_font_family, ',')"/></xsl:when>
5608
+ <xsl:otherwise><xsl:value-of select="$font_main_root_style_font_family"/></xsl:otherwise>
5609
+ </xsl:choose>
5610
+ </xsl:variable>
5611
+
5583
5612
  <xsl:template match="*[local-name()='th' or local-name()='td']" mode="simple-table-id">
5584
5613
  <xsl:param name="id"/>
5585
5614
  <xsl:copy>
@@ -5618,6 +5647,33 @@
5618
5647
 
5619
5648
  <!-- td_text='<xsl:copy-of select="$td_text"/>' -->
5620
5649
 
5650
+ <xsl:variable name="words_with_width">
5651
+ <!-- calculate width for 'word' which contain text only (without formatting tags inside) -->
5652
+ <xsl:for-each select="xalan:nodeset($td_text)//*[local-name() = 'word'][normalize-space() != ''][not(*)]">
5653
+ <xsl:copy>
5654
+ <xsl:copy-of select="@*"/>
5655
+ <xsl:attribute name="width">
5656
+ <xsl:value-of select="java:org.metanorma.fop.Util.getStringWidth(., $font_main)"/> <!-- Example: 'Times New Roman' -->
5657
+ </xsl:attribute>
5658
+ <xsl:copy-of select="node()"/>
5659
+ </xsl:copy>
5660
+ </xsl:for-each>
5661
+ </xsl:variable>
5662
+
5663
+ <xsl:variable name="words_with_width_sorted">
5664
+ <xsl:for-each select="xalan:nodeset($words_with_width)//*[local-name() = 'word']">
5665
+ <xsl:sort select="@width" data-type="number" order="descending"/>
5666
+ <!-- select word maximal width only -->
5667
+ <xsl:if test="position() = 1">
5668
+ <xsl:copy-of select="."/>
5669
+ </xsl:if>
5670
+ </xsl:for-each>
5671
+ <!-- add 'word' with formatting tags inside -->
5672
+ <xsl:for-each select="xalan:nodeset($td_text)//*[local-name() = 'word'][normalize-space() != ''][*]">
5673
+ <xsl:copy-of select="."/>
5674
+ </xsl:for-each>
5675
+ </xsl:variable>
5676
+
5621
5677
  <xsl:variable name="words">
5622
5678
  <xsl:for-each select=".//*[local-name() = 'image' or local-name() = 'stem']">
5623
5679
  <word>
@@ -5625,9 +5681,12 @@
5625
5681
  </word>
5626
5682
  </xsl:for-each>
5627
5683
 
5628
- <xsl:for-each select="xalan:nodeset($td_text)//*[local-name() = 'word'][normalize-space() != '']">
5684
+ <xsl:for-each select="xalan:nodeset($words_with_width_sorted)//*[local-name() = 'word'][normalize-space() != '']">
5629
5685
  <xsl:copy-of select="."/>
5630
5686
  </xsl:for-each>
5687
+ <!-- <xsl:for-each select="xalan:nodeset($td_text)//*[local-name() = 'word'][normalize-space() != '']">
5688
+ <xsl:copy-of select="."/>
5689
+ </xsl:for-each> -->
5631
5690
 
5632
5691
  </xsl:variable>
5633
5692
 
@@ -6088,10 +6147,10 @@
6088
6147
  <xsl:copy>
6089
6148
  <xsl:apply-templates select="@*" mode="mathml"/>
6090
6149
  <xsl:if test="not(@lspace)">
6091
- <xsl:attribute name="lspace">0.4em</xsl:attribute>
6150
+ <xsl:attribute name="lspace">0.2em</xsl:attribute>
6092
6151
  </xsl:if>
6093
- <xsl:if test="not(@rspace)">
6094
- <xsl:attribute name="rspace">0.4em</xsl:attribute>
6152
+ <xsl:if test="not(@rspace) and not(following-sibling::*[1][self::mathml:mo and normalize-space(text()) = '|'])">
6153
+ <xsl:attribute name="rspace">0.2em</xsl:attribute>
6095
6154
  </xsl:if>
6096
6155
  <xsl:apply-templates mode="mathml"/>
6097
6156
  </xsl:copy>
@@ -6108,6 +6167,27 @@
6108
6167
  </xsl:copy>
6109
6168
  </xsl:template>
6110
6169
 
6170
+ <!-- increase space before '(' -->
6171
+ <xsl:template match="mathml:mo[normalize-space(text()) = '(']" mode="mathml">
6172
+ <xsl:copy>
6173
+ <xsl:apply-templates select="@*" mode="mathml"/>
6174
+ <xsl:if test="(preceding-sibling::* and not(preceding-sibling::*[1][self::mathml:mo])) or (../preceding-sibling::* and not(../preceding-sibling::*[1][self::mathml:mo]))">
6175
+ <xsl:if test="not(@lspace)">
6176
+ <xsl:attribute name="lspace">0.4em</xsl:attribute>
6177
+ <xsl:choose>
6178
+ <xsl:when test="preceding-sibling::*[1][self::mathml:mi or self::mathml:mstyle]">
6179
+ <xsl:attribute name="lspace">0.2em</xsl:attribute>
6180
+ </xsl:when>
6181
+ <xsl:when test="../preceding-sibling::*[1][self::mathml:mi or self::mathml:mstyle]">
6182
+ <xsl:attribute name="lspace">0.2em</xsl:attribute>
6183
+ </xsl:when>
6184
+ </xsl:choose>
6185
+ </xsl:if>
6186
+ </xsl:if>
6187
+ <xsl:apply-templates mode="mathml"/>
6188
+ </xsl:copy>
6189
+ </xsl:template>
6190
+
6111
6191
  <!-- Examples:
6112
6192
  <stem type="AsciiMath">x = 1</stem>
6113
6193
  <stem type="AsciiMath"><asciimath>x = 1</asciimath></stem>
@@ -6267,7 +6347,7 @@
6267
6347
  <!-- formula -->
6268
6348
  <!-- ====== -->
6269
6349
  <xsl:template match="*[local-name() = 'formula']" name="formula">
6270
- <fo:block-container margin-left="0mm">
6350
+ <fo:block-container margin-left="0mm" role="SKIP">
6271
6351
  <xsl:if test="parent::*[local-name() = 'note']">
6272
6352
  <xsl:attribute name="margin-left">
6273
6353
  <xsl:choose>
@@ -6277,7 +6357,7 @@
6277
6357
  </xsl:attribute>
6278
6358
 
6279
6359
  </xsl:if>
6280
- <fo:block-container margin-left="0mm">
6360
+ <fo:block-container margin-left="0mm" role="SKIP">
6281
6361
  <fo:block id="{@id}">
6282
6362
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> <!-- formula's number will be process in 'stem' template -->
6283
6363
  </fo:block>
@@ -6357,19 +6437,19 @@
6357
6437
 
6358
6438
  <xsl:template match="*[local-name() = 'note']" name="note">
6359
6439
 
6360
- <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style">
6440
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
6361
6441
 
6362
6442
  <xsl:call-template name="setBlockSpanAll"/>
6363
6443
 
6364
6444
  <xsl:call-template name="refine_note-style"/>
6365
6445
 
6366
- <fo:block-container margin-left="0mm" margin-right="0mm">
6446
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
6367
6447
 
6368
6448
  <fo:block>
6369
6449
 
6370
6450
  <xsl:call-template name="refine_note_block_style"/>
6371
6451
 
6372
- <fo:inline xsl:use-attribute-sets="note-name-style">
6452
+ <fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
6373
6453
 
6374
6454
  <xsl:call-template name="refine_note-name-style"/>
6375
6455
 
@@ -6415,12 +6495,12 @@
6415
6495
  <xsl:variable name="num"><xsl:number/></xsl:variable>
6416
6496
  <xsl:choose>
6417
6497
  <xsl:when test="$num = 1"> <!-- display first NOTE's paragraph in the same line with label NOTE -->
6418
- <fo:inline xsl:use-attribute-sets="note-p-style">
6498
+ <fo:inline xsl:use-attribute-sets="note-p-style" role="SKIP">
6419
6499
  <xsl:apply-templates/>
6420
6500
  </fo:inline>
6421
6501
  </xsl:when>
6422
6502
  <xsl:otherwise>
6423
- <fo:block xsl:use-attribute-sets="note-p-style">
6503
+ <fo:block xsl:use-attribute-sets="note-p-style" role="SKIP">
6424
6504
  <xsl:apply-templates/>
6425
6505
  </fo:block>
6426
6506
  </xsl:otherwise>
@@ -6538,12 +6618,13 @@
6538
6618
 
6539
6619
  <xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']">
6540
6620
  <xsl:if test="normalize-space() != ''">
6541
- <xsl:variable name="level">
6621
+ <!-- <xsl:variable name="level">
6542
6622
  <xsl:call-template name="getLevelTermName"/>
6543
6623
  </xsl:variable>
6544
6624
  <fo:inline role="H{$level}">
6545
- <xsl:apply-templates/>
6546
- </fo:inline>
6625
+ <xsl:apply-templates />
6626
+ </fo:inline> -->
6627
+ <xsl:apply-templates/>
6547
6628
  </xsl:if>
6548
6629
  </xsl:template>
6549
6630
  <!-- ====== -->
@@ -6567,7 +6648,7 @@
6567
6648
  <!-- Example: Dimensions in millimeters -->
6568
6649
  <xsl:apply-templates select="*[local-name() = 'note'][@type = 'units']"/>
6569
6650
 
6570
- <fo:block xsl:use-attribute-sets="figure-style">
6651
+ <fo:block xsl:use-attribute-sets="figure-style" role="SKIP">
6571
6652
  <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note' and @type = 'units')]"/>
6572
6653
  </fo:block>
6573
6654
  <xsl:for-each select="*[local-name() = 'note'][not(@type = 'units')]">
@@ -7701,7 +7782,7 @@
7701
7782
  </xsl:when>
7702
7783
 
7703
7784
  <xsl:otherwise>
7704
- <fo:block-container xsl:use-attribute-sets="sourcecode-container-style">
7785
+ <fo:block-container xsl:use-attribute-sets="sourcecode-container-style" role="SKIP">
7705
7786
 
7706
7787
  <xsl:if test="not(ancestor::*[local-name() = 'li']) or ancestor::*[local-name() = 'example']">
7707
7788
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
@@ -7722,7 +7803,7 @@
7722
7803
  </xsl:attribute>
7723
7804
 
7724
7805
  </xsl:if>
7725
- <fo:block-container margin-left="0mm">
7806
+ <fo:block-container margin-left="0mm" role="SKIP">
7726
7807
 
7727
7808
  <fo:block xsl:use-attribute-sets="sourcecode-style">
7728
7809
 
@@ -8268,11 +8349,11 @@
8268
8349
  <!-- requirement, recommendation, permission table -->
8269
8350
  <!-- ========== -->
8270
8351
  <xsl:template match="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
8271
- <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt">
8352
+ <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt" role="SKIP">
8272
8353
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
8273
8354
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
8274
8355
  </xsl:if>
8275
- <fo:block-container margin-left="0mm" margin-right="0mm">
8356
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
8276
8357
  <fo:table id="{@id}" table-layout="fixed" width="100%"> <!-- border="1pt solid black" -->
8277
8358
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
8278
8359
  <!-- <xsl:attribute name="border">0.5pt solid black</xsl:attribute> -->
@@ -8434,7 +8515,7 @@
8434
8515
  -->
8435
8516
  <xsl:template match="*[local-name() = 'example']">
8436
8517
 
8437
- <fo:block-container id="{@id}" xsl:use-attribute-sets="example-style">
8518
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="example-style" role="SKIP">
8438
8519
 
8439
8520
  <xsl:call-template name="setBlockSpanAll"/>
8440
8521
 
@@ -8445,7 +8526,7 @@
8445
8526
  block
8446
8527
  </xsl:variable>
8447
8528
 
8448
- <fo:block-container margin-left="0mm">
8529
+ <fo:block-container margin-left="0mm" role="SKIP">
8449
8530
 
8450
8531
  <xsl:choose>
8451
8532
 
@@ -8458,8 +8539,8 @@
8458
8539
  </xsl:apply-templates>
8459
8540
  </fo:block>
8460
8541
 
8461
- <fo:block-container xsl:use-attribute-sets="example-body-style">
8462
- <fo:block-container margin-left="0mm" margin-right="0mm">
8542
+ <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
8543
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
8463
8544
  <xsl:apply-templates select="node()[not(local-name() = 'name')]">
8464
8545
  <xsl:with-param name="fo_element" select="$fo_element"/>
8465
8546
  </xsl:apply-templates>
@@ -8512,8 +8593,8 @@
8512
8593
 
8513
8594
  <xsl:if test="*[not(local-name() = 'name')][position() &gt; 1]">
8514
8595
  <!-- display further elements in blocks -->
8515
- <fo:block-container xsl:use-attribute-sets="example-body-style">
8516
- <fo:block-container margin-left="0mm" margin-right="0mm">
8596
+ <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
8597
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
8517
8598
  <xsl:apply-templates select="*[not(local-name() = 'name')][position() &gt; 1]">
8518
8599
  <xsl:with-param name="fo_element" select="'block'"/>
8519
8600
  </xsl:apply-templates>
@@ -8566,7 +8647,7 @@
8566
8647
  </xsl:variable>
8567
8648
  <xsl:choose>
8568
8649
  <xsl:when test="starts-with(normalize-space($element), 'block')">
8569
- <fo:block-container>
8650
+ <fo:block-container role="SKIP">
8570
8651
  <xsl:if test="ancestor::*[local-name() = 'li'] and contains(normalize-space($fo_element), 'block')">
8571
8652
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
8572
8653
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
@@ -8707,7 +8788,7 @@
8707
8788
  <!-- author -->
8708
8789
  <!-- ====== -->
8709
8790
  <xsl:template match="*[local-name() = 'quote']">
8710
- <fo:block-container margin-left="0mm">
8791
+ <fo:block-container margin-left="0mm" role="SKIP">
8711
8792
 
8712
8793
  <xsl:call-template name="setBlockSpanAll"/>
8713
8794
 
@@ -8717,12 +8798,12 @@
8717
8798
  </xsl:if>
8718
8799
  </xsl:if>
8719
8800
 
8720
- <fo:block-container margin-left="0mm">
8721
- <fo:block-container xsl:use-attribute-sets="quote-style">
8801
+ <fo:block-container margin-left="0mm" role="SKIP">
8802
+ <fo:block-container xsl:use-attribute-sets="quote-style" role="SKIP">
8722
8803
 
8723
8804
  <xsl:call-template name="refine_quote-style"/>
8724
8805
 
8725
- <fo:block-container margin-left="0mm" margin-right="0mm">
8806
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
8726
8807
  <fo:block role="BlockQuote">
8727
8808
  <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
8728
8809
  </fo:block>
@@ -8880,10 +8961,10 @@
8880
8961
 
8881
8962
  <xsl:choose>
8882
8963
  <xsl:when test="$lang = 'zh'">
8883
- <fo:inline><xsl:value-of select="$tab_zh"/></fo:inline>
8964
+ <fo:inline role="SKIP"><xsl:value-of select="$tab_zh"/></fo:inline>
8884
8965
  </xsl:when>
8885
8966
  <xsl:when test="../../@inline-header = 'true'">
8886
- <fo:inline font-size="90%">
8967
+ <fo:inline font-size="90%" role="SKIP">
8887
8968
  <xsl:call-template name="insertNonBreakSpaces">
8888
8969
  <xsl:with-param name="count" select="$padding-right"/>
8889
8970
  </xsl:call-template>
@@ -8891,7 +8972,7 @@
8891
8972
  </xsl:when>
8892
8973
  <xsl:otherwise>
8893
8974
  <xsl:variable name="direction"><xsl:if test="$lang = 'ar'"><xsl:value-of select="$RLM"/></xsl:if></xsl:variable>
8894
- <fo:inline padding-right="{$padding-right}mm"><xsl:value-of select="$direction"/>​</fo:inline>
8975
+ <fo:inline padding-right="{$padding-right}mm" role="SKIP"><xsl:value-of select="$direction"/>​</fo:inline>
8895
8976
  </xsl:otherwise>
8896
8977
  </xsl:choose>
8897
8978
 
@@ -8921,12 +9002,12 @@
8921
9002
  <fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="preferred-block-style">
8922
9003
 
8923
9004
  <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'preferred'])"> <!-- if first preffered in term, then display term's name -->
8924
- <fo:block xsl:use-attribute-sets="term-name-style">
9005
+ <fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
8925
9006
  <xsl:apply-templates select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"/>
8926
9007
  </fo:block>
8927
9008
  </xsl:if>
8928
9009
 
8929
- <fo:block xsl:use-attribute-sets="preferred-term-style">
9010
+ <fo:block xsl:use-attribute-sets="preferred-term-style" role="SKIP">
8930
9011
  <xsl:call-template name="setStyle_preferred"/>
8931
9012
  <xsl:apply-templates/>
8932
9013
  </fo:block>
@@ -8967,7 +9048,7 @@
8967
9048
  <!-- definition -->
8968
9049
  <!-- ========== -->
8969
9050
  <xsl:template match="*[local-name() = 'definition']">
8970
- <fo:block xsl:use-attribute-sets="definition-style">
9051
+ <fo:block xsl:use-attribute-sets="definition-style" role="SKIP">
8971
9052
  <xsl:apply-templates/>
8972
9053
  </fo:block>
8973
9054
  </xsl:template>
@@ -9015,6 +9096,10 @@
9015
9096
 
9016
9097
  <xsl:template match="*[local-name() = 'clause']">
9017
9098
  <fo:block>
9099
+ <xsl:if test="parent::*[local-name() = 'copyright-statement']">
9100
+ <xsl:attribute name="role">SKIP</xsl:attribute>
9101
+ </xsl:if>
9102
+
9018
9103
  <xsl:call-template name="setId"/>
9019
9104
 
9020
9105
  <xsl:call-template name="setBlockSpanAll"/>
@@ -9256,7 +9341,7 @@
9256
9341
  <xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
9257
9342
  <xsl:choose>
9258
9343
  <xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
9259
- <fo:block-container>
9344
+ <fo:block-container role="SKIP">
9260
9345
  <xsl:attribute name="margin-left">
9261
9346
  <xsl:choose>
9262
9347
  <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
@@ -9266,7 +9351,7 @@
9266
9351
 
9267
9352
  <xsl:call-template name="refine_list_container_style"/>
9268
9353
 
9269
- <fo:block-container margin-left="0mm">
9354
+ <fo:block-container margin-left="0mm" role="SKIP">
9270
9355
  <fo:block>
9271
9356
  <xsl:apply-templates select="." mode="list"/>
9272
9357
  </fo:block>
@@ -9275,7 +9360,7 @@
9275
9360
  </xsl:when>
9276
9361
  <xsl:otherwise>
9277
9362
 
9278
- <fo:block>
9363
+ <fo:block role="SKIP">
9279
9364
  <xsl:apply-templates select="." mode="list"/>
9280
9365
  </fo:block>
9281
9366
 
@@ -9697,7 +9782,10 @@
9697
9782
  <!-- Reference sections (Normative References and Bibliography) -->
9698
9783
  <!-- ========================================================== -->
9699
9784
  <xsl:template match="*[local-name() = 'references'][@hidden='true']" priority="3"/>
9700
- <xsl:template match="*[local-name() = 'bibitem'][@hidden='true']" priority="3"/>
9785
+ <xsl:template match="*[local-name() = 'bibitem'][@hidden='true']" priority="3">
9786
+ <xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][local-name() = 'bibitem'] and 1 = 1)"/>
9787
+
9788
+ </xsl:template>
9701
9789
  <!-- don't display bibitem with @id starts with '_hidden', that was introduced for references integrity -->
9702
9790
  <xsl:template match="*[local-name() = 'bibitem'][starts-with(@id, 'hidden_bibitem_')]" priority="3"/>
9703
9791
 
@@ -9744,6 +9832,7 @@
9744
9832
 
9745
9833
  <!-- Bibliography (non-normative references) -->
9746
9834
  <xsl:template match="*[local-name() = 'references'][not(@normative='true')]/*[local-name() = 'bibitem']" name="bibitem_non_normative" priority="2">
9835
+ <xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][local-name() = 'bibitem'] and 1 = 1)"/> <!-- current bibiitem is non-first -->
9747
9836
 
9748
9837
  <fo:block id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-style">
9749
9838
  <xsl:call-template name="processBibitem"/>
@@ -9751,6 +9840,35 @@
9751
9840
 
9752
9841
  </xsl:template> <!-- references[not(@normative='true')]/bibitem -->
9753
9842
 
9843
+ <xsl:template name="insertListItem_Bibitem">
9844
+ <xsl:choose>
9845
+ <xsl:when test="@hidden = 'true'"><!-- skip --></xsl:when>
9846
+ <xsl:otherwise>
9847
+ <fo:list-item id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-item-style">
9848
+ <fo:list-item-label end-indent="label-end()">
9849
+ <fo:block role="SKIP">
9850
+ <fo:inline role="SKIP">
9851
+ <xsl:apply-templates select="*[local-name() = 'biblio-tag']">
9852
+ <xsl:with-param name="biblio_tag_part">first</xsl:with-param>
9853
+ </xsl:apply-templates>
9854
+ </fo:inline>
9855
+ </fo:block>
9856
+ </fo:list-item-label>
9857
+ <fo:list-item-body start-indent="body-start()">
9858
+ <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style" role="SKIP">
9859
+ <xsl:call-template name="processBibitem">
9860
+ <xsl:with-param name="biblio_tag_part">last</xsl:with-param>
9861
+ </xsl:call-template>
9862
+ </fo:block>
9863
+ </fo:list-item-body>
9864
+ </fo:list-item>
9865
+ </xsl:otherwise>
9866
+ </xsl:choose>
9867
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'bibitem']">
9868
+ <xsl:with-param name="skip">false</xsl:with-param>
9869
+ </xsl:apply-templates>
9870
+ </xsl:template>
9871
+
9754
9872
  <xsl:template name="processBibitem">
9755
9873
  <xsl:param name="biblio_tag_part">both</xsl:param>
9756
9874
 
@@ -10091,9 +10209,9 @@
10091
10209
 
10092
10210
  <xsl:call-template name="setBlockSpanAll"/>
10093
10211
 
10094
- <fo:block-container xsl:use-attribute-sets="admonition-container-style">
10212
+ <fo:block-container xsl:use-attribute-sets="admonition-container-style" role="SKIP">
10095
10213
 
10096
- <fo:block-container margin-left="0mm" margin-right="0mm">
10214
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
10097
10215
  <fo:block>
10098
10216
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
10099
10217
  </fo:block>