metanorma-ogc 1.4.0 → 1.4.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/lib/asciidoctor/ogc/boilerplate.xml +6 -6
  3. data/lib/asciidoctor/ogc/cleanup.rb +173 -0
  4. data/lib/asciidoctor/ogc/converter.rb +62 -64
  5. data/lib/asciidoctor/ogc/front.rb +1 -1
  6. data/lib/asciidoctor/ogc/isodoc.rng +211 -11
  7. data/lib/asciidoctor/ogc/reqt.rng +16 -0
  8. data/lib/asciidoctor/ogc/validate.rb +35 -20
  9. data/lib/isodoc/ogc/base_convert.rb +47 -10
  10. data/lib/isodoc/ogc/biblio.rb +57 -51
  11. data/lib/isodoc/ogc/html/htmlstyle.css +10 -0
  12. data/lib/isodoc/ogc/html/htmlstyle.scss +12 -0
  13. data/lib/isodoc/ogc/html/ogc.css +4 -0
  14. data/lib/isodoc/ogc/html/ogc.scss +4 -0
  15. data/lib/isodoc/ogc/i18n-en.yaml +24 -8
  16. data/lib/isodoc/ogc/metadata.rb +1 -1
  17. data/lib/isodoc/ogc/ogc.abstract-specification-topic.xsl +501 -127
  18. data/lib/isodoc/ogc/ogc.best-practice.xsl +501 -127
  19. data/lib/isodoc/ogc/ogc.change-request-supporting-document.xsl +501 -127
  20. data/lib/isodoc/ogc/ogc.community-practice.xsl +501 -127
  21. data/lib/isodoc/ogc/ogc.community-standard.xsl +501 -127
  22. data/lib/isodoc/ogc/ogc.discussion-paper.xsl +501 -127
  23. data/lib/isodoc/ogc/ogc.engineering-report.xsl +501 -127
  24. data/lib/isodoc/ogc/ogc.other.xsl +501 -127
  25. data/lib/isodoc/ogc/ogc.policy.xsl +501 -127
  26. data/lib/isodoc/ogc/ogc.reference-model.xsl +501 -127
  27. data/lib/isodoc/ogc/ogc.release-notes.xsl +501 -127
  28. data/lib/isodoc/ogc/ogc.standard.xsl +501 -127
  29. data/lib/isodoc/ogc/ogc.test-suite.xsl +501 -127
  30. data/lib/isodoc/ogc/ogc.user-guide.xsl +501 -127
  31. data/lib/isodoc/ogc/ogc.white-paper.xsl +358 -66
  32. data/lib/isodoc/ogc/presentation_xml_convert.rb +58 -48
  33. data/lib/isodoc/ogc/reqt.rb +64 -46
  34. data/lib/isodoc/ogc/xref.rb +1 -2
  35. data/lib/metanorma/ogc/version.rb +1 -1
  36. metadata +3 -2
@@ -32,6 +32,7 @@
32
32
  <xsl:attribute name="margin-top">18pt</xsl:attribute>
33
33
  <xsl:attribute name="margin-bottom">18pt</xsl:attribute>
34
34
  <xsl:attribute name="line-height">110%</xsl:attribute>
35
+ <xsl:attribute name="role">H1</xsl:attribute>
35
36
  </xsl:attribute-set>
36
37
 
37
38
  <xsl:attribute-set name="title-depth2-style">
@@ -42,6 +43,7 @@
42
43
  <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
43
44
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
44
45
  <xsl:attribute name="line-height">110%</xsl:attribute>
46
+ <xsl:attribute name="role">H2</xsl:attribute>
45
47
  </xsl:attribute-set>
46
48
 
47
49
  <xsl:attribute-set name="title-depth3-style">
@@ -51,7 +53,8 @@
51
53
  <xsl:attribute name="color">rgb(21, 43, 77)</xsl:attribute>
52
54
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
53
55
  <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
54
- <xsl:attribute name="keep-with-next">always</xsl:attribute>
56
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
57
+ <xsl:attribute name="role">H3</xsl:attribute>
55
58
  </xsl:attribute-set>
56
59
 
57
60
  <xsl:attribute-set name="empty-style">
@@ -126,7 +129,7 @@
126
129
 
127
130
  <fo:block-container margin-left="-12mm" margin-right="-9mm">
128
131
  <fo:block-container margin-left="0mm" margin-right="0mm">
129
- <fo:block font-size="36pt" background-color="{$color}" color="white" margin-left="2.5mm" padding-top="1mm" padding-left="1mm">
132
+ <fo:block font-size="36pt" background-color="{$color}" color="white" margin-left="2.5mm" padding-top="1mm" padding-left="1mm" role="H1">
130
133
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibdata/ogc:title/node()"/>
131
134
  </fo:block>
132
135
  </fo:block-container>
@@ -216,43 +219,45 @@
216
219
  <fo:block break-after="page"/>
217
220
 
218
221
  <fo:block-container line-height="1.08" font-family="Lato">
