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.
@@ -1839,19 +1839,32 @@
1839
1839
  <xsl:variable name="titles_">
1840
1840
 
1841
1841
  <!-- These titles of Table of contents renders different than determined in localized-strings -->
1842
- <title-toc lang="en">
1843
-
1844
- </title-toc>
1845
- <title-toc lang="fr">
1842
+ <!-- <title-toc lang="en">
1843
+ <xsl:if test="$namespace = 'csd' or $namespace = 'ieee' or $namespace = 'iho' or $namespace = 'mpfd' or $namespace = 'ogc' or $namespace = 'unece-rec'">
1844
+ <xsl:text>Contents</xsl:text>
1845
+ </xsl:if>
1846
+ <xsl:if test="$namespace = 'csa' or $namespace = 'm3d' or $namespace = 'nist-sp' or $namespace = 'ogc-white-paper'">
1847
+ <xsl:text>Table of Contents</xsl:text>
1848
+ </xsl:if>
1849
+ <xsl:if test="$namespace = 'gb'">
1850
+ <xsl:text>Table of contents</xsl:text>
1851
+ </xsl:if>
1852
+ </title-toc> -->
1853
+ <title-toc lang="en">Table of contents</title-toc>
1854
+ <!-- <title-toc lang="fr">
1846
1855
  <xsl:text>Sommaire</xsl:text>
1847
- </title-toc>
1848
- <title-toc lang="zh">
1849
-
1856
+ </title-toc> -->
1857
+ <!-- <title-toc lang="zh">
1858
+ <xsl:choose>
1859
+ <xsl:when test="$namespace = 'gb'">
1860
+ <xsl:text>目次</xsl:text>
1861
+ </xsl:when>
1862
+ <xsl:otherwise>
1850
1863
  <xsl:text>Contents</xsl:text>
1851
-
1852
- </title-toc>
1853
-
1854
- <title-descriptors lang="en">Descriptors</title-descriptors>
1864
+ </xsl:otherwise>
1865
+ </xsl:choose>
1866
+ </title-toc> -->
1867
+ <title-toc lang="zh">目次</title-toc>
1855
1868
 
1856
1869
  <title-part lang="en">
1857
1870
 
@@ -1867,20 +1880,6 @@
1867
1880
  <title-subpart lang="en">Sub-part #</title-subpart>
1868
1881
  <title-subpart lang="fr">Partie de sub #</title-subpart>
1869
1882
 
1870
- <title-list-tables lang="en">List of Tables</title-list-tables>
1871
-
1872
- <title-list-figures lang="en">List of Figures</title-list-figures>
1873
-
1874
- <title-table-figures lang="en">Table of Figures</title-table-figures>
1875
-
1876
- <title-list-recommendations lang="en">List of Recommendations</title-list-recommendations>
1877
-
1878
- <title-summary lang="en">Summary</title-summary>
1879
-
1880
- <title-continued lang="ru">(продолжение)</title-continued>
1881
- <title-continued lang="en">(continued)</title-continued>
1882
- <title-continued lang="fr">(continué)</title-continued>
1883
-
1884
1883
  </xsl:variable>
1885
1884
  <xsl:variable name="titles" select="xalan:nodeset($titles_)"/>
1886
1885
 
@@ -1888,8 +1887,8 @@
1888
1887
  <xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']"/>
1889
1888
  <xsl:value-of select="$toc_table_title"/>
1890
1889
  <xsl:if test="normalize-space($toc_table_title) = ''">
1891
- <xsl:call-template name="getTitle">
1892
- <xsl:with-param name="name" select="'title-list-tables'"/>
1890
+ <xsl:call-template name="getLocalizedString">
1891
+ <xsl:with-param name="key">toc_tables</xsl:with-param>
1893
1892
  </xsl:call-template>
1894
1893
  </xsl:if>
1895
1894
  </xsl:variable>
@@ -1898,8 +1897,8 @@
1898
1897
  <xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']"/>
1899
1898
  <xsl:value-of select="$toc_figure_title"/>
1900
1899
  <xsl:if test="normalize-space($toc_figure_title) = ''">
1901
- <xsl:call-template name="getTitle">
1902
- <xsl:with-param name="name" select="'title-list-figures'"/>
1900
+ <xsl:call-template name="getLocalizedString">
1901
+ <xsl:with-param name="key">toc_figures</xsl:with-param>
1903
1902
  </xsl:call-template>
1904
1903
  </xsl:if>
1905
1904
  </xsl:variable>
