metanorma-un 0.6.8 → 0.6.12

Sign up to get free protection for your applications and to get access to all the features.
@@ -127,7 +127,7 @@
127
127
  </fo:block>
128
128
  </fo:block>
129
129
  <fo:block-container absolute-position="fixed" left="50mm" top="30mm" width="139mm" height="40mm" text-align="right" display-align="after">
130
- <fo:block font-family="Arial" font-size="24.5pt" font-weight="bold" margin-right="3mm"> <!-- margin-top="19mm" -->
130
+ <fo:block font-family="Arial" font-size="24.5pt" font-weight="bold" margin-right="3mm" role="H1"> <!-- margin-top="19mm" -->
131
131
  <xsl:if test="string-length($title) &gt; 70">
132
132
  <xsl:attribute name="font-size">22pt</xsl:attribute>
133
133
  </xsl:if>
@@ -142,7 +142,7 @@
142
142
  <fo:flow flow-name="xsl-region-body" font-family="Arial">
143
143
  <fo:block font-size="14pt" font-weight="bold" text-align="center">United Nations Economic Commission for Europe</fo:block>
144
144
  <fo:block font-size="12pt" font-weight="normal" text-align="center" margin-top="46pt" margin-bottom="128pt" keep-together="always">United Nations Centre for Trade Facilitation and Electronic Business</fo:block>
145
- <fo:block font-size="22pt" font-weight="bold" text-align="center">
145
+ <fo:block font-size="22pt" font-weight="bold" text-align="center" role="H1">
146
146
  <xsl:value-of select="$title"/>
147
147
  <xsl:value-of select="$linebreak"/>
148
148
  <xsl:value-of select="$doctypenumber"/>
@@ -200,17 +200,17 @@
200
200
  <xsl:with-param name="name" select="'title-toc'"/>
201
201
  </xsl:call-template>
202
202
  </xsl:variable>
203
- <fo:block font-size="14pt" margin-top="4pt" margin-bottom="8pt"><xsl:value-of select="$title-toc"/></fo:block>
203
+ <fo:block font-size="14pt" margin-top="4pt" margin-bottom="8pt" role="H1"><xsl:value-of select="$title-toc"/></fo:block>
204
204
  <xsl:variable name="title-page">
205
205
  <xsl:call-template name="getTitle">
206
206
  <xsl:with-param name="name" select="'title-page'"/>
207
207
  </xsl:call-template>
208
208
  </xsl:variable>
209
209
  <fo:block font-size="9pt" text-align="right" font-style="italic" margin-bottom="6pt"><xsl:value-of select="$title-page"/></fo:block>
210
- <fo:block>
210
+ <fo:block role="TOC">
211
211
  <xsl:for-each select="xalan:nodeset($contents)//item[not (@type = 'annex' or @parent = 'annex') and @display = 'true']">
212
212
 
213
- <fo:block>
213
+ <fo:block role="TOCI">
214
214
 
215
215
  <fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm">
216
216
  <xsl:if test="@level = 2 and @section != ''">
@@ -249,7 +249,7 @@
249
249
  <xsl:if test="xalan:nodeset($contents)//item[@type = 'annex' and @display = 'true']">
250
250
  <fo:block text-align="center" margin-top="12pt" margin-bottom="12pt">ANNEXES</fo:block>
251
251
  <xsl:for-each select="xalan:nodeset($contents)//item[@type = 'annex' and @display = 'true']">
252
- <fo:block>
252
+ <fo:block role="TOCI">
253
253
  <fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm">
254
254
  <fo:basic-link internal-destination="{@id}" fox:alt-text="{@section}">
255
255
  <xsl:if test="@section != ''">
@@ -423,7 +423,10 @@
423
423
 
424
424
 
425
425
  <xsl:template match="un:legal-statement//un:clause/un:title">
426
- <fo:block font-weight="bold">
426
+ <xsl:variable name="level">
427
+ <xsl:call-template name="getLevel"/>
428
+ </xsl:variable>
429
+ <fo:block font-weight="bold" role="H{$level}">
427
430
  <xsl:choose>
428
431
  <xsl:when test="text() = 'Note'">
429
432
  <xsl:attribute name="font-size">14pt</xsl:attribute>
@@ -567,7 +570,10 @@
567
570
  </xsl:template>
568
571
 
569
572
  <xsl:template match="un:title" mode="inline-header">
570
- <fo:inline>
573
+ <xsl:variable name="level">
574
+ <xsl:call-template name="getLevel"/>
575
+ </xsl:variable>
576
+ <fo:inline role="H{$level}">
571
577
  <xsl:apply-templates/>
572
578
  </fo:inline>
573
579
  </xsl:template>
@@ -739,8 +745,9 @@
739
745
  <xsl:otherwise>12pt</xsl:otherwise>
740
746
  </xsl:choose>
741
747
  </xsl:variable>
742
- <fo:block font-size="{$font-size}" font-weight="bold" margin-top="30pt" margin-bottom="16pt" keep-with-next="always">
748
+ <fo:block font-size="{$font-size}" font-weight="bold" margin-top="30pt" margin-bottom="16pt" keep-with-next="always" role="H{$level}">
743
749
  <xsl:apply-templates/>