219
- <fo:block xsl:use-attribute-sets="title-toc-style">
220
- <xsl:text>Table of Contents</xsl:text>
221
- </fo:block>
222
- <xsl:variable name="margin-left">3.9</xsl:variable>
223
- <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']">
224
- <fo:block margin-top="8pt" margin-bottom="5pt" margin-left="{(@level - 1) * $margin-left}mm" text-align-last="justify">
225
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
226
- <xsl:if test="@section != ''">
227
- <xsl:value-of select="@section"/><xsl:text> </xsl:text>
228
- </xsl:if>
229
- <xsl:apply-templates select="title"/>
230
- <fo:inline keep-together.within-line="always">
231
- <fo:leader leader-pattern="dots"/>
232
- <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
233
- </fo:inline>
234
- </fo:basic-link>
222
+ <fo:block role="TOC">
223
+ <fo:block xsl:use-attribute-sets="title-toc-style" role="H1">
224
+ <xsl:text>Table of Contents</xsl:text>
235
225
  </fo:block>
236
- </xsl:for-each>
237
-
238
- <xsl:if test="//ogc:figure[@id and ogc:name] or //ogc:table[@id and ogc:name]">
239
- <fo:block font-size="11pt" margin-top="8pt"> </fo:block>
240
- <fo:block font-size="11pt" margin-top="8pt"> </fo:block>
241
- <fo:block xsl:use-attribute-sets="title-toc-style">
242
- <xsl:text>Table of Figures</xsl:text>
243
- </fo:block>
244
- <xsl:for-each select="//ogc:figure[@id and ogc:name] | //ogc:table[@id and ogc:name]">
245
- <fo:block margin-top="8pt" margin-bottom="5pt" text-align-last="justify">
246
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{ogc:name}">
247
- <xsl:apply-templates select="ogc:name" mode="contents"/>
226
+ <xsl:variable name="margin-left">3.9</xsl:variable>
227
+ <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']">
228
+ <fo:block margin-top="8pt" margin-bottom="5pt" margin-left="{(@level - 1) * $margin-left}mm" text-align-last="justify" role="TOCI">
229
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
230
+ <xsl:if test="@section != ''">
231
+ <xsl:value-of select="@section"/><xsl:text> </xsl:text>
232
+ </xsl:if>
233
+ <xsl:apply-templates select="title"/>
248
234
  <fo:inline keep-together.within-line="always">
249
235
  <fo:leader leader-pattern="dots"/>
250
- <fo:page-number-citation ref-id="{@id}"/>
236
+ <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
251
237
  </fo:inline>
252
238
  </fo:basic-link>
253
239
  </fo:block>
254
240
  </xsl:for-each>
255
- </xsl:if>
241
+
242
+ <xsl:if test="//ogc:figure[@id and ogc:name] or //ogc:table[@id and ogc:name]">
243
+ <fo:block font-size="11pt" margin-top="8pt"> </fo:block>
244
+ <fo:block font-size="11pt" margin-top="8pt"> </fo:block>
245
+ <fo:block xsl:use-attribute-sets="title-toc-style">
246
+ <xsl:text>Table of Figures</xsl:text>
247
+ </fo:block>
248
+ <xsl:for-each select="//ogc:figure[@id and ogc:name] | //ogc:table[@id and ogc:name]">
249
+ <fo:block margin-top="8pt" margin-bottom="5pt" text-align-last="justify" role="TOCI">
250
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{ogc:name}">
251
+ <xsl:apply-templates select="ogc:name" mode="contents"/>
252
+ <fo:inline keep-together.within-line="always">
253
+ <fo:leader leader-pattern="dots"/>
254
+ <fo:page-number-citation ref-id="{@id}"/>
255
+ </fo:inline>
256
+ </fo:basic-link>
257
+ </fo:block>
258
+ </xsl:for-each>
259
+ </xsl:if>
260
+ </fo:block>
256
261
  </fo:block-container>
257
262
 
258
263
 
@@ -417,7 +422,10 @@
417
422
  </xsl:template>
418
423
 
419
424
  <xsl:template match="ogc:license-statement//ogc:title">
420
- <fo:block font-family="Lato" text-align="center" font-weight="bold" margin-top="4pt">
425
+ <xsl:variable name="level">
426
+ <xsl:call-template name="getLevel"/>
427
+ </xsl:variable>
428
+ <fo:block font-family="Lato" text-align="center" font-weight="bold" margin-top="4pt" role="H{$level}">
421
429
  <xsl:apply-templates/>
422
430
  </fo:block>
423
431
  </xsl:template>
@@ -450,7 +458,10 @@
450
458
  </xsl:template>
451
459
 
452
460
  <xsl:template match="ogc:copyright-statement//ogc:title | ogc:legal-statement//ogc:title">
453
- <fo:block font-family="Lato" text-align="center" font-weight="bold">
461
+ <xsl:variable name="level">
462
+ <xsl:call-template name="getLevel"/>
463
+ </xsl:variable>
464
+ <fo:block font-family="Lato" text-align="center" font-weight="bold" role="H{$level}">
454
465
  <xsl:apply-templates/>
