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.
@@ -160,7 +160,7 @@
160
160
  <fo:block>
161
161
  <xsl:value-of select="translate(/un:un-standard/un:sections/un:clause[1]/un:ol[1]/un:li[1]/un:p[1], '.', '')"/>
162
162
  </fo:block>
163
- <fo:block><xsl:value-of select="$title"/></fo:block>
163
+ <fo:block role="H1"><xsl:value-of select="$title"/></fo:block>
164
164
  </fo:block>
165
165
  </fo:block-container>
166
166
 
@@ -485,7 +485,10 @@
485
485
  </xsl:template>
486
486
 
487
487
  <xsl:template match="un:title" mode="inline-header">
488
- <fo:inline>
488
+ <xsl:variable name="level">
489
+ <xsl:call-template name="getLevel"/>
490
+ </xsl:variable>
491
+ <fo:inline role="H{$level}">
489
492
  <xsl:apply-templates/>
490
493
  </fo:inline>
491
494
  </xsl:template>
@@ -715,8 +718,9 @@
715
718
  <xsl:otherwise>11pt</xsl:otherwise>
716
719
  </xsl:choose>
717
720
  </xsl:variable>
718
- <fo:block font-size="{$font-size}" font-weight="bold" margin-top="3pt" margin-bottom="16pt" keep-with-next="always">
721
+ <fo:block font-size="{$font-size}" font-weight="bold" margin-top="3pt" margin-bottom="16pt" keep-with-next="always" role="H{$level}">
719
722
  <xsl:apply-templates/>
723
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
720
724
  </fo:block>
721
725
  </xsl:template>
722
726
 
@@ -734,15 +738,17 @@
734
738
  </xsl:variable>
735
739
  <xsl:choose>
736
740
  <xsl:when test="$level = 1">
737
- <fo:block font-size="{$font-size}" font-weight="bold" space-before="3pt" keep-with-next="always">
741
+ <fo:block font-size="{$font-size}" font-weight="bold" space-before="3pt" keep-with-next="always" role="H{$level}">
738
742
  <fo:block margin-bottom="12pt">
739
743
  <xsl:apply-templates/>
744
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
740
745
  </fo:block>
741
746
  </fo:block>
742
747
  </xsl:when>
743
748
  <xsl:otherwise>
744
- <fo:block font-size="{$font-size}" font-weight="bold" margin-left="1mm" space-before="3pt" margin-bottom="6pt" keep-with-next="always">
749
+ <fo:block font-size="{$font-size}" font-weight="bold" margin-left="1mm" space-before="3pt" margin-bottom="6pt" keep-with-next="always" role="H{$level}">
745
750
  <xsl:apply-templates/>
751
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
746
752
  </fo:block>
747
753
  </xsl:otherwise>
748
754
  </xsl:choose>
@@ -769,7 +775,7 @@
769
775
  <xsl:choose>
770
776
  <xsl:when test="ancestor::un:sections and $level = 1">
771
777
  <fo:block-container margin-left="-16mm">
772
- <fo:block font-size="{$font-size}" font-weight="bold" margin-left="16mm" space-before="16pt" margin-bottom="13pt" keep-with-next="always">
778
+ <fo:block font-size="{$font-size}" font-weight="bold" margin-left="16mm" space-before="16pt" margin-bottom="13pt" keep-with-next="always" role="H{$level}">
773
779
  <fo:table table-layout="fixed" width="100%">
774
780
  <fo:table-column column-width="16mm"/>
775
781
  <fo:table-column column-width="130mm"/>
@@ -788,6 +794,7 @@
788
794
  <fo:table-cell>
789
795
  <fo:block>
790
796
  <xsl:call-template name="extractTitle"/>
797
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
791
798
  </fo:block>
792
799
  </fo:table-cell>
793
800
  </fo:table-row>
@@ -797,7 +804,7 @@
797
804
  </fo:block-container>
798
805
  </xsl:when>
799
806
  <xsl:when test="ancestor::un:sections">
800
- <fo:block font-size="{$font-size}" font-weight="bold" space-before="16pt" margin-bottom="13pt" text-indent="-8mm" keep-with-next="always">
807
+ <fo:block font-size="{$font-size}" font-weight="bold" space-before="16pt" margin-bottom="13pt" text-indent="-8mm" keep-with-next="always" role="H{$level}">
801
808
  <xsl:if test="$level = 2">
802
809
  <xsl:attribute name="margin-left">1mm</xsl:attribute>
803
810
  <xsl:attribute name="space-before">12pt</xsl:attribute>
@@ -814,8 +821,9 @@
814
821
  </fo:block>
815
822
  </xsl:when>
816
823
  <xsl:otherwise>
817
- <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}">
818
825
  <xsl:apply-templates/>
