metanorma-bipm 1.1.6 → 1.1.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -244,7 +244,7 @@
244
244
  <xsl:value-of select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:title[@type = 'provenance']"/>
245
245
  </fo:block>
246
246
  <fo:block border-bottom="1pt solid black"> </fo:block>
247
- <fo:block font-size="16.5pt" margin-left="-0.5mm" padding-top="3.5mm" space-after="7mm" margin-right="7mm" line-height="105%">
247
+ <fo:block font-size="16.5pt" margin-left="-0.5mm" padding-top="3.5mm" space-after="7mm" margin-right="7mm" line-height="105%" role="H1">
248
248
  <xsl:apply-templates select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:title[@language = $lang and @type = 'main']" mode="title"/>
249
249
  <xsl:variable name="title_part">
250
250
  <xsl:apply-templates select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:title[@language = $lang and @type = 'part']" mode="title"/>
@@ -254,7 +254,7 @@
254
254
  <xsl:copy-of select="$title_part"/>
255
255
  </xsl:if>
256
256
  </fo:block>
257
- <fo:block font-size="12pt" font-style="italic" line-height="140%">
257
+ <fo:block font-size="12pt" font-style="italic" line-height="140%" role="H1">
258
258
  <xsl:variable name="secondLang" select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:title/@language[. != $lang]"/>
259
259
  <xsl:apply-templates select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:title[@language = $secondLang and @type = 'main']" mode="title"/>
260
260
  <xsl:variable name="title_part">
@@ -293,7 +293,7 @@
293
293
  </fo:table-row>
294
294
  </fo:table-body>
295
295
  </fo:table>
296
- <fo:block font-size="18pt" space-before="70mm">
296
+ <fo:block font-size="18pt" space-before="70mm" role="H1">
297
297
  <xsl:apply-templates select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:title[@language = $lang and @type = 'main']" mode="title"/>
298
298
  <xsl:variable name="title_part">
299
299
  <xsl:apply-templates select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:title[@language = $lang and @type = 'part']" mode="title"/>
@@ -303,7 +303,7 @@
303
303
  <xsl:copy-of select="$title_part"/>
304
304
  </xsl:if>
305
305
  </fo:block>
306
- <fo:block font-size="13pt" space-before="35mm">
306
+ <fo:block font-size="13pt" space-before="35mm" role="H1">
307
307
  <xsl:variable name="secondLang" select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:title/@language[. != $lang]"/>
308
308
  <xsl:apply-templates select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:title[@language = $secondLang and @type = 'main']" mode="title"/>
309
309
  <xsl:variable name="title_part">
@@ -346,41 +346,43 @@
346
346
 
347
347
  <!-- Table of Contents -->
348
348
  <fo:block-container>
349
- <fo:block text-align-last="justify">
350
- <fo:inline font-size="15pt" font-weight="bold">
351
- <xsl:call-template name="getLocalizedString">
352
- <xsl:with-param name="key">table_of_contents</xsl:with-param>
353
- </xsl:call-template>
354
- </fo:inline>
355
- <fo:inline keep-together.within-line="always">
356
- <fo:leader leader-pattern="space"/>
349
+ <fo:block role="TOC">
350
+ <fo:block text-align-last="justify">
351
+ <fo:inline font-size="15pt" font-weight="bold" role="H1">
352
+ <xsl:call-template name="getLocalizedString">
353
+ <xsl:with-param name="key">table_of_contents</xsl:with-param>
354
+ </xsl:call-template>
355
+ </fo:inline>
356
+ <fo:inline keep-together.within-line="always">
357
+ <fo:leader leader-pattern="space"/>
358
+ <xsl:call-template name="getLocalizedString">
359
+ <xsl:with-param name="key">Page.sg</xsl:with-param>
360
+ </xsl:call-template>
361
+ </fo:inline>
362
+ </fo:block>
363
+
364
+ <xsl:if test="$debug = 'true'">
365
+ <xsl:text disable-output-escaping="yes">&lt;!--</xsl:text>
366
+ DEBUG
367
+ contents=<xsl:copy-of select="xalan:nodeset($contents)"/>
368
+ <xsl:text disable-output-escaping="yes">--&gt;</xsl:text>
369
+ </xsl:if>
370
+
371
+ <xsl:variable name="annexes_title">
357
372
  <xsl:call-template name="getLocalizedString">
358
- <xsl:with-param name="key">Page.sg</xsl:with-param>
373
+ <xsl:with-param name="key">Annex.pl</xsl:with-param>
359
374
  </xsl:call-template>
360
- </fo:inline>
375
+ </xsl:variable>
376
+
377
+ <xsl:for-each select="xalan:nodeset($contents)/doc[@id=$docid]//item[@display = 'true']"> <!-- and not (@type = 'annex') and not (@type = 'references') -->
378
+ <xsl:if test="@type = 'annex' and not(preceding-sibling::item[@display = 'true' and @type = 'annex'])">
379
+ <fo:block font-size="12pt" space-before="16pt" font-weight="bold" role="TOCI">
380
+ <xsl:value-of select="$annexes_title"/>
381
+ </fo:block>
382
+ </xsl:if>
383
+ <xsl:call-template name="print_JCGN_toc_item"/>
384
+ </xsl:for-each>
361
385
  </fo:block>
