metanorma-bipm 1.2.3 → 2.0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,6 +17,8 @@
17
17
 
18
18
  <xsl:param name="add_math_as_attachment">true</xsl:param>
19
19
 
20
+ <xsl:key name="kfn" match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" use="@reference"/>
21
+
20
22
  <xsl:variable name="first_pass" select="count($index//item) = 0"/>
21
23
 
22
24
  <xsl:variable name="pageWidth" select="210"/>
@@ -960,8 +962,11 @@
960
962
  <xsl:template name="setListItemLabel">
961
963
  <xsl:attribute name="label">
962
964
  <xsl:choose>
963
- <xsl:when test="local-name(..) = 'ul' and ../ancestor::bipm:ul">−</xsl:when> <!-- &#x2212; - minus sign. &#x2014; - dash -->
964
- <xsl:when test="local-name(..) = 'ul'">•</xsl:when> <!-- &#x2014; dash -->
965
+ <xsl:when test="local-name(..) = 'ul'">
966
+ <xsl:call-template name="setULLabel"/>
967
+ </xsl:when>
968
+ <!-- <xsl:when test="local-name(..) = 'ul' and ../ancestor::bipm:ul">&#x2212;</xsl:when> --> <!-- &#x2212; - minus sign. &#x2014; - dash -->
969
+ <!-- <xsl:when test="local-name(..) = 'ul'">•</xsl:when> --> <!-- &#x2014; dash -->
965
970
  <xsl:otherwise> <!-- for ordered lists -->
966
971
  <xsl:variable name="start_value">
967
972
  <xsl:choose>
@@ -1253,9 +1258,6 @@
1253
1258
 
1254
1259
  <xsl:variable name="title-toc">
1255
1260
  <fo:inline>
1256
- <!-- <xsl:call-template name="getTitle">
1257
- <xsl:with-param name="name" select="'title-toc'"/>
1258
- </xsl:call-template> -->
1259
1261
  <xsl:call-template name="getLocalizedString">
1260
1262
  <xsl:with-param name="key">table_of_contents</xsl:with-param>
1261
1263
  </xsl:call-template>
@@ -1427,7 +1429,12 @@
1427
1429
  <xsl:if test="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type = 'part']">
1428
1430
  <fo:block role="H2">
1429
1431
  <xsl:if test="$part_num != ''">
1430
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-part[@lang=$curr_lang]),'#',$part_num)"/>
1432
+ <xsl:call-template name="getLocalizedString">
1433
+ <xsl:with-param name="key">Part.sg</xsl:with-param>
1434
+ <xsl:with-param name="lang" select="$curr_lang"/>
1435
+ </xsl:call-template>
1436
+ <xsl:text> </xsl:text>
1437
+ <xsl:value-of select="$part_num"/>
1431
1438
  </xsl:if>
1432
1439
  <xsl:text>: </xsl:text>
1433
1440
  <xsl:apply-templates select="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type = 'part']" mode="title"/>
@@ -1752,9 +1759,13 @@
1752
1759
  <xsl:if test="$part_num != ''">
1753
1760
  <fo:block font-size="{$space-factor * 30.4}pt"> </fo:block>
1754
1761
  <!-- Part -->
1755
- <fo:block font-size="{$font-size-number-factor * 17}pt" font-weight="{$weight-normal}"><xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-part[@lang='fr']),'#',$part_num)"/></fo:block>
1762
+ <fo:block font-size="{$font-size-number-factor * 17}pt" font-weight="{$weight-normal}">
1763
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-part[@lang='fr']),'#',$part_num)"/>
1764
+ </fo:block>
1756
1765
  <!-- Partie -->
1757
- <fo:block font-size="{$font-size-number-factor * 17}pt" font-weight="{$weight-bold}"><xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-part[@lang='en']),'#',$part_num)"/></fo:block>
1766
+ <fo:block font-size="{$font-size-number-factor * 17}pt" font-weight="{$weight-bold}">
1767
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-part[@lang='en']),'#',$part_num)"/>
1768
+ </fo:block>
1758
1769
  </xsl:if>
1759
1770
 
1760
1771
  <fo:block font-size="{$font-size-factor * 30.4}pt">
@@ -2179,7 +2190,7 @@
2179
2190
 
2180
2191
  <xsl:variable name="display">
2181
2192
  <xsl:choose>
2182
- <xsl:when test="$level &gt;= 4">false</xsl:when>
2193
+ <xsl:when test="$level &gt; $toc_level">false</xsl:when>
2183
2194
  <xsl:otherwise>true</xsl:otherwise>
2184
2195
  </xsl:choose>
2185
2196
  </xsl:variable>
@@ -2416,7 +2427,7 @@
2416
2427
  <!-- ====== -->
2417
2428
 
2418
2429
 
2419
- <xsl:template match="bipm:title" name="clause_title">
2430
+ <xsl:template match="bipm:title" name="title">
2420
2431
 
2421
2432
  <xsl:variable name="level">
2422
2433
  <xsl:call-template name="getLevel"/>
@@ -3089,35 +3100,6 @@
3089
3100
  </xsl:choose>
3090
3101
  </xsl:template>
3091
3102
 