826
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
819
827
  </fo:block>
820
828
  </xsl:otherwise>
821
829
  </xsl:choose>
@@ -1046,26 +1054,26 @@
1046
1054
  <!-- ============================ -->
1047
1055
 
1048
1056
  <xsl:template name="insertHeaderFooter">
1049
- <fo:static-content flow-name="header-odd">
1057
+ <fo:static-content flow-name="header-odd" role="artifact">
1050
1058
  <fo:block-container height="25mm" display-align="after" border-bottom="0.5pt solid black" margin-left="-20.5mm" margin-right="-20.5mm">
1051
1059
  <fo:block font-size="9pt" font-weight="bold" text-align="right" margin-left="21mm" margin-right="21mm" padding-bottom="0.5mm">
1052
1060
  <xsl:value-of select="$id"/>
1053
1061
  </fo:block>
1054
1062
  </fo:block-container>
1055
1063
  </fo:static-content>
1056
- <fo:static-content flow-name="footer-odd">
1064
+ <fo:static-content flow-name="footer-odd" role="artifact">
1057
1065
  <fo:block-container height="40mm" margin-left="-20.5mm" margin-right="-20.5mm">
1058
1066
  <fo:block font-size="9pt" font-weight="bold" text-align="right" margin-left="21mm" margin-right="21mm" padding-top="12mm"><fo:page-number/></fo:block>
1059
1067
  </fo:block-container>
1060
1068
  </fo:static-content>
1061
- <fo:static-content flow-name="header-even">
1069
+ <fo:static-content flow-name="header-even" role="artifact">
1062
1070
  <fo:block-container height="25mm" display-align="after" border-bottom="0.5pt solid black" margin-left="-20.5mm" margin-right="-20.5mm">
1063
1071
  <fo:block font-size="9pt" font-weight="bold" margin-left="21mm" margin-right="21mm" padding-bottom="0.5mm">
1064
1072
  <xsl:value-of select="$id"/>
1065
1073
  </fo:block>
1066
1074
  </fo:block-container>
1067
1075
  </fo:static-content>
1068
- <fo:static-content flow-name="footer-even">
1076
+ <fo:static-content flow-name="footer-even" role="artifact">
1069
1077
  <fo:block-container height="40mm" margin-left="-20.5mm" margin-right="-20.5mm">
1070
1078
  <fo:block font-size="9pt" font-weight="bold" margin-left="21mm" margin-right="21mm" padding-top="12mm"><fo:page-number/></fo:block>
1071
1079
  </fo:block-container>
@@ -1271,12 +1279,13 @@
1271
1279
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
1272
1280
  <xsl:attribute name="white-space">pre</xsl:attribute>
1273
1281
  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
1282
+ <xsl:attribute name="role">Code</xsl:attribute>
1274
1283
 
1275
1284
 
1276
1285
 
1277
1286
 
1278
1287
 
1279
- <xsl:attribute name="font-family">Courier</xsl:attribute>
1288
+ <xsl:attribute name="font-family">Courier New</xsl:attribute>
1280
1289
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
1281
1290
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1282
1291
 
@@ -1296,8 +1305,13 @@
1296
1305
 
1297
1306
  </xsl:attribute-set><xsl:attribute-set name="requirement-label-style">
1298
1307
 
1299
- </xsl:attribute-set><xsl:attribute-set name="requirement-subject-style">
1300
- </xsl:attribute-set><xsl:attribute-set name="requirement-inherit-style">
1308
+ </xsl:attribute-set><xsl:attribute-set name="subject-style">
1309
+ </xsl:attribute-set><xsl:attribute-set name="inherit-style">
1310
+ </xsl:attribute-set><xsl:attribute-set name="description-style">
1311
+ </xsl:attribute-set><xsl:attribute-set name="specification-style">
1312
+ </xsl:attribute-set><xsl:attribute-set name="measurement-target-style">
1313
+ </xsl:attribute-set><xsl:attribute-set name="verification-style">
1314
+ </xsl:attribute-set><xsl:attribute-set name="import-style">
1301
1315
  </xsl:attribute-set><xsl:attribute-set name="recommendation-style">
1302
1316
 
1303
1317
 
@@ -1365,6 +1379,7 @@
1365
1379
 
1366
1380
 
1367
1381
 
1382
+
1368
1383
  <xsl:attribute name="font-size">11pt</xsl:attribute>
1369
1384
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
1370
1385
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
@@ -1496,7 +1511,8 @@
1496
1511
 
1497
1512
 
1498
1513
 
1499
- </xsl:attribute-set><xsl:attribute-set name="quote-style">
1514
+ </xsl:attribute-set><xsl:attribute-set name="quote-style">
1515
+ <xsl:attribute name="role">BlockQuote</xsl:attribute>
1500
1516
 