362
-
363
- <xsl:if test="$debug = 'true'">
364
- <xsl:text disable-output-escaping="yes">&lt;!--</xsl:text>
365
- DEBUG
366
- contents=<xsl:copy-of select="xalan:nodeset($contents)"/>
367
- <xsl:text disable-output-escaping="yes">--&gt;</xsl:text>
368
- </xsl:if>
369
-
370
- <xsl:variable name="annexes_title">
371
- <xsl:call-template name="getLocalizedString">
372
- <xsl:with-param name="key">Annex.pl</xsl:with-param>
373
- </xsl:call-template>
374
- </xsl:variable>
375
-
376
- <xsl:for-each select="xalan:nodeset($contents)/doc[@id=$docid]//item[@display = 'true']"> <!-- and not (@type = 'annex') and not (@type = 'references') -->
377
- <xsl:if test="@type = 'annex' and not(preceding-sibling::item[@display = 'true' and @type = 'annex'])">
378
- <fo:block font-size="12pt" space-before="16pt" font-weight="bold">
379
- <xsl:value-of select="$annexes_title"/>
380
- </fo:block>
381
- </xsl:if>
382
- <xsl:call-template name="print_JCGN_toc_item"/>
383
- </xsl:for-each>
384
386
  </fo:block-container>
385
387
 
386
388
  </xsl:for-each>
@@ -445,7 +447,7 @@
445
447
  <xsl:apply-templates select="./*[local-name() = 'bibdata']/*[local-name() = 'title'][@language = $curr_lang and @type = 'part']" mode="title"/>
446
448
  </xsl:variable>
447
449
 
448
- <fo:block>
450
+ <fo:block role="H1">
449
451
  <xsl:copy-of select="$title-main"/>
450
452
  <xsl:if test="normalize-space($title-main) != '' and normalize-space($title-part) != ''">
451
453
  <xsl:text> — </xsl:text>
@@ -910,8 +912,11 @@
910
912
  <xsl:call-template name="note"/>
911
913
  </xsl:template>
912
914
 
913
- <xsl:template match="*[local-name()='preferred']">
914
- <fo:block line-height="1.1">
915
+ <xsl:template match="*[local-name()='preferred']">
916
+ <xsl:variable name="level">
917
+ <xsl:call-template name="getLevel"/>
918
+ </xsl:variable>
919
+ <fo:block line-height="1.1" role="H{$level}">
915
920
  <fo:block font-weight="bold" keep-with-next="always">
916
921
  <xsl:apply-templates select="ancestor::*[local-name()='term']/*[local-name()='name']" mode="presentation"/>
917
922
  </fo:block>
@@ -922,7 +927,10 @@
922
927
  </xsl:template>
923
928
 
924
929
  <xsl:template match="*[local-name()='preferred'][not(parent::*[local-name()='term'])]">
925
- <fo:block line-height="1.1">
930
+ <xsl:variable name="levelTerm">
931
+ <xsl:call-template name="getLevelTermName"/>
932
+ </xsl:variable>
933
+ <fo:block line-height="1.1" role="H{$levelTerm}">
926
934
  <fo:block font-weight="bold" keep-with-next="always">
927
935
  <xsl:apply-templates select="preceding-sibling::*[local-name()='term_name'][1]" mode="presentation"/>
928
936
  </fo:block>
@@ -1251,14 +1259,14 @@
1251
1259
  </xsl:variable>
1252
1260
 
1253
1261
  <xsl:template name="insertHeaderFooter">
1254
- <fo:static-content flow-name="header-even-jcgm">
1262
+ <fo:static-content flow-name="header-even-jcgm" role="artifact">
1255
1263
  <fo:block-container height="98%">
1256
1264
  <fo:block font-size="13pt" font-weight="bold" padding-top="12mm">
1257
1265
  <xsl:value-of select="$header_text"/>
1258
1266
  </fo:block>
1259
1267
  </fo:block-container>
1260
1268
  </fo:static-content>
1261
- <fo:static-content flow-name="footer-even-jcgm">
1269
+ <fo:static-content flow-name="footer-even-jcgm" role="artifact">
1262
1270
  <fo:block-container height="98%">
1263
1271
  <fo:block text-align-last="justify">
1264
1272
  <fo:inline font-size="12pt" font-weight="bold"><fo:page-number/></fo:inline>
@@ -1269,14 +1277,14 @@
1269
1277
  </fo:block>
1270
1278
  </fo:block-container>
1271
1279
  </fo:static-content>
1272
- <fo:static-content flow-name="header-odd-jcgm">
1280
+ <fo:static-content flow-name="header-odd-jcgm" role="artifact">
1273
1281
  <fo:block-container height="98%">
1274
1282
  <fo:block font-size="13pt" font-weight="bold" text-align="right" padding-top="12mm">
1275
1283
  <xsl:value-of select="$header_text"/>
1276
1284
  </fo:block>
1277
1285
  </fo:block-container>
1278
1286
  </fo:static-content>
1279
- <fo:static-content flow-name="footer-odd-jcgm">
1287
+ <fo:static-content flow-name="footer-odd-jcgm" role="artifact">
1280
1288
  <fo:block-container height="98%">
1281
1289
  <fo:block text-align-last="justify">
1282
1290
  <fo:inline font-size="10pt"><xsl:value-of select="$copyrightText"/></fo:inline>
@@ -1350,7 +1358,9 @@
1350
1358
  <xsl:attribute name="text-align">center</xsl:attribute>
1351
1359
  <xsl:attribute name="line-height">130%</xsl:attribute>
1352
1360
  </xsl:if>
1361
+ <xsl:attribute name="role">H<xsl:value-of select="$level"/></xsl:attribute>
1353
1362
  <xsl:apply-templates/>
1363
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
1354
1364
  </xsl:element>
1355
1365
 
1356
1366
  <xsl:if test="$element-name = 'fo:inline' and not(following-sibling::jcgm:p)">
@@ -1433,7 +1443,7 @@
1433
1443
  <fo:block id="{@id}" span="all">
1434
1444
  <xsl:apply-templates select="jcgm:title"/>
1435
1445
  </fo:block>