750
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
744
751
  </fo:block>
745
752
  </xsl:template>
746
753
 
@@ -758,12 +765,13 @@
758
765
 
759
766
  <xsl:choose>
760
767
  <xsl:when test="$level = 1">
761
- <fo:block font-size="{$font-size}" font-weight="bold" space-before="3pt" margin-top="12pt" margin-bottom="16pt" keep-with-next="always" line-height="18pt">
768
+ <fo:block font-size="{$font-size}" font-weight="bold" space-before="3pt" margin-top="12pt" margin-bottom="16pt" keep-with-next="always" line-height="18pt" role="H{$level}">
762
769
  <xsl:apply-templates/>
770
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
763
771
  </fo:block>
764
772
  </xsl:when>
765
773
  <xsl:when test="$level &gt;= 2">
766
- <fo:block font-size="{$font-size}" font-weight="bold" space-before="3pt" margin-bottom="12pt" margin-left="-9.5mm" line-height="108%" keep-with-next="always"> <!-- line-height="14.5pt" text-indent="-9.5mm" -->
774
+ <fo:block font-size="{$font-size}" font-weight="bold" space-before="3pt" margin-bottom="12pt" margin-left="-9.5mm" line-height="108%" keep-with-next="always" role="H{$level}"> <!-- line-height="14.5pt" text-indent="-9.5mm" -->
767
775
  <xsl:if test="$level = 2">
768
776
  <xsl:attribute name="margin-top">16pt</xsl:attribute>
769
777
  </xsl:if>
@@ -796,7 +804,7 @@
796
804
 
797
805
  <xsl:choose>
798
806
  <xsl:when test="ancestor::un:sections">
799
- <fo:block font-size="{$font-size}" font-weight="bold" space-before="3pt" margin-bottom="12pt" margin-left="-9.5mm" line-height="108%" keep-with-next="always"> <!-- line-height="14.5pt" text-indent="-9.5mm" -->
807
+ <fo:block font-size="{$font-size}" font-weight="bold" space-before="3pt" margin-bottom="12pt" margin-left="-9.5mm" line-height="108%" keep-with-next="always" role="H{$level}"> <!-- line-height="14.5pt" text-indent="-9.5mm" -->
800
808
  <xsl:if test="$level = 1">
801
809
  <!-- <xsl:attribute name="margin-left">-8.5mm</xsl:attribute> -->
802
810
  <xsl:attribute name="margin-top">18pt</xsl:attribute>
@@ -813,8 +821,9 @@
813
821
  </xsl:when>
814
822
 
815
823
  <xsl:otherwise>
816
- <fo:block font-size="{$font-size}" font-weight="bold" text-align="left" keep-with-next="always">
824
+ <fo:block font-size="{$font-size}" font-weight="bold" text-align="left" keep-with-next="always" role="H{$level}">
817
825
  <xsl:apply-templates/>
826
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
818
827
  </fo:block>
819
828
  </xsl:otherwise>
820
829
  </xsl:choose>
@@ -1017,7 +1026,7 @@
1017
1026
  <!-- ============================ -->
1018
1027
 
1019
1028
  <xsl:template name="insertHeaderPreface">
1020
- <fo:static-content flow-name="header">
1029
+ <fo:static-content flow-name="header" role="artifact">
1021
1030
  <fo:block-container height="25.5mm" display-align="before" border-bottom="0.5pt solid black">
1022
1031
  <fo:block font-weight="bold" padding-top="20.5mm" text-align="center">
1023
1032
  <!-- <xsl:text>UN/CEFACT </xsl:text> -->
@@ -1028,7 +1037,7 @@
1028
1037
  </xsl:template>
1029
1038
 
1030
1039
  <xsl:template name="insertHeader">
1031
- <fo:static-content flow-name="header">
1040
+ <fo:static-content flow-name="header" role="artifact">
1032
1041
  <fo:block-container height="28.5mm" display-align="before" border-bottom="0.5pt solid black">
1033
1042
  <fo:block font-weight="bold" padding-top="20.5mm" text-align="center">
1034
1043
  <!-- <xsl:text>UN/CEFACT </xsl:text> -->
@@ -1039,7 +1048,7 @@
1039
1048
  </xsl:template>
1040
1049
 
1041
1050
  <xsl:template name="insertFooter">
1042
- <fo:static-content flow-name="footer">
1051
+ <fo:static-content flow-name="footer" role="artifact">
1043
1052
  <fo:block-container height="29mm" display-align="after">
1044
1053
  <fo:block font-size="9pt" font-weight="bold" text-align="center" padding-bottom="24mm"><fo:page-number/></fo:block>
1045
1054
  </fo:block-container>
@@ -1227,12 +1236,13 @@
1227
1236
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
1228
1237
  <xsl:attribute name="white-space">pre</xsl:attribute>
1229
1238
  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
1239
+ <xsl:attribute name="role">Code</xsl:attribute>
1230
1240
 
1231
1241
 
1232
1242
 