1501
1517
 
1502
1518
 
@@ -1620,13 +1636,20 @@
1620
1636
 
1621
1637
  </xsl:attribute-set><xsl:attribute-set name="list-style">
1622
1638
 
1623
- </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">
1639
+ </xsl:attribute-set><xsl:attribute-set name="toc-style">
1640
+ <xsl:attribute name="line-height">135%</xsl:attribute>
1641
+ </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">
1624
1642
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
1625
1643
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
1626
1644
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
1627
1645
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']" mode="contents"/>
1628
1646
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']" mode="contents"/>
1629
- </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
1647
+ </xsl:template><xsl:template name="processPrefaceSectionsDefault_Contents">
1648
+ <xsl:for-each select="/*/*[local-name()='preface']/*">
1649
+ <xsl:sort select="@displayorder" data-type="number"/>
1650
+ <xsl:apply-templates select="." mode="contents"/>
1651
+ </xsl:for-each>
1652
+ </xsl:template><xsl:template name="OLD_processMainSectionsDefault_Contents">
1630
1653
  <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
1631
1654
 
1632
1655
  <!-- Normative references -->
@@ -1639,13 +1662,33 @@
1639
1662
  <!-- Bibliography -->
1640
1663
  <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"/>
1641
1664
 
1642
- </xsl:template><xsl:template name="processPrefaceSectionsDefault">
1665
+ </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
1666
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
1667
+ <xsl:sort select="@displayorder" data-type="number"/>
1668
+ <xsl:apply-templates select="." mode="contents"/>
1669
+ </xsl:for-each>
1670
+
1671
+ <xsl:for-each select="/*/*[local-name()='annex']">
1672
+ <xsl:sort select="@displayorder" data-type="number"/>
1673
+ <xsl:apply-templates select="." mode="contents"/>
1674
+ </xsl:for-each>
1675
+
1676
+ <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
1677
+ <xsl:sort select="@displayorder" data-type="number"/>
1678
+ <xsl:apply-templates select="." mode="contents"/>
1679
+ </xsl:for-each>
1680
+ </xsl:template><xsl:template name="OLD_processPrefaceSectionsDefault">
1643
1681
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
1644
1682
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
1645
1683
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']"/>
1646
1684
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']"/>
1647
1685
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']"/>
1648
- </xsl:template><xsl:template name="processMainSectionsDefault">
1686
+ </xsl:template><xsl:template name="processPrefaceSectionsDefault">
1687
+ <xsl:for-each select="/*/*[local-name()='preface']/*">
1688
+ <xsl:sort select="@displayorder" data-type="number"/>
1689
+ <xsl:apply-templates select="."/>
1690
+ </xsl:for-each>
1691
+ </xsl:template><xsl:template name="OLD_processMainSectionsDefault">
1649
1692
  <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']"/>
1650
1693
 
1651
1694
  <!-- Normative references -->
@@ -1657,6 +1700,22 @@
1657
1700
  <xsl:apply-templates select="/*/*[local-name()='annex']"/>
1658
1701
  <!-- Bibliography -->
1659
1702
  <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]"/>
1703
+ </xsl:template><xsl:template name="processMainSectionsDefault">
1704
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
1705
+ <xsl:sort select="@displayorder" data-type="number"/>
1706
+ <xsl:apply-templates select="."/>
1707
+
1708
+ </xsl:for-each>
1709
+
1710
+ <xsl:for-each select="/*/*[local-name()='annex']">
1711
+ <xsl:sort select="@displayorder" data-type="number"/>
1712
+ <xsl:apply-templates select="."/>
1713
+ </xsl:for-each>
1714
+
1715
+ <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
1716
+ <xsl:sort select="@displayorder" data-type="number"/>
1717
+ <xsl:apply-templates select="."/>
1718
+ </xsl:for-each>
1660
1719
  </xsl:template><xsl:template match="text()">
1661
1720
  <xsl:value-of select="."/>
1662
1721
  </xsl:template><xsl:template match="*[local-name()='br']">
@@ -1687,7 +1746,9 @@
1687
1746
 
1688
1747
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
1689
1748
 
1690
-
1749
+
1750
+
1751
+
1691
1752
 
1692
1753
  <xsl:call-template name="fn_name_display"/>
1693
1754
 
@@ -1816,6 +1877,8 @@
1816
1877
  <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1817
1878
  </xsl:if>
1818
1879
 
1880
+
1881
+
1819
1882
  <xsl:choose>
1820
1883
  <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
1821
1884
  <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
@@ -2100,9 +2163,9 @@
2100
2163
  <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation">
2101
2164
  <xsl:with-param name="continued">true</xsl:with-param>
2102
2165
  </xsl:apply-templates>