455
466
  </fo:block>
456
467
  </xsl:template>
@@ -489,8 +500,9 @@
489
500
  <!-- ====== -->
490
501
 
491
502
  <xsl:template match="ogc:annex/ogc:title">
492
- <fo:block xsl:use-attribute-sets="title-depth1-style">
503
+ <fo:block xsl:use-attribute-sets="title-depth1-style" role="H1">
493
504
  <xsl:apply-templates/>
505
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
494
506
  </fo:block>
495
507
  </xsl:template>
496
508
 
@@ -520,7 +532,7 @@
520
532
  </fo:inline>
521
533
  </xsl:when>
522
534
  <xsl:otherwise>
523
- <fo:inline font-family="Lato">
535
+ <fo:inline font-family="Lato" role="H{$level}">
524
536
  <xsl:apply-templates/>
525
537
  </fo:inline>
526
538
  </xsl:otherwise>
@@ -531,21 +543,25 @@
531
543
  <xsl:when test="$level = 1">
532
544
  <fo:block xsl:use-attribute-sets="title-depth1-style">
533
545
  <xsl:apply-templates/>
546
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
534
547
  </fo:block>
535
548
  </xsl:when>
536
549
  <xsl:when test="$level = 2">
537
550
  <fo:block xsl:use-attribute-sets="title-depth2-style">
538
551
  <xsl:apply-templates/>
552
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
539
553
  </fo:block>
540
554
  </xsl:when>
541
555
  <xsl:when test="$level = 3">
542
556
  <fo:block xsl:use-attribute-sets="title-depth3-style">
543
557
  <xsl:apply-templates/>
558
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
544
559
  </fo:block>
545
560
  </xsl:when>
546
561
  <xsl:otherwise>
547
- <fo:block font-family="Lato">
562
+ <fo:block font-family="Lato" role="H{$level}">
548
563
  <xsl:apply-templates/>
564
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
549
565
  </fo:block>
550
566
  </xsl:otherwise>
551
567
  </xsl:choose>
@@ -751,7 +767,10 @@
751
767
  <xsl:otherwise>12pt</xsl:otherwise>
752
768
  </xsl:choose>
753
769
  </xsl:variable>
754
- <fo:block font-size="{$font-size}">
770
+ <xsl:variable name="levelTerm">
771
+ <xsl:call-template name="getLevelTermName"/>
772
+ </xsl:variable>
773
+ <fo:block font-size="{$font-size}" role="H{$levelTerm}">
755
774
  <fo:block font-weight="bold" keep-with-next="always">
756
775
  <xsl:apply-templates select="ancestor::ogc:term/ogc:name" mode="presentation"/>
757
776
  </fo:block>
@@ -861,13 +880,13 @@
861
880
  </fo:block>
862
881
  </fo:static-content>
863
882
 
864
- <fo:static-content flow-name="header">
883
+ <fo:static-content flow-name="header" role="artifact">
865
884
  <fo:block-container height="16.5mm" background-color="{$color}">
866
885
  <fo:block> </fo:block>
867
886
  </fo:block-container>
868
887
  </fo:static-content>
869
888
 
870
- <fo:static-content flow-name="footer">
889
+ <fo:static-content flow-name="footer" role="artifact">
871
890
  <fo:block-container height="100%" display-align="after">
872
891
  <fo:block-container height="23.5mm" background-color="{$color}" color="rgb(231, 230, 230)" display-align="after">
873
892
  <fo:block-container margin-left="1in" margin-right="1in">
@@ -1072,6 +1091,7 @@
1072
1091
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
1073
1092
  <xsl:attribute name="white-space">pre</xsl:attribute>
1074
1093
  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
1094
+ <xsl:attribute name="role">Code</xsl:attribute>
1075
1095
 
1076
1096
 
1077
1097
 
@@ -1124,8 +1144,13 @@
1124
1144
 
1125
1145
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1126
1146
 
1127
- </xsl:attribute-set><xsl:attribute-set name="requirement-subject-style">
1128
- </xsl:attribute-set><xsl:attribute-set name="requirement-inherit-style">
1147
+ </xsl:attribute-set><xsl:attribute-set name="subject-style">
1148
+ </xsl:attribute-set><xsl:attribute-set name="inherit-style">
1149
+ </xsl:attribute-set><xsl:attribute-set name="description-style">
1150
+ </xsl:attribute-set><xsl:attribute-set name="specification-style">
1151
+ </xsl:attribute-set><xsl:attribute-set name="measurement-target-style">
1152
+ </xsl:attribute-set><xsl:attribute-set name="verification-style">
1153
+ </xsl:attribute-set><xsl:attribute-set name="import-style">
1129
1154
  </xsl:attribute-set><xsl:attribute-set name="recommendation-style">
1130
1155
 
1131
1156
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
@@ -1332,6 +1357,11 @@
1332
1357
 
1333
1358
 
1334
1359
 