3092
- <!--
3093
- <fn reference="1">
3094
- <p id="_8e5cf917-f75a-4a49-b0aa-1714cb6cf954">Formerly denoted as 15 % (m/m).</p>
3095
- </fn>
3096
- -->
3097
- <xsl:template match="bipm:title//bipm:fn | bipm:name//bipm:fn | bipm:p/bipm:fn[not(ancestor::bipm:table)] | bipm:p/*/bipm:fn[not(ancestor::bipm:table)] | bipm:sourcecode/bipm:fn[not(ancestor::bipm:table)]" priority="2" name="fn">
3098
- <fo:footnote keep-with-previous.within-line="always">
3099
- <xsl:variable name="number"> <!-- select="@reference"/> -->
3100
- <xsl:number count="bipm:fn[not(ancestor::bipm:table)]" level="any"/>
3101
- </xsl:variable>
3102
- <xsl:variable name="gen_id" select="generate-id()"/>
3103
- <xsl:variable name="lang" select="ancestor::bipm:bipm-standard/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
3104
- <fo:inline font-size="65%" keep-with-previous.within-line="always" vertical-align="super">
3105
- <fo:basic-link internal-destination="{$lang}_footnote_{@reference}_{$number}_{$gen_id}" fox:alt-text="footnote {@reference}">
3106
- <xsl:value-of select="$number"/><!-- + count(//bipm:bibitem/bipm:note) -->
3107
- </fo:basic-link>
3108
- </fo:inline>
3109
- <fo:footnote-body>
3110
- <fo:block font-size="9pt" margin-bottom="12pt" font-weight="normal" text-indent="0" start-indent="0" line-height="124%" text-align="justify">
3111
- <fo:inline id="{$lang}_footnote_{@reference}_{$number}_{$gen_id}" keep-with-next.within-line="always" font-size="60%" vertical-align="super" padding-right="1mm"> <!-- baseline-shift="30%" padding-right="3mm" font-size="60%" alignment-baseline="hanging" -->
3112
- <xsl:value-of select="$number "/><!-- + count(//bipm:bibitem/bipm:note) -->
3113
- </fo:inline>
3114
- <xsl:for-each select="bipm:p">
3115
- <xsl:apply-templates/>
3116
- </xsl:for-each>
3117
- </fo:block>
3118
- </fo:footnote-body>
3119
- </fo:footnote>
3120
- </xsl:template>
3121
3103
 
3122
3104
  <xsl:template match="bipm:fn/bipm:p">
3123
3105
  <fo:block>
@@ -3364,11 +3346,13 @@
3364
3346
  <fo:table-body>
3365
3347
  <fo:table-row>
3366
3348
  <fo:table-cell>
3367
- <fo:block><xsl:apply-templates select="*[local-name()='name']" mode="presentation"/></fo:block>
3349
+ <fo:block>
3350
+ <xsl:apply-templates select="*[local-name()='name']"/>
3351
+ </fo:block>
3368
3352
  </fo:table-cell>
3369
3353
  <fo:table-cell>
3370
3354
  <fo:block>
3371
- <xsl:apply-templates/>
3355
+ <xsl:apply-templates select="node()[not(local-name()='name')]"/>
3372
3356
  </fo:block>
3373
3357
  </fo:table-cell>
3374
3358
  </fo:table-row>
@@ -3452,14 +3436,17 @@
3452
3436
  <fo:block>
3453
3437
  <fo:inline>
3454
3438
  <!-- <xsl:number format="1."/> -->
3455
- <xsl:choose>
3456
- <xsl:when test="bipm:docidentifier[@type='metanorma']">
3457
- <xsl:value-of select="bipm:docidentifier[@type='metanorma']"/>
3458
- </xsl:when>
3459
- <xsl:otherwise>
3460
- <xsl:number format="[1]"/>
3461
- </xsl:otherwise>
3462
- </xsl:choose>
3439
+ <xsl:value-of select="bipm:docidentifier[@type='metanorma-ordinal']"/>
3440
+ <xsl:if test="not(bipm:docidentifier[@type='metanorma-ordinal'])">
3441
+ <xsl:choose>
3442
+ <xsl:when test="bipm:docidentifier[@type='metanorma']">
3443
+ <xsl:value-of select="bipm:docidentifier[@type='metanorma']"/>
3444
+ </xsl:when>
3445
+ <xsl:otherwise>
3446
+ <xsl:number format="[1]"/>
3447
+ </xsl:otherwise>
3448
+ </xsl:choose>
3449
+ </xsl:if>
3463
3450
  </fo:inline>
3464
3451
  </fo:block>
3465
3452
  </fo:list-item-label>
@@ -3473,8 +3460,6 @@
3473
3460
  </fo:list-block>
3474
3461
  </xsl:template>
3475
3462
 
3476
-
3477
- <xsl:template match="bipm:references[not(@normative='true')]/bipm:bibitem" mode="contents"/>
3478
3463
 
3479
3464
  <xsl:template match="bipm:bibitem/bipm:title">
3480
3465
  <fo:inline font-style="italic">
@@ -3482,7 +3467,7 @@
3482
3467
  </fo:inline>
3483
3468
  </xsl:template>
3484
3469
 
3485
- <xsl:template match="bipm:references/bipm:bibitem/bipm:docidentifier[@type='metanorma' and ../bipm:formattedref]"/>
3470
+ <xsl:template match="bipm:references/bipm:bibitem/bipm:docidentifier[(@type='metanorma' or @type='metanorma-ordinal') and ../bipm:formattedref]"/>
3486
3471
 
3487
3472
 
3488
3473
  <xsl:template match="bipm:pagebreak">
@@ -4676,55 +4661,32 @@
4676
4661
 
4677
4662
 
4678
4663
 
4679
- <xsl:variable name="titles" select="xalan:nodeset($titles_)"/><xsl:variable name="titles_">
4680
-
4681
- <title-annex lang="en">Annex </title-annex>
4682
- <title-annex lang="fr">Annexe </title-annex>
4683
-
4684
- <title-annex lang="zh">Annex </title-annex>
4685
-
4686
-
4664
+ <xsl:variable name="titles_">
4687
4665
 
4688
4666
  <title-edition lang="en">
4689
4667
 
4690
- <xsl:text>Edition </xsl:text>
4691
-
4692
-
4668
+ <xsl:text>Edition </xsl:text>
4669
+
4693
4670
  </title-edition>
4694
4671
 
4695
4672
  <title-edition lang="fr">
4696
-
4697
- <xsl:text>Édition </xsl:text>
4698
-
4673
+ <xsl:text>Édition </xsl:text>
4699
4674
  </title-edition>
4700
4675
 
4701
-
4676
+ <!-- These titles of Table of contents renders different than determined in localized-strings -->
4702
4677
  <title-toc lang="en">
4703
4678
 
4704
- <xsl:text>Contents</xsl:text>
4705
-
4706
4679
 
4707
4680
 
4708
4681
  </title-toc>
4709
4682
  <title-toc lang="fr">
4683
+ <xsl:text>Sommaire</xsl:text>
4684
+ </title-toc>
4685
+ <title-toc lang="zh">
4710
4686
 
4711
-
4712
- <xsl:text>Table des matières</xsl:text>
4713
-
4714
- </title-toc>
4715
-
4716
- <title-toc lang="zh">Contents</title-toc>
4717
-
4718
-
4719
-
4720
- <title-page lang="en">Page</title-page>
4721
- <title-page lang="fr">Page</title-page>
4722
-
4723
- <title-key lang="en">Key</title-key>
4724
- <title-key lang="fr">Légende</title-key>
4725
-
4726
- <title-where lang="en">where</title-where>
4727
- <title-where lang="fr">où</title-where>
4687
+ <xsl:text>Contents</xsl:text>
4688
+
4689
+ </title-toc>
4728
4690
 
4729
4691
  <title-descriptors lang="en">Descriptors</title-descriptors>
4730
4692
 
@@ -4744,36 +4706,9 @@
4744
4706
  </title-part>
4745
4707
  <title-part lang="zh">第 # 部分:</title-part>
4746
4708
 
4747
- <title-subpart lang="en">
4748
-
4749
- <xsl:text>Sub-part #</xsl:text>
4750
-
4751
- </title-subpart>
4752
- <title-subpart lang="fr">
4753
-
4754
- <xsl:text>Partie de sub #</xsl:text>
4755
-
4756
- </title-subpart>
4757
-
4758
- <title-modified lang="en">modified</title-modified>
4759
- <title-modified lang="fr">modifiée</title-modified>
4760
-
4761
- <title-modified lang="zh">modified</title-modified>
4762
-
4763
-
4709
+ <title-subpart lang="en">Sub-part #</title-subpart>
4710
+ <title-subpart lang="fr">Partie de sub #</title-subpart>
4764
4711
 
4765
- <title-source lang="en">
4766
-
4767
- <xsl:text>SOURCE</xsl:text>
4768
-
4769
-
4770
- </title-source>
4771
-
4772
- <title-keywords lang="en">Keywords</title-keywords>
4773
-
4774
- <title-deprecated lang="en">DEPRECATED</title-deprecated>
4775
- <title-deprecated lang="fr">DEPRECATED</title-deprecated>
4776
-
4777
4712
  <title-list-tables lang="en">List of Tables</title-list-tables>
4778
4713
 
4779
4714
  <title-list-figures lang="en">List of Figures</title-list-figures>
@@ -4782,41 +4717,12 @@
4782
4717
 
4783
4718
  <title-list-recommendations lang="en">List of Recommendations</title-list-recommendations>
4784
4719
 
4785
- <title-acknowledgements lang="en">Acknowledgements</title-acknowledgements>
4786
-
4787
- <title-abstract lang="en">Abstract</title-abstract>
4788
-
4789
4720
  <title-summary lang="en">Summary</title-summary>
4790
4721
 
4791
- <title-in lang="en">in </title-in>
4792
-
4793
- <title-partly-supercedes lang="en">Partly Supercedes </title-partly-supercedes>
4794
- <title-partly-supercedes lang="zh">部分代替 </title-partly-supercedes>
4795
-
4796
- <title-completion-date lang="en">Completion date for this manuscript</title-completion-date>
4797
- <title-completion-date lang="zh">本稿完成日期</title-completion-date>
4798
-
4799
- <title-issuance-date lang="en">Issuance Date: #</title-issuance-date>
4800
- <title-issuance-date lang="zh"># 发布</title-issuance-date>
4801
-
4802
- <title-implementation-date lang="en">Implementation Date: #</title-implementation-date>
4803
- <title-implementation-date lang="zh"># 实施</title-implementation-date>
4804
-
4805
- <title-obligation-normative lang="en">normative</title-obligation-normative>
4806
- <title-obligation-normative lang="zh">规范性附录</title-obligation-normative>
4807
-
4808
- <title-caution lang="en">CAUTION</title-caution>
4809
- <title-caution lang="zh">注意</title-caution>
4810
-
4811
- <title-warning lang="en">WARNING</title-warning>
4812
- <title-warning lang="zh">警告</title-warning>
4813
-
4814
- <title-amendment lang="en">AMENDMENT</title-amendment>
4815
-
4816
4722
  <title-continued lang="en">(continued)</title-continued>
4817
4723
  <title-continued lang="fr">(continué)</title-continued>
4818
4724
 
4819
- </xsl:variable><xsl:variable name="bibdata">
4725
+ </xsl:variable><xsl:variable name="titles" select="xalan:nodeset($titles_)"/><xsl:variable name="bibdata">
4820
4726
  <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']"/>
4821
4727
  <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'localized-strings']"/>
4822
4728
  </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
@@ -4917,6 +4823,7 @@
4917
4823
 
4918
4824
 
4919
4825
 
4826
+
4920
4827
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
4921
4828
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
4922
4829
 
@@ -4925,7 +4832,9 @@
4925
4832
 
4926
4833
 
4927
4834
 
4835
+
4928
4836
  </xsl:attribute-set><xsl:attribute-set name="example-name-style">
4837
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
4929
4838
 
4930
4839
 
4931
4840
 
@@ -4960,6 +4869,7 @@
4960
4869
 
4961
4870
 
4962
4871
 
4872
+
4963
4873
  </xsl:attribute-set><xsl:attribute-set name="termexample-name-style">
4964
4874
 
4965
4875
 
@@ -5209,30 +5119,85 @@
5209
5119
 
5210
5120
  </xsl:attribute-set><xsl:attribute-set name="toc-style">
5211
5121
  <xsl:attribute name="line-height">135%</xsl:attribute>
5212
- </xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:template name="OLD_processPrefaceSectionsDefault_Contents">
5213
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
5214
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
5215
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
5216
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']" mode="contents"/>
5217
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']" mode="contents"/>
5218
- </xsl:template><xsl:template name="processPrefaceSectionsDefault_Contents">
5122
+ </xsl:attribute-set><xsl:attribute-set name="fn-style">
5123
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
5124
+ </xsl:attribute-set><xsl:attribute-set name="fn-num-style">
5125
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
5126
+
5127
+ <xsl:attribute name="font-size">65%</xsl:attribute>
5128
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
5129
+
5130
+
5131
+
5132
+
5133
+
5134
+
5135
+
5136
+
5137
+
5138
+
5139
+
5140
+
5141
+
5142
+
5143
+
5144
+
5145
+ </xsl:attribute-set><xsl:attribute-set name="fn-body-style">
5146
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
5147
+ <xsl:attribute name="font-style">normal</xsl:attribute>
5148
+ <xsl:attribute name="text-indent">0</xsl:attribute>
5149
+ <xsl:attribute name="start-indent">0</xsl:attribute>
5150
+
5151
+
5152
+ <xsl:attribute name="font-size">9pt</xsl:attribute>
5153
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
5154
+ <xsl:attribute name="line-height">124%</xsl:attribute>
5155
+ <xsl:attribute name="text-align">justify</xsl:attribute>
5156
+
5157
+
5158
+
5159
+
5160
+
5161
+
5162
+
5163
+
5164
+
5165
+
5166
+
5167
+
5168
+
5169
+
5170
+
5171
+
5172
+
5173
+ </xsl:attribute-set><xsl:attribute-set name="fn-body-num-style">
5174
+ <xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
5175
+
5176
+ <xsl:attribute name="font-size">60%</xsl:attribute>
5177
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
5178
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
5179
+
5180
+
5181
+
5182
+
5183
+
5184
+
5185
+
5186
+
5187
+
5188
+
5189
+
5190
+
5191
+
5192
+
5193
+
5194
+
5195
+
5196
+ </xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:variable name="ace_tag">ace-tag_</xsl:variable><xsl:template name="processPrefaceSectionsDefault_Contents">
5219
5197
  <xsl:for-each select="/*/*[local-name()='preface']/*">
5220
5198
  <xsl:sort select="@displayorder" data-type="number"/>
5221
5199
  <xsl:apply-templates select="." mode="contents"/>
5222
5200
  </xsl:for-each>
5223
- </xsl:template><xsl:template name="OLD_processMainSectionsDefault_Contents">
5224
- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
5225
-
5226
- <!-- Normative references -->
5227
- <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true'] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][@normative='true']]" mode="contents"/>
5228
- <!-- Terms and definitions -->
5229
- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='terms'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='terms']] | /*/*[local-name()='sections']/*[local-name()='definitions'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='definitions']]" mode="contents"/>
5230
- <!-- Another main sections -->
5231
- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name() != 'terms' and local-name() != 'definitions' and not(@type='scope') and not(local-name() = 'clause' and .//*[local-name()='terms']) and not(local-name() = 'clause' and .//*[local-name()='definitions'])]" mode="contents"/>
5232
- <xsl:apply-templates select="/*/*[local-name()='annex']" mode="contents"/>
5233
- <!-- Bibliography -->
5234
- <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]" mode="contents"/>
5235
-
5236
5201
  </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
5237
5202
 
5238
5203
  <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true'] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][@normative='true']]">
@@ -5249,29 +5214,11 @@
5249
5214
  <xsl:sort select="@displayorder" data-type="number"/>
5250
5215
  <xsl:apply-templates select="." mode="contents"/>
5251
5216
  </xsl:for-each>
5252
- </xsl:template><xsl:template name="OLD_processPrefaceSectionsDefault">
5253
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
5254
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
5255
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']"/>
5256
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']"/>
5257
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']"/>
5258
5217
  </xsl:template><xsl:template name="processPrefaceSectionsDefault">
5259
5218
  <xsl:for-each select="/*/*[local-name()='preface']/*">
5260
5219
  <xsl:sort select="@displayorder" data-type="number"/>
5261
5220
  <xsl:apply-templates select="."/>
5262
5221
  </xsl:for-each>
5263
- </xsl:template><xsl:template name="OLD_processMainSectionsDefault">
5264
- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']"/>
5265
-
5266
- <!-- Normative references -->
5267
- <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']"/>
5268
- <!-- Terms and definitions -->
5269
- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='terms'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='terms']] | /*/*[local-name()='sections']/*[local-name()='definitions'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='definitions']]"/>
5270
- <!-- Another main sections -->
5271
- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name() != 'terms' and local-name() != 'definitions' and not(@type='scope') and not(local-name() = 'clause' and .//*[local-name()='terms']) and not(local-name() = 'clause' and .//*[local-name()='definitions'])]"/>
5272
- <xsl:apply-templates select="/*/*[local-name()='annex']"/>
5273
- <!-- Bibliography -->
5274
- <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]"/>
5275
5222
  </xsl:template><xsl:template name="processMainSectionsDefault">
5276
5223
  <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
5277
5224
  <xsl:sort select="@displayorder" data-type="number"/>
@@ -5316,35 +5263,15 @@
5316
5263
  <!-- Display table's name before table as standalone block -->
5317
5264
  <!-- $namespace = 'iso' or -->
5318
5265
 
5319
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
5320
-
5321
-
5322
-
5323
-
5266
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
5267
+
5324
5268
 
5325
- <xsl:call-template name="fn_name_display"/>
5326
5269
 
5270
+ <xsl:call-template name="fn_name_display"/>
5327
5271
 
5328
5272
 