2103
- <xsl:for-each select="ancestor::*[local-name()='table'][1]">
2104
- <xsl:call-template name="fn_name_display"/>
2105
- </xsl:for-each>
2166
+
2167
+
2168
+
2106
2169
 
2107
2170
  </fo:table-cell>
2108
2171
  </fo:table-row>
@@ -2184,7 +2247,11 @@
2184
2247
 
2185
2248
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
2186
2249
 
2187
- <xsl:if test="$isNoteOrFnExist = 'true'">
2250
+ <xsl:variable name="isNoteOrFnExistShowAfterTable">
2251
+
2252
+ </xsl:variable>
2253
+
2254
+ <xsl:if test="$isNoteOrFnExist = 'true' or normalize-space($isNoteOrFnExistShowAfterTable) = 'true'">
2188
2255
 
2189
2256
  <xsl:variable name="cols-count">
2190
2257
  <xsl:choose>
@@ -2325,6 +2392,19 @@
2325
2392
 
2326
2393
  </fo:table-body>
2327
2394
 
2395
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/text()[1]" priority="2" mode="presentation_name">
2396
+ <xsl:choose>
2397
+ <xsl:when test="substring-after(., '—') != ''">
2398
+ <xsl:text>—</xsl:text><xsl:value-of select="substring-after(., '—')"/>
2399
+ </xsl:when>
2400
+ <xsl:otherwise>
2401
+ <xsl:value-of select="."/>
2402
+ </xsl:otherwise>
2403
+ </xsl:choose>
2404
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']" mode="presentation_name">
2405
+ <xsl:apply-templates mode="presentation_name"/>
2406
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/node()" mode="presentation_name">
2407
+ <xsl:apply-templates select="."/>
2328
2408
  </xsl:template><xsl:template match="*[local-name()='tr']">
2329
2409
  <xsl:variable name="parent-name" select="local-name(..)"/>
2330
2410
  <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
@@ -2529,14 +2609,12 @@
2529
2609
  <xsl:apply-templates/>
2530
2610
  </xsl:template><xsl:template name="fn_display">
2531
2611
  <xsl:variable name="references">
2612
+
2532
2613
  <xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']">
2533
- <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
2534
-
2535
-
2536
- <xsl:apply-templates/>
2537
- </fn>
2614
+ <xsl:call-template name="create_fn"/>
2538
2615
  </xsl:for-each>
2539
2616
  </xsl:variable>
2617
+
2540
2618
  <xsl:for-each select="xalan:nodeset($references)//fn">
2541
2619
  <xsl:variable name="reference" select="@reference"/>
2542
2620
  <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
@@ -2572,6 +2650,12 @@
2572
2650
  </fo:block>
2573
2651
  </xsl:if>
2574
2652
  </xsl:for-each>
2653
+ </xsl:template><xsl:template name="create_fn">
2654
+ <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
2655
+
2656
+
2657
+ <xsl:apply-templates/>
2658
+ </fn>
2575
2659
  </xsl:template><xsl:template name="fn_name_display">
2576
2660
  <!-- <xsl:variable name="references">
2577
2661
  <xsl:for-each select="*[local-name()='name']//*[local-name()='fn']">
@@ -3551,16 +3635,68 @@
3551
3635
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
3552
3636
  </xsl:call-template>
3553
3637
 
3638
+
3639
+
3554
3640
  <xsl:variable name="mathml">
3555
3641
  <xsl:apply-templates select="." mode="mathml"/>
3556
3642
  </xsl:variable>
3557
3643
  <fo:instream-foreign-object fox:alt-text="Math">
3558
3644
 
3559
3645
 
3646
+ <xsl:variable name="comment_text_following" select="following-sibling::node()[1][self::comment()]"/>
3647
+ <xsl:variable name="comment_text_">
3648
+ <xsl:choose>
3649
+ <xsl:when test="normalize-space($comment_text_following) != ''">
3650
+ <xsl:value-of select="$comment_text_following"/>
3651
+ </xsl:when>
3652
+ <xsl:otherwise>
3653
+ <xsl:value-of select="normalize-space(translate(.,' ⁢',' '))"/>
3654
+ </xsl:otherwise>
3655
+ </xsl:choose>
3656
+ </xsl:variable>
3657
+ <xsl:variable name="comment_text" select="java:org.metanorma.fop.Util.unescape($comment_text_)"/>
3658
+
3659
+ <xsl:if test="normalize-space($comment_text) != ''">
3660
+ <!-- put Mathin Alternate Text -->
3661
+ <xsl:attribute name="fox:alt-text">
3662
+ <xsl:value-of select="java:org.metanorma.fop.Util.unescape($comment_text)"/>
3663
+ </xsl:attribute>
3664
+ </xsl:if>
3665
+
3666
+ <xsl:variable name="mathml_content">
3667
+ <xsl:apply-templates select="." mode="mathml_actual_text"/>
3668
+ </xsl:variable>
3669
+ <!-- put MathML in Actual Text -->
3670
+ <xsl:attribute name="fox:actual-text">
3671
+ <xsl:value-of select="$mathml_content"/>
3672
+ </xsl:attribute>
3673
+
3674
+
3560
3675
  <!-- <xsl:copy-of select="."/> -->
