metanorma-bipm 2.2.12 → 2.2.14

Sign up to get free protection for your applications and to get access to all the features.
@@ -4009,19 +4009,32 @@
4009
4009
  <xsl:variable name="titles_">
4010
4010
 
4011
4011
  <!-- These titles of Table of contents renders different than determined in localized-strings -->
4012
- <title-toc lang="en">
4013
-
4014
- </title-toc>
4015
- <title-toc lang="fr">
4012
+ <!-- <title-toc lang="en">
4013
+ <xsl:if test="$namespace = 'csd' or $namespace = 'ieee' or $namespace = 'iho' or $namespace = 'mpfd' or $namespace = 'ogc' or $namespace = 'unece-rec'">
4014
+ <xsl:text>Contents</xsl:text>
4015
+ </xsl:if>
4016
+ <xsl:if test="$namespace = 'csa' or $namespace = 'm3d' or $namespace = 'nist-sp' or $namespace = 'ogc-white-paper'">
4017
+ <xsl:text>Table of Contents</xsl:text>
4018
+ </xsl:if>
4019
+ <xsl:if test="$namespace = 'gb'">
4020
+ <xsl:text>Table of contents</xsl:text>
4021
+ </xsl:if>
4022
+ </title-toc> -->
4023
+ <title-toc lang="en">Table of contents</title-toc>
4024
+ <!-- <title-toc lang="fr">
4016
4025
  <xsl:text>Sommaire</xsl:text>
4017
- </title-toc>
4018
- <title-toc lang="zh">
4019
-
4026
+ </title-toc> -->
4027
+ <!-- <title-toc lang="zh">
4028
+ <xsl:choose>
4029
+ <xsl:when test="$namespace = 'gb'">
4030
+ <xsl:text>目次</xsl:text>
4031
+ </xsl:when>
4032
+ <xsl:otherwise>
4020
4033
  <xsl:text>Contents</xsl:text>
4021
-
4022
- </title-toc>
4023
-
4024
- <title-descriptors lang="en">Descriptors</title-descriptors>
4034
+ </xsl:otherwise>
4035
+ </xsl:choose>
4036
+ </title-toc> -->
4037
+ <title-toc lang="zh">目次</title-toc>
4025
4038
 
4026
4039
  <title-part lang="en">
4027
4040
 
@@ -4041,20 +4054,6 @@
4041
4054
  <title-subpart lang="en">Sub-part #</title-subpart>
4042
4055
  <title-subpart lang="fr">Partie de sub #</title-subpart>
4043
4056
 
4044
- <title-list-tables lang="en">List of Tables</title-list-tables>
4045
-
4046
- <title-list-figures lang="en">List of Figures</title-list-figures>
4047
-
4048
- <title-table-figures lang="en">Table of Figures</title-table-figures>
4049
-
4050
- <title-list-recommendations lang="en">List of Recommendations</title-list-recommendations>
4051
-
4052
- <title-summary lang="en">Summary</title-summary>
4053
-
4054
- <title-continued lang="ru">(продолжение)</title-continued>
4055
- <title-continued lang="en">(continued)</title-continued>
4056
- <title-continued lang="fr">(continué)</title-continued>
4057
-
4058
4057
  </xsl:variable>
4059
4058
  <xsl:variable name="titles" select="xalan:nodeset($titles_)"/>
4060
4059
 
@@ -4062,8 +4061,8 @@
4062
4061
  <xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']"/>
4063
4062
  <xsl:value-of select="$toc_table_title"/>
4064
4063
  <xsl:if test="normalize-space($toc_table_title) = ''">
4065
- <xsl:call-template name="getTitle">
4066
- <xsl:with-param name="name" select="'title-list-tables'"/>
4064
+ <xsl:call-template name="getLocalizedString">
4065
+ <xsl:with-param name="key">toc_tables</xsl:with-param>
4067
4066
  </xsl:call-template>
4068
4067
  </xsl:if>
4069
4068
  </xsl:variable>
@@ -4072,8 +4071,8 @@
4072
4071
  <xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']"/>
4073
4072
  <xsl:value-of select="$toc_figure_title"/>
4074
4073
  <xsl:if test="normalize-space($toc_figure_title) = ''">
4075
- <xsl:call-template name="getTitle">
4076
- <xsl:with-param name="name" select="'title-list-figures'"/>
4074
+ <xsl:call-template name="getLocalizedString">
4075
+ <xsl:with-param name="key">toc_figures</xsl:with-param>
4077
4076
  </xsl:call-template>
4078
4077
  </xsl:if>
4079
4078
  </xsl:variable>