5329
5273
  <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)/*/tr[1]/td)"/>
5330
5274
 
5331
- <!-- <xsl:variable name="cols-count">
5332
- <xsl:choose>
5333
- <xsl:when test="*[local-name()='thead']">
5334
- <xsl:call-template name="calculate-columns-numbers">
5335
- <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
5336
- </xsl:call-template>
5337
- </xsl:when>
5338
- <xsl:otherwise>
5339
- <xsl:call-template name="calculate-columns-numbers">
5340
- <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
5341
- </xsl:call-template>
5342
- </xsl:otherwise>
5343
- </xsl:choose>
5344
- </xsl:variable> -->
5345
- <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
5346
- <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
5347
-
5348
5275
  <xsl:variable name="colwidths">
5349
5276
  <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
5350
5277
  <xsl:call-template name="calculate-column-widths">
@@ -5355,15 +5282,6 @@
5355
5282
  </xsl:variable>
5356
5283
  <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
5357
5284
 
5358
- <!-- <xsl:variable name="colwidths2">
5359
- <xsl:call-template name="calculate-column-widths">
5360
- <xsl:with-param name="cols-count" select="$cols-count"/>
5361
- </xsl:call-template>
5362
- </xsl:variable> -->
5363
-
5364
- <!-- cols-count=<xsl:copy-of select="$cols-count"/>
5365
- colwidthsNew=<xsl:copy-of select="$colwidths"/>
5366
- colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
5367
5285
 
5368
5286
  <xsl:variable name="margin-left">
5369
5287
  <xsl:choose>
@@ -5506,25 +5424,6 @@
5506
5424
  </xsl:call-template>
5507
5425
  </xsl:for-each>
5508
5426
 
5509
- <!-- insert footer as table -->
5510
- <!-- <fo:table>
5511
- <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
5512
- <xsl:attribute name="{@name}">
5513
- <xsl:value-of select="."/>
5514
- </xsl:attribute>
5515
- </xsl:for-each>
5516
-
5517
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
5518
- <xsl:choose>
5519
- <xsl:when test=". = 1 or . = 0">
5520
- <fo:table-column column-width="proportional-column-width(2)"/>
5521
- </xsl:when>
5522
- <xsl:otherwise>
5523
- <fo:table-column column-width="proportional-column-width({.})"/>
5524
- </xsl:otherwise>
5525
- </xsl:choose>
5526
- </xsl:for-each>
5527
- </fo:table>-->
5528
5427
 
5529
5428
 
5530
5429
 
@@ -5600,7 +5499,6 @@
5600
5499
 
5601
5500
  <xsl:choose>
5602
5501
  <xsl:when test="$continued = 'true'">
5603
- <!-- <xsl:if test="$namespace = 'bsi'"></xsl:if> -->
5604
5502
 
5605
5503
  </xsl:when>
5606
5504
  <xsl:otherwise>
@@ -5663,13 +5561,6 @@
5663
5561
  <xsl:for-each select="xalan:nodeset($table)/*/tr">
5664
5562
  <xsl:variable name="td_text">
5665
5563
  <xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
5666
-
5667
- <!-- <xsl:if test="$namespace = 'bipm'">
5668
- <xsl:for-each select="*[local-name()='td'][$curr-col]//*[local-name()='math']">
5669
- <word><xsl:value-of select="normalize-space(.)"/></word>
5670
- </xsl:for-each>
5671
- </xsl:if> -->
5672
-
5673
5564
  </xsl:variable>
5674
5565
  <xsl:variable name="words">
5675
5566
  <xsl:variable name="string_with_added_zerospaces">
@@ -5760,7 +5651,6 @@
5760
5651
 
5761
5652
 
5762
5653
 
5763
-
5764
5654
  </fo:table-cell>
5765
5655
  </fo:table-row>
5766
5656
  </xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
@@ -5776,66 +5666,6 @@
5776
5666
  <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/>
5777
5667
  </fo:table-footer>
5778
5668
  </xsl:if>
5779
- </xsl:template><xsl:template name="insertTableFooter2">
5780
- <xsl:param name="cols-count"/>
5781
- <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
5782
- <xsl:if test="../*[local-name()='tfoot'] or $isNoteOrFnExist = 'true'">
5783
-
5784
- <fo:table-footer>
5785
-
5786
- <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/>
5787
-
5788
- <!-- if there are note(s) or fn(s) then create footer row -->
5789
- <xsl:if test="$isNoteOrFnExist = 'true'">
5790
-
5791
-
5792
-
5793
- <fo:table-row>
5794
- <fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
5795
-
5796
-
5797
-
5798
- <!-- fn will be processed inside 'note' processing -->
5799
-
5800
-
5801
-
5802
- <xsl:attribute name="border">solid black 0pt</xsl:attribute>
5803
-
5804
-
5805
-
5806
-
5807
- <!-- except gb -->
5808
-
5809
- <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
5810
-
5811
-
5812
- <!-- show Note under table in preface (ex. abstract) sections -->
5813
- <!-- empty, because notes show at page side in main sections -->
5814
- <!-- <xsl:if test="$namespace = 'bipm'">
5815
- <xsl:choose>
5816
- <xsl:when test="ancestor::*[local-name()='preface']">
5817
- <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
5818
- </xsl:when>
5819
- <xsl:otherwise>
5820
- <fo:block/>
5821
- </xsl:otherwise>
5822
- </xsl:choose>
5823
- </xsl:if> -->
5824
-
5825
-
5826
- <!-- horizontal row separator -->
5827
-
5828
-
5829
- <!-- fn processing -->
5830
- <xsl:call-template name="fn_display"/>
5831
-
5832
- </fo:table-cell>
5833
- </fo:table-row>
5834
-
5835
- </xsl:if>
5836
- </fo:table-footer>
5837
-
5838
- </xsl:if>
5839
5669
  </xsl:template><xsl:template name="insertTableFooterInSeparateTable">
5840
5670
  <xsl:param name="table_attributes"/>
5841
5671
  <xsl:param name="colwidths"/>
@@ -5930,23 +5760,10 @@
5930
5760
  <!-- for BSI (not PAS) display Notes before footnotes -->
5931
5761
 
5932
5762
 
5933
- <!-- except gb -->
5763
+ <!-- except gb and bsi -->
5934
5764
 
5935
- <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
5936
-
5937
-
5938
- <!-- <xsl:if test="$namespace = 'bipm'">
5939
- <xsl:choose>
5940
- <xsl:when test="ancestor::*[local-name()='preface']">
5941
- show Note under table in preface (ex. abstract) sections
5942
- <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
5943
- </xsl:when>
5944
- <xsl:otherwise>
5945
- empty, because notes show at page side in main sections
5946
- <fo:block/>
5947
- </xsl:otherwise>
5948
- </xsl:choose>
5949
- </xsl:if> -->
5765
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
5766
+
5950
5767
 
5951
5768
 
5952
5769
  <!-- horizontal row separator -->
@@ -5955,7 +5772,6 @@
5955
5772
  <!-- fn processing -->
5956
5773
  <xsl:call-template name="fn_display"/>
5957
5774
 
5958
-
5959
5775
  <!-- for PAS display Notes after footnotes -->
5960
5776
 
5961
5777
 
@@ -5996,8 +5812,7 @@
5996
5812
 
5997
5813
 
5998
5814
  <xsl:apply-templates/>
5999
- <!-- <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/> -->
6000
-
5815
+
6001
5816
  </fo:table-body>
6002
5817
 
6003
5818
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/text()[1]" priority="2" mode="presentation_name">
@@ -6015,7 +5830,7 @@
6015
5830
  <xsl:apply-templates select="."/>
6016
5831
  </xsl:template><xsl:template match="*[local-name()='tr']">
6017
5832
  <xsl:variable name="parent-name" select="local-name(..)"/>
6018
- <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
5833
+
6019
5834
  <fo:table-row min-height="4mm">
6020
5835
  <xsl:if test="$parent-name = 'thead'">
6021
5836
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -6050,10 +5865,6 @@
6050
5865
 
6051
5866
 
6052
5867
 
6053
- <!-- <xsl:if test="$namespace = 'bipm'">
6054
- <xsl:attribute name="height">8mm</xsl:attribute>
6055
- </xsl:if> -->
6056
-
6057
5868
  <xsl:apply-templates/>
6058
5869
  </fo:table-row>
6059
5870
  </xsl:template><xsl:template match="*[local-name()='th']">
@@ -6062,7 +5873,6 @@
6062
5873
  <xsl:choose>
6063
5874
  <xsl:when test="@align">
6064
5875
  <xsl:call-template name="setAlignment"/>
6065
- <!-- <xsl:value-of select="@align"/> -->
6066
5876
  </xsl:when>
6067
5877
  <xsl:otherwise>center</xsl:otherwise>
6068
5878
  </xsl:choose>
@@ -6137,7 +5947,6 @@
6137
5947
  <xsl:choose>
6138
5948
  <xsl:when test="@align">
6139
5949
  <xsl:call-template name="setAlignment"/>
6140
- <!-- <xsl:value-of select="@align"/> -->
6141
5950
  </xsl:when>
6142
5951
  <xsl:otherwise>left</xsl:otherwise>
6143
5952
  </xsl:choose>
@@ -6247,20 +6056,116 @@
6247
6056
 
6248
6057
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='name']" mode="process"/><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" mode="process">
6249
6058
  <xsl:apply-templates/>
6250
- </xsl:template><xsl:template name="fn_display">
6251
- <xsl:variable name="references">
6252
-
6253
- <xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']">
6254
- <xsl:call-template name="create_fn"/>
6255
- </xsl:for-each>
6059
+ </xsl:template><xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" priority="2" name="fn">
6060
+
6061
+ <!-- list of footnotes to calculate actual footnotes number -->
6062
+ <xsl:variable name="p_fn_">
6063
+ <xsl:choose>
6064
+ <xsl:when test="@current_fn_number"> <!-- for BSI, footnote reference number calculated already -->
6065
+ <fn gen_id="{generate-id(.)}">
6066
+ <xsl:copy-of select="@*"/>
6067
+ <xsl:copy-of select="node()"/>
6068
+ </fn>
6069
+ </xsl:when>
6070
+ <xsl:otherwise>
6071
+ <!-- itetation for:
6072
+ footnotes in bibdata/title
6073
+ footnotes in bibliography
6074
+ footnotes in document's body (except table's head/body/foot and figure text)
6075
+ -->
6076
+ <xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']/*[local-name() = 'note'][@type='title-footnote']">
6077
+ <fn gen_id="{generate-id(.)}">
6078
+ <xsl:copy-of select="@*"/>
6079
+ <xsl:copy-of select="node()"/>
6080
+ </fn>
6081
+ </xsl:for-each>
6082
+ <xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='preface']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='sections']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='annex'] | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibliography']/*">
6083
+ <xsl:sort select="@displayorder" data-type="number"/>
6084
+ <xsl:for-each select=".//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] | .//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
6085
+ <!-- copy unique fn -->
6086
+ <fn gen_id="{generate-id(.)}">
6087
+ <xsl:copy-of select="@*"/>
6088
+ <xsl:copy-of select="node()"/>
6089
+ </fn>
6090
+ </xsl:for-each>
6091
+ </xsl:for-each>
6092
+ </xsl:otherwise>
6093
+ </xsl:choose>
6256
6094
  </xsl:variable>
6095
+ <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
6257
6096
 