3561
3676
  <xsl:copy-of select="xalan:nodeset($mathml)"/>
3562
3677
  </fo:instream-foreign-object>
3563
3678
  </fo:inline>
3679
+ </xsl:template><xsl:template match="mathml:*" mode="mathml_actual_text">
3680
+ <!-- <xsl:text>a+b</xsl:text> -->
3681
+ <xsl:text>&lt;</xsl:text>
3682
+ <xsl:value-of select="local-name()"/>
3683
+ <xsl:if test="local-name() = 'math'">
3684
+ <xsl:text> xmlns="http://www.w3.org/1998/Math/MathML"</xsl:text>
3685
+ </xsl:if>
3686
+ <xsl:for-each select="@*">
3687
+ <xsl:text> </xsl:text>
3688
+ <xsl:value-of select="local-name()"/>
3689
+ <xsl:text>="</xsl:text>
3690
+ <xsl:value-of select="."/>
3691
+ <xsl:text>"</xsl:text>
3692
+ </xsl:for-each>
3693
+ <xsl:text>&gt;</xsl:text>
3694
+ <xsl:apply-templates mode="mathml_actual_text"/>
3695
+ <xsl:text>&lt;/</xsl:text>
3696
+ <xsl:value-of select="local-name()"/>
3697
+ <xsl:text>&gt;</xsl:text>
3698
+ </xsl:template><xsl:template match="text()" mode="mathml_actual_text">
3699
+ <xsl:value-of select="normalize-space()"/>
3564
3700
  </xsl:template><xsl:template match="@*|node()" mode="mathml">
3565
3701
  <xsl:copy>
3566
3702
  <xsl:apply-templates select="@*|node()" mode="mathml"/>
@@ -3570,19 +3706,6 @@
3570
3706
  <!-- replace start and end spaces to non-break space -->
3571
3707
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
3572
3708
  </xsl:copy>
3573
- </xsl:template><xsl:template match="mathml:mi[. = ',' and not(following-sibling::*[1][local-name() = 'mtext' and text() = ' '])]" mode="mathml">
3574
- <xsl:copy>
3575
- <xsl:apply-templates select="@*|node()" mode="mathml"/>
3576
- </xsl:copy>
3577
- <xsl:choose>
3578
- <!-- if in msub, then don't add space -->
3579
- <xsl:when test="ancestor::mathml:mrow[parent::mathml:msub and preceding-sibling::*[1][self::mathml:mrow]]"/>
3580
- <!-- if next char in digit, don't add space -->
3581
- <xsl:when test="translate(substring(following-sibling::*[1]/text(),1,1),'0123456789','') = ''"/>
3582
- <xsl:otherwise>
3583
- <mathml:mspace width="0.5ex"/>
3584
- </xsl:otherwise>
3585
- </xsl:choose>
3586
3709
  </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">
3587
3710
  <xsl:variable name="target">
3588
3711
  <xsl:choose>
@@ -3635,7 +3758,10 @@
3635
3758
  </fo:block>
3636
3759
  <xsl:apply-templates/>
3637
3760
  </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
3638
- <fo:inline><xsl:apply-templates/></fo:inline>
3761
+ <xsl:variable name="level">
3762
+ <xsl:call-template name="getLevel"/>
3763
+ </xsl:variable>
3764
+ <fo:inline role="H{$level}"><xsl:apply-templates/></fo:inline>
3639
3765
  </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
3640
3766
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
3641
3767
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -3670,9 +3796,10 @@
3670
3796
 
3671
3797
  </xsl:variable>
3672
3798
 
3799
+ <xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
3673
3800
  <xsl:choose>
3674
- <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
3675
- <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
3801
+ <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>
3802
+ <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>
3676
3803
  </xsl:choose>
3677
3804
  <xsl:apply-templates/>
3678
3805
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
@@ -3829,7 +3956,10 @@
3829
3956
  </fo:block>
3830
3957
  </xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']" mode="presentation">
3831
3958
  <xsl:if test="normalize-space() != ''">
3832
- <fo:inline>
3959
+ <xsl:variable name="level">
3960
+ <xsl:call-template name="getLevelTermName"/>
3961
+ </xsl:variable>
3962
+ <fo:inline role="H{$level}">
3833
3963
  <xsl:apply-templates/>
3834
3964
  <!-- <xsl:if test="$namespace = 'gb' or $namespace = 'ogc'">