1360
+ </xsl:attribute-set><xsl:attribute-set name="table-note-name-style">
1361
+
1362
+
1363
+
1364
+
1335
1365
  </xsl:attribute-set><xsl:attribute-set name="note-p-style">
1336
1366
 
1337
1367
 
@@ -1365,7 +1395,8 @@
1365
1395
 
1366
1396
 
1367
1397
 
1368
- </xsl:attribute-set><xsl:attribute-set name="quote-style">
1398
+ </xsl:attribute-set><xsl:attribute-set name="quote-style">
1399
+ <xsl:attribute name="role">BlockQuote</xsl:attribute>
1369
1400
 
1370
1401
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
1371
1402
  <xsl:attribute name="margin-left">13mm</xsl:attribute>
@@ -1511,13 +1542,20 @@
1511
1542
 
1512
1543
  </xsl:attribute-set><xsl:attribute-set name="list-style">
1513
1544
 
1514
- </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">
1545
+ </xsl:attribute-set><xsl:attribute-set name="toc-style">
1546
+ <xsl:attribute name="line-height">135%</xsl:attribute>
1547
+ </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">
1515
1548
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
1516
1549
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
1517
1550
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
1518
1551
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']" mode="contents"/>
1519
1552
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']" mode="contents"/>
1520
- </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
1553
+ </xsl:template><xsl:template name="processPrefaceSectionsDefault_Contents">
1554
+ <xsl:for-each select="/*/*[local-name()='preface']/*">
1555
+ <xsl:sort select="@displayorder" data-type="number"/>
1556
+ <xsl:apply-templates select="." mode="contents"/>
1557
+ </xsl:for-each>
1558
+ </xsl:template><xsl:template name="OLD_processMainSectionsDefault_Contents">
1521
1559
  <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
1522
1560
 
1523
1561
  <!-- Normative references -->
@@ -1530,13 +1568,33 @@
1530
1568
  <!-- Bibliography -->
1531
1569
  <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"/>
1532
1570
 
1533
- </xsl:template><xsl:template name="processPrefaceSectionsDefault">
1571
+ </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
1572
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
1573
+ <xsl:sort select="@displayorder" data-type="number"/>
1574
+ <xsl:apply-templates select="." mode="contents"/>
1575
+ </xsl:for-each>
1576
+
1577
+ <xsl:for-each select="/*/*[local-name()='annex']">
1578
+ <xsl:sort select="@displayorder" data-type="number"/>
1579
+ <xsl:apply-templates select="." mode="contents"/>
1580
+ </xsl:for-each>
1581
+
1582
+ <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
1583
+ <xsl:sort select="@displayorder" data-type="number"/>
1584
+ <xsl:apply-templates select="." mode="contents"/>
1585
+ </xsl:for-each>
1586
+ </xsl:template><xsl:template name="OLD_processPrefaceSectionsDefault">
1534
1587
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
1535
1588
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
1536
1589
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']"/>
1537
1590
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']"/>
1538
1591
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']"/>
1539
- </xsl:template><xsl:template name="processMainSectionsDefault">
1592
+ </xsl:template><xsl:template name="processPrefaceSectionsDefault">
1593
+ <xsl:for-each select="/*/*[local-name()='preface']/*">
1594
+ <xsl:sort select="@displayorder" data-type="number"/>
1595
+ <xsl:apply-templates select="."/>
1596
+ </xsl:for-each>
1597
+ </xsl:template><xsl:template name="OLD_processMainSectionsDefault">
1540
1598
  <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']"/>
1541
1599
 
1542
1600
  <!-- Normative references -->
@@ -1548,6 +1606,22 @@
1548
1606
  <xsl:apply-templates select="/*/*[local-name()='annex']"/>
1549
1607
  <!-- Bibliography -->
1550
1608
  <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]"/>
1609
+ </xsl:template><xsl:template name="processMainSectionsDefault">
1610
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
1611
+ <xsl:sort select="@displayorder" data-type="number"/>
1612
+ <xsl:apply-templates select="."/>
1613
+
1614
+ </xsl:for-each>
1615
+
1616
+ <xsl:for-each select="/*/*[local-name()='annex']">
1617
+ <xsl:sort select="@displayorder" data-type="number"/>
1618
+ <xsl:apply-templates select="."/>
1619
+ </xsl:for-each>
1620
+
1621
+ <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
1622
+ <xsl:sort select="@displayorder" data-type="number"/>
1623
+ <xsl:apply-templates select="."/>
1624
+ </xsl:for-each>
1551
1625
  </xsl:template><xsl:template match="text()">
1552
1626
  <xsl:value-of select="."/>
1553
1627
  </xsl:template><xsl:template match="*[local-name()='br']">
@@ -1576,7 +1650,9 @@
1576
1650
  <!-- Display table's name before table as standalone block -->
1577
1651
  <!-- $namespace = 'iso' or -->
1578
1652
 
1579
-
1653
+
1654
+
1655
+
1580
1656
 
1581
1657
  <xsl:call-template name="fn_name_display"/>