6258
- <xsl:for-each select="xalan:nodeset($references)//fn">
6259
- <xsl:variable name="reference" select="@reference"/>
6260
- <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
6261
- <fo:block margin-bottom="12pt">
6262
-
6263
-
6097
+ <xsl:variable name="gen_id" select="generate-id(.)"/>
6098
+ <xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
6099
+ <xsl:variable name="reference" select="@reference"/>
6100
+ <!-- fn sequence number in document -->
6101
+ <xsl:variable name="current_fn_number">
6102
+ <xsl:choose>
6103
+ <xsl:when test="@current_fn_number"><xsl:value-of select="@current_fn_number"/></xsl:when> <!-- for BSI -->
6104
+ <xsl:otherwise>
6105
+ <xsl:value-of select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1"/>
6106
+ </xsl:otherwise>
6107
+ </xsl:choose>
6108
+ </xsl:variable>
6109
+ <xsl:variable name="current_fn_number_text">
6110
+ <xsl:value-of select="$current_fn_number"/>
6111
+
6112
+
6113
+ </xsl:variable>
6114
+
6115
+ <xsl:variable name="ref_id" select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
6116
+ <xsl:variable name="footnote_inline">
6117
+ <fo:inline xsl:use-attribute-sets="fn-num-style">
6118
+
6119
+ <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
6120
+ <xsl:value-of select="$current_fn_number_text"/>
6121
+ </fo:basic-link>
6122
+ </fo:inline>
6123
+ </xsl:variable>
6124
+ <!-- DEBUG: p_fn=<xsl:copy-of select="$p_fn"/>
6125
+ gen_id=<xsl:value-of select="$gen_id"/> -->
6126
+ <xsl:choose>
6127
+ <xsl:when test="normalize-space(@skip_footnote_body) = 'true'">
6128
+ <xsl:copy-of select="$footnote_inline"/>
6129
+ </xsl:when>
6130
+ <xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false'">
6131
+ <fo:footnote xsl:use-attribute-sets="fn-style">
6132
+ <xsl:copy-of select="$footnote_inline"/>
6133
+ <fo:footnote-body>
6134
+
6135
+ <fo:block-container text-indent="0" start-indent="0">
6136
+
6137
+
6138
+ <fo:block xsl:use-attribute-sets="fn-body-style">
6139
+
6140
+
6141
+ <fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style">
6142
+
6143
+ <xsl:value-of select="$current_fn_number_text"/>
6144
+ </fo:inline>
6145
+ <xsl:apply-templates/>
6146
+ </fo:block>
6147
+ </fo:block-container>
6148
+ </fo:footnote-body>
6149
+ </fo:footnote>
6150
+ </xsl:when>
6151
+ <xsl:otherwise>
6152
+ <xsl:copy-of select="$footnote_inline"/>
6153
+ </xsl:otherwise>
6154
+ </xsl:choose>
6155
+ </xsl:template><xsl:template name="fn_display">
6156
+ <xsl:variable name="references">
6157
+
6158
+ <xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']">
6159
+ <xsl:call-template name="create_fn"/>
6160
+ </xsl:for-each>
6161
+ </xsl:variable>
6162
+
6163
+ <xsl:for-each select="xalan:nodeset($references)//fn">
6164
+ <xsl:variable name="reference" select="@reference"/>
6165
+ <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
6166
+ <fo:block margin-bottom="12pt">
6167
+
6168
+
6264
6169
 
6265
6170
 
6266
6171
 
@@ -6294,7 +6199,6 @@
6294
6199
  </fo:inline>
6295
6200
  <fo:inline>
6296
6201
 
6297
- <!-- <xsl:apply-templates /> -->
6298
6202
  <xsl:copy-of select="./node()"/>
6299
6203
  </fo:inline>
6300
6204
  </fo:block>
@@ -6307,14 +6211,6 @@
6307
6211
  <xsl:apply-templates/>
6308
6212
  </fn>
6309
6213
  </xsl:template><xsl:template name="fn_name_display">
6310
- <!-- <xsl:variable name="references">
6311
- <xsl:for-each select="*[local-name()='name']//*[local-name()='fn']">
6312
- <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
6313
- <xsl:apply-templates />
6314
- </fn>
6315
- </xsl:for-each>
6316
- </xsl:variable>
6317
- $references=<xsl:copy-of select="$references"/> -->
6318
6214
  <xsl:for-each select="*[local-name()='name']//*[local-name()='fn']">
6319
6215
  <xsl:variable name="reference" select="@reference"/>
6320
6216
  <fo:block id="{@reference}_{ancestor::*[@id][1]/@id}"><xsl:value-of select="@reference"/></fo:block>
@@ -6351,14 +6247,12 @@
6351
6247
  </xsl:otherwise>
6352
6248
  </xsl:choose>
6353
6249
  </xsl:variable>
6354
- <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
6355
- <!-- <xsl:element name="{$ns}:table"> -->
6356
- <xsl:for-each select="*[local-name() = 'dl'][1]">
6357
- <tbody>
6358
- <xsl:apply-templates mode="dl"/>
6359
- </tbody>
6360
- </xsl:for-each>
6361
- <!-- </xsl:element> -->
6250
+
6251
+ <xsl:for-each select="*[local-name() = 'dl'][1]">
6252
+ <tbody>
6253
+ <xsl:apply-templates mode="dl"/>
6254
+ </tbody>
6255
+ </xsl:for-each>
6362
6256
  </xsl:variable>
6363
6257
 
6364
6258
  <xsl:call-template name="calculate-column-widths">
@@ -6429,7 +6323,6 @@
6429
6323
  </xsl:if>
6430
6324
 
6431
6325
  </xsl:template><xsl:template match="*[local-name()='fn']">
6432
- <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
6433
6326
  <fo:inline font-size="80%" keep-with-previous.within-line="always">
6434
6327
 
6435
6328
 
@@ -6457,6 +6350,8 @@
6457
6350
 
6458
6351
  </fo:basic-link>
6459
6352
  </fo:inline>
6353
+ </xsl:template><xsl:template match="*[local-name()='fn']/text()[normalize-space() != '']">
6354
+ <fo:inline><xsl:value-of select="."/></fo:inline>
6460
6355
  </xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
6461
6356
  <fo:inline>
6462
6357
  <xsl:apply-templates/>
@@ -6466,13 +6361,13 @@
6466
6361
  <xsl:variable name="isDeleted" select="@deleted"/>
6467
6362
  <fo:block-container>
6468
6363
 
6469
-
6470
- <xsl:if test="not(ancestor::*[local-name() = 'li'])">
6471
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
6472
- </xsl:if>
6473
- <xsl:if test="ancestor::*[local-name() = 'li']">
6474
- <xsl:attribute name="margin-left">6.5mm</xsl:attribute><!-- 8 mm -->
6475
- </xsl:if>
6364
+ <xsl:if test="not(ancestor::*[local-name() = 'li'])">
6365
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
6366
+ </xsl:if>
6367
+ <xsl:if test="ancestor::*[local-name() = 'li']">
6368
+ <xsl:attribute name="margin-left">6.5mm</xsl:attribute><!-- 8 mm -->
6369
+ </xsl:if>
6370
+
6476
6371
 
6477
6372
  <xsl:if test="parent::*[local-name() = 'note']">
6478
6373
  <xsl:attribute name="margin-left">
@@ -6491,10 +6386,8 @@
6491
6386
 
6492
6387
  <fo:block-container>
6493
6388
 
6494
-
6495
- <!-- <xsl:if test="not(ancestor::*[local-name() = 'li'])"> -->
6496
6389
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
6497
- <!-- </xsl:if> -->
6390
+
6498
6391
 
6499
6392
  <xsl:variable name="parent" select="local-name(..)"/>
6500
6393
 
@@ -6505,23 +6398,19 @@
6505
6398
  <xsl:choose>
6506
6399
  <xsl:when test="$parent = 'formula' and count(*[local-name()='dt']) = 1"> <!-- only one component -->
6507
6400
 
6508
-
6509
- <fo:block margin-bottom="12pt" text-align="left">
6510
-
6511
- <xsl:variable name="title-where">
6401
+ <fo:block margin-bottom="12pt" text-align="left">
6512
6402
 
6513
-
6514
- <xsl:call-template name="getTitle">
6515
- <xsl:with-param name="name" select="'title-where'"/>
6403
+ <xsl:variable name="title-where">
6404
+ <xsl:call-template name="getLocalizedString">
6405
+ <xsl:with-param name="key">where</xsl:with-param>
6516
6406
  </xsl:call-template>
6517
-
6518
- </xsl:variable>
6519
- <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
6520
- <xsl:apply-templates select="*[local-name()='dt']/*"/>
6521
- <xsl:text/>
6522
- <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
6523
- </fo:block>
6524
-
6407
+ </xsl:variable>
6408
+ <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
6409
+ <xsl:apply-templates select="*[local-name()='dt']/*"/>
6410
+ <xsl:text/>
6411
+ <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
6412
+ </fo:block>
6413
+
6525
6414
  </xsl:when>
6526
6415
  <xsl:when test="$parent = 'formula'"> <!-- a few components -->
6527
6416
  <fo:block margin-bottom="12pt" text-align="left">
@@ -6530,12 +6419,9 @@
6530
6419
 
6531
6420
 
6532
6421
  <xsl:variable name="title-where">
6533
-
6534
-
6535
- <xsl:call-template name="getTitle">
6536
- <xsl:with-param name="name" select="'title-where'"/>
6537
- </xsl:call-template>
6538
-
6422
+ <xsl:call-template name="getLocalizedString">
6423
+ <xsl:with-param name="key">where</xsl:with-param>
6424
+ </xsl:call-template>
6539
6425
  </xsl:variable>
6540
6426
  <xsl:value-of select="$title-where"/>
6541
6427
  </fo:block>
@@ -6547,12 +6433,9 @@
6547
6433
 
6548
6434
 
6549
6435
  <xsl:variable name="title-key">
6550
-
6551
-
6552
- <xsl:call-template name="getTitle">
6553
- <xsl:with-param name="name" select="'title-key'"/>
6554
- </xsl:call-template>
6555
-
6436
+ <xsl:call-template name="getLocalizedString">
6437
+ <xsl:with-param name="key">key</xsl:with-param>
6438
+ </xsl:call-template>
6556
6439
  </xsl:variable>
6557
6440
  <xsl:value-of select="$title-key"/>
6558
6441
  </fo:block>
@@ -6574,9 +6457,7 @@
6574
6457
  <fo:table width="95%" table-layout="fixed">
6575
6458
 
6576
6459
  <xsl:choose>
6577
- <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'">
6578
- <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
6579
- </xsl:when>
6460
+ <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'"/>
6580
6461
  <xsl:when test="normalize-space($key_iso) = 'true'">
6581
6462
  <xsl:attribute name="font-size">10pt</xsl:attribute>
6582
6463
 
@@ -6597,12 +6478,9 @@
6597
6478
  </xsl:otherwise>
6598
6479
  </xsl:choose>
6599
6480
  </xsl:variable>
6600
- <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
6601
- <!-- <xsl:element name="{$ns}:table"> -->
6602
- <tbody>
6603
- <xsl:apply-templates mode="dl"/>
6604
- </tbody>
6605
- <!-- </xsl:element> -->
6481
+ <tbody>
6482
+ <xsl:apply-templates mode="dl"/>
6483
+ </tbody>
6606
6484
  </xsl:variable>
6607
6485
  <!-- html-table<xsl:copy-of select="$html-table"/> -->
6608
6486
  <xsl:variable name="colwidths">
@@ -6682,8 +6560,6 @@
6682
6560
  </xsl:for-each>
6683
6561
  </xsl:otherwise>
6684
6562
  </xsl:choose>
6685
- <!-- <fo:table-column column-width="15%"/>
6686
- <fo:table-column column-width="85%"/> -->
6687
6563
  </xsl:otherwise>
6688
6564
  </xsl:choose>
6689
6565
  </xsl:template><xsl:template name="getMaxLength_dt">
@@ -6698,12 +6574,6 @@
6698
6574
  </xsl:for-each>
6699
6575
  </xsl:variable>
6700
6576
  <xsl:variable name="maxLength">
6701
- <!-- <xsl:for-each select="*[local-name()='dt']">
6702
- <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
6703
- <xsl:if test="position() = 1">
6704
- <xsl:value-of select="string-length(normalize-space(.))"/>
6705
- </xsl:if>
6706
- </xsl:for-each> -->
6707
6577
  <xsl:for-each select="xalan:nodeset($lengths)/length">
6708
6578
  <xsl:sort select="." data-type="number" order="descending"/>
6709
6579
  <xsl:if test="position() = 1">
@@ -6745,9 +6615,8 @@
6745
6615
  </td>
6746
6616
  <td>
6747
6617
 
6748
-
6749
- <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
6750
-
6618
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
6619
+
6751
6620
  </td>
6752
6621
  </tr>
6753
6622
 
@@ -6778,49 +6647,20 @@
6778
6647
 
6779
6648
 
6780
6649
  <xsl:apply-templates/>