@@ -1908,8 +1907,8 @@
1908
1907
  <xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='requirement']/*[local-name() = 'title']"/>
1909
1908
  <xsl:value-of select="$toc_requirement_title"/>
1910
1909
  <xsl:if test="normalize-space($toc_requirement_title) = ''">
1911
- <xsl:call-template name="getTitle">
1912
- <xsl:with-param name="name" select="'title-list-recommendations'"/>
1910
+ <xsl:call-template name="getLocalizedString">
1911
+ <xsl:with-param name="key">toc_recommendations</xsl:with-param>
1913
1912
  </xsl:call-template>
1914
1913
  </xsl:if>
1915
1914
  </xsl:variable>
@@ -2684,6 +2683,7 @@
2684
2683
  </xsl:attribute-set>
2685
2684
 
2686
2685
  <xsl:attribute-set name="figure-block-style">
2686
+ <xsl:attribute name="role">SKIP</xsl:attribute>
2687
2687
 
2688
2688
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2689
2689
 
@@ -2694,6 +2694,7 @@
2694
2694
  </xsl:attribute-set>
2695
2695
 
2696
2696
  <xsl:attribute-set name="figure-name-style">
2697
+ <xsl:attribute name="role">Caption</xsl:attribute>
2697
2698
 
2698
2699
  <xsl:attribute name="font-weight">bold</xsl:attribute>
2699
2700
  <xsl:attribute name="text-align">center</xsl:attribute>
@@ -2741,6 +2742,7 @@
2741
2742
  </xsl:template>
2742
2743
 
2743
2744
  <xsl:attribute-set name="image-style">
2745
+ <xsl:attribute name="role">SKIP</xsl:attribute>
2744
2746
  <xsl:attribute name="text-align">center</xsl:attribute>
2745
2747
 
2746
2748
  </xsl:attribute-set>
@@ -3011,6 +3013,13 @@
3011
3013
 
3012
3014
  </xsl:attribute-set> <!-- bibitem-non-normative-list-style -->
3013
3015
 
3016
+ <xsl:attribute-set name="bibitem-non-normative-list-item-style">
3017
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
3018
+
3019
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
3020
+
3021
+ </xsl:attribute-set>
3022
+
3014
3023
  <!-- bibitem in bibliography section (references/@normative="false"), list body -->
3015
3024
  <xsl:attribute-set name="bibitem-normative-list-body-style">
3016
3025
 
@@ -3411,14 +3420,14 @@
3411
3420
  <xsl:value-of select="$sep"/><xsl:value-of select="$zero_width_space"/>
3412
3421
  </xsl:when>
3413
3422
  <xsl:otherwise>
3414
- <fo:inline keep-together.within-line="always"><xsl:apply-templates/></fo:inline>
3423
+ <fo:inline keep-together.within-line="always" role="SKIP"><xsl:apply-templates/></fo:inline>
3415
3424
  </xsl:otherwise>
3416
3425
  </xsl:choose>
3417
3426
  </xsl:for-each>
3418
3427
  </xsl:when>
3419
3428
 
3420
3429
  <xsl:otherwise>
3421
- <fo:inline keep-together.within-line="always"><xsl:apply-templates/></fo:inline>
3430
+ <fo:inline keep-together.within-line="always" role="SKIP"><xsl:apply-templates/></fo:inline>
3422
3431
  </xsl:otherwise>
3423
3432
 
3424
3433
  </xsl:choose>
@@ -3428,7 +3437,7 @@
3428
3437
  <!-- Preface boilerplate sections processing -->
3429
3438
  <!-- ================================= -->
3430
3439
  <xsl:template match="*[local-name()='copyright-statement']">
3431
- <fo:block xsl:use-attribute-sets="copyright-statement-style">
3440
+ <fo:block xsl:use-attribute-sets="copyright-statement-style" role="SKIP">
3432
3441
  <xsl:apply-templates/>
3433
3442
  </fo:block>
3434
3443
  </xsl:template> <!-- copyright-statement -->
@@ -3594,7 +3603,7 @@
3594
3603
  </xsl:choose>
3595
3604
  </xsl:variable>
3596
3605
 
3597
- <fo:block-container xsl:use-attribute-sets="table-container-style">
3606
+ <fo:block-container xsl:use-attribute-sets="table-container-style" role="SKIP">
3598
3607
 
3599
3608
  <xsl:call-template name="refine_table-container-style">
3600
3609
  <xsl:with-param name="margin-side" select="$margin-side"/>
@@ -4369,13 +4378,13 @@
4369
4378
  <fo:table-body>
4370
4379
 
4371
4380
  <xsl:variable name="title_continued_">
4372
- <xsl:call-template name="getTitle">
4373
- <xsl:with-param name="name" select="'title-continued'"/>
4381
+ <xsl:call-template name="getLocalizedString">
4382
+ <xsl:with-param name="key">continued</xsl:with-param>
4374
4383
  </xsl:call-template>
4375
4384
  </xsl:variable>
4376
-
4385
+ <xsl:variable name="title_continued_in_parenthesis" select="concat('(',$title_continued_,')')"/>
4377
4386
  <xsl:variable name="title_continued">
4378
- <xsl:value-of select="$title_continued_"/>
4387
+ <xsl:value-of select="$title_continued_in_parenthesis"/>
4379
4388
 
4380
4389
  </xsl:variable>
4381
4390
 
@@ -4683,7 +4692,7 @@
4683
4692
  </xsl:choose>
4684
4693
  </xsl:variable>
4685
4694
  <xsl:variable name="footnote_inline">
4686
- <fo:inline>
4695
+ <fo:inline role="Reference">
4687
4696
 
4688
4697
  <xsl:variable name="fn_styles">
4689
4698
  <xsl:choose>
@@ -4706,7 +4715,7 @@
4706
4715
 
4707
4716
  <xsl:call-template name="insert_basic_link">
4708
4717
  <xsl:with-param name="element">
4709
- <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
4718
+ <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}" role="Lbl">
4710
4719
  <xsl:copy-of select="$current_fn_number_text"/>
4711
4720
  </fo:basic-link>
4712
4721
  </xsl:with-param>
@@ -4719,17 +4728,17 @@
4719
4728
  <xsl:copy-of select="$footnote_inline"/>
4720
4729
  </xsl:when>
4721
4730
  <xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false'">
4722
- <fo:footnote xsl:use-attribute-sets="fn-style">
4731
+ <fo:footnote xsl:use-attribute-sets="fn-style" role="SKIP">
4723
4732
  <xsl:copy-of select="$footnote_inline"/>
4724
- <fo:footnote-body>
4733
+ <fo:footnote-body role="Note">
4725
4734
 
4726
- <fo:block-container xsl:use-attribute-sets="fn-container-body-style">
4735
+ <fo:block-container xsl:use-attribute-sets="fn-container-body-style" role="SKIP">
4727
4736
 
4728
- <fo:block xsl:use-attribute-sets="fn-body-style">
4737
+ <fo:block xsl:use-attribute-sets="fn-body-style" role="SKIP">
4729
4738
 
4730
4739
  <xsl:call-template name="refine_fn-body-style"/>
4731
4740
 
4732
- <fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style">
4741
+ <fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style" role="Lbl">
4733
4742
 
4734
4743
  <xsl:call-template name="refine_fn-body-num-style"/>
4735
4744
 
@@ -4991,11 +5000,11 @@
4991
5000
  </xsl:template>
4992
5001
 
4993
5002
  <xsl:template match="*[local-name()='fn']/text()[normalize-space() != '']">
4994
- <fo:inline><xsl:value-of select="."/></fo:inline>
5003
+ <fo:inline role="SKIP"><xsl:value-of select="."/></fo:inline>
4995
5004
  </xsl:template>
4996
5005
 
4997
5006
  <xsl:template match="*[local-name()='fn']//*[local-name()='p']">
4998
- <fo:inline>
5007
+ <fo:inline role="P">
4999
5008
  <xsl:apply-templates/>
5000
5009
  </fo:inline>
5001
5010
  </xsl:template>
@@ -5010,7 +5019,7 @@
5010
5019
  <xsl:variable name="isAdded" select="@added"/>
5011
5020
  <xsl:variable name="isDeleted" select="@deleted"/>
5012
5021
  <!-- <dl><xsl:copy-of select="."/></dl> -->
5013
- <fo:block-container xsl:use-attribute-sets="dl-block-style">
5022
+ <fo:block-container xsl:use-attribute-sets="dl-block-style" role="SKIP">
5014
5023
 
5015
5024
  <xsl:call-template name="setBlockSpanAll"/>
5016
5025
 
@@ -5045,7 +5054,7 @@
5045
5054
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
5046
5055
  </xsl:call-template>
5047
5056
 
5048
- <fo:block-container margin-left="0mm">
5057
+ <fo:block-container margin-left="0mm" role="SKIP">
5049
5058
 
5050
5059
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
5051
5060
 
@@ -5114,7 +5123,7 @@
5114
5123
 
5115
5124
  <!-- a few components -->
5116
5125
  <xsl:if test="$onlyOneComponent = 'false'">
5117
- <fo:block>
5126
+ <fo:block role="SKIP">
5118
5127
 
5119
5128
  <xsl:call-template name="refine_multicomponent_style"/>
5120
5129
 
@@ -5122,7 +5131,7 @@
5122
5131
  <xsl:attribute name="margin-top">0</xsl:attribute>
5123
5132
  </xsl:if>
5124
5133
 
5125
- <fo:block>
5134
+ <fo:block role="SKIP">
5126
5135
 
5127
5136
  <xsl:call-template name="refine_multicomponent_block_style"/>
5128
5137
 
@@ -5727,6 +5736,9 @@
5727
5736
 
5728
5737
  <xsl:template name="refine_strong_style">
5729
5738
 
5739
+ <xsl:if test="ancestor::*['preferred']">
5740
+ <xsl:attribute name="role">SKIP</xsl:attribute>
5741
+ </xsl:if>
5730
5742
  </xsl:template>
5731
5743
 
5732
5744
  <xsl:template match="*[local-name()='padding']">
@@ -5774,7 +5786,7 @@
5774
5786
  <xsl:variable name="regex_url_start">^(http://|https://|www\.)?(.*)</xsl:variable>
5775
5787
  <xsl:template match="*[local-name()='tt']/text()" priority="2">
5776
5788
  <xsl:choose>
5777
- <xsl:when test="java:replaceAll(java:java.lang.String.new(.), '$2', '') != ''">
5789
+ <xsl:when test="java:replaceAll(java:java.lang.String.new(.), $regex_url_start, '$2') != ''">
5778
5790
  <!-- url -->
5779
5791
  <xsl:call-template name="add-zero-spaces-link-java"/>
5780
5792
  </xsl:when>
@@ -6236,10 +6248,13 @@
6236
6248
  </xsl:choose>
6237
6249
  </xsl:variable>
6238
6250
 
6251
+ <!-- replace sequence #x200B to one &#x200B -->
6252
+ <xsl:variable name="text10" select="java:replaceAll(java:java.lang.String.new($text9), '\u200b{2,}', '​')"/>
6253
+
6239
6254
  <!-- replace sequence #x200B and space TO space -->
6240
- <xsl:variable name="text10" select="java:replaceAll(java:java.lang.String.new($text9), '\u200b ', ' ')"/>
6255
+ <xsl:variable name="text11" select="java:replaceAll(java:java.lang.String.new($text10), '\u200b ', ' ')"/>
6241
6256
 
6242
- <xsl:value-of select="$text10"/>
6257
+ <xsl:value-of select="$text11"/>
6243
6258
  </xsl:template>
6244
6259
 
6245
6260
  <xsl:template name="add-zero-spaces-link-java">
@@ -6249,8 +6264,12 @@
6249
6264
  <xsl:variable name="url_continue" select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$2')"/>
6250
6265
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space, comma, slash, @ -->
6251
6266
  <xsl:variable name="url" select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/|@)','$1​')"/>
6267
+
6268
+ <!-- replace sequence #x200B to one &#x200B -->
6269
+ <xsl:variable name="url2" select="java:replaceAll(java:java.lang.String.new($url), '\u200b{2,}', '​')"/>
6270
+
6252
6271
  <!-- remove zero-width space at the end -->
6253
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url), '​$', '')"/>
6272
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url2), '​$', '')"/>
6254
6273
  </xsl:template>
6255
6274
 
6256
6275
  <!-- add zero space after dash character (for table's entries) -->
@@ -6661,6 +6680,18 @@
6661
6680
  </xsl:copy>
6662
6681
  </xsl:template>
6663
6682
 
6683
+ <xsl:variable name="font_main_root_style">
6684
+ <root-style xsl:use-attribute-sets="root-style">
6685
+ </root-style>
6686
+ </xsl:variable>
6687
+ <xsl:variable name="font_main_root_style_font_family" select="xalan:nodeset($font_main_root_style)/root-style/@font-family"/>
6688
+ <xsl:variable name="font_main">
6689
+ <xsl:choose>
6690
+ <xsl:when test="contains($font_main_root_style_font_family, ',')"><xsl:value-of select="substring-before($font_main_root_style_font_family, ',')"/></xsl:when>
6691
+ <xsl:otherwise><xsl:value-of select="$font_main_root_style_font_family"/></xsl:otherwise>
6692
+ </xsl:choose>
6693
+ </xsl:variable>
6694
+
6664
6695
  <xsl:template match="*[local-name()='th' or local-name()='td']" mode="simple-table-id">
6665
6696
  <xsl:param name="id"/>
6666
6697
  <xsl:copy>
@@ -6699,6 +6730,33 @@
6699
6730
 
6700
6731
  <!-- td_text='<xsl:copy-of select="$td_text"/>' -->
6701
6732
 
6733
+ <xsl:variable name="words_with_width">
6734
+ <!-- calculate width for 'word' which contain text only (without formatting tags inside) -->
6735
+ <xsl:for-each select="xalan:nodeset($td_text)//*[local-name() = 'word'][normalize-space() != ''][not(*)]">
6736
+ <xsl:copy>
6737
+ <xsl:copy-of select="@*"/>
6738
+ <xsl:attribute name="width">
6739
+ <xsl:value-of select="java:org.metanorma.fop.Util.getStringWidth(., $font_main)"/> <!-- Example: 'Times New Roman' -->
6740
+ </xsl:attribute>
6741
+ <xsl:copy-of select="node()"/>
6742
+ </xsl:copy>
6743
+ </xsl:for-each>
6744
+ </xsl:variable>
6745
+
6746
+ <xsl:variable name="words_with_width_sorted">
6747
+ <xsl:for-each select="xalan:nodeset($words_with_width)//*[local-name() = 'word']">
6748
+ <xsl:sort select="@width" data-type="number" order="descending"/>
6749
+ <!-- select word maximal width only -->
6750
+ <xsl:if test="position() = 1">
6751
+ <xsl:copy-of select="."/>
6752
+ </xsl:if>
6753
+ </xsl:for-each>
6754
+ <!-- add 'word' with formatting tags inside -->
6755
+ <xsl:for-each select="xalan:nodeset($td_text)//*[local-name() = 'word'][normalize-space() != ''][*]">
6756
+ <xsl:copy-of select="."/>
6757
+ </xsl:for-each>
6758
+ </xsl:variable>
6759
+
6702
6760
  <xsl:variable name="words">
6703
6761
  <xsl:for-each select=".//*[local-name() = 'image' or local-name() = 'stem']">
6704
6762
  <word>
@@ -6706,9 +6764,12 @@
6706
6764
  </word>
6707
6765
  </xsl:for-each>
6708
6766
 
6709
- <xsl:for-each select="xalan:nodeset($td_text)//*[local-name() = 'word'][normalize-space() != '']">
6767
+ <xsl:for-each select="xalan:nodeset($words_with_width_sorted)//*[local-name() = 'word'][normalize-space() != '']">
6710
6768
  <xsl:copy-of select="."/>
6711
6769
  </xsl:for-each>
6770
+ <!-- <xsl:for-each select="xalan:nodeset($td_text)//*[local-name() = 'word'][normalize-space() != '']">
6771
+ <xsl:copy-of select="."/>
6772
+ </xsl:for-each> -->
6712
6773
 
6713
6774
  </xsl:variable>
6714
6775
 
@@ -7176,10 +7237,10 @@
7176
7237
  <xsl:copy>
7177
7238
  <xsl:apply-templates select="@*" mode="mathml"/>
7178
7239
  <xsl:if test="not(@lspace)">
7179
- <xsl:attribute name="lspace">0.4em</xsl:attribute>
7240
+ <xsl:attribute name="lspace">0.2em</xsl:attribute>
7180
7241
  </xsl:if>
7181
- <xsl:if test="not(@rspace)">
7182
- <xsl:attribute name="rspace">0.4em</xsl:attribute>
7242
+ <xsl:if test="not(@rspace) and not(following-sibling::*[1][self::mathml:mo and normalize-space(text()) = '|'])">
7243
+ <xsl:attribute name="rspace">0.2em</xsl:attribute>
7183
7244
  </xsl:if>
7184
7245
  <xsl:apply-templates mode="mathml"/>
7185
7246
  </xsl:copy>
@@ -7196,6 +7257,27 @@
7196
7257
  </xsl:copy>
7197
7258
  </xsl:template>
7198
7259
 
7260
+ <!-- increase space before '(' -->
7261
+ <xsl:template match="mathml:mo[normalize-space(text()) = '(']" mode="mathml">
7262
+ <xsl:copy>
7263
+ <xsl:apply-templates select="@*" mode="mathml"/>
7264
+ <xsl:if test="(preceding-sibling::* and not(preceding-sibling::*[1][self::mathml:mo])) or (../preceding-sibling::* and not(../preceding-sibling::*[1][self::mathml:mo]))">
7265
+ <xsl:if test="not(@lspace)">
7266
+ <xsl:attribute name="lspace">0.4em</xsl:attribute>
7267
+ <xsl:choose>
7268
+ <xsl:when test="preceding-sibling::*[1][self::mathml:mi or self::mathml:mstyle]">
7269
+ <xsl:attribute name="lspace">0.2em</xsl:attribute>
7270
+ </xsl:when>
7271
+ <xsl:when test="../preceding-sibling::*[1][self::mathml:mi or self::mathml:mstyle]">
7272
+ <xsl:attribute name="lspace">0.2em</xsl:attribute>
7273
+ </xsl:when>
7274
+ </xsl:choose>
7275
+ </xsl:if>
7276
+ </xsl:if>
7277
+ <xsl:apply-templates mode="mathml"/>
7278
+ </xsl:copy>
7279
+ </xsl:template>
7280
+
7199
7281
  <!-- Examples:
7200
7282
  <stem type="AsciiMath">x = 1</stem>
7201
7283
  <stem type="AsciiMath"><asciimath>x = 1</asciimath></stem>
@@ -7355,7 +7437,7 @@
7355
7437
  <!-- formula -->
7356
7438
  <!-- ====== -->
7357
7439
  <xsl:template match="*[local-name() = 'formula']" name="formula">
7358
- <fo:block-container margin-left="0mm">
7440
+ <fo:block-container margin-left="0mm" role="SKIP">
7359
7441
  <xsl:if test="parent::*[local-name() = 'note']">
7360
7442
  <xsl:attribute name="margin-left">
7361
7443
  <xsl:choose>
@@ -7365,7 +7447,7 @@
7365
7447
  </xsl:attribute>
7366
7448
 
7367
7449
  </xsl:if>
7368
- <fo:block-container margin-left="0mm">
7450
+ <fo:block-container margin-left="0mm" role="SKIP">
7369
7451
  <fo:block id="{@id}">
7370
7452
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> <!-- formula's number will be process in 'stem' template -->
7371
7453
  </fo:block>
@@ -7445,19 +7527,19 @@
7445
7527
 
7446
7528
  <xsl:template match="*[local-name() = 'note']" name="note">
7447
7529
 
7448
- <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style">
7530
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
7449
7531
 
7450
7532
  <xsl:call-template name="setBlockSpanAll"/>
7451
7533
 
7452
7534
  <xsl:call-template name="refine_note-style"/>
7453
7535
 
7454
- <fo:block-container margin-left="0mm" margin-right="0mm">
7536
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
7455
7537
 
7456
7538
  <fo:block>
7457
7539
 
7458
7540
  <xsl:call-template name="refine_note_block_style"/>
7459
7541
 
7460
- <fo:inline xsl:use-attribute-sets="note-name-style">
7542
+ <fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
7461
7543
 
7462
7544
  <xsl:call-template name="refine_note-name-style"/>
7463
7545
 
@@ -7494,12 +7576,12 @@
7494
7576
  <xsl:variable name="num"><xsl:number/></xsl:variable>
7495
7577
  <xsl:choose>
7496
7578
  <xsl:when test="$num = 1"> <!-- display first NOTE's paragraph in the same line with label NOTE -->
7497
- <fo:inline xsl:use-attribute-sets="note-p-style">
7579
+ <fo:inline xsl:use-attribute-sets="note-p-style" role="SKIP">
7498
7580
  <xsl:apply-templates/>
7499
7581
  </fo:inline>
7500
7582
  </xsl:when>
7501
7583
  <xsl:otherwise>
7502
- <fo:block xsl:use-attribute-sets="note-p-style">
7584
+ <fo:block xsl:use-attribute-sets="note-p-style" role="SKIP">
7503
7585
  <xsl:apply-templates/>
7504
7586
  </fo:block>
7505
7587
  </xsl:otherwise>
@@ -7615,12 +7697,13 @@
7615
7697
 
7616
7698
  <xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']">
7617
7699
  <xsl:if test="normalize-space() != ''">
7618
- <xsl:variable name="level">
7700
+ <!-- <xsl:variable name="level">
7619
7701
  <xsl:call-template name="getLevelTermName"/>
7620
7702
  </xsl:variable>
7621
7703
  <fo:inline role="H{$level}">
7622
- <xsl:apply-templates/>
7623
- </fo:inline>
7704
+ <xsl:apply-templates />
7705
+ </fo:inline> -->
7706
+ <xsl:apply-templates/>
7624
7707
  </xsl:if>
7625
7708
  </xsl:template>
7626
7709
  <!-- ====== -->
@@ -7644,7 +7727,7 @@
7644
7727
  <!-- Example: Dimensions in millimeters -->
7645
7728
  <xsl:apply-templates select="*[local-name() = 'note'][@type = 'units']"/>
7646
7729
 
7647
- <fo:block xsl:use-attribute-sets="figure-style">
7730
+ <fo:block xsl:use-attribute-sets="figure-style" role="SKIP">
7648
7731
  <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note' and @type = 'units')]"/>
7649
7732
  </fo:block>
7650
7733
  <xsl:for-each select="*[local-name() = 'note'][not(@type = 'units')]">
@@ -8778,7 +8861,7 @@
8778
8861
  </xsl:when>
8779
8862
 
8780
8863
  <xsl:otherwise>
8781
- <fo:block-container xsl:use-attribute-sets="sourcecode-container-style">
8864
+ <fo:block-container xsl:use-attribute-sets="sourcecode-container-style" role="SKIP">
8782
8865
 
8783
8866
  <xsl:if test="not(ancestor::*[local-name() = 'li']) or ancestor::*[local-name() = 'example']">
8784
8867
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
@@ -8799,7 +8882,7 @@
8799
8882
  </xsl:attribute>
8800
8883
 
8801
8884
  </xsl:if>
8802
- <fo:block-container margin-left="0mm">
8885
+ <fo:block-container margin-left="0mm" role="SKIP">
8803
8886
 
8804
8887
  <fo:block xsl:use-attribute-sets="sourcecode-style">
8805
8888
 
@@ -9345,11 +9428,11 @@
9345
9428
  <!-- requirement, recommendation, permission table -->
9346
9429
  <!-- ========== -->
9347
9430
  <xsl:template match="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
9348
- <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt">
9431
+ <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt" role="SKIP">
9349
9432
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
9350
9433
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
9351
9434
  </xsl:if>
9352
- <fo:block-container margin-left="0mm" margin-right="0mm">
9435
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
9353
9436
  <fo:table id="{@id}" table-layout="fixed" width="100%"> <!-- border="1pt solid black" -->
9354
9437
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
9355
9438
  <!-- <xsl:attribute name="border">0.5pt solid black</xsl:attribute> -->
@@ -9511,7 +9594,7 @@
9511
9594
  -->
9512
9595
  <xsl:template match="*[local-name() = 'example']">
9513
9596
 
9514
- <fo:block-container id="{@id}" xsl:use-attribute-sets="example-style">
9597
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="example-style" role="SKIP">
9515
9598
 
9516
9599
  <xsl:call-template name="setBlockSpanAll"/>
9517
9600
 
@@ -9522,7 +9605,7 @@
9522
9605
  inline
9523
9606
  </xsl:variable>
9524
9607
 
9525
- <fo:block-container margin-left="0mm">
9608
+ <fo:block-container margin-left="0mm" role="SKIP">
9526
9609
 
9527
9610
  <xsl:choose>
9528
9611
 
@@ -9535,8 +9618,8 @@
9535
9618
  </xsl:apply-templates>
9536
9619
  </fo:block>
9537
9620
 
9538
- <fo:block-container xsl:use-attribute-sets="example-body-style">
9539
- <fo:block-container margin-left="0mm" margin-right="0mm">
9621
+ <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
9622
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
9540
9623
  <xsl:apply-templates select="node()[not(local-name() = 'name')]">
9541
9624
  <xsl:with-param name="fo_element" select="$fo_element"/>
9542
9625
  </xsl:apply-templates>
@@ -9589,8 +9672,8 @@
9589
9672
 
9590
9673
  <xsl:if test="*[not(local-name() = 'name')][position() &gt; 1]">
9591
9674
  <!-- display further elements in blocks -->
9592
- <fo:block-container xsl:use-attribute-sets="example-body-style">
9593
- <fo:block-container margin-left="0mm" margin-right="0mm">
9675
+ <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
9676
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
9594
9677
  <xsl:apply-templates select="*[not(local-name() = 'name')][position() &gt; 1]">
9595
9678
  <xsl:with-param name="fo_element" select="'block'"/>
9596
9679
  </xsl:apply-templates>
@@ -9648,7 +9731,7 @@
9648
9731
  </xsl:variable>
9649
9732
  <xsl:choose>
9650
9733
  <xsl:when test="starts-with(normalize-space($element), 'block')">
9651
- <fo:block-container>
9734
+ <fo:block-container role="SKIP">
9652
9735
  <xsl:if test="ancestor::*[local-name() = 'li'] and contains(normalize-space($fo_element), 'block')">
9653
9736
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
9654
9737
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
@@ -9789,7 +9872,7 @@
9789
9872
  <!-- author -->
9790
9873
  <!-- ====== -->
9791
9874
  <xsl:template match="*[local-name() = 'quote']">
9792
- <fo:block-container margin-left="0mm">
9875
+ <fo:block-container margin-left="0mm" role="SKIP">
9793
9876
 
9794
9877
  <xsl:call-template name="setBlockSpanAll"/>
9795
9878
 
@@ -9803,12 +9886,12 @@
9803
9886
  <xsl:attribute name="space-after">12pt</xsl:attribute>
9804
9887
  </xsl:if>
9805
9888
 
9806
- <fo:block-container margin-left="0mm">
9807
- <fo:block-container xsl:use-attribute-sets="quote-style">
9889
+ <fo:block-container margin-left="0mm" role="SKIP">
9890
+ <fo:block-container xsl:use-attribute-sets="quote-style" role="SKIP">
9808
9891
 
9809
9892
  <xsl:call-template name="refine_quote-style"/>
9810
9893
 
9811
- <fo:block-container margin-left="0mm" margin-right="0mm">
9894
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
9812
9895
  <fo:block role="BlockQuote">
9813
9896
  <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
9814
9897
  </fo:block>
@@ -9964,10 +10047,10 @@
9964
10047
 
9965
10048
  <xsl:choose>
9966
10049
  <xsl:when test="$lang = 'zh'">
9967
- <fo:inline><xsl:value-of select="$tab_zh"/></fo:inline>
10050
+ <fo:inline role="SKIP"><xsl:value-of select="$tab_zh"/></fo:inline>
9968
10051
  </xsl:when>
9969
10052
  <xsl:when test="../../@inline-header = 'true'">
9970
- <fo:inline font-size="90%">
10053
+ <fo:inline font-size="90%" role="SKIP">
9971
10054
  <xsl:call-template name="insertNonBreakSpaces">
9972
10055
  <xsl:with-param name="count" select="$padding-right"/>
9973
10056
  </xsl:call-template>
@@ -9975,7 +10058,7 @@
9975
10058
  </xsl:when>
9976
10059
  <xsl:otherwise>
9977
10060
  <xsl:variable name="direction"><xsl:if test="$lang = 'ar'"><xsl:value-of select="$RLM"/></xsl:if></xsl:variable>
9978
- <fo:inline padding-right="{$padding-right}mm"><xsl:value-of select="$direction"/>​</fo:inline>
10061
+ <fo:inline padding-right="{$padding-right}mm" role="SKIP"><xsl:value-of select="$direction"/>​</fo:inline>
9979
10062
  </xsl:otherwise>
9980
10063
  </xsl:choose>
9981
10064
 
@@ -10005,12 +10088,12 @@
10005
10088
  <fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="preferred-block-style">
10006
10089
 
10007
10090
  <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'preferred'])"> <!-- if first preffered in term, then display term's name -->
10008
- <fo:block xsl:use-attribute-sets="term-name-style">
10091
+ <fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
10009
10092
  <xsl:apply-templates select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"/>
10010
10093
  </fo:block>
10011
10094
  </xsl:if>
10012
10095
 
10013
- <fo:block xsl:use-attribute-sets="preferred-term-style">
10096
+ <fo:block xsl:use-attribute-sets="preferred-term-style" role="SKIP">
10014
10097
  <xsl:call-template name="setStyle_preferred"/>
10015
10098
  <xsl:apply-templates/>
10016
10099
  </fo:block>
@@ -10051,7 +10134,7 @@
10051
10134
  <!-- definition -->
10052
10135
  <!-- ========== -->
10053
10136
  <xsl:template match="*[local-name() = 'definition']">
10054
- <fo:block xsl:use-attribute-sets="definition-style">
10137
+ <fo:block xsl:use-attribute-sets="definition-style" role="SKIP">
10055
10138
  <xsl:apply-templates/>
10056
10139
  </fo:block>
10057
10140
  </xsl:template>
@@ -10099,6 +10182,10 @@
10099
10182
 
10100
10183
  <xsl:template match="*[local-name() = 'clause']">
10101
10184
  <fo:block>
10185
+ <xsl:if test="parent::*[local-name() = 'copyright-statement']">
10186
+ <xsl:attribute name="role">SKIP</xsl:attribute>
10187
+ </xsl:if>
10188
+
10102
10189
  <xsl:call-template name="setId"/>
10103
10190
 
10104
10191
  <xsl:call-template name="setBlockSpanAll"/>
@@ -10341,7 +10428,7 @@
10341
10428
  <xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
10342
10429
  <xsl:choose>
10343
10430
  <xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
10344
- <fo:block-container>
10431
+ <fo:block-container role="SKIP">
10345
10432
  <xsl:attribute name="margin-left">
10346
10433
  <xsl:choose>
10347
10434
  <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
@@ -10351,7 +10438,7 @@
10351
10438
 
10352
10439
  <xsl:call-template name="refine_list_container_style"/>
10353
10440
 
10354
- <fo:block-container margin-left="0mm">
10441
+ <fo:block-container margin-left="0mm" role="SKIP">
10355
10442
  <fo:block>
10356
10443
  <xsl:apply-templates select="." mode="list"/>
10357
10444
  </fo:block>
@@ -10360,7 +10447,7 @@
10360
10447
  </xsl:when>
10361
10448
  <xsl:otherwise>
10362
10449
 
10363
- <fo:block>
10450
+ <fo:block role="SKIP">
10364
10451
  <xsl:apply-templates select="." mode="list"/>
10365
10452
  </fo:block>
10366
10453
 
@@ -10778,7 +10865,10 @@
10778
10865
  <!-- Reference sections (Normative References and Bibliography) -->
10779
10866
  <!-- ========================================================== -->
10780
10867
  <xsl:template match="*[local-name() = 'references'][@hidden='true']" priority="3"/>
10781
- <xsl:template match="*[local-name() = 'bibitem'][@hidden='true']" priority="3"/>
10868
+ <xsl:template match="*[local-name() = 'bibitem'][@hidden='true']" priority="3">
10869
+ <xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][local-name() = 'bibitem'] and 1 = 1)"/>
10870
+
10871
+ </xsl:template>
10782
10872
  <!-- don't display bibitem with @id starts with '_hidden', that was introduced for references integrity -->
10783
10873
  <xsl:template match="*[local-name() = 'bibitem'][starts-with(@id, 'hidden_bibitem_')]" priority="3"/>
10784
10874
 
@@ -10827,7 +10917,7 @@
10827
10917
 
10828
10918
  <!-- Bibliography (non-normative references) -->
10829
10919
  <xsl:template match="*[local-name() = 'references'][not(@normative='true')]/*[local-name() = 'bibitem']" name="bibitem_non_normative" priority="2">
10830
-
10920
+ <xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][local-name() = 'bibitem'] and 1 = 1)"/> <!-- current bibiitem is non-first -->
10831
10921
  <!-- $namespace = 'csd' or $namespace = 'gb' or $namespace = 'iec' or $namespace = 'ieee' or $namespace = 'iso' or $namespace = 'jcgm' or $namespace = 'm3d' or
10832
10922
  $namespace = 'mpfd' or $namespace = 'ogc' or $namespace = 'ogc-white-paper' -->
10833
10923
  <!-- Example: [1] ISO 9:1995, Information and documentation – Transliteration of Cyrillic characters into Latin characters – Slavic and non-Slavic languages -->
@@ -10855,6 +10945,35 @@
10855
10945
 
10856
10946
  </xsl:template> <!-- references[not(@normative='true')]/bibitem -->
10857
10947
 
10948
+ <xsl:template name="insertListItem_Bibitem">
10949
+ <xsl:choose>
10950
+ <xsl:when test="@hidden = 'true'"><!-- skip --></xsl:when>
10951
+ <xsl:otherwise>
10952
+ <fo:list-item id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-item-style">
10953
+ <fo:list-item-label end-indent="label-end()">
10954
+ <fo:block role="SKIP">
10955
+ <fo:inline role="SKIP">
10956
+ <xsl:apply-templates select="*[local-name() = 'biblio-tag']">
10957
+ <xsl:with-param name="biblio_tag_part">first</xsl:with-param>
10958
+ </xsl:apply-templates>
10959
+ </fo:inline>
10960
+ </fo:block>
10961
+ </fo:list-item-label>
10962
+ <fo:list-item-body start-indent="body-start()">
10963
+ <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style" role="SKIP">
10964
+ <xsl:call-template name="processBibitem">
10965
+ <xsl:with-param name="biblio_tag_part">last</xsl:with-param>
10966
+ </xsl:call-template>
10967
+ </fo:block>
10968
+ </fo:list-item-body>
10969
+ </fo:list-item>
10970
+ </xsl:otherwise>
10971
+ </xsl:choose>
10972
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'bibitem']">
10973
+ <xsl:with-param name="skip">false</xsl:with-param>
10974
+ </xsl:apply-templates>
10975
+ </xsl:template>
10976
+
10858
10977
  <xsl:template name="processBibitem">
10859
10978
  <xsl:param name="biblio_tag_part">both</xsl:param>
10860
10979