1582
1658
 
@@ -2401,9 +2477,8 @@
2401
2477
 
2402
2478
  <!-- Table's note name (NOTE, for example) -->
2403
2479
 
2404
- <fo:inline padding-right="2mm">
2480
+ <fo:inline padding-right="2mm" xsl:use-attribute-sets="table-note-name-style">
2405
2481
 
2406
-
2407
2482
 
2408
2483
 
2409
2484
 
@@ -3032,6 +3107,8 @@
3032
3107
  <xsl:if test="$font-size != ''">
3033
3108
  <xsl:attribute name="font-size">
3034
3109
  <xsl:choose>
3110
+ <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
3111
+ <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
3035
3112
  <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
3036
3113
  <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
3037
3114
  </xsl:choose>
@@ -3466,16 +3543,68 @@
3466
3543
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
3467
3544
  </xsl:call-template>
3468
3545
 
3546
+
3547
+
3469
3548
  <xsl:variable name="mathml">
3470
3549
  <xsl:apply-templates select="." mode="mathml"/>
3471
3550
  </xsl:variable>
3472
3551
  <fo:instream-foreign-object fox:alt-text="Math">
3473
3552
 
3474
3553
 
3554
+ <xsl:variable name="comment_text_following" select="following-sibling::node()[1][self::comment()]"/>
3555
+ <xsl:variable name="comment_text_">
3556
+ <xsl:choose>
3557
+ <xsl:when test="normalize-space($comment_text_following) != ''">
3558
+ <xsl:value-of select="$comment_text_following"/>
3559
+ </xsl:when>
3560
+ <xsl:otherwise>
3561
+ <xsl:value-of select="normalize-space(translate(.,' ⁢',' '))"/>
3562
+ </xsl:otherwise>
3563
+ </xsl:choose>
3564
+ </xsl:variable>
3565
+ <xsl:variable name="comment_text" select="java:org.metanorma.fop.Util.unescape($comment_text_)"/>
3566
+
3567
+ <xsl:if test="normalize-space($comment_text) != ''">
3568
+ <!-- put Mathin Alternate Text -->
3569
+ <xsl:attribute name="fox:alt-text">
3570
+ <xsl:value-of select="java:org.metanorma.fop.Util.unescape($comment_text)"/>
3571
+ </xsl:attribute>
3572
+ </xsl:if>
3573
+
3574
+ <xsl:variable name="mathml_content">
3575
+ <xsl:apply-templates select="." mode="mathml_actual_text"/>
3576
+ </xsl:variable>
3577
+ <!-- put MathML in Actual Text -->
3578
+ <xsl:attribute name="fox:actual-text">
3579
+ <xsl:value-of select="$mathml_content"/>
3580
+ </xsl:attribute>
3581
+
3582
+
3475
3583
  <!-- <xsl:copy-of select="."/> -->
3476
3584
  <xsl:copy-of select="xalan:nodeset($mathml)"/>
3477
3585
  </fo:instream-foreign-object>
3478
3586
  </fo:inline>
3587
+ </xsl:template><xsl:template match="mathml:*" mode="mathml_actual_text">
3588
+ <!-- <xsl:text>a+b</xsl:text> -->
3589
+ <xsl:text>&lt;</xsl:text>
3590
+ <xsl:value-of select="local-name()"/>
3591
+ <xsl:if test="local-name() = 'math'">
3592
+ <xsl:text> xmlns="http://www.w3.org/1998/Math/MathML"</xsl:text>
3593
+ </xsl:if>
3594
+ <xsl:for-each select="@*">
3595
+ <xsl:text> </xsl:text>
3596
+ <xsl:value-of select="local-name()"/>
3597
+ <xsl:text>="</xsl:text>
3598
+ <xsl:value-of select="."/>
3599
+ <xsl:text>"</xsl:text>
3600
+ </xsl:for-each>
3601
+ <xsl:text>&gt;</xsl:text>
3602
+ <xsl:apply-templates mode="mathml_actual_text"/>
3603
+ <xsl:text>&lt;/</xsl:text>
3604
+ <xsl:value-of select="local-name()"/>
3605
+ <xsl:text>&gt;</xsl:text>
3606
+ </xsl:template><xsl:template match="text()" mode="mathml_actual_text">
3607
+ <xsl:value-of select="normalize-space()"/>
3479
3608
  </xsl:template><xsl:template match="@*|node()" mode="mathml">
3480
3609
  <xsl:copy>
3481
3610
  <xsl:apply-templates select="@*|node()" mode="mathml"/>
@@ -3537,7 +3666,10 @@
3537
3666
  </fo:block>
3538
3667
  <xsl:apply-templates/>
3539
3668
  </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
3540
- <fo:inline><xsl:apply-templates/></fo:inline>
3669
+ <xsl:variable name="level">
3670
+ <xsl:call-template name="getLevel"/>
3671
+ </xsl:variable>
3672
+ <fo:inline role="H{$level}"><xsl:apply-templates/></fo:inline>
3541
3673
  </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