1436
- <fo:block>
1446
+ <fo:block role="Index">
1437
1447
  <xsl:apply-templates select="*[not(local-name() = 'title')]"/>
1438
1448
  </fo:block>
1439
1449
  </fo:flow>
@@ -1442,7 +1452,7 @@
1442
1452
 
1443
1453
  <!-- <xsl:template match="jcgm:clause[@type = 'index']/jcgm:title" priority="4"> -->
1444
1454
  <xsl:template match="jcgm:indexsect/jcgm:title" priority="4">
1445
- <fo:block font-weight="bold" span="all">
1455
+ <fo:block font-weight="bold" span="all" role="H1">
1446
1456
  <!-- Index -->
1447
1457
  <xsl:apply-templates/>
1448
1458
  </fo:block>
@@ -2177,8 +2187,9 @@
2177
2187
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
2178
2188
  <xsl:attribute name="white-space">pre</xsl:attribute>
2179
2189
  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
2190
+ <xsl:attribute name="role">Code</xsl:attribute>
2180
2191
 
2181
- <xsl:attribute name="font-family">Courier</xsl:attribute>
2192
+ <xsl:attribute name="font-family">Courier New</xsl:attribute>
2182
2193
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2183
2194
 
2184
2195
 
@@ -2201,8 +2212,13 @@
2201
2212
 
2202
2213
  </xsl:attribute-set><xsl:attribute-set name="requirement-label-style">
2203
2214
 
2204
- </xsl:attribute-set><xsl:attribute-set name="requirement-subject-style">
2205
- </xsl:attribute-set><xsl:attribute-set name="requirement-inherit-style">
2215
+ </xsl:attribute-set><xsl:attribute-set name="subject-style">
2216
+ </xsl:attribute-set><xsl:attribute-set name="inherit-style">
2217
+ </xsl:attribute-set><xsl:attribute-set name="description-style">
2218
+ </xsl:attribute-set><xsl:attribute-set name="specification-style">
2219
+ </xsl:attribute-set><xsl:attribute-set name="measurement-target-style">
2220
+ </xsl:attribute-set><xsl:attribute-set name="verification-style">
2221
+ </xsl:attribute-set><xsl:attribute-set name="import-style">
2206
2222
  </xsl:attribute-set><xsl:attribute-set name="recommendation-style">
2207
2223
 
2208
2224
 
@@ -2269,6 +2285,7 @@
2269
2285
 
2270
2286
 
2271
2287
 
2288
+
2272
2289
  <xsl:attribute name="font-size">10pt</xsl:attribute>
2273
2290
  <xsl:attribute name="margin-top">8pt</xsl:attribute>
2274
2291
  <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
@@ -2424,7 +2441,8 @@
2424
2441
 
2425
2442
 
2426
2443
 
2427
- </xsl:attribute-set><xsl:attribute-set name="quote-style">
2444
+ </xsl:attribute-set><xsl:attribute-set name="quote-style">
2445
+ <xsl:attribute name="role">BlockQuote</xsl:attribute>
2428
2446
 
2429
2447
 
2430
2448
 
@@ -2516,7 +2534,7 @@
2516
2534
  </xsl:attribute-set><xsl:attribute-set name="tt-style">
2517
2535
 
2518
2536
 
2519
- <xsl:attribute name="font-family">Courier</xsl:attribute>
2537
+ <xsl:attribute name="font-family">Courier New</xsl:attribute>
2520
2538
 
2521
2539
 
2522
2540
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-name-style">
@@ -2563,13 +2581,20 @@
2563
2581
 
2564
2582
  </xsl:attribute-set><xsl:attribute-set name="list-style">
2565
2583
 
2566
- </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="processPrefaceSectionsDefault_Contents">
2584
+ </xsl:attribute-set><xsl:attribute-set name="toc-style">
2585
+ <xsl:attribute name="line-height">135%</xsl:attribute>
2586
+ </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">
2567
2587
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
2568
2588
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
2569
2589
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
2570
2590
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']" mode="contents"/>
2571
2591
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']" mode="contents"/>
2572
- </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
2592
+ </xsl:template><xsl:template name="processPrefaceSectionsDefault_Contents">
2593
+ <xsl:for-each select="/*/*[local-name()='preface']/*">
2594
+ <xsl:sort select="@displayorder" data-type="number"/>
2595
+ <xsl:apply-templates select="." mode="contents"/>
2596
+ </xsl:for-each>
2597
+ </xsl:template><xsl:template name="OLD_processMainSectionsDefault_Contents">
2573
2598
  <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
2574
2599
 
2575
2600
  <!-- Normative references -->
@@ -2582,13 +2607,33 @@
2582
2607
  <!-- Bibliography -->
2583
2608
  <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"/>
2584
2609
 
2585
- </xsl:template><xsl:template name="processPrefaceSectionsDefault">
2610
+ </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
2611
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
2612
+ <xsl:sort select="@displayorder" data-type="number"/>
2613
+ <xsl:apply-templates select="." mode="contents"/>
2614
+ </xsl:for-each>
2615
+
2616
+ <xsl:for-each select="/*/*[local-name()='annex']">
2617
+ <xsl:sort select="@displayorder" data-type="number"/>
2618
+ <xsl:apply-templates select="." mode="contents"/>
2619
+ </xsl:for-each>
2620
+
2621
+ <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
2622
+ <xsl:sort select="@displayorder" data-type="number"/>
2623
+ <xsl:apply-templates select="." mode="contents"/>
2624
+ </xsl:for-each>
2625
+ </xsl:template><xsl:template name="OLD_processPrefaceSectionsDefault">
2586
2626
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
2587
2627
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
2588
2628
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']"/>
2589
2629
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']"/>
2590
2630
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']"/>
2591
- </xsl:template><xsl:template name="processMainSectionsDefault">
2631
+ </xsl:template><xsl:template name="processPrefaceSectionsDefault">
2632
+ <xsl:for-each select="/*/*[local-name()='preface']/*">
2633
+ <xsl:sort select="@displayorder" data-type="number"/>
2634
+ <xsl:apply-templates select="."/>
2635
+ </xsl:for-each>
2636
+ </xsl:template><xsl:template name="OLD_processMainSectionsDefault">
2592
2637
  <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']"/>