3835
3965
  <xsl:text>.</xsl:text>
@@ -4130,6 +4260,13 @@
4130
4260
  </xsl:attribute>
4131
4261
  <xsl:apply-templates mode="svg_update"/>
4132
4262
  </xsl:copy>
4263
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][*[local-name() = 'svg']]" priority="3">
4264
+ <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
4265
+ <xsl:for-each select="*[local-name() = 'svg']">
4266
+ <xsl:call-template name="image_svg">
4267
+ <xsl:with-param name="name" select="$name"/>
4268
+ </xsl:call-template>
4269
+ </xsl:for-each>
4133
4270
  </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
4134
4271
  <xsl:variable name="svg_content" select="document(@src)"/>
4135
4272
  <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
@@ -4234,7 +4371,7 @@
4234
4371
  </fo:basic-link>
4235
4372
  </fo:block>
4236
4373
  </fo:block-container>
4237
- </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">
4374
+ </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">
4238
4375
  <xsl:apply-templates mode="contents"/>
4239
4376
  <xsl:text> </xsl:text>
4240
4377
  </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">
@@ -4460,6 +4597,7 @@
4460
4597
  </xsl:when>
4461
4598
  <xsl:otherwise>
4462
4599
  <xsl:apply-templates/>
4600
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
4463
4601
  </xsl:otherwise>
4464
4602
  </xsl:choose>
4465
4603
  </fo:block>
@@ -4600,14 +4738,6 @@
4600
4738
  <fo:block>
4601
4739
  <fo:inline padding-right="3mm">Obligation</fo:inline><xsl:value-of select="."/>
4602
4740
  </fo:block>
4603
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
4604
- <fo:block xsl:use-attribute-sets="requirement-subject-style">
4605
- <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
4606
- </fo:block>
4607
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'inherit']">
4608
- <fo:block xsl:use-attribute-sets="requirement-inherit-style">
4609
- <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
4610
- </fo:block>
4611
4741
  </xsl:template><xsl:template match="*[local-name() = 'recommendation']">
4612
4742
  <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
4613
4743
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -4624,6 +4754,38 @@
4624
4754
  <fo:block xsl:use-attribute-sets="recommendation-label-style">
4625
4755
  <xsl:apply-templates/>
4626
4756
  </fo:block>
4757
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" priority="2"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
4758
+ <fo:block xsl:use-attribute-sets="subject-style">
4759
+ <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
4760
+ </fo:block>
4761
+ </xsl:template><xsl:template match="*[local-name() = 'subject']">
4762
+ <fo:block xsl:use-attribute-sets="subject-style">
4763
+ <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
4764
+ </fo:block>
4765
+ </xsl:template><xsl:template match="*[local-name() = 'inherit'] | *[local-name() = 'component'][@class = 'inherit']">
4766
+ <fo:block xsl:use-attribute-sets="inherit-style">
4767
+ <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
4768
+ </fo:block>
4769
+ </xsl:template><xsl:template match="*[local-name() = 'description'] | *[local-name() = 'component'][@class = 'description']">
4770
+ <fo:block xsl:use-attribute-sets="description-style">
4771
+ <xsl:apply-templates/>
4772
+ </fo:block>
4773
+ </xsl:template><xsl:template match="*[local-name() = 'specification'] | *[local-name() = 'component'][@class = 'specification']">
4774
+ <fo:block xsl:use-attribute-sets="specification-style">
4775
+ <xsl:apply-templates/>
4776
+ </fo:block>
4777
+ </xsl:template><xsl:template match="*[local-name() = 'measurement-target'] | *[local-name() = 'component'][@class = 'measurement-target']">
4778
+ <fo:block xsl:use-attribute-sets="measurement-target-style">
4779
+ <xsl:apply-templates/>
4780
+ </fo:block>
4781
+ </xsl:template><xsl:template match="*[local-name() = 'verification'] | *[local-name() = 'component'][@class = 'verification']">
4782
+ <fo:block xsl:use-attribute-sets="verification-style">
4783
+ <xsl:apply-templates/>
4784
+ </fo:block>
4785
+ </xsl:template><xsl:template match="*[local-name() = 'import'] | *[local-name() = 'component'][@class = 'import']">
4786
+ <fo:block xsl:use-attribute-sets="import-style">
4787
+ <xsl:apply-templates/>
4788
+ </fo:block>
4627
4789
  </xsl:template><xsl:template match="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
4628
4790
  <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt">
4629
4791
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
@@ -4775,7 +4937,19 @@
4775
4937
  </fo:inline>
4776
4938
  </xsl:if>
4777
4939
  </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'p']">