3542
3674
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
3543
3675
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -3572,9 +3704,10 @@
3572
3704
 
3573
3705
  </xsl:variable>
3574
3706
 
3707
+ <xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
3575
3708
  <xsl:choose>
3576
- <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
3577
- <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
3709
+ <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>
3710
+ <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>
3578
3711
  </xsl:choose>
3579
3712
  <xsl:apply-templates/>
3580
3713
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
@@ -3724,7 +3857,10 @@
3724
3857
  </fo:block>
3725
3858
  </xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']" mode="presentation">
3726
3859
  <xsl:if test="normalize-space() != ''">
3727
- <fo:inline>
3860
+ <xsl:variable name="level">
3861
+ <xsl:call-template name="getLevelTermName"/>
3862
+ </xsl:variable>
3863
+ <fo:inline role="H{$level}">
3728
3864
  <xsl:apply-templates/>
3729
3865
  <!-- <xsl:if test="$namespace = 'gb' or $namespace = 'ogc'">
3730
3866
  <xsl:text>.</xsl:text>
@@ -4025,6 +4161,13 @@
4025
4161
  </xsl:attribute>
4026
4162
  <xsl:apply-templates mode="svg_update"/>
4027
4163
  </xsl:copy>
4164
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][*[local-name() = 'svg']]" priority="3">
4165
+ <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
4166
+ <xsl:for-each select="*[local-name() = 'svg']">
4167
+ <xsl:call-template name="image_svg">
4168
+ <xsl:with-param name="name" select="$name"/>
4169
+ </xsl:call-template>
4170
+ </xsl:for-each>
4028
4171
  </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
4029
4172
  <xsl:variable name="svg_content" select="document(@src)"/>
4030
4173
  <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
@@ -4129,7 +4272,7 @@
4129
4272
  </fo:basic-link>
4130
4273
  </fo:block>
4131
4274
  </fo:block-container>
4132
- </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">
4275
+ </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">
4133
4276
  <xsl:apply-templates mode="contents"/>
4134
4277
  <xsl:text> </xsl:text>
4135
4278
  </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">
@@ -4366,6 +4509,7 @@
4366
4509
  </xsl:when>
4367
4510
  <xsl:otherwise>
4368
4511
  <xsl:apply-templates/>
4512
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
4369
4513
  </xsl:otherwise>
4370
4514
  </xsl:choose>
4371
4515
  </fo:block>
@@ -4438,12 +4582,16 @@
4438
4582
  <xsl:if test="$font-size != ''">
4439
4583
  <xsl:attribute name="font-size">
4440
4584
  <xsl:choose>
4585
+ <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
4586
+ <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
4441
4587
  <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
4442
4588
  <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
4443
4589
  </xsl:choose>
4444
4590
  </xsl:attribute>
4445
4591
  </xsl:if>
4446
4592
 
4593
+
4594
+
4447
4595
  <xsl:apply-templates/>
4448
4596
  </fo:block>
4449
4597
 
@@ -4514,14 +4662,6 @@
4514
4662
  <fo:block>
4515
4663
  <fo:inline padding-right="3mm">Obligation</fo:inline><xsl:value-of select="."/>
4516
4664
  </fo:block>
4517
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
4518
- <fo:block xsl:use-attribute-sets="requirement-subject-style">
4519
- <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
4520
- </fo:block>
4521
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'inherit']">
4522
- <fo:block xsl:use-attribute-sets="requirement-inherit-style">
4523
- <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
4524
- </fo:block>
4525
4665
  </xsl:template><xsl:template match="*[local-name() = 'recommendation']">
4526
4666
  <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
4527
4667
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -4538,6 +4678,38 @@
4538
4678
  <fo:block xsl:use-attribute-sets="recommendation-label-style">
4539
4679
  <xsl:apply-templates/>
4540
4680
  </fo:block>
4681
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" priority="2"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
4682
+ <fo:block xsl:use-attribute-sets="subject-style">
4683
+ <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
4684
+ </fo:block>
4685
+ </xsl:template><xsl:template match="*[local-name() = 'subject']">
4686
+ <fo:block xsl:use-attribute-sets="subject-style">
4687
+ <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
4688
+ </fo:block>
4689
+ </xsl:template><xsl:template match="*[local-name() = 'inherit'] | *[local-name() = 'component'][@class = 'inherit']">
4690
+ <fo:block xsl:use-attribute-sets="inherit-style">
4691
+ <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
4692
+ </fo:block>
4693
+ </xsl:template><xsl:template match="*[local-name() = 'description'] | *[local-name() = 'component'][@class = 'description']">
4694
+ <fo:block xsl:use-attribute-sets="description-style">
4695
+ <xsl:apply-templates/>
4696
+ </fo:block>
4697
+ </xsl:template><xsl:template match="*[local-name() = 'specification'] | *[local-name() = 'component'][@class = 'specification']">
4698
+ <fo:block xsl:use-attribute-sets="specification-style">
4699
+ <xsl:apply-templates/>
4700
+ </fo:block>
4701
+ </xsl:template><xsl:template match="*[local-name() = 'measurement-target'] | *[local-name() = 'component'][@class = 'measurement-target']">
4702
+ <fo:block xsl:use-attribute-sets="measurement-target-style">
4703
+ <xsl:apply-templates/>
4704
+ </fo:block>
4705
+ </xsl:template><xsl:template match="*[local-name() = 'verification'] | *[local-name() = 'component'][@class = 'verification']">
4706
+ <fo:block xsl:use-attribute-sets="verification-style">
4707
+ <xsl:apply-templates/>
4708
+ </fo:block>
4709
+ </xsl:template><xsl:template match="*[local-name() = 'import'] | *[local-name() = 'component'][@class = 'import']">
4710
+ <fo:block xsl:use-attribute-sets="import-style">
4711
+ <xsl:apply-templates/>
4712
+ </fo:block>
4541
4713
  </xsl:template><xsl:template match="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