1233
1243
 
1234
1244
 
1235
- <xsl:attribute name="font-family">Courier</xsl:attribute>
1245
+ <xsl:attribute name="font-family">Courier New</xsl:attribute>
1236
1246
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
1237
1247
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1238
1248
 
@@ -1252,8 +1262,13 @@
1252
1262
 
1253
1263
  </xsl:attribute-set><xsl:attribute-set name="requirement-label-style">
1254
1264
 
1255
- </xsl:attribute-set><xsl:attribute-set name="requirement-subject-style">
1256
- </xsl:attribute-set><xsl:attribute-set name="requirement-inherit-style">
1265
+ </xsl:attribute-set><xsl:attribute-set name="subject-style">
1266
+ </xsl:attribute-set><xsl:attribute-set name="inherit-style">
1267
+ </xsl:attribute-set><xsl:attribute-set name="description-style">
1268
+ </xsl:attribute-set><xsl:attribute-set name="specification-style">
1269
+ </xsl:attribute-set><xsl:attribute-set name="measurement-target-style">
1270
+ </xsl:attribute-set><xsl:attribute-set name="verification-style">
1271
+ </xsl:attribute-set><xsl:attribute-set name="import-style">
1257
1272
  </xsl:attribute-set><xsl:attribute-set name="recommendation-style">
1258
1273
 
1259
1274
 
@@ -1321,6 +1336,7 @@
1321
1336
 
1322
1337
 
1323
1338
 
1339
+
1324
1340
  <xsl:attribute name="font-size">11pt</xsl:attribute>
1325
1341
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
1326
1342
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
@@ -1453,7 +1469,8 @@
1453
1469
 
1454
1470
 
1455
1471
 
1456
- </xsl:attribute-set><xsl:attribute-set name="quote-style">
1472
+ </xsl:attribute-set><xsl:attribute-set name="quote-style">
1473
+ <xsl:attribute name="role">BlockQuote</xsl:attribute>
1457
1474
 
1458
1475
 
1459
1476
 
@@ -1577,13 +1594,20 @@
1577
1594
 
1578
1595
  </xsl:attribute-set><xsl:attribute-set name="list-style">
1579
1596
 
1580
- </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">
1597
+ </xsl:attribute-set><xsl:attribute-set name="toc-style">
1598
+ <xsl:attribute name="line-height">135%</xsl:attribute>
1599
+ </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">
1581
1600
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
1582
1601
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
1583
1602
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
1584
1603
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']" mode="contents"/>
1585
1604
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']" mode="contents"/>
1586
- </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
1605
+ </xsl:template><xsl:template name="processPrefaceSectionsDefault_Contents">
1606
+ <xsl:for-each select="/*/*[local-name()='preface']/*">
1607
+ <xsl:sort select="@displayorder" data-type="number"/>
1608
+ <xsl:apply-templates select="." mode="contents"/>
1609
+ </xsl:for-each>
1610
+ </xsl:template><xsl:template name="OLD_processMainSectionsDefault_Contents">
1587
1611
  <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
1588
1612
 
1589
1613
  <!-- Normative references -->
@@ -1596,13 +1620,33 @@
1596
1620
  <!-- Bibliography -->
1597
1621
  <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"/>
1598
1622
 
1599
- </xsl:template><xsl:template name="processPrefaceSectionsDefault">
1623
+ </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
1624
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
1625
+ <xsl:sort select="@displayorder" data-type="number"/>
1626
+ <xsl:apply-templates select="." mode="contents"/>
1627
+ </xsl:for-each>
1628
+
1629
+ <xsl:for-each select="/*/*[local-name()='annex']">
1630
+ <xsl:sort select="@displayorder" data-type="number"/>
1631
+ <xsl:apply-templates select="." mode="contents"/>
1632
+ </xsl:for-each>
1633
+
1634
+ <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
1635
+ <xsl:sort select="@displayorder" data-type="number"/>
1636
+ <xsl:apply-templates select="." mode="contents"/>
1637
+ </xsl:for-each>
1638
+ </xsl:template><xsl:template name="OLD_processPrefaceSectionsDefault">
1600
1639
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
1601
1640
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
1602
1641
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']"/>
1603
1642
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']"/>
1604
1643
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']"/>
1605
- </xsl:template><xsl:template name="processMainSectionsDefault">
1644
+ </xsl:template><xsl:template name="processPrefaceSectionsDefault">
1645
+ <xsl:for-each select="/*/*[local-name()='preface']/*">
1646
+ <xsl:sort select="@displayorder" data-type="number"/>
1647
+ <xsl:apply-templates select="."/>
1648
+ </xsl:for-each>
1649
+ </xsl:template><xsl:template name="OLD_processMainSectionsDefault">
1606
1650
  <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']"/>
1607
1651
 
1608
1652
  <!-- Normative references -->
@@ -1614,6 +1658,22 @@
1614
1658
  <xsl:apply-templates select="/*/*[local-name()='annex']"/>
1615
1659
  <!-- Bibliography -->
1616
1660
  <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]"/>