6781
- <!-- <xsl:if test="$namespace = 'gb'">
6782
- <xsl:if test="ancestor::*[local-name()='formula']">
6783
- <xsl:text>—</xsl:text>
6784
- </xsl:if>
6785
- </xsl:if> -->
6786
6650
  </fo:block>
6787
6651
  </fo:table-cell>
6788
6652
  <fo:table-cell>
6789
6653
  <fo:block>
6790
6654
 
6791
- <!-- <xsl:if test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'">
6792
- <xsl:if test="local-name(*[1]) != 'stem'">
6793
- <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
6794
- </xsl:if>
6795
- </xsl:if> -->
6796
-
6797
- <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
6798
-
6655
+
6656
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
6799
6657
  </fo:block>
6800
6658
  </fo:table-cell>
6801
6659
  </fo:table-row>
6802
- <!-- <xsl:if test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'">
6803
- <xsl:if test="local-name(*[1]) = 'stem'">
6804
- <fo:table-row>
6805
- <fo:table-cell>
6806
- <fo:block margin-top="6pt">
6807
- <xsl:if test="normalize-space($key_iso) = 'true'">
6808
- <xsl:attribute name="margin-top">0</xsl:attribute>
6809
- </xsl:if>
6810
- <xsl:text>&#xA0;</xsl:text>
6811
- </fo:block>
6812
- </fo:table-cell>
6813
- <fo:table-cell>
6814
- <fo:block>
6815
- <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
6816
- </fo:block>
6817
- </fo:table-cell>
6818
- </fo:table-row>
6819
- </xsl:if>
6820
- </xsl:if> -->
6821
6660
  </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process">
6822
6661
  <xsl:apply-templates/>
6823
6662
  </xsl:template><xsl:template match="*[local-name()='dd']"/><xsl:template match="*[local-name()='dd']" mode="process">
6663
+ <xsl:apply-templates select="@language"/>
6824
6664
  <xsl:apply-templates/>
6825
6665
  </xsl:template><xsl:template match="*[local-name()='dd']/*[local-name()='p']" mode="inline">
6826
6666
  <fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
@@ -6882,6 +6722,15 @@
6882
6722
  </fo:inline>
6883
6723
  </xsl:template><xsl:template match="*[local-name()='add']">
6884
6724
  <xsl:choose>
6725
+ <xsl:when test="starts-with(., $ace_tag)"> <!-- examples: ace-tag_A1_start, ace-tag_A2_end, C1_start, AC_start -->
6726
+ <fo:inline>
6727
+ <xsl:call-template name="insertTag">
6728
+ <xsl:with-param name="type" select="substring-after(substring-after(., $ace_tag), '_')"/> <!-- start or end -->
6729
+ <xsl:with-param name="kind" select="substring(substring-before(substring-after(., $ace_tag), '_'), 1, 1)"/> <!-- A or C -->
6730
+ <xsl:with-param name="value" select="substring(substring-before(substring-after(., $ace_tag), '_'), 2)"/> <!-- 1, 2, C -->
6731
+ </xsl:call-template>
6732
+ </fo:inline>
6733
+ </xsl:when>
6885
6734
  <xsl:when test="@amendment">
6886
6735
  <fo:inline>
6887
6736
  <xsl:call-template name="insertTag">
@@ -6916,7 +6765,6 @@
6916
6765
  </fo:inline>
6917
6766
  </xsl:otherwise>
6918
6767
  </xsl:choose>
6919
-
6920
6768
  </xsl:template><xsl:template name="insertTag">
6921
6769
  <xsl:param name="type"/>
6922
6770
  <xsl:param name="kind"/>
@@ -6924,22 +6772,20 @@
6924
6772
  <xsl:variable name="add_width" select="string-length($value) * 20"/>
6925
6773
  <xsl:variable name="maxwidth" select="60 + $add_width"/>
6926
6774
  <fo:instream-foreign-object fox:alt-text="OpeningTag" baseline-shift="-20%"><!-- alignment-baseline="middle" -->
6927
- <!-- <xsl:attribute name="width">7mm</xsl:attribute>
6928
- <xsl:attribute name="content-height">100%</xsl:attribute> -->
6929
6775
  <xsl:attribute name="height">5mm</xsl:attribute>
6930
6776
  <xsl:attribute name="content-width">100%</xsl:attribute>
6931
6777
  <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
6932
6778
  <xsl:attribute name="scaling">uniform</xsl:attribute>
6933
6779
  <svg xmlns="http://www.w3.org/2000/svg" width="{$maxwidth + 32}" height="80">
6934
6780
  <g>
6935
- <xsl:if test="$type = 'closing'">
6781
+ <xsl:if test="$type = 'closing' or $type = 'end'">
6936
6782
  <xsl:attribute name="transform">scale(-1 1) translate(-<xsl:value-of select="$maxwidth + 32"/>,0)</xsl:attribute>
6937
6783
  </xsl:if>
6938
6784
  <polyline points="0,0 {$maxwidth},0 {$maxwidth + 30},40 {$maxwidth},80 0,80 " stroke="black" stroke-width="5" fill="white"/>
6939
6785
  <line x1="0" y1="0" x2="0" y2="80" stroke="black" stroke-width="20"/>
6940
6786
  </g>
6941
6787
  <text font-family="Arial" x="15" y="57" font-size="40pt">
6942
- <xsl:if test="$type = 'closing'">
6788
+ <xsl:if test="$type = 'closing' or $type = 'end'">
6943
6789
  <xsl:attribute name="x">25</xsl:attribute>
6944
6790
  </xsl:if>
6945
6791
  <xsl:value-of select="$kind"/><tspan dy="10" font-size="30pt"><xsl:value-of select="$value"/></tspan>
@@ -7143,14 +6989,6 @@
7143
6989
 
7144
6990
  <xsl:copy-of select="xalan:nodeset($simple-table-rowspan)"/>
7145
6991
 
7146
- <!-- <xsl:choose>
7147
- <xsl:when test="current()//*[local-name()='th'][@colspan] or current()//*[local-name()='td'][@colspan] ">
7148
-
7149
- </xsl:when>
7150
- <xsl:otherwise>
7151
- <xsl:copy-of select="current()"/>
7152
- </xsl:otherwise>
7153
- </xsl:choose> -->
7154
6992
  </xsl:variable>
7155
6993
  <xsl:copy-of select="$simple-table"/>
7156
6994
  </xsl:template><xsl:template match="*[local-name()='thead'] | *[local-name()='tbody']" mode="simple-table-colspan">
@@ -7269,8 +7107,6 @@
7269
7107
  <xsl:choose>
7270
7108
  <xsl:when test="contains($str2, ' ')">
7271
7109
  <xsl:variable name="substr" select="substring-before($str2, ' ')"/>
7272
- <!-- <xsl:value-of select="translate(substring($substr, 1, 1), $lower, $upper)"/>
7273
- <xsl:value-of select="substring($substr, 2)"/> -->
7274
7110
  <xsl:call-template name="capitalize">
7275
7111
  <xsl:with-param name="str" select="$substr"/>
7276
7112
  </xsl:call-template>
@@ -7280,8 +7116,6 @@
7280
7116
  </xsl:call-template>
7281
7117
  </xsl:when>
7282
7118
  <xsl:otherwise>
7283
- <!-- <xsl:value-of select="translate(substring($str2, 1, 1), $lower, $upper)"/>
7284
- <xsl:value-of select="substring($str2, 2)"/> -->
7285
7119
  <xsl:call-template name="capitalize">
7286
7120
  <xsl:with-param name="str" select="$str2"/>
7287
7121
  </xsl:call-template>
@@ -7328,12 +7162,10 @@
7328
7162
  <xsl:if test="$add_math_as_text = 'true'">
7329
7163
  <!-- <xsl:variable name="comment_text" select="following-sibling::node()[1][self::comment()]"/> -->
7330
7164
  <xsl:variable name="comment_text" select="normalize-space(translate(.,' ⁢',' '))"/>
7331
- <!-- <xsl:variable name="comment_text" select="normalize-space(.)"/> -->
7332
7165
  <xsl:if test="normalize-space($comment_text) != ''">
7333
7166
  <!-- put Mathin Alternate Text -->
7334
7167
  <xsl:attribute name="fox:alt-text">
7335
7168
  <xsl:value-of select="java:org.metanorma.fop.Util.unescape($comment_text)"/>
7336
- <!-- <xsl:value-of select="$comment_text"/> -->
7337
7169
  </xsl:attribute>
7338
7170
  </xsl:if>
7339
7171
  </xsl:if>
@@ -7368,7 +7200,6 @@
7368
7200
  </xsl:attribute>
7369
7201
 
7370
7202
 
7371
- <!-- <xsl:copy-of select="."/> -->
7372
7203
  <xsl:copy-of select="xalan:nodeset($mathml)"/>
7373
7204
  </fo:instream-foreign-object>
7374
7205
  </fo:inline>
@@ -7460,9 +7291,9 @@
7460
7291
  <fo:inline role="H{$level}"><xsl:apply-templates/></fo:inline>
7461
7292
  </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
7462
7293
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
7463
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
7294
+ <xsl:apply-templates select="*[local-name()='name']"/>
7464
7295
  </fo:block>
7465
- <xsl:apply-templates/>
7296
+ <xsl:apply-templates select="node()[not(local-name()='name')]"/>
7466
7297
  </xsl:template><xsl:template match="*[local-name() = 'callout']">
7467
7298
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link>
7468
7299
  </xsl:template><xsl:template match="*[local-name() = 'annotation']">
@@ -7482,22 +7313,6 @@
7482
7313
  <xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
7483
7314
  <xsl:apply-templates/>
7484
7315
  </fo:inline>
7485
- </xsl:template><xsl:template match="*[local-name() = 'modification']">
7486
- <xsl:variable name="title-modified">
7487
-
7488
-
7489
- <xsl:call-template name="getTitle">
7490
- <xsl:with-param name="name" select="'title-modified'"/>
7491
- </xsl:call-template>
7492
-
7493
- </xsl:variable>
7494
-
7495
- <xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
7496
- <xsl:choose>
7497
- <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text>—</xsl:text></xsl:if></xsl:when>
7498
- <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text> — </xsl:text></xsl:if></xsl:otherwise>
7499
- </xsl:choose>
7500
- <xsl:apply-templates/>
7501
7316
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
7502
7317
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
7503
7318
 
@@ -7546,36 +7361,33 @@
7546
7361
  </xsl:if>
7547
7362
 
7548
7363
  <fo:block-container margin-left="0mm">
7364
+
7549
7365
 
7550
7366
 
7551
7367
 
7368
+
7552
7369
 
7553
-
7554
-
7555
-
7556
-
7557
- <fo:block>
7558
-
7559
-
7560
-
7561
-
7562
- <xsl:if test="@parent-type = 'quote'">
7563
- <xsl:attribute name="font-family">Arial</xsl:attribute>
7564
- <xsl:attribute name="font-size">9pt</xsl:attribute>
7565
- <xsl:attribute name="line-height">130%</xsl:attribute>
7566
- <xsl:attribute name="text-align">justify</xsl:attribute>
7567
- </xsl:if>
7568
-
7569
-
7570
-
7571
- <fo:inline xsl:use-attribute-sets="note-name-style">
7370
+ <fo:block>
7572
7371
 
7573
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
7574
- </fo:inline>
7575
- <xsl:apply-templates/>
7576
- </fo:block>
7577
-
7578
-
7372
+
7373
+
7374
+
7375
+ <xsl:if test="@parent-type = 'quote'">
7376
+ <xsl:attribute name="font-family">Arial</xsl:attribute>
7377
+ <xsl:attribute name="font-size">9pt</xsl:attribute>
7378
+ <xsl:attribute name="line-height">130%</xsl:attribute>
7379
+ <xsl:attribute name="text-align">justify</xsl:attribute>
7380
+ </xsl:if>
7381
+
7382
+
7383
+
7384
+ <fo:inline xsl:use-attribute-sets="note-name-style">
7385
+
7386
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
7387
+ </fo:inline>
7388
+ <xsl:apply-templates/>
7389
+ </fo:block>
7390
+
7579
7391
  </fo:block-container>