@@ -4082,8 +4081,8 @@
4082
4081
  <xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='requirement']/*[local-name() = 'title']"/>
4083
4082
  <xsl:value-of select="$toc_requirement_title"/>
4084
4083
  <xsl:if test="normalize-space($toc_requirement_title) = ''">
4085
- <xsl:call-template name="getTitle">
4086
- <xsl:with-param name="name" select="'title-list-recommendations'"/>
4084
+ <xsl:call-template name="getLocalizedString">
4085
+ <xsl:with-param name="key">toc_recommendations</xsl:with-param>
4087
4086
  </xsl:call-template>
4088
4087
  </xsl:if>
4089
4088
  </xsl:variable>
@@ -4854,6 +4853,7 @@
4854
4853
  </xsl:attribute-set>
4855
4854
 
4856
4855
  <xsl:attribute-set name="figure-block-style">
4856
+ <xsl:attribute name="role">SKIP</xsl:attribute>
4857
4857
 
4858
4858
  </xsl:attribute-set>
4859
4859
 
@@ -4862,6 +4862,7 @@
4862
4862
  </xsl:attribute-set>
4863
4863
 
4864
4864
  <xsl:attribute-set name="figure-name-style">
4865
+ <xsl:attribute name="role">Caption</xsl:attribute>
4865
4866
 
4866
4867
  <xsl:attribute name="keep-with-previous">always</xsl:attribute>
4867
4868
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -4908,6 +4909,7 @@
4908
4909
  </xsl:template>
4909
4910
 
4910
4911
  <xsl:attribute-set name="image-style">
4912
+ <xsl:attribute name="role">SKIP</xsl:attribute>
4911
4913
  <xsl:attribute name="text-align">center</xsl:attribute>
4912
4914
 
4913
4915
  </xsl:attribute-set>
@@ -5183,6 +5185,11 @@
5183
5185
 
5184
5186
  </xsl:attribute-set> <!-- bibitem-non-normative-list-style -->
5185
5187
 
5188
+ <xsl:attribute-set name="bibitem-non-normative-list-item-style">
5189
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
5190
+
5191
+ </xsl:attribute-set>
5192
+
5186
5193
  <!-- bibitem in bibliography section (references/@normative="false"), list body -->
5187
5194
  <xsl:attribute-set name="bibitem-normative-list-body-style">
5188
5195
 
@@ -5585,14 +5592,14 @@
5585
5592
  <xsl:value-of select="$sep"/><xsl:value-of select="$zero_width_space"/>
5586
5593
  </xsl:when>
5587
5594
  <xsl:otherwise>
5588
- <fo:inline keep-together.within-line="always"><xsl:apply-templates/></fo:inline>
5595
+ <fo:inline keep-together.within-line="always" role="SKIP"><xsl:apply-templates/></fo:inline>
5589
5596
  </xsl:otherwise>
5590
5597
  </xsl:choose>
5591
5598
  </xsl:for-each>
5592
5599
  </xsl:when>
5593
5600
 
5594
5601
  <xsl:otherwise>
5595
- <fo:inline keep-together.within-line="always"><xsl:apply-templates/></fo:inline>
5602
+ <fo:inline keep-together.within-line="always" role="SKIP"><xsl:apply-templates/></fo:inline>
5596
5603
  </xsl:otherwise>
5597
5604
 
5598
5605
  </xsl:choose>
@@ -5602,7 +5609,7 @@
5602
5609
  <!-- Preface boilerplate sections processing -->
5603
5610
  <!-- ================================= -->
5604
5611
  <xsl:template match="*[local-name()='copyright-statement']">
5605
- <fo:block xsl:use-attribute-sets="copyright-statement-style">
5612
+ <fo:block xsl:use-attribute-sets="copyright-statement-style" role="SKIP">
5606
5613
  <xsl:apply-templates/>
5607
5614
  </fo:block>
5608
5615
  </xsl:template> <!-- copyright-statement -->
@@ -5778,7 +5785,7 @@
5778
5785
  </xsl:choose>
5779
5786
  </xsl:variable>
5780
5787
 
5781
- <fo:block-container xsl:use-attribute-sets="table-container-style">
5788
+ <fo:block-container xsl:use-attribute-sets="table-container-style" role="SKIP">
5782
5789
 
5783
5790
  <xsl:call-template name="refine_table-container-style">
5784
5791
  <xsl:with-param name="margin-side" select="$margin-side"/>
@@ -6860,7 +6867,7 @@
6860
6867
  </xsl:choose>
6861
6868
  </xsl:variable>
6862
6869
  <xsl:variable name="footnote_inline">
6863
- <fo:inline>
6870
+ <fo:inline role="Reference">
6864
6871
 
6865
6872
  <xsl:variable name="fn_styles">
6866
6873
  <xsl:choose>
@@ -6883,7 +6890,7 @@
6883
6890
 
6884
6891
  <xsl:call-template name="insert_basic_link">
6885
6892
  <xsl:with-param name="element">
6886
- <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
6893
+ <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}" role="Lbl">
6887
6894
  <xsl:copy-of select="$current_fn_number_text"/>
6888
6895
  </fo:basic-link>
6889
6896
  </xsl:with-param>
@@ -6896,17 +6903,17 @@
6896
6903
  <xsl:copy-of select="$footnote_inline"/>
6897
6904
  </xsl:when>
6898
6905
  <xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false'">
6899
- <fo:footnote xsl:use-attribute-sets="fn-style">
6906
+ <fo:footnote xsl:use-attribute-sets="fn-style" role="SKIP">
6900
6907
  <xsl:copy-of select="$footnote_inline"/>
6901
- <fo:footnote-body>
6908
+ <fo:footnote-body role="Note">
6902
6909
 
6903
- <fo:block-container xsl:use-attribute-sets="fn-container-body-style">
6910
+ <fo:block-container xsl:use-attribute-sets="fn-container-body-style" role="SKIP">
6904
6911
 
6905
- <fo:block xsl:use-attribute-sets="fn-body-style">
6912
+ <fo:block xsl:use-attribute-sets="fn-body-style" role="SKIP">
6906
6913
 
6907
6914
  <xsl:call-template name="refine_fn-body-style"/>
6908
6915
 
6909
- <fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style">
6916
+ <fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style" role="Lbl">
6910
6917
 
6911
6918
  <xsl:call-template name="refine_fn-body-num-style"/>
6912
6919
 
@@ -7176,11 +7183,11 @@
7176
7183
  </xsl:template>
7177
7184
 
7178
7185
  <xsl:template match="*[local-name()='fn']/text()[normalize-space() != '']">
7179
- <fo:inline><xsl:value-of select="."/></fo:inline>
7186
+ <fo:inline role="SKIP"><xsl:value-of select="."/></fo:inline>
7180
7187
  </xsl:template>
7181
7188
 
7182
7189
  <xsl:template match="*[local-name()='fn']//*[local-name()='p']">
7183
- <fo:inline>
7190
+ <fo:inline role="P">
7184
7191
  <xsl:apply-templates/>
7185
7192
  </fo:inline>
7186
7193
  </xsl:template>
@@ -7195,7 +7202,7 @@
7195
7202
  <xsl:variable name="isAdded" select="@added"/>
7196
7203
  <xsl:variable name="isDeleted" select="@deleted"/>
7197
7204
  <!-- <dl><xsl:copy-of select="."/></dl> -->
7198
- <fo:block-container xsl:use-attribute-sets="dl-block-style">
7205
+ <fo:block-container xsl:use-attribute-sets="dl-block-style" role="SKIP">
7199
7206
 
7200
7207
  <xsl:call-template name="setBlockSpanAll"/>
7201
7208
 
@@ -7233,7 +7240,7 @@
7233
7240
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
7234
7241
  </xsl:call-template>
7235
7242
 
7236
- <fo:block-container margin-left="0mm">
7243
+ <fo:block-container margin-left="0mm" role="SKIP">
7237
7244
 
7238
7245
  <xsl:variable name="parent" select="local-name(..)"/>
7239
7246
 
@@ -7296,7 +7303,7 @@
7296
7303
 
7297
7304
  <!-- a few components -->
7298
7305
  <xsl:if test="$onlyOneComponent = 'false'">
7299
- <fo:block>
7306
+ <fo:block role="SKIP">
7300
7307
 
7301
7308
  <xsl:call-template name="refine_multicomponent_style"/>
7302
7309
 
@@ -7304,7 +7311,7 @@
7304
7311
  <xsl:attribute name="margin-top">0</xsl:attribute>
7305
7312
  </xsl:if>
7306
7313
 
7307
- <fo:block>
7314
+ <fo:block role="SKIP">
7308
7315
 
7309
7316
  <xsl:call-template name="refine_multicomponent_block_style"/>
7310
7317
 
@@ -7899,6 +7906,9 @@
7899
7906
 
7900
7907
  <xsl:template name="refine_strong_style">
7901
7908
 
7909
+ <xsl:if test="ancestor::*['preferred']">
7910
+ <xsl:attribute name="role">SKIP</xsl:attribute>
7911
+ </xsl:if>
7902
7912
  </xsl:template>
7903
7913
 
7904
7914
  <xsl:template match="*[local-name()='padding']">
@@ -7943,7 +7953,7 @@
7943
7953
  <xsl:variable name="regex_url_start">^(http://|https://|www\.)?(.*)</xsl:variable>
7944
7954
  <xsl:template match="*[local-name()='tt']/text()" priority="2">
7945
7955
  <xsl:choose>
7946
- <xsl:when test="java:replaceAll(java:java.lang.String.new(.), '$2', '') != ''">
7956
+ <xsl:when test="java:replaceAll(java:java.lang.String.new(.), $regex_url_start, '$2') != ''">
7947
7957
  <!-- url -->
7948
7958
  <xsl:call-template name="add-zero-spaces-link-java"/>
7949
7959
  </xsl:when>
@@ -8405,10 +8415,13 @@
8405
8415
  </xsl:choose>
8406
8416
  </xsl:variable>
8407
8417
 
8418
+ <!-- replace sequence #x200B to one &#x200B -->
8419
+ <xsl:variable name="text10" select="java:replaceAll(java:java.lang.String.new($text9), '\u200b{2,}', '​')"/>
8420
+
8408
8421
  <!-- replace sequence #x200B and space TO space -->
8409
- <xsl:variable name="text10" select="java:replaceAll(java:java.lang.String.new($text9), '\u200b ', ' ')"/>
8422
+ <xsl:variable name="text11" select="java:replaceAll(java:java.lang.String.new($text10), '\u200b ', ' ')"/>
8410
8423
 
8411
- <xsl:value-of select="$text10"/>
8424
+ <xsl:value-of select="$text11"/>
8412
8425
  </xsl:template>
8413
8426
 
8414
8427
  <xsl:template name="add-zero-spaces-link-java">
@@ -8418,8 +8431,12 @@
8418
8431
  <xsl:variable name="url_continue" select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$2')"/>
8419
8432
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space, comma, slash, @ -->
8420
8433
  <xsl:variable name="url" select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/|@)','$1​')"/>
8434
+
8435
+ <!-- replace sequence #x200B to one &#x200B -->
8436
+ <xsl:variable name="url2" select="java:replaceAll(java:java.lang.String.new($url), '\u200b{2,}', '​')"/>
8437
+
8421
8438
  <!-- remove zero-width space at the end -->
8422
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url), '​$', '')"/>
8439
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url2), '​$', '')"/>
8423
8440
  </xsl:template>
8424
8441
 
8425
8442
  <!-- add zero space after dash character (for table's entries) -->
@@ -8830,6 +8847,18 @@
8830
8847
  </xsl:copy>
8831
8848
  </xsl:template>
8832
8849
 
8850
+ <xsl:variable name="font_main_root_style">
8851
+ <root-style xsl:use-attribute-sets="root-style">
8852
+ </root-style>
8853
+ </xsl:variable>
8854
+ <xsl:variable name="font_main_root_style_font_family" select="xalan:nodeset($font_main_root_style)/root-style/@font-family"/>
8855
+ <xsl:variable name="font_main">
8856
+ <xsl:choose>
8857
+ <xsl:when test="contains($font_main_root_style_font_family, ',')"><xsl:value-of select="substring-before($font_main_root_style_font_family, ',')"/></xsl:when>
8858
+ <xsl:otherwise><xsl:value-of select="$font_main_root_style_font_family"/></xsl:otherwise>
8859
+ </xsl:choose>
8860
+ </xsl:variable>
8861
+
8833
8862
  <xsl:template match="*[local-name()='th' or local-name()='td']" mode="simple-table-id">
8834
8863
  <xsl:param name="id"/>
8835
8864
  <xsl:copy>
@@ -8868,6 +8897,33 @@
8868
8897
 
8869
8898
  <!-- td_text='<xsl:copy-of select="$td_text"/>' -->
8870
8899
 
8900
+ <xsl:variable name="words_with_width">
8901
+ <!-- calculate width for 'word' which contain text only (without formatting tags inside) -->
8902
+ <xsl:for-each select="xalan:nodeset($td_text)//*[local-name() = 'word'][normalize-space() != ''][not(*)]">
8903
+ <xsl:copy>
8904
+ <xsl:copy-of select="@*"/>
8905
+ <xsl:attribute name="width">
8906
+ <xsl:value-of select="java:org.metanorma.fop.Util.getStringWidth(., $font_main)"/> <!-- Example: 'Times New Roman' -->
8907
+ </xsl:attribute>
8908
+ <xsl:copy-of select="node()"/>
8909
+ </xsl:copy>
8910
+ </xsl:for-each>
8911
+ </xsl:variable>
8912
+
8913
+ <xsl:variable name="words_with_width_sorted">
8914
+ <xsl:for-each select="xalan:nodeset($words_with_width)//*[local-name() = 'word']">
8915
+ <xsl:sort select="@width" data-type="number" order="descending"/>
8916
+ <!-- select word maximal width only -->
8917
+ <xsl:if test="position() = 1">
8918
+ <xsl:copy-of select="."/>
8919
+ </xsl:if>
8920
+ </xsl:for-each>
8921
+ <!-- add 'word' with formatting tags inside -->
8922
+ <xsl:for-each select="xalan:nodeset($td_text)//*[local-name() = 'word'][normalize-space() != ''][*]">
8923
+ <xsl:copy-of select="."/>
8924
+ </xsl:for-each>
8925
+ </xsl:variable>
8926
+
8871
8927
  <xsl:variable name="words">
8872
8928
  <xsl:for-each select=".//*[local-name() = 'image' or local-name() = 'stem']">
8873
8929
  <word>
@@ -8875,9 +8931,12 @@
8875
8931
  </word>
8876
8932
  </xsl:for-each>
8877
8933
 
8878
- <xsl:for-each select="xalan:nodeset($td_text)//*[local-name() = 'word'][normalize-space() != '']">
8934
+ <xsl:for-each select="xalan:nodeset($words_with_width_sorted)//*[local-name() = 'word'][normalize-space() != '']">
8879
8935
  <xsl:copy-of select="."/>
8880
8936
  </xsl:for-each>
8937
+ <!-- <xsl:for-each select="xalan:nodeset($td_text)//*[local-name() = 'word'][normalize-space() != '']">
8938
+ <xsl:copy-of select="."/>
8939
+ </xsl:for-each> -->
8881
8940
 
8882
8941
  </xsl:variable>
8883
8942
 
@@ -9370,10 +9429,10 @@
9370
9429
  <xsl:copy>
9371
9430
  <xsl:apply-templates select="@*" mode="mathml"/>
9372
9431
  <xsl:if test="not(@lspace)">
9373
- <xsl:attribute name="lspace">0.4em</xsl:attribute>
9432
+ <xsl:attribute name="lspace">0.2em</xsl:attribute>
9374
9433
  </xsl:if>
9375
- <xsl:if test="not(@rspace)">
9376
- <xsl:attribute name="rspace">0.4em</xsl:attribute>
9434
+ <xsl:if test="not(@rspace) and not(following-sibling::*[1][self::mathml:mo and normalize-space(text()) = '|'])">
9435
+ <xsl:attribute name="rspace">0.2em</xsl:attribute>
9377
9436
  </xsl:if>
9378
9437
  <xsl:apply-templates mode="mathml"/>
9379
9438
  </xsl:copy>
@@ -9390,6 +9449,27 @@
9390
9449
  </xsl:copy>
9391
9450
  </xsl:template>
9392
9451
 
9452
+ <!-- increase space before '(' -->
9453
+ <xsl:template match="mathml:mo[normalize-space(text()) = '(']" mode="mathml">
9454
+ <xsl:copy>
9455
+ <xsl:apply-templates select="@*" mode="mathml"/>
9456
+ <xsl:if test="(preceding-sibling::* and not(preceding-sibling::*[1][self::mathml:mo])) or (../preceding-sibling::* and not(../preceding-sibling::*[1][self::mathml:mo]))">
9457
+ <xsl:if test="not(@lspace)">
9458
+ <xsl:attribute name="lspace">0.4em</xsl:attribute>
9459
+ <xsl:choose>
9460
+ <xsl:when test="preceding-sibling::*[1][self::mathml:mi or self::mathml:mstyle]">
9461
+ <xsl:attribute name="lspace">0.2em</xsl:attribute>
9462
+ </xsl:when>
9463
+ <xsl:when test="../preceding-sibling::*[1][self::mathml:mi or self::mathml:mstyle]">
9464
+ <xsl:attribute name="lspace">0.2em</xsl:attribute>
9465
+ </xsl:when>
9466
+ </xsl:choose>
9467
+ </xsl:if>
9468
+ </xsl:if>
9469
+ <xsl:apply-templates mode="mathml"/>
9470
+ </xsl:copy>
9471
+ </xsl:template>
9472
+
9393
9473
  <!-- Examples:
9394
9474
  <stem type="AsciiMath">x = 1</stem>
9395
9475
  <stem type="AsciiMath"><asciimath>x = 1</asciimath></stem>
@@ -9549,7 +9629,7 @@
9549
9629
  <!-- formula -->
9550
9630
  <!-- ====== -->
9551
9631
  <xsl:template match="*[local-name() = 'formula']" name="formula">
9552
- <fo:block-container margin-left="0mm">
9632
+ <fo:block-container margin-left="0mm" role="SKIP">
9553
9633
  <xsl:if test="parent::*[local-name() = 'note']">
9554
9634
  <xsl:attribute name="margin-left">
9555
9635
  <xsl:choose>
@@ -9559,7 +9639,7 @@
9559
9639
  </xsl:attribute>
9560
9640
 
9561
9641
  </xsl:if>
9562
- <fo:block-container margin-left="0mm">
9642
+ <fo:block-container margin-left="0mm" role="SKIP">
9563
9643
  <fo:block id="{@id}">
9564
9644
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> <!-- formula's number will be process in 'stem' template -->
9565
9645
  </fo:block>
@@ -9639,19 +9719,19 @@
9639
9719
 
9640
9720
  <xsl:template match="*[local-name() = 'note']" name="note">
9641
9721
 
9642
- <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style">
9722
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
9643
9723
 
9644
9724
  <xsl:call-template name="setBlockSpanAll"/>
9645
9725
 
9646
9726
  <xsl:call-template name="refine_note-style"/>
9647
9727
 
9648
- <fo:block-container margin-left="0mm" margin-right="0mm">
9728
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
9649
9729
 
9650
9730
  <fo:block>
9651
9731
 
9652
9732
  <xsl:call-template name="refine_note_block_style"/>
9653
9733
 
9654
- <fo:inline xsl:use-attribute-sets="note-name-style">
9734
+ <fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
9655
9735
 
9656
9736
  <xsl:call-template name="refine_note-name-style"/>
9657
9737
 
@@ -9695,12 +9775,12 @@
9695
9775
  <xsl:variable name="num"><xsl:number/></xsl:variable>
9696
9776
  <xsl:choose>
9697
9777
  <xsl:when test="$num = 1"> <!-- display first NOTE's paragraph in the same line with label NOTE -->
9698
- <fo:inline xsl:use-attribute-sets="note-p-style">
9778
+ <fo:inline xsl:use-attribute-sets="note-p-style" role="SKIP">
9699
9779
  <xsl:apply-templates/>
9700
9780
  </fo:inline>
9701
9781
  </xsl:when>
9702
9782
  <xsl:otherwise>
9703
- <fo:block xsl:use-attribute-sets="note-p-style">
9783
+ <fo:block xsl:use-attribute-sets="note-p-style" role="SKIP">
9704
9784
  <xsl:apply-templates/>
9705
9785
  </fo:block>
9706
9786
  </xsl:otherwise>
@@ -9828,12 +9908,13 @@
9828
9908
 
9829
9909
  <xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']">
9830
9910
  <xsl:if test="normalize-space() != ''">
9831
- <xsl:variable name="level">
9911
+ <!-- <xsl:variable name="level">
9832
9912
  <xsl:call-template name="getLevelTermName"/>
9833
9913
  </xsl:variable>
9834
9914
  <fo:inline role="H{$level}">
9835
- <xsl:apply-templates/>
9836
- </fo:inline>
9915
+ <xsl:apply-templates />
9916
+ </fo:inline> -->
9917
+ <xsl:apply-templates/>
9837
9918
  </xsl:if>
9838
9919
  </xsl:template>
9839
9920
  <!-- ====== -->
@@ -9861,7 +9942,7 @@
9861
9942
  <!-- Example: Dimensions in millimeters -->
9862
9943
  <xsl:apply-templates select="*[local-name() = 'note'][@type = 'units']"/>
9863
9944
 
9864
- <fo:block xsl:use-attribute-sets="figure-style">
9945
+ <fo:block xsl:use-attribute-sets="figure-style" role="SKIP">
9865
9946
  <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note' and @type = 'units')]"/>
9866
9947
  </fo:block>
9867
9948
  <xsl:for-each select="*[local-name() = 'note'][not(@type = 'units')]">
@@ -11008,7 +11089,7 @@
11008
11089
  </xsl:when>
11009
11090
 
11010
11091
  <xsl:otherwise>
11011
- <fo:block-container xsl:use-attribute-sets="sourcecode-container-style">
11092
+ <fo:block-container xsl:use-attribute-sets="sourcecode-container-style" role="SKIP">
11012
11093
 
11013
11094
  <xsl:if test="not(ancestor::*[local-name() = 'li']) or ancestor::*[local-name() = 'example']">
11014
11095
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
@@ -11029,7 +11110,7 @@
11029
11110
  </xsl:attribute>
11030
11111
 
11031
11112
  </xsl:if>
11032
- <fo:block-container margin-left="0mm">
11113
+ <fo:block-container margin-left="0mm" role="SKIP">
11033
11114
 
11034
11115
  <fo:block xsl:use-attribute-sets="sourcecode-style">
11035
11116
 
@@ -11575,11 +11656,11 @@
11575
11656
  <!-- requirement, recommendation, permission table -->
11576
11657
  <!-- ========== -->
11577
11658
  <xsl:template match="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
11578
- <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt">
11659
+ <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt" role="SKIP">
11579
11660
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
11580
11661
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
11581
11662
  </xsl:if>
11582
- <fo:block-container margin-left="0mm" margin-right="0mm">
11663
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
11583
11664
  <fo:table id="{@id}" table-layout="fixed" width="100%"> <!-- border="1pt solid black" -->
11584
11665
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
11585
11666
  <!-- <xsl:attribute name="border">0.5pt solid black</xsl:attribute> -->
@@ -11741,7 +11822,7 @@
11741
11822
  -->
11742
11823
  <xsl:template match="*[local-name() = 'example']">
11743
11824
 
11744
- <fo:block-container id="{@id}" xsl:use-attribute-sets="example-style">
11825
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="example-style" role="SKIP">
11745
11826
 
11746
11827
  <xsl:call-template name="setBlockSpanAll"/>
11747
11828
 
@@ -11752,7 +11833,7 @@
11752
11833
  block
11753
11834
  </xsl:variable>
11754
11835
 
11755
- <fo:block-container margin-left="0mm">
11836
+ <fo:block-container margin-left="0mm" role="SKIP">
11756
11837
 
11757
11838
  <xsl:choose>
11758
11839
 
@@ -11765,8 +11846,8 @@
11765
11846
  </xsl:apply-templates>
11766
11847
  </fo:block>
11767
11848
 
11768
- <fo:block-container xsl:use-attribute-sets="example-body-style">
11769
- <fo:block-container margin-left="0mm" margin-right="0mm">
11849
+ <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
11850
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
11770
11851
  <xsl:apply-templates select="node()[not(local-name() = 'name')]">
11771
11852
  <xsl:with-param name="fo_element" select="$fo_element"/>
11772
11853
  </xsl:apply-templates>
@@ -11819,8 +11900,8 @@
11819
11900
 
11820
11901
  <xsl:if test="*[not(local-name() = 'name')][position() &gt; 1]">
11821
11902
  <!-- display further elements in blocks -->
11822
- <fo:block-container xsl:use-attribute-sets="example-body-style">
11823
- <fo:block-container margin-left="0mm" margin-right="0mm">
11903
+ <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
11904
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
11824
11905
  <xsl:apply-templates select="*[not(local-name() = 'name')][position() &gt; 1]">
11825
11906
  <xsl:with-param name="fo_element" select="'block'"/>
11826
11907
  </xsl:apply-templates>
@@ -11873,7 +11954,7 @@
11873
11954
  </xsl:variable>
11874
11955
  <xsl:choose>
11875
11956
  <xsl:when test="starts-with(normalize-space($element), 'block')">
11876
- <fo:block-container>
11957
+ <fo:block-container role="SKIP">
11877
11958
  <xsl:if test="ancestor::*[local-name() = 'li'] and contains(normalize-space($fo_element), 'block')">
11878
11959
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
11879
11960
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
@@ -12014,7 +12095,7 @@
12014
12095
  <!-- author -->
12015
12096
  <!-- ====== -->
12016
12097
  <xsl:template match="*[local-name() = 'quote']">
12017
- <fo:block-container margin-left="0mm">
12098
+ <fo:block-container margin-left="0mm" role="SKIP">
12018
12099
 
12019
12100
  <xsl:call-template name="setBlockSpanAll"/>
12020
12101
 
@@ -12024,12 +12105,12 @@
12024
12105
  </xsl:if>
12025
12106
  </xsl:if>
12026
12107
 
12027
- <fo:block-container margin-left="0mm">
12028
- <fo:block-container xsl:use-attribute-sets="quote-style">
12108
+ <fo:block-container margin-left="0mm" role="SKIP">
12109
+ <fo:block-container xsl:use-attribute-sets="quote-style" role="SKIP">
12029
12110
 
12030
12111
  <xsl:call-template name="refine_quote-style"/>
12031
12112
 
12032
- <fo:block-container margin-left="0mm" margin-right="0mm">
12113
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
12033
12114
  <fo:block role="BlockQuote">
12034
12115
  <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
12035
12116
  </fo:block>
@@ -12194,10 +12275,10 @@
12194
12275
 
12195
12276
  <xsl:choose>
12196
12277
  <xsl:when test="$lang = 'zh'">
12197
- <fo:inline><xsl:value-of select="$tab_zh"/></fo:inline>
12278
+ <fo:inline role="SKIP"><xsl:value-of select="$tab_zh"/></fo:inline>
12198
12279
  </xsl:when>
12199
12280
  <xsl:when test="../../@inline-header = 'true'">
12200
- <fo:inline font-size="90%">
12281
+ <fo:inline font-size="90%" role="SKIP">
12201
12282
  <xsl:call-template name="insertNonBreakSpaces">
12202
12283
  <xsl:with-param name="count" select="$padding-right"/>
12203
12284
  </xsl:call-template>
@@ -12205,7 +12286,7 @@
12205
12286
  </xsl:when>
12206
12287
  <xsl:otherwise>
12207
12288
  <xsl:variable name="direction"><xsl:if test="$lang = 'ar'"><xsl:value-of select="$RLM"/></xsl:if></xsl:variable>
12208
- <fo:inline padding-right="{$padding-right}mm"><xsl:value-of select="$direction"/>​</fo:inline>
12289
+ <fo:inline padding-right="{$padding-right}mm" role="SKIP"><xsl:value-of select="$direction"/>​</fo:inline>
12209
12290
  </xsl:otherwise>
12210
12291
  </xsl:choose>
12211
12292
 
@@ -12235,12 +12316,12 @@
12235
12316
  <fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="preferred-block-style">
12236
12317
 
12237
12318
  <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'preferred'])"> <!-- if first preffered in term, then display term's name -->
12238
- <fo:block xsl:use-attribute-sets="term-name-style">
12319
+ <fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
12239
12320
  <xsl:apply-templates select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"/>
12240
12321
  </fo:block>
12241
12322
  </xsl:if>
12242
12323
 
12243
- <fo:block xsl:use-attribute-sets="preferred-term-style">
12324
+ <fo:block xsl:use-attribute-sets="preferred-term-style" role="SKIP">
12244
12325
  <xsl:call-template name="setStyle_preferred"/>
12245
12326
  <xsl:apply-templates/>
12246
12327
  </fo:block>
@@ -12281,7 +12362,7 @@
12281
12362
  <!-- definition -->
12282
12363
  <!-- ========== -->
12283
12364
  <xsl:template match="*[local-name() = 'definition']">
12284
- <fo:block xsl:use-attribute-sets="definition-style">
12365
+ <fo:block xsl:use-attribute-sets="definition-style" role="SKIP">
12285
12366
  <xsl:apply-templates/>
12286
12367
  </fo:block>
12287
12368
  </xsl:template>
@@ -12324,6 +12405,10 @@
12324
12405
 
12325
12406
  <xsl:template match="*[local-name() = 'clause']">
12326
12407
  <fo:block>
12408
+ <xsl:if test="parent::*[local-name() = 'copyright-statement']">
12409
+ <xsl:attribute name="role">SKIP</xsl:attribute>
12410
+ </xsl:if>
12411
+
12327
12412
  <xsl:call-template name="setId"/>
12328
12413
 
12329
12414
  <xsl:call-template name="setBlockSpanAll"/>
@@ -12564,7 +12649,7 @@
12564
12649
  <xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
12565
12650
  <xsl:choose>
12566
12651
  <xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
12567
- <fo:block-container>
12652
+ <fo:block-container role="SKIP">
12568
12653
  <xsl:attribute name="margin-left">
12569
12654
  <xsl:choose>
12570
12655
  <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
@@ -12574,7 +12659,7 @@
12574
12659
 
12575
12660
  <xsl:call-template name="refine_list_container_style"/>
12576
12661
 
12577
- <fo:block-container margin-left="0mm">
12662
+ <fo:block-container margin-left="0mm" role="SKIP">
12578
12663
  <fo:block>
12579
12664
  <xsl:apply-templates select="." mode="list"/>
12580
12665
  </fo:block>
@@ -12583,7 +12668,7 @@
12583
12668
  </xsl:when>
12584
12669
  <xsl:otherwise>
12585
12670
 
12586
- <fo:block>
12671
+ <fo:block role="SKIP">
12587
12672
  <xsl:apply-templates select="." mode="list"/>
12588
12673
  </fo:block>
12589
12674
 
@@ -13003,7 +13088,10 @@
13003
13088
  <!-- Reference sections (Normative References and Bibliography) -->
13004
13089
  <!-- ========================================================== -->
13005
13090
  <xsl:template match="*[local-name() = 'references'][@hidden='true']" priority="3"/>
13006
- <xsl:template match="*[local-name() = 'bibitem'][@hidden='true']" priority="3"/>
13091
+ <xsl:template match="*[local-name() = 'bibitem'][@hidden='true']" priority="3">
13092
+ <xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][local-name() = 'bibitem'] and 1 = 1)"/>
13093
+
13094
+ </xsl:template>
13007
13095
  <!-- don't display bibitem with @id starts with '_hidden', that was introduced for references integrity -->
13008
13096
  <xsl:template match="*[local-name() = 'bibitem'][starts-with(@id, 'hidden_bibitem_')]" priority="3"/>
13009
13097
 
@@ -13052,6 +13140,7 @@
13052
13140
 
13053
13141
  <!-- Bibliography (non-normative references) -->
13054
13142
  <xsl:template match="*[local-name() = 'references'][not(@normative='true')]/*[local-name() = 'bibitem']" name="bibitem_non_normative" priority="2">
13143
+ <xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][local-name() = 'bibitem'] and 1 = 1)"/> <!-- current bibiitem is non-first -->
13055
13144
 
13056
13145
  <!-- start BIPM bibitem processing -->
13057
13146
  <fo:list-block id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-style">
@@ -13078,6 +13167,35 @@
13078
13167
 
13079
13168
  </xsl:template> <!-- references[not(@normative='true')]/bibitem -->
13080
13169
 
13170
+ <xsl:template name="insertListItem_Bibitem">
13171
+ <xsl:choose>
13172
+ <xsl:when test="@hidden = 'true'"><!-- skip --></xsl:when>
13173
+ <xsl:otherwise>
13174
+ <fo:list-item id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-item-style">
13175
+ <fo:list-item-label end-indent="label-end()">
13176
+ <fo:block role="SKIP">
13177
+ <fo:inline role="SKIP">
13178
+ <xsl:apply-templates select="*[local-name() = 'biblio-tag']">
13179
+ <xsl:with-param name="biblio_tag_part">first</xsl:with-param>
13180
+ </xsl:apply-templates>
13181
+ </fo:inline>
13182
+ </fo:block>
13183
+ </fo:list-item-label>
13184
+ <fo:list-item-body start-indent="body-start()">
13185
+ <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style" role="SKIP">
13186
+ <xsl:call-template name="processBibitem">
13187
+ <xsl:with-param name="biblio_tag_part">last</xsl:with-param>
13188
+ </xsl:call-template>
13189
+ </fo:block>
13190
+ </fo:list-item-body>
13191
+ </fo:list-item>
13192
+ </xsl:otherwise>
13193
+ </xsl:choose>
13194
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'bibitem']">
13195
+ <xsl:with-param name="skip">false</xsl:with-param>
13196
+ </xsl:apply-templates>
13197
+ </xsl:template>
13198
+
13081
13199
  <xsl:template name="processBibitem">
13082
13200
  <xsl:param name="biblio_tag_part">both</xsl:param>
13083
13201
 
@@ -13411,7 +13529,7 @@
13411
13529
 
13412
13530
  <xsl:call-template name="setBlockSpanAll"/>
13413
13531
 
13414
- <fo:block-container xsl:use-attribute-sets="admonition-container-style">
13532
+ <fo:block-container xsl:use-attribute-sets="admonition-container-style" role="SKIP">
13415
13533
 
13416
13534
  <fo:block xsl:use-attribute-sets="admonition-name-style">
13417
13535
  <xsl:call-template name="displayAdmonitionName"/>