1661
+ </xsl:template><xsl:template name="processMainSectionsDefault">
1662
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
1663
+ <xsl:sort select="@displayorder" data-type="number"/>
1664
+ <xsl:apply-templates select="."/>
1665
+
1666
+ </xsl:for-each>
1667
+
1668
+ <xsl:for-each select="/*/*[local-name()='annex']">
1669
+ <xsl:sort select="@displayorder" data-type="number"/>
1670
+ <xsl:apply-templates select="."/>
1671
+ </xsl:for-each>
1672
+
1673
+ <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
1674
+ <xsl:sort select="@displayorder" data-type="number"/>
1675
+ <xsl:apply-templates select="."/>
1676
+ </xsl:for-each>
1617
1677
  </xsl:template><xsl:template match="text()">
1618
1678
  <xsl:value-of select="."/>
1619
1679
  </xsl:template><xsl:template match="*[local-name()='br']">
@@ -1644,7 +1704,9 @@
1644
1704
 
1645
1705
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
1646
1706
 
1647
-
1707
+
1708
+
1709
+
1648
1710
 
1649
1711
  <xsl:call-template name="fn_name_display"/>
1650
1712
 
@@ -1778,6 +1840,8 @@
1778
1840
  <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1779
1841
  </xsl:if>
1780
1842
 
1843
+
1844
+
1781
1845
  <xsl:choose>
1782
1846
  <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
1783
1847
  <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
@@ -2062,9 +2126,9 @@
2062
2126
  <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation">
2063
2127
  <xsl:with-param name="continued">true</xsl:with-param>
2064
2128
  </xsl:apply-templates>
2065
- <xsl:for-each select="ancestor::*[local-name()='table'][1]">
2066
- <xsl:call-template name="fn_name_display"/>
2067
- </xsl:for-each>
2129
+
2130
+
2131
+
2068
2132
 
2069
2133
  </fo:table-cell>
2070
2134
  </fo:table-row>
@@ -2146,7 +2210,11 @@
2146
2210
 
2147
2211
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
2148
2212
 
2149
- <xsl:if test="$isNoteOrFnExist = 'true'">
2213
+ <xsl:variable name="isNoteOrFnExistShowAfterTable">
2214
+
2215
+ </xsl:variable>
2216
+
2217
+ <xsl:if test="$isNoteOrFnExist = 'true' or normalize-space($isNoteOrFnExistShowAfterTable) = 'true'">
2150
2218
 
2151
2219
  <xsl:variable name="cols-count">
2152
2220
  <xsl:choose>
@@ -2287,6 +2355,19 @@
2287
2355
 
2288
2356
  </fo:table-body>
2289
2357
 
2358
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/text()[1]" priority="2" mode="presentation_name">
2359
+ <xsl:choose>
2360
+ <xsl:when test="substring-after(., '—') != ''">
2361
+ <xsl:text>—</xsl:text><xsl:value-of select="substring-after(., '—')"/>
2362
+ </xsl:when>
2363
+ <xsl:otherwise>
2364
+ <xsl:value-of select="."/>
2365
+ </xsl:otherwise>
2366
+ </xsl:choose>
2367
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']" mode="presentation_name">
2368
+ <xsl:apply-templates mode="presentation_name"/>
2369
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/node()" mode="presentation_name">
2370
+ <xsl:apply-templates select="."/>
2290
2371
  </xsl:template><xsl:template match="*[local-name()='tr']">
2291
2372
  <xsl:variable name="parent-name" select="local-name(..)"/>
2292
2373
  <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
@@ -2491,14 +2572,12 @@
2491
2572
  <xsl:apply-templates/>
2492
2573
  </xsl:template><xsl:template name="fn_display">
2493
2574
  <xsl:variable name="references">
2575
+
2494
2576
  <xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']">
2495
- <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
2496
-
2497
-
2498
- <xsl:apply-templates/>
2499
- </fn>
2577
+ <xsl:call-template name="create_fn"/>
2500
2578
  </xsl:for-each>
2501
2579
  </xsl:variable>
2580
+
2502
2581
  <xsl:for-each select="xalan:nodeset($references)//fn">
2503
2582
  <xsl:variable name="reference" select="@reference"/>
2504
2583
  <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
@@ -2534,6 +2613,12 @@
2534
2613
  </fo:block>
2535
2614
  </xsl:if>
2536
2615
  </xsl:for-each>
2616
+ </xsl:template><xsl:template name="create_fn">
2617
+ <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
2618
+
2619
+
2620
+ <xsl:apply-templates/>
2621
+ </fn>
2537
2622
  </xsl:template><xsl:template name="fn_name_display">
2538
2623
  <!-- <xsl:variable name="references">
2539
2624
  <xsl:for-each select="*[local-name()='name']//*[local-name()='fn']">
@@ -3513,16 +3598,68 @@
3513
3598
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
3514
3599
  </xsl:call-template>
3515
3600
 
3601
+
3602
+
3516
3603
  <xsl:variable name="mathml">
3517
3604
  <xsl:apply-templates select="." mode="mathml"/>
3518
3605
  </xsl:variable>