4778
- <fo:inline><xsl:apply-templates/></fo:inline>
4940
+ <xsl:variable name="element">inline
4941
+
4942
+ </xsl:variable>
4943
+ <xsl:choose>
4944
+ <xsl:when test="contains($element, 'block')">
4945
+ <fo:block xsl:use-attribute-sets="example-p-style">
4946
+ <xsl:apply-templates/>
4947
+ </fo:block>
4948
+ </xsl:when>
4949
+ <xsl:otherwise>
4950
+ <fo:inline><xsl:apply-templates/></fo:inline>
4951
+ </xsl:otherwise>
4952
+ </xsl:choose>
4779
4953
  </xsl:template><xsl:template match="*[local-name() = 'example']">
4780
4954
  <fo:block id="{@id}" xsl:use-attribute-sets="example-style">
4781
4955
 
@@ -4882,8 +5056,8 @@
4882
5056
  </xsl:if>
4883
5057
  </xsl:template><xsl:variable name="localized.source">
4884
5058
  <xsl:call-template name="getLocalizedString">
4885
- <xsl:with-param name="key">source</xsl:with-param>
4886
- </xsl:call-template>
5059
+ <xsl:with-param name="key">source</xsl:with-param>
5060
+ </xsl:call-template>
4887
5061
  </xsl:variable><xsl:template match="*[local-name() = 'origin']">
4888
5062
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
4889
5063
  <xsl:if test="normalize-space(@citeas) = ''">
@@ -4893,6 +5067,7 @@
4893
5067
  <fo:inline xsl:use-attribute-sets="origin-style">
4894
5068
  <xsl:apply-templates/>
4895
5069
  </fo:inline>
5070
+
4896
5071
  </fo:basic-link>
4897
5072
  </xsl:template><xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']">
4898
5073
  <fo:inline><xsl:apply-templates/></fo:inline>
@@ -4959,6 +5134,9 @@
4959
5134
 
4960
5135
  </xsl:if>
4961
5136
 
5137
+ <xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets -->
5138
+ <xsl:variable name="text" select="normalize-space()"/>
5139
+
4962
5140
 
4963
5141
 
4964
5142
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
@@ -4973,7 +5151,9 @@
4973
5151
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
4974
5152
 
4975
5153
  </xsl:if>
4976
-
5154
+
5155
+
5156
+
4977
5157
  <xsl:apply-templates/>
4978
5158
  </fo:basic-link>
4979
5159
 
@@ -5316,6 +5496,7 @@
5316
5496
  </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" priority="4">
5317
5497
  <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
5318
5498
  <fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
5499
+
5319
5500
  <xsl:apply-templates/>
5320
5501
  </fo:block>
5321
5502
  </xsl:template><xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
@@ -5355,7 +5536,6 @@
5355
5536
  </xsl:template><xsl:template name="processBibitem">
5356
5537
 
5357
5538
 
5358
- <!-- end BIPM bibitem processing-->
5359
5539
 
5360
5540
 
5361
5541
 
@@ -5485,6 +5665,97 @@
5485
5665
  <fo:block-container border="1pt solid black" width="50%">
5486
5666
  <fo:block> </fo:block>
5487
5667
  </fo:block-container>