7580
7392
  </fo:block-container>
7581
7393
 
@@ -7648,7 +7460,6 @@
7648
7460
  <xsl:apply-templates/>
7649
7461
  </fo:block>
7650
7462
  </xsl:template><xsl:template match="*[local-name() = 'term']">
7651
- <!-- <xsl:message>'term' <xsl:number/> processing, name=<xsl:value-of select="iso:name"/>, preferred=<xsl:value-of select="iso:preferred"/>...</xsl:message> -->
7652
7463
  <fo:block id="{@id}" xsl:use-attribute-sets="term-style">
7653
7464
 
7654
7465
 
@@ -7664,9 +7475,6 @@
7664
7475
  </xsl:variable>
7665
7476
  <fo:inline role="H{$level}">
7666
7477
  <xsl:apply-templates/>
7667
- <!-- <xsl:if test="$namespace = 'gb' or $namespace = 'ogc'">
7668
- <xsl:text>.</xsl:text>
7669
- </xsl:if> -->
7670
7478
  </fo:inline>
7671
7479
  </xsl:if>
7672
7480
  </xsl:template><xsl:template match="*[local-name() = 'figure']" name="figure">
@@ -7693,7 +7501,8 @@
7693
7501
  </xsl:for-each>
7694
7502
 
7695
7503
 
7696
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
7504
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
7505
+
7697
7506
 
7698
7507
  </fo:block-container>
7699
7508
  </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
@@ -7807,9 +7616,7 @@
7807
7616
  <xsl:variable name="bis" select="java:java.io.ByteArrayInputStream.new($fileContent)"/>
7808
7617
  <xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($bis)"/>
7809
7618
  <xsl:variable name="width" select="java:getWidth($bufferedImage)"/>
7810
- <!-- width=<xsl:value-of select="$width"/> -->
7811
7619
  <xsl:variable name="height" select="java:getHeight($bufferedImage)"/>
7812
- <!-- height=<xsl:value-of select="$height"/> -->
7813
7620
  <svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="enable-background:new 0 0 595.28 841.89;" height="{$height}" width="{$width}" viewBox="0 0 {$width} {$height}" y="0px" x="0px" id="Layer_1" version="1.1">
7814
7621
  <image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="{@src}" height="{$height}" width="{$width}" style="overflow:visible;"/>
7815
7622
  <xsl:call-template name="svg_cross">
@@ -8091,11 +7898,58 @@
8091
7898
  <xsl:value-of select="."/>
8092
7899
  </xsl:template><xsl:template match="node()" mode="contents">
8093
7900
  <xsl:apply-templates mode="contents"/>
7901
+ </xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'floating-title']" priority="2" mode="contents">
7902
+ <xsl:variable name="level">
7903
+ <xsl:call-template name="getLevel">
7904
+ <xsl:with-param name="depth" select="@depth"/>
7905
+ </xsl:call-template>
7906
+ </xsl:variable>
7907
+
7908
+ <xsl:variable name="section">
7909
+ <xsl:value-of select="*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
7910
+ </xsl:variable>
7911
+
7912
+ <xsl:variable name="type">floating-title</xsl:variable>
7913
+
7914
+ <xsl:variable name="display">
7915
+ <xsl:choose>
7916
+ <xsl:when test="normalize-space(@id) = ''">false</xsl:when>
7917
+ <xsl:when test="$level &lt;= $toc_level">true</xsl:when>
7918
+ <xsl:otherwise>false</xsl:otherwise>
7919
+ </xsl:choose>
7920
+ </xsl:variable>
7921
+
7922
+ <xsl:variable name="skip">false</xsl:variable>
7923
+
7924
+ <xsl:if test="$skip = 'false'">
7925
+
7926
+ <xsl:variable name="title">
7927
+ <xsl:choose>
7928
+ <xsl:when test="*[local-name() = 'tab']">
7929
+ <xsl:copy-of select="*[local-name() = 'tab'][1]/following-sibling::node()"/>
7930
+ </xsl:when>
7931
+ <xsl:otherwise>
7932
+ <xsl:copy-of select="node()"/>
7933
+ </xsl:otherwise>
7934
+ </xsl:choose>
7935
+ </xsl:variable>
7936
+
7937
+ <xsl:variable name="root">
7938
+ <xsl:if test="ancestor-or-self::*[local-name() = 'preface']">preface</xsl:if>
7939
+ <xsl:if test="ancestor-or-self::*[local-name() = 'annex']">annex</xsl:if>
7940
+ </xsl:variable>
7941
+
7942
+ <item id="{@id}" level="{$level}" section="{$section}" type="{$type}" root="{$root}" display="{$display}">
7943
+ <title>
7944
+ <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
7945
+ </title>
7946
+ </item>
7947
+ </xsl:if>
8094
7948
  </xsl:template><xsl:template match="node()" mode="bookmarks">
8095
7949
  <xsl:apply-templates mode="bookmarks"/>
8096
7950
  </xsl:template><xsl:template match="*[local-name() = 'title' or local-name() = 'name']//*[local-name() = 'stem']" mode="contents">
8097
7951
  <xsl:apply-templates select="."/>