3519
3606
  <fo:instream-foreign-object fox:alt-text="Math">
3520
3607
 
3521
3608
 
3609
+ <xsl:variable name="comment_text_following" select="following-sibling::node()[1][self::comment()]"/>
3610
+ <xsl:variable name="comment_text_">
3611
+ <xsl:choose>
3612
+ <xsl:when test="normalize-space($comment_text_following) != ''">
3613
+ <xsl:value-of select="$comment_text_following"/>
3614
+ </xsl:when>
3615
+ <xsl:otherwise>
3616
+ <xsl:value-of select="normalize-space(translate(.,' ⁢',' '))"/>
3617
+ </xsl:otherwise>
3618
+ </xsl:choose>
3619
+ </xsl:variable>
3620
+ <xsl:variable name="comment_text" select="java:org.metanorma.fop.Util.unescape($comment_text_)"/>
3621
+
3622
+ <xsl:if test="normalize-space($comment_text) != ''">
3623
+ <!-- put Mathin Alternate Text -->
3624
+ <xsl:attribute name="fox:alt-text">
3625
+ <xsl:value-of select="java:org.metanorma.fop.Util.unescape($comment_text)"/>
3626
+ </xsl:attribute>
3627
+ </xsl:if>
3628
+
3629
+ <xsl:variable name="mathml_content">
3630
+ <xsl:apply-templates select="." mode="mathml_actual_text"/>
3631
+ </xsl:variable>
3632
+ <!-- put MathML in Actual Text -->
3633
+ <xsl:attribute name="fox:actual-text">
3634
+ <xsl:value-of select="$mathml_content"/>
3635
+ </xsl:attribute>
3636
+
3637
+
3522
3638
  <!-- <xsl:copy-of select="."/> -->
3523
3639
  <xsl:copy-of select="xalan:nodeset($mathml)"/>
3524
3640
  </fo:instream-foreign-object>
3525
3641
  </fo:inline>
3642
+ </xsl:template><xsl:template match="mathml:*" mode="mathml_actual_text">
3643
+ <!-- <xsl:text>a+b</xsl:text> -->
3644
+ <xsl:text>&lt;</xsl:text>
3645
+ <xsl:value-of select="local-name()"/>
3646
+ <xsl:if test="local-name() = 'math'">
3647
+ <xsl:text> xmlns="http://www.w3.org/1998/Math/MathML"</xsl:text>
3648
+ </xsl:if>
3649
+ <xsl:for-each select="@*">
3650
+ <xsl:text> </xsl:text>
3651
+ <xsl:value-of select="local-name()"/>
3652
+ <xsl:text>="</xsl:text>
3653
+ <xsl:value-of select="."/>
3654
+ <xsl:text>"</xsl:text>
3655
+ </xsl:for-each>
3656
+ <xsl:text>&gt;</xsl:text>
3657
+ <xsl:apply-templates mode="mathml_actual_text"/>
3658
+ <xsl:text>&lt;/</xsl:text>
3659
+ <xsl:value-of select="local-name()"/>
3660
+ <xsl:text>&gt;</xsl:text>
3661
+ </xsl:template><xsl:template match="text()" mode="mathml_actual_text">
3662
+ <xsl:value-of select="normalize-space()"/>
3526
3663
  </xsl:template><xsl:template match="@*|node()" mode="mathml">
3527
3664
  <xsl:copy>
3528
3665
  <xsl:apply-templates select="@*|node()" mode="mathml"/>
@@ -3532,19 +3669,6 @@
3532
3669
  <!-- replace start and end spaces to non-break space -->
3533
3670
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
3534
3671
  </xsl:copy>
3535
- </xsl:template><xsl:template match="mathml:mi[. = ',' and not(following-sibling::*[1][local-name() = 'mtext' and text() = ' '])]" mode="mathml">
3536
- <xsl:copy>
3537
- <xsl:apply-templates select="@*|node()" mode="mathml"/>
3538
- </xsl:copy>
3539
- <xsl:choose>
3540
- <!-- if in msub, then don't add space -->
3541
- <xsl:when test="ancestor::mathml:mrow[parent::mathml:msub and preceding-sibling::*[1][self::mathml:mrow]]"/>
3542
- <!-- if next char in digit, don't add space -->
3543
- <xsl:when test="translate(substring(following-sibling::*[1]/text(),1,1),'0123456789','') = ''"/>
3544
- <xsl:otherwise>
3545
- <mathml:mspace width="0.5ex"/>
3546
- </xsl:otherwise>
3547
- </xsl:choose>
3548
3672
  </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">
3549
3673
  <xsl:variable name="target">
3550
3674
  <xsl:choose>
@@ -3597,7 +3721,10 @@
3597
3721
  </fo:block>
3598
3722
  <xsl:apply-templates/>
3599
3723
  </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
3600
- <fo:inline><xsl:apply-templates/></fo:inline>
3724
+ <xsl:variable name="level">
3725
+ <xsl:call-template name="getLevel"/>
3726
+ </xsl:variable>
3727
+ <fo:inline role="H{$level}"><xsl:apply-templates/></fo:inline>
3601
3728
  </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