5668
+ </xsl:template><xsl:template match="*[local-name() = 'toc']">
5669
+ <xsl:param name="colwidths"/>
5670
+ <xsl:variable name="colwidths_">
5671
+ <xsl:choose>
5672
+ <xsl:when test="not($colwidths)">
5673
+ <xsl:variable name="toc_table_simple">
5674
+ <tbody>
5675
+ <xsl:apply-templates mode="toc_table_width"/>
5676
+ </tbody>
5677
+ </xsl:variable>
5678
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($toc_table_simple)/*/tr[1]/td)"/>
5679
+ <xsl:call-template name="calculate-column-widths">
5680
+ <xsl:with-param name="cols-count" select="$cols-count"/>
5681
+ <xsl:with-param name="table" select="$toc_table_simple"/>
5682
+ </xsl:call-template>
5683
+ </xsl:when>
5684
+ <xsl:otherwise>
5685
+ <xsl:copy-of select="$colwidths"/>
5686
+ </xsl:otherwise>
5687
+ </xsl:choose>
5688
+ </xsl:variable>
5689
+ <fo:block role="TOCI" space-after="16pt">
5690
+ <fo:table width="100%" table-layout="fixed">
5691
+ <xsl:for-each select="xalan:nodeset($colwidths_)/column">
5692
+ <fo:table-column column-width="proportional-column-width({.})"/>
5693
+ </xsl:for-each>
5694
+ <fo:table-body>
5695
+ <xsl:apply-templates/>
5696
+ </fo:table-body>
5697
+ </fo:table>
5698
+ </fo:block>
5699
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']">
5700
+ <fo:table-row min-height="5mm">
5701
+ <xsl:apply-templates/>
5702
+ </fo:table-row>
5703
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']/*[local-name() = 'p']">
5704
+ <xsl:apply-templates/>
5705
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'xref']" priority="3">
5706
+ <!-- <xref target="cgpm9th1948r6">1.6.3<tab/>&#8220;9th CGPM, 1948:<tab/>decision to establish the SI&#8221;</xref> -->
5707
+ <xsl:variable name="target" select="@target"/>
5708
+ <xsl:for-each select="*[local-name() = 'tab']">
5709
+ <xsl:variable name="current_id" select="generate-id()"/>
5710
+ <fo:table-cell>
5711
+ <fo:block>
5712
+ <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
5713
+ <xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
5714
+ <xsl:choose>
5715
+ <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
5716
+ <xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
5717
+ </xsl:choose>
5718
+ </xsl:for-each>
5719
+ </fo:basic-link>
5720
+ </fo:block>
5721
+ </fo:table-cell>
5722
+ </xsl:for-each>
5723
+ <!-- last column - for page numbers -->
5724
+ <fo:table-cell text-align="right" font-size="10pt" font-weight="bold" font-family="Arial">
5725
+ <fo:block>
5726
+ <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
5727
+ <fo:page-number-citation ref-id="{$target}"/>
5728
+ </fo:basic-link>
5729
+ </fo:block>
5730
+ </fo:table-cell>
5731
+ </xsl:template><xsl:template match="*" mode="toc_table_width">
5732
+ <xsl:apply-templates mode="toc_table_width"/>
5733
+ </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">
5734
+ <tr>
5735
+ <xsl:apply-templates mode="toc_table_width"/>
5736
+ </tr>
5737
+ </xsl:template><xsl:template match="*[local-name() = 'xref']" mode="toc_table_width">
5738
+ <!-- <xref target="cgpm9th1948r6">1.6.3<tab/>&#8220;9th CGPM, 1948:<tab/>decision to establish the SI&#8221;</xref> -->
5739
+ <xsl:for-each select="*[local-name() = 'tab']">
5740
+ <xsl:variable name="current_id" select="generate-id()"/>
5741
+ <td>
5742
+ <xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
5743
+ <xsl:copy-of select="."/>
5744
+ </xsl:for-each>
5745
+ </td>
5746
+ </xsl:for-each>
5747
+ <td>333</td> <!-- page number, just for fill -->
5748
+ </xsl:template><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']"/><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
5749
+ <fo:inline padding-right="5mm"> </fo:inline>
5750
+ <fo:inline><xsl:apply-templates/></fo:inline>
5751
+ </xsl:template><xsl:template match="*[local-name() = 'blacksquare']" name="blacksquare">
5752
+ <fo:inline padding-right="2.5mm" baseline-shift="5%">
5753
+ <fo:instream-foreign-object content-height="2mm" content-width="2mm" fox:alt-text="Quad">
5754
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" viewBox="0 0 2 2">
5755
+ <rect x="0" y="0" width="2" height="2" fill="black"/>
5756
+ </svg>
5757
+ </fo:instream-foreign-object>
5758
+ </fo:inline>
5488
5759
  </xsl:template><xsl:template name="convertDate">
5489
5760
  <xsl:param name="date"/>
5490
5761
  <xsl:param name="format" select="'short'"/>
@@ -5723,6 +5994,26 @@
5723
5994
  <xsl:value-of select="$level"/>
5724
5995
  </xsl:otherwise>
5725
5996
  </xsl:choose>
5997
+ </xsl:template><xsl:template name="getLevelTermName">
5998
+ <xsl:choose>
5999
+ <xsl:when test="normalize-space(../@depth) != ''">
6000
+ <xsl:value-of select="../@depth"/>
6001
+ </xsl:when>
6002
+ <xsl:otherwise>
6003
+ <xsl:variable name="title_level_">
6004
+ <xsl:for-each select="../preceding-sibling::*[local-name() = 'title'][1]">
6005
+ <xsl:call-template name="getLevel"/>
6006
+ </xsl:for-each>
6007
+ </xsl:variable>
6008
+ <xsl:variable name="title_level" select="normalize-space($title_level_)"/>
6009
+ <xsl:choose>
6010
+ <xsl:when test="$title_level != ''"><xsl:value-of select="$title_level + 1"/></xsl:when>
6011
+ <xsl:otherwise>
6012
+ <xsl:call-template name="getLevel"/>
6013
+ </xsl:otherwise>
6014
+ </xsl:choose>
6015
+ </xsl:otherwise>
6016
+ </xsl:choose>
5726
6017
  </xsl:template><xsl:template name="split">
5727
6018
  <xsl:param name="pText" select="."/>
5728
6019
  <xsl:param name="sep" select="','"/>