2593
2638
 
2594
2639
  <!-- Normative references -->
@@ -2600,6 +2645,22 @@
2600
2645
  <xsl:apply-templates select="/*/*[local-name()='annex']"/>
2601
2646
  <!-- Bibliography -->
2602
2647
  <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]"/>
2648
+ </xsl:template><xsl:template name="processMainSectionsDefault">
2649
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
2650
+ <xsl:sort select="@displayorder" data-type="number"/>
2651
+ <xsl:apply-templates select="."/>
2652
+
2653
+ </xsl:for-each>
2654
+
2655
+ <xsl:for-each select="/*/*[local-name()='annex']">
2656
+ <xsl:sort select="@displayorder" data-type="number"/>
2657
+ <xsl:apply-templates select="."/>
2658
+ </xsl:for-each>
2659
+
2660
+ <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
2661
+ <xsl:sort select="@displayorder" data-type="number"/>
2662
+ <xsl:apply-templates select="."/>
2663
+ </xsl:for-each>
2603
2664
  </xsl:template><xsl:template match="text()">
2604
2665
  <xsl:value-of select="."/>
2605
2666
  </xsl:template><xsl:template match="*[local-name()='br']">
@@ -2628,7 +2689,9 @@
2628
2689
  <!-- Display table's name before table as standalone block -->
2629
2690
  <!-- $namespace = 'iso' or -->
2630
2691
 
2631
-
2692
+
2693
+
2694
+
2632
2695
 
2633
2696
 
2634
2697
 
@@ -2760,6 +2823,8 @@
2760
2823
  <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
2761
2824
  </xsl:if>
2762
2825
 
2826
+
2827
+
2763
2828
  <xsl:choose>
2764
2829
  <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
2765
2830
  <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
@@ -3055,9 +3120,13 @@
3055
3120
  <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation">
3056
3121
  <xsl:with-param name="continued">true</xsl:with-param>
3057
3122
  </xsl:apply-templates>
3058
- <xsl:for-each select="ancestor::*[local-name()='table'][1]">
3059
- <xsl:call-template name="fn_name_display"/>
3060
- </xsl:for-each>
3123
+
3124
+
3125
+ <xsl:for-each select="ancestor::*[local-name()='table'][1]">
3126
+ <xsl:call-template name="fn_name_display"/>
3127
+ </xsl:for-each>
3128
+
3129
+
3061
3130
 
3062
3131
  <fo:block text-align="right" font-style="italic">
3063
3132
  <xsl:text> </xsl:text>
@@ -3146,7 +3215,11 @@
3146
3215
 
3147
3216
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
3148
3217
 
3149
- <xsl:if test="$isNoteOrFnExist = 'true'">
3218
+ <xsl:variable name="isNoteOrFnExistShowAfterTable">
3219
+
3220
+ </xsl:variable>
3221
+
3222
+ <xsl:if test="$isNoteOrFnExist = 'true' or normalize-space($isNoteOrFnExistShowAfterTable) = 'true'">
3150
3223
 
3151
3224
  <xsl:variable name="cols-count">
3152
3225
  <xsl:choose>
@@ -3308,10 +3381,13 @@
3308
3381
 
3309
3382
  <fo:table-row height="0" keep-with-next.within-page="always">
3310
3383
  <fo:table-cell>
3384
+
3385
+
3311
3386
 
3312
3387
 
3313
3388
  <fo:marker marker-class-name="table_continued"/>
3314
3389
 
3390
+
3315
3391
  <fo:block/>
3316
3392
  </fo:table-cell>
3317
3393
  </fo:table-row>
@@ -3331,6 +3407,19 @@
3331
3407
 
3332
3408
  </fo:table-body>
3333
3409
 
3410
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/text()[1]" priority="2" mode="presentation_name">
3411
+ <xsl:choose>
3412
+ <xsl:when test="substring-after(., '—') != ''">
3413
+ <xsl:text>—</xsl:text><xsl:value-of select="substring-after(., '—')"/>
3414
+ </xsl:when>
3415
+ <xsl:otherwise>
3416
+ <xsl:value-of select="."/>
3417
+ </xsl:otherwise>
3418
+ </xsl:choose>
3419
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']" mode="presentation_name">
3420
+ <xsl:apply-templates mode="presentation_name"/>
3421
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/node()" mode="presentation_name">
3422
+ <xsl:apply-templates select="."/>
3334
3423
  </xsl:template><xsl:template match="*[local-name()='tr']">
3335
3424
  <xsl:variable name="parent-name" select="local-name(..)"/>
3336
3425
  <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
@@ -3537,14 +3626,12 @@
3537
3626
  <xsl:apply-templates/>
3538
3627
  </xsl:template><xsl:template name="fn_display">
3539
3628
  <xsl:variable name="references">
3629
+
3540
3630
  <xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']">
3541
- <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
3542
-
3543
-
3544
- <xsl:apply-templates/>
3545
- </fn>
3631
+ <xsl:call-template name="create_fn"/>
3546
3632
  </xsl:for-each>
3547
3633
  </xsl:variable>
3634
+
3548
3635
  <xsl:for-each select="xalan:nodeset($references)//fn">