3602
3729
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
3603
3730
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -3632,9 +3759,10 @@
3632
3759
 
3633
3760
  </xsl:variable>
3634
3761
 
3762
+ <xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
3635
3763
  <xsl:choose>
3636
- <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
3637
- <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
3764
+ <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>
3765
+ <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>
3638
3766
  </xsl:choose>
3639
3767
  <xsl:apply-templates/>
3640
3768
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
@@ -3795,7 +3923,10 @@
3795
3923
  </fo:block>
3796
3924
  </xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']" mode="presentation">
3797
3925
  <xsl:if test="normalize-space() != ''">
3798
- <fo:inline>
3926
+ <xsl:variable name="level">
3927
+ <xsl:call-template name="getLevelTermName"/>
3928
+ </xsl:variable>
3929
+ <fo:inline role="H{$level}">
3799
3930
  <xsl:apply-templates/>
3800
3931
  <!-- <xsl:if test="$namespace = 'gb' or $namespace = 'ogc'">
3801
3932
  <xsl:text>.</xsl:text>
@@ -4101,6 +4232,13 @@
4101
4232
  </xsl:attribute>
4102
4233
  <xsl:apply-templates mode="svg_update"/>
4103
4234
  </xsl:copy>
4235
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][*[local-name() = 'svg']]" priority="3">
4236
+ <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
4237
+ <xsl:for-each select="*[local-name() = 'svg']">
4238
+ <xsl:call-template name="image_svg">
4239
+ <xsl:with-param name="name" select="$name"/>
4240
+ </xsl:call-template>
4241
+ </xsl:for-each>
4104
4242
  </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
4105
4243
  <xsl:variable name="svg_content" select="document(@src)"/>
4106
4244
  <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
@@ -4205,7 +4343,7 @@
4205
4343
  </fo:basic-link>
4206
4344
  </fo:block>
4207
4345
  </fo:block-container>
4208
- </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">
4346
+ </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">
4209
4347
  <xsl:apply-templates mode="contents"/>
4210
4348
  <xsl:text> </xsl:text>
4211
4349
  </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">
@@ -4431,6 +4569,7 @@
4431
4569
  </xsl:when>
4432
4570
  <xsl:otherwise>
4433
4571
  <xsl:apply-templates/>
4572
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
4434
4573
  </xsl:otherwise>
4435
4574
  </xsl:choose>
4436
4575
  </fo:block>
@@ -4571,14 +4710,6 @@
4571
4710
  <fo:block>
4572
4711
  <fo:inline padding-right="3mm">Obligation</fo:inline><xsl:value-of select="."/>
4573
4712
  </fo:block>
4574
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
4575
- <fo:block xsl:use-attribute-sets="requirement-subject-style">
4576
- <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
4577
- </fo:block>
4578
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'inherit']">
4579
- <fo:block xsl:use-attribute-sets="requirement-inherit-style">
4580
- <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
4581
- </fo:block>
4582
4713
  </xsl:template><xsl:template match="*[local-name() = 'recommendation']">
4583
4714
  <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
4584
4715
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -4595,6 +4726,38 @@
4595
4726
  <fo:block xsl:use-attribute-sets="recommendation-label-style">
4596
4727
  <xsl:apply-templates/>
4597
4728
  </fo:block>
4729
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" priority="2"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
4730
+ <fo:block xsl:use-attribute-sets="subject-style">
4731
+ <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
4732
+ </fo:block>
4733
+ </xsl:template><xsl:template match="*[local-name() = 'subject']">
4734
+ <fo:block xsl:use-attribute-sets="subject-style">
4735
+ <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
4736
+ </fo:block>
4737
+ </xsl:template><xsl:template match="*[local-name() = 'inherit'] | *[local-name() = 'component'][@class = 'inherit']">
4738
+ <fo:block xsl:use-attribute-sets="inherit-style">
4739
+ <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
4740
+ </fo:block>
4741
+ </xsl:template><xsl:template match="*[local-name() = 'description'] | *[local-name() = 'component'][@class = 'description']">
4742
+ <fo:block xsl:use-attribute-sets="description-style">
4743
+ <xsl:apply-templates/>
4744
+ </fo:block>
4745
+ </xsl:template><xsl:template match="*[local-name() = 'specification'] | *[local-name() = 'component'][@class = 'specification']">
4746
+ <fo:block xsl:use-attribute-sets="specification-style">
4747
+ <xsl:apply-templates/>
4748
+ </fo:block>
4749
+ </xsl:template><xsl:template match="*[local-name() = 'measurement-target'] | *[local-name() = 'component'][@class = 'measurement-target']">
4750
+ <fo:block xsl:use-attribute-sets="measurement-target-style">
4751
+ <xsl:apply-templates/>
4752
+ </fo:block>
4753
+ </xsl:template><xsl:template match="*[local-name() = 'verification'] | *[local-name() = 'component'][@class = 'verification']">
4754
+ <fo:block xsl:use-attribute-sets="verification-style">
4755
+ <xsl:apply-templates/>
4756
+ </fo:block>
4757
+ </xsl:template><xsl:template match="*[local-name() = 'import'] | *[local-name() = 'component'][@class = 'import']">
4758
+ <fo:block xsl:use-attribute-sets="import-style">
4759
+ <xsl:apply-templates/>
4760
+ </fo:block>
4598
4761
  </xsl:template><xsl:template match="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