8098
- </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
7952
+ </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'references']/*[local-name() = 'bibitem']" mode="contents"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
8099
7953
  <xsl:apply-templates mode="bookmarks"/>
8100
7954
  </xsl:template><xsl:template name="addBookmarks">
8101
7955
  <xsl:param name="contents"/>
@@ -8185,8 +8039,6 @@
8185
8039
 
8186
8040
 
8187
8041
 
8188
-
8189
-
8190
8042
  </fo:bookmark-tree>
8191
8043
  </xsl:if>
8192
8044
  </xsl:template><xsl:template name="insertFigureBookmarks">
@@ -8280,16 +8132,13 @@
8280
8132
  </fo:block>
8281
8133
  </xsl:if>
8282
8134
  </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note']"/><xsl:template match="*[local-name() = 'title']" mode="contents_item">
8283
- <xsl:apply-templates mode="contents_item"/>
8135
+ <xsl:param name="mode">bookmarks</xsl:param>
8136
+ <xsl:apply-templates mode="contents_item">
8137
+ <xsl:with-param name="mode" select="$mode"/>
8138
+ </xsl:apply-templates>
8284
8139
  <!-- <xsl:text> </xsl:text> -->
8285
8140
  </xsl:template><xsl:template name="getSection">
8286
8141
  <xsl:value-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
8287
- <!--
8288
- <xsl:for-each select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()">
8289
- <xsl:value-of select="."/>
8290
- </xsl:for-each>
8291
- -->
8292
-
8293
8142
  </xsl:template><xsl:template name="getName">
8294
8143
  <xsl:choose>
8295
8144
  <xsl:when test="*[local-name() = 'title']/*[local-name() = 'tab']">
@@ -8353,6 +8202,18 @@
8353
8202
  <xsl:copy-of select="."/>
8354
8203
  </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
8355
8204
  <xsl:text> </xsl:text>
8205
+ </xsl:template><xsl:template match="*[local-name() = 'name']" mode="contents_item">
8206
+ <xsl:param name="mode">bookmarks</xsl:param>
8207
+ <xsl:apply-templates mode="contents_item">
8208
+ <xsl:with-param name="mode" select="$mode"/>
8209
+ </xsl:apply-templates>
8210
+ </xsl:template><xsl:template match="*[local-name() = 'add'][starts-with(text(), $ace_tag)]" mode="contents_item">
8211
+ <xsl:param name="mode">bookmarks</xsl:param>
8212
+ <xsl:if test="$mode = 'contents'">
8213
+ <xsl:copy>
8214
+ <xsl:apply-templates mode="contents_item"/>
8215
+ </xsl:copy>
8216
+ </xsl:if>
8356
8217
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
8357
8218
 
8358
8219
  <fo:block-container margin-left="0mm">
@@ -8412,7 +8273,7 @@
8412
8273
  </fo:block>
8413
8274
 
8414
8275
 
8415
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
8276
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
8416
8277
 
8417
8278
 
8418
8279
 
@@ -8535,8 +8396,6 @@
8535
8396
  </xsl:variable>
8536
8397
  <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
8537
8398
  <xsl:if test="$cols-count = 2 and not(ancestor::*[local-name()='table'])">
8538
- <!-- <fo:table-column column-width="35mm"/>
8539
- <fo:table-column column-width="115mm"/> -->
8540
8399
  <fo:table-column column-width="30%"/>
8541
8400
  <fo:table-column column-width="70%"/>
8542
8401
  </xsl:if>
@@ -8563,7 +8422,6 @@
8563
8422
  </xsl:template><xsl:template match="*[local-name()='tr']" mode="requirement">
8564
8423
  <fo:table-row height="7mm" border-bottom="0.5pt solid grey">
8565
8424
  <xsl:if test="parent::*[local-name()='thead']"> <!-- and not(ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']) -->
8566
- <!-- <xsl:attribute name="border">1pt solid black</xsl:attribute> -->
8567
8425
  <xsl:attribute name="background-color">rgb(33, 55, 92)</xsl:attribute>
8568
8426
  </xsl:if>
8569
8427
  <xsl:if test="starts-with(*[local-name()='td'][1], 'Requirement ')">
@@ -8596,15 +8454,6 @@
8596
8454
  </xsl:if>
8597
8455
  <xsl:call-template name="display-align"/>
8598
8456
 
8599
- <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
8600
- <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
8601
- <xsl:attribute name="background-color">rgb(165, 165, 165)</xsl:attribute>
8602
- </xsl:if>
8603
- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommendtest'">
8604
- <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
8605
- <xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute>
8606
- </xsl:if> -->
8607
-
8608
8457
  <fo:block>
8609
8458
  <xsl:apply-templates/>
8610
8459
  </fo:block>
@@ -8638,15 +8487,6 @@
8638
8487
  </xsl:if>
8639
8488
  <xsl:call-template name="display-align"/>
8640
8489
 
8641
- <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
8642
- <xsl:attribute name="padding-left">0.5mm</xsl:attribute>
8643
- <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
8644
- <xsl:if test="parent::*[local-name()='tr']/preceding-sibling::*[local-name()='tr'] and not(*[local-name()='table'])">
8645
- <xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute>
8646
- </xsl:if>
8647
- </xsl:if> -->
8648
- <!-- 2nd line and below -->
8649
-
8650
8490
  <fo:block>
8651
8491
  <xsl:apply-templates/>
8652
8492
  </fo:block>
@@ -8657,7 +8497,7 @@
8657
8497
  <xsl:apply-templates/>
8658
8498
  </fo:block>
8659
8499
  </xsl:template><xsl:template match="*[local-name() = 'p2'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]">
8660
- <fo:block> <!-- margin-bottom="10pt" -->
8500
+ <fo:block>
8661
8501
  <xsl:apply-templates/>
8662
8502
  </fo:block>
8663
8503
  </xsl:template><xsl:template match="*[local-name() = 'termexample']">
@@ -8689,42 +8529,48 @@
8689
8529
  <fo:block id="{@id}" xsl:use-attribute-sets="example-style">
8690
8530
 
8691
8531
 
8692
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
8693
-
8694
- <xsl:variable name="element">
8532
+ <xsl:variable name="fo_element">
8533
+ <xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl']">block</xsl:if>
8695
8534
  block
8696
8535
 
8697
- <xsl:if test=".//*[local-name() = 'table']">block</xsl:if>
8536
+
8698
8537
  </xsl:variable>
8699
8538
 
8539
+ <!-- display 'EXAMPLE' -->
8540
+ <xsl:apply-templates select="*[local-name()='name']">
8541
+ <xsl:with-param name="fo_element" select="$fo_element"/>
8542
+ </xsl:apply-templates>
8543
+
8700
8544
  <xsl:choose>
8701
- <xsl:when test="contains(normalize-space($element), 'block')">
8702
- <fo:block xsl:use-attribute-sets="example-body-style">
8703
- <xsl:apply-templates/>
8704
- </fo:block>
8545
+ <xsl:when test="contains(normalize-space($fo_element), 'block')">
8546
+ <fo:block-container xsl:use-attribute-sets="example-body-style">
8547
+ <fo:block-container margin-left="0mm" margin-right="0mm">
8548
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]">
8549
+ <xsl:with-param name="fo_element" select="$fo_element"/>
8550
+ </xsl:apply-templates>
8551
+ </fo:block-container>
8552
+ </fo:block-container>
8705
8553
  </xsl:when>
8706
8554
  <xsl:otherwise>
8707
8555
  <fo:inline>
8708
- <xsl:apply-templates/>
8556
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]">
8557
+ <xsl:with-param name="fo_element" select="$fo_element"/>
8558
+ </xsl:apply-templates>
8709
8559
  </fo:inline>
8710
8560
  </xsl:otherwise>
8711
8561
  </xsl:choose>
8712
8562
 
8713
8563
  </fo:block>
8714
- </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']" mode="presentation">
8715
-
8716
- <xsl:variable name="element">
8717
- block
8718
-
8719
- <xsl:if test="following-sibling::*[1][local-name() = 'table']">block</xsl:if>
8720
- </xsl:variable>
8564
+ </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']">
8565
+ <xsl:param name="fo_element">block</xsl:param>
8566
+
8721
8567
  <xsl:choose>
8722
8568
  <xsl:when test="ancestor::*[local-name() = 'appendix']">
8723
8569
  <fo:inline>
8724
8570
  <xsl:apply-templates/>
8725
8571
  </fo:inline>
8726
8572
  </xsl:when>
8727
- <xsl:when test="contains(normalize-space($element), 'block')">
8573
+ <xsl:when test="contains(normalize-space($fo_element), 'block')">
8728
8574
  <fo:block xsl:use-attribute-sets="example-name-style">
8729
8575
  <xsl:apply-templates/>
8730
8576
  </fo:block>
@@ -8737,14 +8583,15 @@
8737
8583
  </xsl:choose>
8738
8584
 
8739
8585
  </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
8586
+ <xsl:param name="fo_element">block</xsl:param>
8587
+
8740
8588
  <xsl:variable name="num"><xsl:number/></xsl:variable>
8741
8589
  <xsl:variable name="element">
8742
- block
8743
-
8744
8590
 
8591
+ <xsl:value-of select="$fo_element"/>
8745
8592
  </xsl:variable>
8746
8593
  <xsl:choose>
8747
- <xsl:when test="normalize-space($element) = 'block'">
8594
+ <xsl:when test="starts-with(normalize-space($element), 'block')">
8748
8595
  <fo:block xsl:use-attribute-sets="example-p-style">
8749
8596
 
8750
8597
  <xsl:apply-templates/>
@@ -8763,60 +8610,66 @@
8763
8610
  <xsl:variable name="termsource_text">
8764
8611
  <xsl:apply-templates/>
8765
8612
  </xsl:variable>
8766
-
8767
- <xsl:choose>
8613
+ <xsl:copy-of select="$termsource_text"/>
8614
+ <!-- <xsl:choose>
8768
8615
  <xsl:when test="starts-with(normalize-space($termsource_text), '[')">
8769
- <!-- <xsl:apply-templates /> -->
8770
8616
  <xsl:copy-of select="$termsource_text"/>
8771
8617
  </xsl:when>
8772
8618
  <xsl:otherwise>
8773
-
8774
-
8619
+ <xsl:if test="$namespace = 'bsi'">
8620
+ <xsl:choose>
8621
+ <xsl:when test="$document_type = 'PAS' and starts-with(*[local-name() = 'origin']/@citeas, '[')"><xsl:text>{</xsl:text></xsl:when>
8622
+ <xsl:otherwise><xsl:text>[</xsl:text></xsl:otherwise>
8623
+ </xsl:choose>
8624
+ </xsl:if>
8625
+ <xsl:if test="$namespace = 'gb' or $namespace = 'iso' or $namespace = 'iec' or $namespace = 'itu' or $namespace = 'unece' or $namespace = 'unece-rec' or $namespace = 'nist-cswp' or $namespace = 'nist-sp' or $namespace = 'ogc-white-paper' or $namespace = 'csa' or $namespace = 'csd' or $namespace = 'm3d' or $namespace = 'iho' or $namespace = 'bipm' or $namespace = 'jcgm'">
8775
8626
  <xsl:text>[</xsl:text>
8776
-
8777
- <!-- <xsl:apply-templates /> -->
8627
+ </xsl:if>
8778
8628
  <xsl:copy-of select="$termsource_text"/>
8779
-
8780
-
8629
+ <xsl:if test="$namespace = 'bsi'">
8630
+ <xsl:choose>
8631
+ <xsl:when test="$document_type = 'PAS' and starts-with(*[local-name() = 'origin']/@citeas, '[')"><xsl:text>}</xsl:text></xsl:when>
8632
+ <xsl:otherwise><xsl:text>]</xsl:text></xsl:otherwise>
8633
+ </xsl:choose>
8634
+ </xsl:if>
8635
+ <xsl:if test="$namespace = 'gb' or $namespace = 'iso' or $namespace = 'iec' or $namespace = 'itu' or $namespace = 'unece' or $namespace = 'unece-rec' or $namespace = 'nist-cswp' or $namespace = 'nist-sp' or $namespace = 'ogc-white-paper' or $namespace = 'csa' or $namespace = 'csd' or $namespace = 'm3d' or $namespace = 'iho' or $namespace = 'bipm' or $namespace = 'jcgm'">
8781
8636
  <xsl:text>]</xsl:text>
8782
-
8637
+ </xsl:if>
8783
8638
  </xsl:otherwise>
8784
- </xsl:choose>
8639
+ </xsl:choose> -->
8785
8640
  </fo:block>
8786
8641
  </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()">
8787
8642
  <xsl:if test="normalize-space() != ''">
8788
8643
  <xsl:value-of select="."/>
8789
8644
  </xsl:if>
8790
- </xsl:template><xsl:variable name="localized.source">
8791
- <xsl:call-template name="getLocalizedString">
8792
- <xsl:with-param name="key">source</xsl:with-param>
8793
- </xsl:call-template>
8794
- </xsl:variable><xsl:template match="*[local-name() = 'origin']">
8645
+ </xsl:template><xsl:template match="*[local-name() = 'termsource']/*[local-name() = 'strong'][1][following-sibling::*[1][local-name() = 'origin']]/text()">
8646
+ <fo:inline>
8647
+
8648
+
8649
+ <xsl:value-of select="."/>
8650
+ </fo:inline>
8651
+ </xsl:template><xsl:template match="*[local-name() = 'origin']">
8795
8652
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
8796
8653
  <xsl:if test="normalize-space(@citeas) = ''">
8797
8654
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
8798
8655
  </xsl:if>
8799
-
8800
-
8801
- <fo:inline>
8802
-
8803
-
8804
-
8805
-
8806
-
8807
-
8808
- <xsl:value-of select="$localized.source"/>
8809
- <xsl:text> </xsl:text>
8810
-
8811
-
8812
-
8813
- </fo:inline>
8814
-
8815
8656
  <fo:inline xsl:use-attribute-sets="origin-style">
8816
8657
  <xsl:apply-templates/>
8817
8658
  </fo:inline>
8818
-
8819
- </fo:basic-link>
8659
+ </fo:basic-link>
8660
+ </xsl:template><xsl:template match="*[local-name() = 'modification']">
8661
+ <xsl:variable name="title-modified">
8662
+ <xsl:call-template name="getLocalizedString">
8663
+ <xsl:with-param name="key">modified</xsl:with-param>
8664
+ </xsl:call-template>
8665
+ </xsl:variable>
8666
+
8667
+ <xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
8668
+ <xsl:choose>
8669
+ <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text>—</xsl:text></xsl:if></xsl:when>
8670
+ <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text> — </xsl:text></xsl:if></xsl:otherwise>
8671
+ </xsl:choose>
8672
+ <xsl:apply-templates/>
8820
8673
  </xsl:template><xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']">
8821
8674
  <fo:inline><xsl:apply-templates/></fo:inline>
8822
8675
  </xsl:template><xsl:template match="*[local-name() = 'modification']/text()">
@@ -8835,7 +8688,6 @@
8835
8688
  <fo:block-container margin-left="0mm">
8836
8689
 
8837
8690
  <fo:block xsl:use-attribute-sets="quote-style">
8838
- <!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
8839
8691
 
8840
8692
  <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
8841
8693
  </fo:block>
@@ -8881,12 +8733,10 @@
8881
8733
  <xsl:when test="normalize-space($bibitemid) != ''">
8882
8734
  <fo:inline xsl:use-attribute-sets="eref-style">
8883
8735
  <xsl:if test="@type = 'footnote'">
8884
-
8885
- <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
8886
- <xsl:attribute name="font-size">80%</xsl:attribute>
8887
- <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
8888
- <xsl:attribute name="vertical-align">super</xsl:attribute>
8889
-
8736
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
8737
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
8738
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
8739
+ <xsl:attribute name="font-size">80%</xsl:attribute>
8890
8740
 
8891
8741
  </xsl:if>
8892
8742
 
@@ -8970,7 +8820,6 @@
8970
8820
  </xsl:choose>
8971
8821
  </xsl:variable>
8972
8822
 
8973
- <!-- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/> -->
8974
8823
 
8975
8824
  <xsl:choose>
8976
8825
  <xsl:when test="$lang = 'zh'">
@@ -9006,12 +8855,9 @@
9006
8855
  </fo:block>
9007
8856
  </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
9008
8857
  <xsl:variable name="title-deprecated">
9009
-
9010
- <xsl:call-template name="getLocalizedString">
9011
- <xsl:with-param name="key">deprecated</xsl:with-param>
9012
- </xsl:call-template>
9013
-
9014
-
8858
+ <xsl:call-template name="getLocalizedString">
8859
+ <xsl:with-param name="key">deprecated</xsl:with-param>
8860
+ </xsl:call-template>
9015
8861
  </xsl:variable>
9016
8862
  <fo:block xsl:use-attribute-sets="deprecates-style">
9017
8863
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
@@ -9020,6 +8866,8 @@
9020
8866
  <xsl:if test="*[local-name() = 'strong']">
9021
8867
  <xsl:attribute name="font-weight">normal</xsl:attribute>
9022
8868
  </xsl:if>
8869
+ </xsl:template><xsl:template match="*[local-name() = 'preferred']/text()[contains(., ';')] | *[local-name() = 'preferred']/*[local-name() = 'strong']/text()[contains(., ';')]">
8870
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.), ';', $linebreak)"/>
9023
8871
  </xsl:template><xsl:template match="*[local-name() = 'definition']">
9024
8872
  <fo:block xsl:use-attribute-sets="definition-style">
9025
8873
  <xsl:apply-templates/>
@@ -9028,7 +8876,6 @@
9028
8876
  <xsl:apply-templates/>
9029
8877
  </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p'][1]">
9030
8878
  <fo:inline> <xsl:apply-templates/></fo:inline>
9031
- <!-- <fo:block>&#xA0;</fo:block> -->
9032
8879
  <fo:block/>
9033
8880
  </xsl:template><xsl:template match="/*/*[local-name() = 'sections']/*" priority="2">
9034
8881
 
@@ -9087,6 +8934,53 @@
9087
8934
  </xsl:template><xsl:template match="*[local-name() = 'name']/text()">
9088
8935
  <!-- 0xA0 to space replacement -->
9089
8936
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
8937
+ </xsl:template><xsl:variable name="ul_labels_">
8938
+
8939
+ <label level="1" font-size="15pt">•</label>
8940
+ <label level="2">−</label><!-- &#x2212; - minus sign. &#x2014; - en dash -->
8941
+ <label level="3" font-size="75%">o</label> <!-- white circle -->
8942
+
8943
+
8944
+
8945
+
8946
+
8947
+
8948
+
8949
+
8950
+
8951
+
8952
+
8953
+
8954
+
8955
+
8956
+
8957
+
8958
+
8959
+ </xsl:variable><xsl:variable name="ul_labels" select="xalan:nodeset($ul_labels_)"/><xsl:template name="setULLabel">
8960
+ <xsl:variable name="list_level_" select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/>
8961
+ <xsl:variable name="list_level">
8962
+ <xsl:choose>
8963
+ <xsl:when test="$list_level_ &lt;= 3"><xsl:value-of select="$list_level_"/></xsl:when>
8964
+ <xsl:otherwise><xsl:value-of select="$list_level_ mod 3"/></xsl:otherwise>
8965
+ </xsl:choose>
8966
+ </xsl:variable>
8967
+ <xsl:choose>
8968
+ <xsl:when test="$ul_labels/label[not(@level)]"> <!-- one label for all levels -->
8969
+ <xsl:apply-templates select="$ul_labels/label[not(@level)]" mode="ul_labels"/>
8970
+ </xsl:when>
8971
+ <xsl:when test="$list_level mod 3 = 0">
8972
+ <xsl:apply-templates select="$ul_labels/label[@level = 3]" mode="ul_labels"/>
8973
+ </xsl:when>
8974
+ <xsl:when test="$list_level mod 2 = 0">
8975
+ <xsl:apply-templates select="$ul_labels/label[@level = 2]" mode="ul_labels"/>
8976
+ </xsl:when>
8977
+ <xsl:otherwise>
8978
+ <xsl:apply-templates select="$ul_labels/label[@level = 1]" mode="ul_labels"/>
8979
+ </xsl:otherwise>
8980
+ </xsl:choose>
8981
+ </xsl:template><xsl:template match="label" mode="ul_labels">
8982
+ <xsl:copy-of select="@*[not(local-name() = 'level')]"/>
8983
+ <xsl:value-of select="."/>
9090
8984
  </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
9091
8985
  <xsl:choose>
9092
8986
  <xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
@@ -9304,7 +9198,7 @@
9304
9198
  <xsl:apply-templates select="*[local-name() = 'formattedref']"/>
9305
9199
  </xsl:when>
9306
9200
  <xsl:otherwise>
9307
- <xsl:variable name="docidentifier" select="*[local-name() = 'docidentifier'][not(@type = 'URN' or @type = 'metanorma' or @type = 'BIPM' or @type = 'ISBN' or @type = 'ISSN')]"/>
9201
+ <xsl:variable name="docidentifier" select="*[local-name() = 'docidentifier'][not(@type = 'URN' or @type = 'metanorma' or @type = 'metanorma-ordinal' or @type = 'BIPM' or @type = 'ISBN' or @type = 'ISSN')]"/>
9308
9202
 
9309
9203
  <xsl:value-of select="$docidentifier"/>
9310
9204
  <xsl:if test="$docidentifier != '' and *[local-name() = 'title']">, </xsl:if>
@@ -9328,16 +9222,28 @@
9328
9222
  <!-- end BIPM bibitem processing-->
9329
9223
 
9330
9224
 
9331
-
9225
+
9226
+
9227
+
9228
+
9229
+
9230
+
9332
9231
 
9333
9232
 
9334
9233
 
9335
9234
 
9336
9235
 
9236
+
9237
+
9238
+
9239
+
9240
+
9337
9241
 
9242
+
9243
+
9338
9244
 
9339
9245
  </xsl:template><xsl:template name="processBibitemDocId">
9340
- <xsl:variable name="_doc_ident" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]"/>
9246
+ <xsl:variable name="_doc_ident" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'metanorma-ordinal' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]"/>
9341
9247
  <xsl:choose>
9342
9248
  <xsl:when test="normalize-space($_doc_ident) != ''">
9343
9249
  <!-- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]/@type"/>
@@ -9351,7 +9257,7 @@
9351
9257
  <xsl:if test="$type != ''">
9352
9258
  <xsl:value-of select="$type"/><xsl:text> </xsl:text>
9353
9259
  </xsl:if> -->
9354
- <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]"/>
9260
+ <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma') and not(@type = 'metanorma-ordinal')]"/>
9355
9261
  </xsl:otherwise>
9356
9262
  </xsl:choose>
9357
9263
  </xsl:template><xsl:template name="processPersonalAuthor">
@@ -9456,7 +9362,18 @@
9456
9362
  <fo:block-container border="1pt solid black" width="50%">
9457
9363
  <fo:block> </fo:block>
9458
9364
  </fo:block-container>
9459
- </xsl:template><xsl:template match="*[local-name() = 'toc']">
9365
+ </xsl:template><xsl:variable name="toc_level">
9366
+ <!-- https://www.metanorma.org/author/ref/document-attributes/ -->
9367
+ <xsl:variable name="htmltoclevels" select="normalize-space(//*[local-name() = 'misc-container']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name']/text() = 'HTML TOC Heading Levels']/*[local-name() = 'value'])"/> <!-- :htmltoclevels Number of table of contents levels to render in HTML/PDF output; used to override :toclevels:-->
9368
+ <xsl:variable name="toclevels" select="normalize-space(//*[local-name() = 'misc-container']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name']/text() = 'TOC Heading Levels']/*[local-name() = 'value'])"/> <!-- Number of table of contents levels to render -->
9369
+ <xsl:choose>
9370
+ <xsl:when test="$htmltoclevels != ''"><xsl:value-of select="number($htmltoclevels)"/></xsl:when> <!-- if there is value in xml -->
9371
+ <xsl:when test="$toclevels != ''"><xsl:value-of select="number($toclevels)"/></xsl:when> <!-- if there is value in xml -->
9372
+ <xsl:otherwise><!-- default value -->
9373
+ 3
9374
+ </xsl:otherwise>
9375
+ </xsl:choose>
9376
+ </xsl:variable><xsl:template match="*[local-name() = 'toc']">
9460
9377
  <xsl:param name="colwidths"/>
9461
9378
  <xsl:variable name="colwidths_">
9462
9379
  <xsl:choose>
@@ -9536,7 +9453,7 @@
9536
9453
  </td>
9537
9454
  </xsl:for-each>
9538
9455
  <td>333</td> <!-- page number, just for fill -->
9539
- </xsl:template><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']"/><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
9456
+ </xsl:template><xsl:template match="*[local-name() = 'variant-title']"/><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
9540
9457
  <fo:inline padding-right="5mm"> </fo:inline>
9541
9458
  <fo:inline><xsl:apply-templates/></fo:inline>
9542
9459
  </xsl:template><xsl:template match="*[local-name() = 'blacksquare']" name="blacksquare">
@@ -9547,6 +9464,10 @@
9547
9464
  </svg>
9548
9465
  </fo:instream-foreign-object>
9549
9466
  </fo:inline>
9467
+ </xsl:template><xsl:template match="@language">
9468
+ <xsl:copy-of select="."/>
9469
+ </xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'floating-title']" priority="4">
9470
+ <xsl:call-template name="title"/>
9550
9471
  </xsl:template><xsl:template name="convertDate">
9551
9472
  <xsl:param name="date"/>
9552
9473
  <xsl:param name="format" select="'short'"/>
@@ -9679,13 +9600,8 @@
9679
9600
  <xsl:variable name="title">
9680
9601
  <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
9681
9602
 
9682
-
9683
- <xsl:value-of select="*[local-name() = 'title'][@language = $lang and @type = 'main']"/>
9684
-
9685
-
9686
-
9687
-
9688
-
9603
+ <xsl:value-of select="*[local-name() = 'title'][@language = $lang and @type = 'main']"/>
9604
+
9689
9605
  </xsl:for-each>
9690
9606
  </xsl:variable>
9691
9607
  <xsl:choose>
@@ -9700,21 +9616,18 @@
9700
9616
  <dc:creator>
9701
9617
  <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
9702
9618
 
9703
- <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
9704
- <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
9705
- <xsl:if test="position() != last()">; </xsl:if>
9706
- </xsl:for-each>
9707
-
9708
-
9709
-
9619
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
9620
+ <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
9621
+ <xsl:if test="position() != last()">; </xsl:if>
9622
+ </xsl:for-each>
9623
+
9710
9624
  </xsl:for-each>
9711
9625
  </dc:creator>
9712
9626
  <dc:description>
9713
9627
  <xsl:variable name="abstract">
9714
9628
 
9715
- <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
9716
-
9717
-
9629
+ <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
9630
+
9718
9631
  </xsl:variable>
9719
9632
  <xsl:value-of select="normalize-space($abstract)"/>
9720
9633
  </dc:description>
@@ -9734,7 +9647,6 @@
9734
9647
  <xsl:value-of select="../@id"/>
9735
9648
  </xsl:when>
9736
9649
  <xsl:otherwise>
9737
- <!-- <xsl:value-of select="concat(local-name(..), '_', text())"/> -->
9738
9650
  <xsl:value-of select="concat(generate-id(..), '_', text())"/>
9739
9651
  </xsl:otherwise>
9740
9652
  </xsl:choose>
@@ -9760,9 +9672,6 @@
9760
9672
  <xsl:when test="ancestor::*[local-name() = 'preface']">
9761
9673
  <xsl:value-of select="$level_total - 2"/>
9762
9674
  </xsl:when>
9763
- <!-- <xsl:when test="parent::*[local-name() = 'sections']">
9764
- <xsl:value-of select="$level_total - 1"/>
9765
- </xsl:when> -->
9766
9675
  <xsl:when test="ancestor::*[local-name() = 'sections']">
9767
9676
  <xsl:value-of select="$level_total - 1"/>
9768
9677
  </xsl:when>
@@ -9904,9 +9813,15 @@
9904
9813
  </xsl:template><xsl:template name="getLocalizedString">
9905
9814
  <xsl:param name="key"/>
9906
9815
  <xsl:param name="formatted">false</xsl:param>
9816
+ <xsl:param name="lang"/>
9907
9817
 
9908
9818
  <xsl:variable name="curr_lang">
9909
- <xsl:call-template name="getLang"/>
9819
+ <xsl:choose>
9820
+ <xsl:when test="$lang != ''"><xsl:value-of select="$lang"/></xsl:when>
9821
+ <xsl:otherwise>
9822
+ <xsl:call-template name="getLang"/>
9823
+ </xsl:otherwise>
9824
+ </xsl:choose>
9910
9825
  </xsl:variable>
9911
9826
 
9912
9827
  <xsl:variable name="data_value">
@@ -9969,7 +9884,6 @@
9969
9884
  <xsl:if test="local-name() = 'table'">
9970
9885
  <xsl:attribute name="background-color">rgb(255, 185, 185)</xsl:attribute>
9971
9886
  </xsl:if>
9972
- <!-- <xsl:attribute name="color"><xsl:value-of select="$color-deleted-text"/></xsl:attribute> -->
9973
9887
  <xsl:attribute name="padding">2mm</xsl:attribute>
9974
9888
  </xsl:if>
9975
9889
  </xsl:otherwise>
@@ -10096,4 +10010,14 @@
10096
10010
  </xsl:otherwise>
10097
10011
  </xsl:choose>
10098
10012
  </xsl:if>
10013
+ </xsl:template><xsl:template name="setAltText">
10014
+ <xsl:param name="value"/>
10015
+ <xsl:attribute name="fox:alt-text">
10016
+ <xsl:choose>
10017
+ <xsl:when test="normalize-space($value) != ''">
10018
+ <xsl:value-of select="$value"/>
10019
+ </xsl:when>
10020
+ <xsl:otherwise>_</xsl:otherwise>
10021
+ </xsl:choose>
10022
+ </xsl:attribute>
10099
10023
  </xsl:template></xsl:stylesheet>