3549
3636
  <xsl:variable name="reference" select="@reference"/>
3550
3637
  <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
@@ -3583,6 +3670,12 @@
3583
3670
  </fo:block>
3584
3671
  </xsl:if>
3585
3672
  </xsl:for-each>
3673
+ </xsl:template><xsl:template name="create_fn">
3674
+ <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
3675
+
3676
+
3677
+ <xsl:apply-templates/>
3678
+ </fn>
3586
3679
  </xsl:template><xsl:template name="fn_name_display">
3587
3680
  <!-- <xsl:variable name="references">
3588
3681
  <xsl:for-each select="*[local-name()='name']//*[local-name()='fn']">
@@ -3711,7 +3804,7 @@
3711
3804
 
3712
3805
 
3713
3806
 
3714
- <xsl:if test="ancestor::*[local-name()='td']">
3807
+ <xsl:if test="ancestor::*[local-name()='table']">
3715
3808
  <xsl:attribute name="font-weight">normal</xsl:attribute>
3716
3809
  <!-- <xsl:attribute name="alignment-baseline">hanging</xsl:attribute> -->
3717
3810
  <xsl:attribute name="baseline-shift">15%</xsl:attribute>
@@ -4584,16 +4677,68 @@
4584
4677
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
4585
4678
  </xsl:call-template>
4586
4679
 
4680
+
4681
+
4587
4682
  <xsl:variable name="mathml">
4588
4683
  <xsl:apply-templates select="." mode="mathml"/>
4589
4684
  </xsl:variable>
4590
4685
  <fo:instream-foreign-object fox:alt-text="Math">
4591
4686
 
4592
4687
 
4688
+ <xsl:variable name="comment_text_following" select="following-sibling::node()[1][self::comment()]"/>
4689
+ <xsl:variable name="comment_text_">
4690
+ <xsl:choose>
4691
+ <xsl:when test="normalize-space($comment_text_following) != ''">
4692
+ <xsl:value-of select="$comment_text_following"/>
4693
+ </xsl:when>
4694
+ <xsl:otherwise>
4695
+ <xsl:value-of select="normalize-space(translate(.,' ⁢',' '))"/>
4696
+ </xsl:otherwise>
4697
+ </xsl:choose>
4698
+ </xsl:variable>
4699
+ <xsl:variable name="comment_text" select="java:org.metanorma.fop.Util.unescape($comment_text_)"/>
4700
+
4701
+ <xsl:if test="normalize-space($comment_text) != ''">
4702
+ <!-- put Mathin Alternate Text -->
4703
+ <xsl:attribute name="fox:alt-text">
4704
+ <xsl:value-of select="java:org.metanorma.fop.Util.unescape($comment_text)"/>
4705
+ </xsl:attribute>
4706
+ </xsl:if>
4707
+
4708
+ <xsl:variable name="mathml_content">
4709
+ <xsl:apply-templates select="." mode="mathml_actual_text"/>
4710
+ </xsl:variable>
4711
+ <!-- put MathML in Actual Text -->
4712
+ <xsl:attribute name="fox:actual-text">
4713
+ <xsl:value-of select="$mathml_content"/>
4714
+ </xsl:attribute>
4715
+
4716
+
4593
4717
  <!-- <xsl:copy-of select="."/> -->
4594
4718
  <xsl:copy-of select="xalan:nodeset($mathml)"/>
4595
4719
  </fo:instream-foreign-object>
4596
4720
  </fo:inline>
4721
+ </xsl:template><xsl:template match="mathml:*" mode="mathml_actual_text">
4722
+ <!-- <xsl:text>a+b</xsl:text> -->
4723
+ <xsl:text>&lt;</xsl:text>
4724
+ <xsl:value-of select="local-name()"/>
4725
+ <xsl:if test="local-name() = 'math'">
4726
+ <xsl:text> xmlns="http://www.w3.org/1998/Math/MathML"</xsl:text>
4727
+ </xsl:if>
4728
+ <xsl:for-each select="@*">
4729
+ <xsl:text> </xsl:text>
4730
+ <xsl:value-of select="local-name()"/>
4731
+ <xsl:text>="</xsl:text>
4732
+ <xsl:value-of select="."/>
4733
+ <xsl:text>"</xsl:text>
4734
+ </xsl:for-each>
4735
+ <xsl:text>&gt;</xsl:text>
4736
+ <xsl:apply-templates mode="mathml_actual_text"/>
4737
+ <xsl:text>&lt;/</xsl:text>
4738
+ <xsl:value-of select="local-name()"/>
4739
+ <xsl:text>&gt;</xsl:text>
4740
+ </xsl:template><xsl:template match="text()" mode="mathml_actual_text">
4741
+ <xsl:value-of select="normalize-space()"/>
4597
4742
  </xsl:template><xsl:template match="@*|node()" mode="mathml">
4598
4743
  <xsl:copy>
4599
4744
  <xsl:apply-templates select="@*|node()" mode="mathml"/>
@@ -4603,19 +4748,6 @@
4603
4748
  <!-- replace start and end spaces to non-break space -->
4604
4749
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
4605
4750
  </xsl:copy>