4599
4762
  <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt">
4600
4763
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
@@ -4746,7 +4909,19 @@
4746
4909
  </fo:inline>
4747
4910
  </xsl:if>
4748
4911
  </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'p']">
4749
- <fo:inline><xsl:apply-templates/></fo:inline>
4912
+ <xsl:variable name="element">inline
4913
+
4914
+ </xsl:variable>
4915
+ <xsl:choose>
4916
+ <xsl:when test="contains($element, 'block')">
4917
+ <fo:block xsl:use-attribute-sets="example-p-style">
4918
+ <xsl:apply-templates/>
4919
+ </fo:block>
4920
+ </xsl:when>
4921
+ <xsl:otherwise>
4922
+ <fo:inline><xsl:apply-templates/></fo:inline>
4923
+ </xsl:otherwise>
4924
+ </xsl:choose>
4750
4925
  </xsl:template><xsl:template match="*[local-name() = 'example']">
4751
4926
  <fo:block id="{@id}" xsl:use-attribute-sets="example-style">
4752
4927
 
@@ -4853,8 +5028,8 @@
4853
5028
  </xsl:if>
4854
5029
  </xsl:template><xsl:variable name="localized.source">
4855
5030
  <xsl:call-template name="getLocalizedString">
4856
- <xsl:with-param name="key">source</xsl:with-param>
4857
- </xsl:call-template>
5031
+ <xsl:with-param name="key">source</xsl:with-param>
5032
+ </xsl:call-template>
4858
5033
  </xsl:variable><xsl:template match="*[local-name() = 'origin']">
4859
5034
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
4860
5035
  <xsl:if test="normalize-space(@citeas) = ''">
@@ -4864,6 +5039,7 @@
4864
5039
  <fo:inline xsl:use-attribute-sets="origin-style">
4865
5040
  <xsl:apply-templates/>
4866
5041
  </fo:inline>
5042
+
4867
5043
  </fo:basic-link>
4868
5044
  </xsl:template><xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']">
4869
5045
  <fo:inline><xsl:apply-templates/></fo:inline>
@@ -4930,6 +5106,9 @@
4930
5106
 
4931
5107
  </xsl:if>
4932
5108
 
5109
+ <xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets -->
5110
+ <xsl:variable name="text" select="normalize-space()"/>
5111
+
4933
5112
 
4934
5113
 
4935
5114
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
@@ -4942,7 +5121,9 @@
4942
5121
 
4943
5122
 
4944
5123
  </xsl:if>
4945
-
5124
+
5125
+
5126
+
4946
5127
  <xsl:apply-templates/>
4947
5128
  </fo:basic-link>
4948
5129
 
@@ -5287,6 +5468,7 @@
5287
5468
  </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" priority="4">
5288
5469
  <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
5289
5470
  <fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
5471
+
5290
5472
  <xsl:apply-templates/>
5291
5473
  </fo:block>
5292
5474
  </xsl:template><xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
@@ -5326,7 +5508,6 @@
5326
5508
  </xsl:template><xsl:template name="processBibitem">
5327
5509
 
5328
5510
 
5329
- <!-- end BIPM bibitem processing-->
5330
5511
 
5331
5512
 
5332
5513
 
@@ -5456,6 +5637,97 @@
5456
5637
  <fo:block-container border="1pt solid black" width="50%">
5457
5638
  <fo:block> </fo:block>
5458
5639
  </fo:block-container>