4542
4714
  <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt">
4543
4715
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
@@ -4803,14 +4975,15 @@
4803
4975
  </xsl:if>
4804
4976
  </xsl:template><xsl:variable name="localized.source">
4805
4977
  <xsl:call-template name="getLocalizedString">
4806
- <xsl:with-param name="key">source</xsl:with-param>
4807
- </xsl:call-template>
4978
+ <xsl:with-param name="key">source</xsl:with-param>
4979
+ </xsl:call-template>
4808
4980
  </xsl:variable><xsl:template match="*[local-name() = 'origin']">
4809
4981
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
4810
4982
  <xsl:if test="normalize-space(@citeas) = ''">
4811
4983
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
4812
4984
  </xsl:if>
4813
4985
 
4986
+
4814
4987
  <fo:inline>
4815
4988
 
4816
4989
 
@@ -4818,6 +4991,7 @@
4818
4991
 
4819
4992
 
4820
4993
 
4994
+
4821
4995
  <xsl:call-template name="getTitle">
4822
4996
  <xsl:with-param name="name" select="'title-source'"/>
4823
4997
  </xsl:call-template>
@@ -4829,6 +5003,7 @@
4829
5003
  <fo:inline xsl:use-attribute-sets="origin-style">
4830
5004
  <xsl:apply-templates/>
4831
5005
  </fo:inline>
5006
+
4832
5007
  </fo:basic-link>
4833
5008
  </xsl:template><xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']">
4834
5009
  <fo:inline><xsl:apply-templates/></fo:inline>
@@ -4895,6 +5070,9 @@
4895
5070
 
4896
5071
  </xsl:if>
4897
5072
 
5073
+ <xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets -->
5074
+ <xsl:variable name="text" select="normalize-space()"/>
5075
+
4898
5076
 
4899
5077
 
4900
5078
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
@@ -4910,7 +5088,9 @@
4910
5088
 
4911
5089
 
4912
5090
  </xsl:if>
4913
-
5091
+
5092
+
5093
+
4914
5094
  <xsl:apply-templates/>
4915
5095
  </fo:basic-link>
4916
5096
 
@@ -5252,6 +5432,7 @@
5252
5432
  </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" priority="4">
5253
5433
  <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
5254
5434
  <fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
5435
+
5255
5436
  <xsl:apply-templates/>
5256
5437
  </fo:block>
5257
5438
  </xsl:template><xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
@@ -5560,6 +5741,97 @@
5560
5741
  <fo:block-container border="1pt solid black" width="50%">
5561
5742
  <fo:block> </fo:block>
5562
5743
  </fo:block-container>