4606
- </xsl:template><xsl:template match="mathml:mi[. = ',' and not(following-sibling::*[1][local-name() = 'mtext' and text() = ' '])]" mode="mathml">
4607
- <xsl:copy>
4608
- <xsl:apply-templates select="@*|node()" mode="mathml"/>
4609
- </xsl:copy>
4610
- <xsl:choose>
4611
- <!-- if in msub, then don't add space -->
4612
- <xsl:when test="ancestor::mathml:mrow[parent::mathml:msub and preceding-sibling::*[1][self::mathml:mrow]]"/>
4613
- <!-- if next char in digit, don't add space -->
4614
- <xsl:when test="translate(substring(following-sibling::*[1]/text(),1,1),'0123456789','') = ''"/>
4615
- <xsl:otherwise>
4616
- <mathml:mspace width="0.5ex"/>
4617
- </xsl:otherwise>
4618
- </xsl:choose>
4619
4751
  </xsl:template><xsl:template match="mathml:math/*[local-name()='unit']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='prefix']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='dimension']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='quantity']" mode="mathml"/><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
4620
4752
  <xsl:variable name="target">
4621
4753
  <xsl:choose>
@@ -4668,7 +4800,10 @@
4668
4800
  </fo:block>
4669
4801
  <xsl:apply-templates/>
4670
4802
  </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
4671
- <fo:inline><xsl:apply-templates/></fo:inline>
4803
+ <xsl:variable name="level">
4804
+ <xsl:call-template name="getLevel"/>
4805
+ </xsl:variable>
4806
+ <fo:inline role="H{$level}"><xsl:apply-templates/></fo:inline>
4672
4807
  </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
4673
4808
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
4674
4809
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -4703,9 +4838,10 @@
4703
4838
 
4704
4839
  </xsl:variable>
4705
4840
 
4841
+ <xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
4706
4842
  <xsl:choose>
4707
- <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
4708
- <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
4843
+ <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>
4844
+ <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>
4709
4845
  </xsl:choose>
4710
4846
  <xsl:apply-templates/>
4711
4847
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
@@ -4851,7 +4987,10 @@
4851
4987
  </fo:block>
4852
4988
  </xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']" mode="presentation">
4853
4989
  <xsl:if test="normalize-space() != ''">
4854
- <fo:inline>
4990
+ <xsl:variable name="level">
4991
+ <xsl:call-template name="getLevelTermName"/>
4992
+ </xsl:variable>
4993
+ <fo:inline role="H{$level}">
4855
4994
  <xsl:apply-templates/>
4856
4995
  <!-- <xsl:if test="$namespace = 'gb' or $namespace = 'ogc'">
4857
4996
  <xsl:text>.</xsl:text>
@@ -5152,6 +5291,13 @@
5152
5291
  </xsl:attribute>
5153
5292
  <xsl:apply-templates mode="svg_update"/>
5154
5293
  </xsl:copy>
5294
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][*[local-name() = 'svg']]" priority="3">
5295
+ <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
5296
+ <xsl:for-each select="*[local-name() = 'svg']">
5297
+ <xsl:call-template name="image_svg">
5298
+ <xsl:with-param name="name" select="$name"/>
5299
+ </xsl:call-template>
5300
+ </xsl:for-each>
5155
5301
  </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
5156
5302
  <xsl:variable name="svg_content" select="document(@src)"/>
5157
5303
  <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
@@ -5256,7 +5402,7 @@
5256
5402
  </fo:basic-link>
5257
5403
  </fo:block>
5258
5404
  </fo:block-container>
5259
- </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
5405
+ </xsl:template><xsl:template match="*[local-name() = 'emf']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
5260
5406
  <xsl:apply-templates mode="contents"/>
5261
5407
  <xsl:text> </xsl:text>
5262
5408
  </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="bookmarks">
@@ -5482,6 +5628,7 @@
5482
5628
  </xsl:when>
5483
5629
  <xsl:otherwise>
5484
5630
  <xsl:apply-templates/>
5631
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
5485
5632
  </xsl:otherwise>
5486
5633
  </xsl:choose>
5487
5634
  </fo:block>
@@ -5622,14 +5769,6 @@
5622
5769
  <fo:block>
5623
5770
  <fo:inline padding-right="3mm">Obligation</fo:inline><xsl:value-of select="."/>
5624
5771
  </fo:block>
5625
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
5626
- <fo:block xsl:use-attribute-sets="requirement-subject-style">
5627
- <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
5628
- </fo:block>
5629
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'inherit']">
5630
- <fo:block xsl:use-attribute-sets="requirement-inherit-style">
5631
- <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
5632
- </fo:block>
5633
5772
  </xsl:template><xsl:template match="*[local-name() = 'recommendation']">
5634
5773
  <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
5635
5774
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -5646,6 +5785,38 @@
5646
5785
  <fo:block xsl:use-attribute-sets="recommendation-label-style">
5647
5786
  <xsl:apply-templates/>
5648
5787
  </fo:block>
5788
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" priority="2"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
5789
+ <fo:block xsl:use-attribute-sets="subject-style">
5790
+ <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
5791
+ </fo:block>
5792
+ </xsl:template><xsl:template match="*[local-name() = 'subject']">
5793
+ <fo:block xsl:use-attribute-sets="subject-style">
5794
+ <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
5795
+ </fo:block>
5796
+ </xsl:template><xsl:template match="*[local-name() = 'inherit'] | *[local-name() = 'component'][@class = 'inherit']">
5797
+ <fo:block xsl:use-attribute-sets="inherit-style">
5798
+ <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
5799
+ </fo:block>
5800
+ </xsl:template><xsl:template match="*[local-name() = 'description'] | *[local-name() = 'component'][@class = 'description']">
5801
+ <fo:block xsl:use-attribute-sets="description-style">
5802
+ <xsl:apply-templates/>
5803
+ </fo:block>
5804
+ </xsl:template><xsl:template match="*[local-name() = 'specification'] | *[local-name() = 'component'][@class = 'specification']">
5805
+ <fo:block xsl:use-attribute-sets="specification-style">
5806
+ <xsl:apply-templates/>
5807
+ </fo:block>
5808
+ </xsl:template><xsl:template match="*[local-name() = 'measurement-target'] | *[local-name() = 'component'][@class = 'measurement-target']">
5809
+ <fo:block xsl:use-attribute-sets="measurement-target-style">
5810
+ <xsl:apply-templates/>
5811
+ </fo:block>
5812
+ </xsl:template><xsl:template match="*[local-name() = 'verification'] | *[local-name() = 'component'][@class = 'verification']">
5813
+ <fo:block xsl:use-attribute-sets="verification-style">
5814
+ <xsl:apply-templates/>
5815
+ </fo:block>
5816
+ </xsl:template><xsl:template match="*[local-name() = 'import'] | *[local-name() = 'component'][@class = 'import']">
5817
+ <fo:block xsl:use-attribute-sets="import-style">
5818
+ <xsl:apply-templates/>
5819
+ </fo:block>
5649
5820
  </xsl:template><xsl:template match="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