5640
+ </xsl:template><xsl:template match="*[local-name() = 'toc']">
5641
+ <xsl:param name="colwidths"/>
5642
+ <xsl:variable name="colwidths_">
5643
+ <xsl:choose>
5644
+ <xsl:when test="not($colwidths)">
5645
+ <xsl:variable name="toc_table_simple">
5646
+ <tbody>
5647
+ <xsl:apply-templates mode="toc_table_width"/>
5648
+ </tbody>
5649
+ </xsl:variable>
5650
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($toc_table_simple)/*/tr[1]/td)"/>
5651
+ <xsl:call-template name="calculate-column-widths">
5652
+ <xsl:with-param name="cols-count" select="$cols-count"/>
5653
+ <xsl:with-param name="table" select="$toc_table_simple"/>
5654
+ </xsl:call-template>
5655
+ </xsl:when>
5656
+ <xsl:otherwise>
5657
+ <xsl:copy-of select="$colwidths"/>
5658
+ </xsl:otherwise>
5659
+ </xsl:choose>
5660
+ </xsl:variable>
5661
+ <fo:block role="TOCI" space-after="16pt">
5662
+ <fo:table width="100%" table-layout="fixed">
5663
+ <xsl:for-each select="xalan:nodeset($colwidths_)/column">
5664
+ <fo:table-column column-width="proportional-column-width({.})"/>
5665
+ </xsl:for-each>
5666
+ <fo:table-body>
5667
+ <xsl:apply-templates/>
5668
+ </fo:table-body>
5669
+ </fo:table>
5670
+ </fo:block>
5671
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']">
5672
+ <fo:table-row min-height="5mm">
5673
+ <xsl:apply-templates/>
5674
+ </fo:table-row>
5675
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']/*[local-name() = 'p']">
5676
+ <xsl:apply-templates/>
5677
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'xref']" priority="3">
5678
+ <!-- <xref target="cgpm9th1948r6">1.6.3<tab/>&#8220;9th CGPM, 1948:<tab/>decision to establish the SI&#8221;</xref> -->
5679
+ <xsl:variable name="target" select="@target"/>
5680
+ <xsl:for-each select="*[local-name() = 'tab']">
5681
+ <xsl:variable name="current_id" select="generate-id()"/>
5682
+ <fo:table-cell>
5683
+ <fo:block>
5684
+ <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
5685
+ <xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
5686
+ <xsl:choose>
5687
+ <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
5688
+ <xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
5689
+ </xsl:choose>
5690
+ </xsl:for-each>
5691
+ </fo:basic-link>
5692
+ </fo:block>
5693
+ </fo:table-cell>
5694
+ </xsl:for-each>
5695
+ <!-- last column - for page numbers -->
5696
+ <fo:table-cell text-align="right" font-size="10pt" font-weight="bold" font-family="Arial">
5697
+ <fo:block>
5698
+ <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
5699
+ <fo:page-number-citation ref-id="{$target}"/>
5700
+ </fo:basic-link>
5701
+ </fo:block>
5702
+ </fo:table-cell>
5703
+ </xsl:template><xsl:template match="*" mode="toc_table_width">
5704
+ <xsl:apply-templates mode="toc_table_width"/>
5705
+ </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">
5706
+ <tr>
5707
+ <xsl:apply-templates mode="toc_table_width"/>
5708
+ </tr>
5709
+ </xsl:template><xsl:template match="*[local-name() = 'xref']" mode="toc_table_width">
5710
+ <!-- <xref target="cgpm9th1948r6">1.6.3<tab/>&#8220;9th CGPM, 1948:<tab/>decision to establish the SI&#8221;</xref> -->
5711
+ <xsl:for-each select="*[local-name() = 'tab']">
5712
+ <xsl:variable name="current_id" select="generate-id()"/>
5713
+ <td>
5714
+ <xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
5715
+ <xsl:copy-of select="."/>
5716
+ </xsl:for-each>
5717
+ </td>
5718
+ </xsl:for-each>
5719
+ <td>333</td> <!-- page number, just for fill -->
5720
+ </xsl:template><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']"/><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
5721
+ <fo:inline padding-right="5mm"> </fo:inline>
5722
+ <fo:inline><xsl:apply-templates/></fo:inline>
5723
+ </xsl:template><xsl:template match="*[local-name() = 'blacksquare']" name="blacksquare">
5724
+ <fo:inline padding-right="2.5mm" baseline-shift="5%">
5725
+ <fo:instream-foreign-object content-height="2mm" content-width="2mm" fox:alt-text="Quad">
5726
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" viewBox="0 0 2 2">
5727
+ <rect x="0" y="0" width="2" height="2" fill="black"/>
5728
+ </svg>
5729
+ </fo:instream-foreign-object>
5730
+ </fo:inline>
5459
5731
  </xsl:template><xsl:template name="convertDate">
5460
5732
  <xsl:param name="date"/>
5461
5733
  <xsl:param name="format" select="'short'"/>
@@ -5694,6 +5966,26 @@
5694
5966
  <xsl:value-of select="$level"/>
5695
5967
  </xsl:otherwise>
5696
5968
  </xsl:choose>
5969
+ </xsl:template><xsl:template name="getLevelTermName">
5970
+ <xsl:choose>
5971
+ <xsl:when test="normalize-space(../@depth) != ''">
5972
+ <xsl:value-of select="../@depth"/>
5973
+ </xsl:when>
5974
+ <xsl:otherwise>
5975
+ <xsl:variable name="title_level_">
5976
+ <xsl:for-each select="../preceding-sibling::*[local-name() = 'title'][1]">
5977
+ <xsl:call-template name="getLevel"/>
5978
+ </xsl:for-each>
5979
+ </xsl:variable>
5980
+ <xsl:variable name="title_level" select="normalize-space($title_level_)"/>
5981
+ <xsl:choose>
5982
+ <xsl:when test="$title_level != ''"><xsl:value-of select="$title_level + 1"/></xsl:when>
5983
+ <xsl:otherwise>
5984
+ <xsl:call-template name="getLevel"/>
5985
+ </xsl:otherwise>
5986
+ </xsl:choose>
5987
+ </xsl:otherwise>
5988
+ </xsl:choose>
5697
5989
  </xsl:template><xsl:template name="split">
5698
5990
  <xsl:param name="pText" select="."/>
5699
5991
  <xsl:param name="sep" select="','"/>