5744
+ </xsl:template><xsl:template match="*[local-name() = 'toc']">
5745
+ <xsl:param name="colwidths"/>
5746
+ <xsl:variable name="colwidths_">
5747
+ <xsl:choose>
5748
+ <xsl:when test="not($colwidths)">
5749
+ <xsl:variable name="toc_table_simple">
5750
+ <tbody>
5751
+ <xsl:apply-templates mode="toc_table_width"/>
5752
+ </tbody>
5753
+ </xsl:variable>
5754
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($toc_table_simple)/*/tr[1]/td)"/>
5755
+ <xsl:call-template name="calculate-column-widths">
5756
+ <xsl:with-param name="cols-count" select="$cols-count"/>
5757
+ <xsl:with-param name="table" select="$toc_table_simple"/>
5758
+ </xsl:call-template>
5759
+ </xsl:when>
5760
+ <xsl:otherwise>
5761
+ <xsl:copy-of select="$colwidths"/>
5762
+ </xsl:otherwise>
5763
+ </xsl:choose>
5764
+ </xsl:variable>
5765
+ <fo:block role="TOCI" space-after="16pt">
5766
+ <fo:table width="100%" table-layout="fixed">
5767
+ <xsl:for-each select="xalan:nodeset($colwidths_)/column">
5768
+ <fo:table-column column-width="proportional-column-width({.})"/>
5769
+ </xsl:for-each>
5770
+ <fo:table-body>
5771
+ <xsl:apply-templates/>
5772
+ </fo:table-body>
5773
+ </fo:table>
5774
+ </fo:block>
5775
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']">
5776
+ <fo:table-row min-height="5mm">
5777
+ <xsl:apply-templates/>
5778
+ </fo:table-row>
5779
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']/*[local-name() = 'p']">
5780
+ <xsl:apply-templates/>
5781
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'xref']" priority="3">
5782
+ <!-- <xref target="cgpm9th1948r6">1.6.3<tab/>&#8220;9th CGPM, 1948:<tab/>decision to establish the SI&#8221;</xref> -->
5783
+ <xsl:variable name="target" select="@target"/>
5784
+ <xsl:for-each select="*[local-name() = 'tab']">
5785
+ <xsl:variable name="current_id" select="generate-id()"/>
5786
+ <fo:table-cell>
5787
+ <fo:block>
5788
+ <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
5789
+ <xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
5790
+ <xsl:choose>
5791
+ <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
5792
+ <xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
5793
+ </xsl:choose>
5794
+ </xsl:for-each>
5795
+ </fo:basic-link>
5796
+ </fo:block>
5797
+ </fo:table-cell>
5798
+ </xsl:for-each>
5799
+ <!-- last column - for page numbers -->
5800
+ <fo:table-cell text-align="right" font-size="10pt" font-weight="bold" font-family="Arial">
5801
+ <fo:block>
5802
+ <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
5803
+ <fo:page-number-citation ref-id="{$target}"/>
5804
+ </fo:basic-link>
5805
+ </fo:block>
5806
+ </fo:table-cell>
5807
+ </xsl:template><xsl:template match="*" mode="toc_table_width">
5808
+ <xsl:apply-templates mode="toc_table_width"/>
5809
+ </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">
5810
+ <tr>
5811
+ <xsl:apply-templates mode="toc_table_width"/>
5812
+ </tr>
5813
+ </xsl:template><xsl:template match="*[local-name() = 'xref']" mode="toc_table_width">
5814
+ <!-- <xref target="cgpm9th1948r6">1.6.3<tab/>&#8220;9th CGPM, 1948:<tab/>decision to establish the SI&#8221;</xref> -->
5815
+ <xsl:for-each select="*[local-name() = 'tab']">
5816
+ <xsl:variable name="current_id" select="generate-id()"/>
5817
+ <td>
5818
+ <xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
5819
+ <xsl:copy-of select="."/>
5820
+ </xsl:for-each>
5821
+ </td>
5822
+ </xsl:for-each>
5823
+ <td>333</td> <!-- page number, just for fill -->
5824
+ </xsl:template><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']"/><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
5825
+ <fo:inline padding-right="5mm"> </fo:inline>
5826
+ <fo:inline><xsl:apply-templates/></fo:inline>
5827
+ </xsl:template><xsl:template match="*[local-name() = 'blacksquare']" name="blacksquare">
5828
+ <fo:inline padding-right="2.5mm" baseline-shift="5%">
5829
+ <fo:instream-foreign-object content-height="2mm" content-width="2mm" fox:alt-text="Quad">
5830
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" viewBox="0 0 2 2">
5831
+ <rect x="0" y="0" width="2" height="2" fill="black"/>
5832
+ </svg>
5833
+ </fo:instream-foreign-object>
5834
+ </fo:inline>
5563
5835
  </xsl:template><xsl:template name="convertDate">
5564
5836
  <xsl:param name="date"/>
5565
5837
  <xsl:param name="format" select="'short'"/>
@@ -5798,6 +6070,26 @@
5798
6070
  <xsl:value-of select="$level"/>
5799
6071
  </xsl:otherwise>
5800
6072
  </xsl:choose>
6073
+ </xsl:template><xsl:template name="getLevelTermName">
6074
+ <xsl:choose>
6075
+ <xsl:when test="normalize-space(../@depth) != ''">
6076
+ <xsl:value-of select="../@depth"/>
6077
+ </xsl:when>
6078
+ <xsl:otherwise>
6079
+ <xsl:variable name="title_level_">
6080
+ <xsl:for-each select="../preceding-sibling::*[local-name() = 'title'][1]">
6081
+ <xsl:call-template name="getLevel"/>
6082
+ </xsl:for-each>
6083
+ </xsl:variable>
6084
+ <xsl:variable name="title_level" select="normalize-space($title_level_)"/>
6085
+ <xsl:choose>
6086
+ <xsl:when test="$title_level != ''"><xsl:value-of select="$title_level + 1"/></xsl:when>
6087
+ <xsl:otherwise>
6088
+ <xsl:call-template name="getLevel"/>
6089
+ </xsl:otherwise>
6090
+ </xsl:choose>
6091
+ </xsl:otherwise>
6092
+ </xsl:choose>
5801
6093
  </xsl:template><xsl:template name="split">
5802
6094
  <xsl:param name="pText" select="."/>
5803
6095
  <xsl:param name="sep" select="','"/>