5650
5821
  <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt">
5651
5822
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
@@ -5797,7 +5968,19 @@
5797
5968
  </fo:inline>
5798
5969
  </xsl:if>
5799
5970
  </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'p']">
5800
- <fo:inline><xsl:apply-templates/></fo:inline>
5971
+ <xsl:variable name="element">inline
5972
+
5973
+ </xsl:variable>
5974
+ <xsl:choose>
5975
+ <xsl:when test="contains($element, 'block')">
5976
+ <fo:block xsl:use-attribute-sets="example-p-style">
5977
+ <xsl:apply-templates/>
5978
+ </fo:block>
5979
+ </xsl:when>
5980
+ <xsl:otherwise>
5981
+ <fo:inline><xsl:apply-templates/></fo:inline>
5982
+ </xsl:otherwise>
5983
+ </xsl:choose>
5801
5984
  </xsl:template><xsl:template match="*[local-name() = 'example']">
5802
5985
  <fo:block id="{@id}" xsl:use-attribute-sets="example-style">
5803
5986
 
@@ -5904,20 +6087,22 @@
5904
6087
  </xsl:if>
5905
6088
  </xsl:template><xsl:variable name="localized.source">
5906
6089
  <xsl:call-template name="getLocalizedString">
5907
- <xsl:with-param name="key">source</xsl:with-param>
5908
- </xsl:call-template>
6090
+ <xsl:with-param name="key">source</xsl:with-param>
6091
+ </xsl:call-template>
5909
6092
  </xsl:variable><xsl:template match="*[local-name() = 'origin']">
5910
6093
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
5911
6094
  <xsl:if test="normalize-space(@citeas) = ''">
5912
6095
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
5913
6096
  </xsl:if>
5914
6097
 
6098
+
5915
6099
  <fo:inline>
5916
6100
 
5917
6101
 
5918
6102
 
5919
6103
 
5920
6104
 
6105
+
5921
6106
  <xsl:value-of select="$localized.source"/>
5922
6107
  <xsl:text> </xsl:text>
5923
6108
 
@@ -5928,6 +6113,7 @@
5928
6113
  <fo:inline xsl:use-attribute-sets="origin-style">
5929
6114
  <xsl:apply-templates/>
5930
6115
  </fo:inline>
6116
+
5931
6117
  </fo:basic-link>
5932
6118
  </xsl:template><xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']">
5933
6119
  <fo:inline><xsl:apply-templates/></fo:inline>
@@ -6004,6 +6190,9 @@
6004
6190
 
6005
6191
  </xsl:if>
6006
6192
 
6193
+ <xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets -->
6194
+ <xsl:variable name="text" select="normalize-space()"/>
6195
+
6007
6196
 
6008
6197
 
6009
6198
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
@@ -6016,7 +6205,9 @@
6016
6205
 
6017
6206
 
6018
6207
  </xsl:if>
6019
-
6208
+
6209
+
6210
+
6020
6211
  <xsl:apply-templates/>
6021
6212
  </fo:basic-link>
6022
6213
 
@@ -6358,6 +6549,7 @@
6358
6549
  </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" priority="4">
6359
6550
  <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
6360
6551
  <fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
6552
+
6361
6553
  <xsl:apply-templates/>
6362
6554
  </fo:block>
6363
6555
  </xsl:template><xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
@@ -6397,7 +6589,6 @@
6397
6589
  </xsl:template><xsl:template name="processBibitem">
6398
6590
 
6399
6591
 
6400
- <!-- end BIPM bibitem processing-->
6401
6592
 
6402
6593
 
6403
6594
 
@@ -6527,6 +6718,97 @@
6527
6718
  <fo:block-container border="1pt solid black" width="50%">
6528
6719
  <fo:block> </fo:block>
6529
6720
  </fo:block-container>
6721
+ </xsl:template><xsl:template match="*[local-name() = 'toc']">
6722
+ <xsl:param name="colwidths"/>
6723
+ <xsl:variable name="colwidths_">
6724
+ <xsl:choose>
6725
+ <xsl:when test="not($colwidths)">
6726
+ <xsl:variable name="toc_table_simple">
6727
+ <tbody>
6728
+ <xsl:apply-templates mode="toc_table_width"/>
6729
+ </tbody>
6730
+ </xsl:variable>
6731
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($toc_table_simple)/*/tr[1]/td)"/>
6732
+ <xsl:call-template name="calculate-column-widths">
6733
+ <xsl:with-param name="cols-count" select="$cols-count"/>
6734
+ <xsl:with-param name="table" select="$toc_table_simple"/>
6735
+ </xsl:call-template>
6736
+ </xsl:when>
6737
+ <xsl:otherwise>
6738
+ <xsl:copy-of select="$colwidths"/>
6739
+ </xsl:otherwise>
6740
+ </xsl:choose>
6741
+ </xsl:variable>
6742
+ <fo:block role="TOCI" space-after="16pt">
6743
+ <fo:table width="100%" table-layout="fixed">
6744
+ <xsl:for-each select="xalan:nodeset($colwidths_)/column">
6745
+ <fo:table-column column-width="proportional-column-width({.})"/>
6746
+ </xsl:for-each>
6747
+ <fo:table-body>
6748
+ <xsl:apply-templates/>
6749
+ </fo:table-body>
6750
+ </fo:table>
6751
+ </fo:block>
6752
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']">
6753
+ <fo:table-row min-height="5mm">
6754
+ <xsl:apply-templates/>
6755
+ </fo:table-row>
6756
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']/*[local-name() = 'p']">
6757
+ <xsl:apply-templates/>
6758
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'xref']" priority="3">
6759
+ <!-- <xref target="cgpm9th1948r6">1.6.3<tab/>&#8220;9th CGPM, 1948:<tab/>decision to establish the SI&#8221;</xref> -->
6760
+ <xsl:variable name="target" select="@target"/>
6761
+ <xsl:for-each select="*[local-name() = 'tab']">
6762
+ <xsl:variable name="current_id" select="generate-id()"/>
6763
+ <fo:table-cell>
6764
+ <fo:block>
6765
+ <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
6766
+ <xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
6767
+ <xsl:choose>
6768
+ <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
6769
+ <xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
6770
+ </xsl:choose>
6771
+ </xsl:for-each>
6772
+ </fo:basic-link>
6773
+ </fo:block>
6774
+ </fo:table-cell>
6775
+ </xsl:for-each>
6776
+ <!-- last column - for page numbers -->
6777
+ <fo:table-cell text-align="right" font-size="10pt" font-weight="bold" font-family="Arial">
6778
+ <fo:block>
6779
+ <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
6780
+ <fo:page-number-citation ref-id="{$target}"/>
6781
+ </fo:basic-link>
6782
+ </fo:block>
6783
+ </fo:table-cell>
6784
+ </xsl:template><xsl:template match="*" mode="toc_table_width">
6785
+ <xsl:apply-templates mode="toc_table_width"/>
6786
+ </xsl:template><xsl:template match="*[local-name() = 'clause'][@type = 'toc']/*[local-name() = 'title']" mode="toc_table_width"/><xsl:template match="*[local-name() = 'clause'][not(@type = 'toc')]/*[local-name() = 'title']" mode="toc_table_width"/><xsl:template match="*[local-name() = 'li']" mode="toc_table_width">
6787
+ <tr>
6788
+ <xsl:apply-templates mode="toc_table_width"/>
6789
+ </tr>
6790
+ </xsl:template><xsl:template match="*[local-name() = 'xref']" mode="toc_table_width">
6791
+ <!-- <xref target="cgpm9th1948r6">1.6.3<tab/>&#8220;9th CGPM, 1948:<tab/>decision to establish the SI&#8221;</xref> -->
6792
+ <xsl:for-each select="*[local-name() = 'tab']">
6793
+ <xsl:variable name="current_id" select="generate-id()"/>
6794
+ <td>
6795
+ <xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
6796
+ <xsl:copy-of select="."/>
6797
+ </xsl:for-each>
6798
+ </td>
6799
+ </xsl:for-each>
6800
+ <td>333</td> <!-- page number, just for fill -->
6801
+ </xsl:template><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']"/><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
6802
+ <fo:inline padding-right="5mm"> </fo:inline>
6803
+ <fo:inline><xsl:apply-templates/></fo:inline>
6804
+ </xsl:template><xsl:template match="*[local-name() = 'blacksquare']" name="blacksquare">
6805
+ <fo:inline padding-right="2.5mm" baseline-shift="5%">
6806
+ <fo:instream-foreign-object content-height="2mm" content-width="2mm" fox:alt-text="Quad">
6807
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" viewBox="0 0 2 2">
6808
+ <rect x="0" y="0" width="2" height="2" fill="black"/>
6809
+ </svg>
6810
+ </fo:instream-foreign-object>
6811
+ </fo:inline>
6530
6812
  </xsl:template><xsl:template name="convertDate">
6531
6813
  <xsl:param name="date"/>
6532
6814
  <xsl:param name="format" select="'short'"/>
@@ -6762,6 +7044,26 @@
6762
7044
  <xsl:value-of select="$level"/>
6763
7045
  </xsl:otherwise>
6764
7046
  </xsl:choose>
7047
+ </xsl:template><xsl:template name="getLevelTermName">
7048
+ <xsl:choose>
7049
+ <xsl:when test="normalize-space(../@depth) != ''">
7050
+ <xsl:value-of select="../@depth"/>
7051
+ </xsl:when>
7052
+ <xsl:otherwise>
7053
+ <xsl:variable name="title_level_">
7054
+ <xsl:for-each select="../preceding-sibling::*[local-name() = 'title'][1]">
7055
+ <xsl:call-template name="getLevel"/>
7056
+ </xsl:for-each>
7057
+ </xsl:variable>
7058
+ <xsl:variable name="title_level" select="normalize-space($title_level_)"/>
7059
+ <xsl:choose>
7060
+ <xsl:when test="$title_level != ''"><xsl:value-of select="$title_level + 1"/></xsl:when>
7061
+ <xsl:otherwise>
7062
+ <xsl:call-template name="getLevel"/>
7063
+ </xsl:otherwise>
7064
+ </xsl:choose>
7065
+ </xsl:otherwise>
7066
+ </xsl:choose>
6765
7067
  </xsl:template><xsl:template name="split">
6766
7068
  <xsl:param name="pText" select="."/>
6767
7069
  <xsl:param name="sep" select="','"/>