metanorma-iso 1.9.2 → 1.9.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -529,7 +529,7 @@
529
529
 
530
530
  <fo:block-container border-top="1mm double black" line-height="1.1" margin-top="3mm">
531
531
  <fo:block margin-right="5mm">
532
- <fo:block font-size="18pt" font-weight="bold" margin-top="6pt">
532
+ <fo:block font-size="18pt" font-weight="bold" margin-top="6pt" role="H1">
533
533
  <xsl:if test="normalize-space($title-intro) != ''">
534
534
  <xsl:value-of select="$title-intro"/>
535
535
  <xsl:text> — </xsl:text>
@@ -541,7 +541,7 @@
541
541
 
542
542
  <xsl:variable name="title-amd" select="/iso:iso-standard/iso:bibdata/iso:title[@language = 'en' and @type = 'title-amd']"/>
543
543
  <xsl:if test="$doctype = 'amendment' and normalize-space($title-amd) != ''">
544
- <fo:block margin-top="12pt">
544
+ <fo:block margin-top="12pt" role="H1">
545
545
  <xsl:call-template name="printAmendmentTitle"/>
546
546
  </fo:block>
547
547
  </xsl:if>
@@ -549,7 +549,7 @@
549
549
  </fo:block>
550
550
 
551
551
  <fo:block font-size="9pt"><xsl:value-of select="$linebreak"/></fo:block>
552
- <fo:block font-size="11pt" font-style="italic" line-height="1.5">
552
+ <fo:block font-size="11pt" font-style="italic" line-height="1.5" role="H1">
553
553
 
554
554
  <xsl:if test="normalize-space($title-intro-fr) != ''">
555
555
  <xsl:value-of select="$title-intro-fr"/>
@@ -562,7 +562,7 @@
562
562
 
563
563
  <xsl:variable name="title-amd" select="/iso:iso-standard/iso:bibdata/iso:title[@language = 'fr' and @type = 'title-amd']"/>
564
564
  <xsl:if test="$doctype = 'amendment' and normalize-space($title-amd) != ''">
565
- <fo:block margin-top="6pt">
565
+ <fo:block margin-top="6pt" role="H1">
566
566
  <xsl:call-template name="printAmendmentTitle">
567
567
  <xsl:with-param name="lang" select="'fr'"/>
568
568
  </xsl:call-template>
@@ -654,7 +654,7 @@
654
654
  <xsl:value-of select="/iso:iso-standard/iso:bibdata/iso:version/iso:revision-date"/> -->
655
655
  <xsl:if test="$doctype = 'amendment'">
656
656
  <fo:block text-align="right" margin-right="0.5mm">
657
- <fo:block font-weight="bold" margin-top="4pt">
657
+ <fo:block font-weight="bold" margin-top="4pt" role="H1">
658
658
  <xsl:variable name="title-amendment">
659
659
  <xsl:call-template name="getTitle">
660
660
  <xsl:with-param name="name" select="'title-amendment'"/>
@@ -724,7 +724,7 @@
724
724
  <fo:table-cell>
725
725
  <fo:block-container border-top="1mm double black" line-height="1.1">
726
726
  <fo:block margin-right="5mm">
727
- <fo:block font-size="18pt" font-weight="bold" margin-top="12pt">
727
+ <fo:block font-size="18pt" font-weight="bold" margin-top="12pt" role="H1">
728
728
 
729
729
  <xsl:if test="normalize-space($title-intro) != ''">
730
730
  <xsl:value-of select="$title-intro"/>
@@ -746,14 +746,14 @@
746
746
  </xsl:if> -->
747
747
  <xsl:variable name="title-amd" select="/iso:iso-standard/iso:bibdata/iso:title[@language = 'en' and @type = 'title-amd']"/>
748
748
  <xsl:if test="$doctype = 'amendment' and normalize-space($title-amd) != ''">
749
- <fo:block margin-right="-5mm" margin-top="12pt">
749
+ <fo:block margin-right="-5mm" margin-top="12pt" role="H1">
750
750
  <xsl:call-template name="printAmendmentTitle"/>
751
751
  </fo:block>
752
752
  </xsl:if>
753
753
  </fo:block>
754
754
 
755
755
  <fo:block font-size="9pt"><xsl:value-of select="$linebreak"/></fo:block>
756
- <fo:block font-size="11pt" font-style="italic" line-height="1.5">
756
+ <fo:block font-size="11pt" font-style="italic" line-height="1.5" role="H1">
757
757
 
758
758
  <xsl:if test="normalize-space($title-intro-fr) != ''">
759
759
  <xsl:value-of select="$title-intro-fr"/>
@@ -766,7 +766,7 @@
766
766
 
767
767
  <xsl:variable name="title-amd" select="/iso:iso-standard/iso:bibdata/iso:title[@language = 'fr' and @type = 'title-amd']"/>
768
768
  <xsl:if test="$doctype = 'amendment' and normalize-space($title-amd) != ''">
769
- <fo:block margin-right="-5mm" margin-top="6pt">
769
+ <fo:block margin-right="-5mm" margin-top="6pt" role="H1">
770
770
  <xsl:call-template name="printAmendmentTitle">
771
771
  <xsl:with-param name="lang" select="'fr'"/>
772
772
  </xsl:call-template>
@@ -857,7 +857,7 @@
857
857
 
858
858
  <fo:block-container border-top="1mm double black" line-height="1.1">
859
859
  <fo:block margin-right="40mm">
860
- <fo:block font-size="18pt" font-weight="bold" margin-top="12pt">
860
+ <fo:block font-size="18pt" font-weight="bold" margin-top="12pt" role="H1">
861
861
 
862
862
  <xsl:if test="normalize-space($title-intro) != ''">
863
863
  <xsl:value-of select="$title-intro"/>
@@ -880,7 +880,7 @@
880
880
  </fo:block>
881
881
 
882
882
  <fo:block font-size="9pt"><xsl:value-of select="$linebreak"/></fo:block>
883
- <fo:block font-size="11pt" font-style="italic" line-height="1.5">
883
+ <fo:block font-size="11pt" font-style="italic" line-height="1.5" role="H1">
884
884
 
885
885
  <xsl:if test="normalize-space($title-intro-fr) != ''">
886
886
  <xsl:value-of select="$title-intro-fr"/>
@@ -972,7 +972,7 @@
972
972
  </fo:block-container>
973
973
  <fo:block-container font-size="16pt">
974
974
  <!-- Information and documentation — Codes for transcription systems -->
975
- <fo:block font-weight="bold">
975
+ <fo:block font-weight="bold" role="H1">
976
976
 
977
977
  <xsl:if test="normalize-space($title-intro) != ''">
978
978
  <xsl:value-of select="$title-intro"/>
@@ -995,7 +995,7 @@
995
995
  </fo:block>
996
996
 
997
997
  <fo:block font-size="12pt"><xsl:value-of select="$linebreak"/></fo:block>
998
- <fo:block>
998
+ <fo:block role="H1">
999
999
  <xsl:if test="normalize-space($title-intro-fr) != ''">
1000
1000
  <xsl:value-of select="$title-intro-fr"/>
1001
1001
  <xsl:text> — </xsl:text>
@@ -1073,79 +1073,80 @@
1073
1073
  <fo:block break-after="page"/>
1074
1074
  </xsl:if>
1075
1075
  <fo:block-container font-weight="bold">
1076
-
1077
- <fo:block text-align-last="justify" font-size="16pt" margin-top="10pt" margin-bottom="18pt">
1078
- <fo:inline font-size="16pt" font-weight="bold">
1079
- <!-- Contents -->
1080
- <xsl:call-template name="getLocalizedString">
1081
- <xsl:with-param name="key">table_of_contents</xsl:with-param>
1082
- </xsl:call-template>
1083
- </fo:inline>
1084
- <fo:inline keep-together.within-line="always">
1085
- <fo:leader leader-pattern="space"/>
1086
- <fo:inline font-weight="normal" font-size="10pt">
1087
- <!-- Page -->
1076
+ <fo:block role="TOC">
1077
+ <fo:block text-align-last="justify" font-size="16pt" margin-top="10pt" margin-bottom="18pt">
1078
+ <fo:inline font-size="16pt" font-weight="bold" role="H1">
1079
+ <!-- Contents -->
1088
1080
  <xsl:call-template name="getLocalizedString">
1089
- <xsl:with-param name="key">locality.page</xsl:with-param>
1090
- </xsl:call-template>
1081
+ <xsl:with-param name="key">table_of_contents</xsl:with-param>
1082
+ </xsl:call-template>
1091
1083
  </fo:inline>
1092
- </fo:inline>
1093
- </fo:block>
1094
-
1095
- <xsl:if test="$debug = 'true'">
1096
- <xsl:text disable-output-escaping="yes">&lt;!--</xsl:text>
1097
- DEBUG
1098
- contents=<xsl:copy-of select="xalan:nodeset($contents)"/>
1099
- <xsl:text disable-output-escaping="yes">--&gt;</xsl:text>
1100
- </xsl:if>
1101
-
1102
- <xsl:variable name="margin-left">12</xsl:variable>
1103
- <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']"><!-- [not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
1084
+ <fo:inline keep-together.within-line="always">
1085
+ <fo:leader leader-pattern="space"/>
1086
+ <fo:inline font-weight="normal" font-size="10pt">
1087
+ <!-- Page -->
1088
+ <xsl:call-template name="getLocalizedString">
1089
+ <xsl:with-param name="key">locality.page</xsl:with-param>
1090
+ </xsl:call-template>
1091
+ </fo:inline>
1092
+ </fo:inline>
1093
+ </fo:block>
1104
1094
 
1105
- <fo:block>
1106
- <xsl:if test="@level = 1">
1107
- <xsl:attribute name="margin-top">5pt</xsl:attribute>
1108
- </xsl:if>
1109
- <xsl:if test="@level = 3">
1110
- <xsl:attribute name="margin-top">-0.7pt</xsl:attribute>
1111
- </xsl:if>
1112
- <fo:list-block>
1113
- <xsl:attribute name="margin-left"><xsl:value-of select="$margin-left * (@level - 1)"/>mm</xsl:attribute>
1114
- <xsl:if test="@level &gt;= 2 or @type = 'annex'">
1115
- <xsl:attribute name="font-weight">normal</xsl:attribute>
1095
+ <xsl:if test="$debug = 'true'">
1096
+ <xsl:text disable-output-escaping="yes">&lt;!--</xsl:text>
1097
+ DEBUG
1098
+ contents=<xsl:copy-of select="xalan:nodeset($contents)"/>
1099
+ <xsl:text disable-output-escaping="yes">--&gt;</xsl:text>
1100
+ </xsl:if>
1101
+
1102
+ <xsl:variable name="margin-left">12</xsl:variable>
1103
+ <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']"><!-- [not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
1104
+
1105
+ <fo:block role="TOCI">
1106
+ <xsl:if test="@level = 1">
1107
+ <xsl:attribute name="margin-top">5pt</xsl:attribute>
1116
1108
  </xsl:if>
1117
- <xsl:attribute name="provisional-distance-between-starts">
1118
- <xsl:choose>
1119
- <!-- skip 0 section without subsections -->
1120
- <xsl:when test="@level &gt;= 3"><xsl:value-of select="$margin-left * 1.2"/>mm</xsl:when>
1121
- <xsl:when test="@section != ''"><xsl:value-of select="$margin-left"/>mm</xsl:when>
1122
- <xsl:otherwise>0mm</xsl:otherwise>
1123
- </xsl:choose>
1124
- </xsl:attribute>
1125
- <fo:list-item>
1126
- <fo:list-item-label end-indent="label-end()">
1127
- <fo:block>
1128
- <xsl:value-of select="@section"/>
1129
- </fo:block>
1130
- </fo:list-item-label>
1131
- <fo:list-item-body start-indent="body-start()">
1132
- <fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm">
1133
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
1134
-
1135
- <xsl:apply-templates select="title"/>
1109
+ <xsl:if test="@level = 3">
1110
+ <xsl:attribute name="margin-top">-0.7pt</xsl:attribute>
1111
+ </xsl:if>
1112
+ <fo:list-block>
1113
+ <xsl:attribute name="margin-left"><xsl:value-of select="$margin-left * (@level - 1)"/>mm</xsl:attribute>
1114
+ <xsl:if test="@level &gt;= 2 or @type = 'annex'">
1115
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
1116
+ </xsl:if>
1117
+ <xsl:attribute name="provisional-distance-between-starts">
1118
+ <xsl:choose>
1119
+ <!-- skip 0 section without subsections -->
1120
+ <xsl:when test="@level &gt;= 3"><xsl:value-of select="$margin-left * 1.2"/>mm</xsl:when>
1121
+ <xsl:when test="@section != ''"><xsl:value-of select="$margin-left"/>mm</xsl:when>
1122
+ <xsl:otherwise>0mm</xsl:otherwise>
1123
+ </xsl:choose>
1124
+ </xsl:attribute>
1125
+ <fo:list-item>
1126
+ <fo:list-item-label end-indent="label-end()">
1127
+ <fo:block>
1128
+ <xsl:value-of select="@section"/>
1129
+ </fo:block>
1130
+ </fo:list-item-label>
1131
+ <fo:list-item-body start-indent="body-start()">
1132
+ <fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm">
1133
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
1136
1134
 
1137
- <fo:inline keep-together.within-line="always">
1138
- <fo:leader font-size="9pt" font-weight="normal" leader-pattern="dots"/>
1139
- <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
1140
- </fo:inline>
1141
- </fo:basic-link>
1142
- </fo:block>
1143
- </fo:list-item-body>
1144
- </fo:list-item>
1145
- </fo:list-block>
1146
- </fo:block>
1147
-
1148
- </xsl:for-each>
1135
+ <xsl:apply-templates select="title"/>
1136
+
1137
+ <fo:inline keep-together.within-line="always">
1138
+ <fo:leader font-size="9pt" font-weight="normal" leader-pattern="dots"/>
1139
+ <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
1140
+ </fo:inline>
1141
+ </fo:basic-link>
1142
+ </fo:block>
1143
+ </fo:list-item-body>
1144
+ </fo:list-item>
1145
+ </fo:list-block>
1146
+ </fo:block>
1147
+
1148
+ </xsl:for-each>
1149
+ </fo:block>
1149
1150
  </fo:block-container>
1150
1151
  </xsl:otherwise>
1151
1152
  </xsl:choose>
@@ -1179,7 +1180,7 @@
1179
1180
 
1180
1181
  <xsl:variable name="title-intro-doc-lang" select="/iso:iso-standard/iso:bibdata/iso:title[@language = $lang and @type = 'title-intro']"/>
1181
1182
 
1182
- <fo:block>
1183
+ <fo:block role="H1">
1183
1184
  <xsl:if test="normalize-space($title-intro-doc-lang) != ''">
1184
1185
  <xsl:value-of select="$title-intro-doc-lang"/>
1185
1186
  <xsl:text> — </xsl:text>
@@ -1201,13 +1202,13 @@
1201
1202
  </xsl:if>
1202
1203
  </xsl:if>
1203
1204
  </fo:block>
1204
- <fo:block>
1205
+ <fo:block role="H1">
1205
1206
  <xsl:value-of select="$title-part-doc-lang"/>
1206
1207
  </fo:block>
1207
1208
 
1208
1209
  <xsl:variable name="title-amd" select="/iso:iso-standard/iso:bibdata/iso:title[@language = $lang and @type = 'title-amd']"/>
1209
1210
  <xsl:if test="$doctype = 'amendment' and normalize-space($title-amd) != ''">
1210
- <fo:block margin-top="12pt">
1211
+ <fo:block margin-top="12pt" role="H1">
1211
1212
  <xsl:call-template name="printAmendmentTitle"/>
1212
1213
  </fo:block>
1213
1214
  </xsl:if>
@@ -1454,7 +1455,10 @@
1454
1455
 
1455
1456
 
1456
1457
  <xsl:template match="iso:license-statement//iso:title">
1457
- <fo:block text-align="center" font-weight="bold">
1458
+ <xsl:variable name="level">
1459
+ <xsl:call-template name="getLevel"/>
1460
+ </xsl:variable>
1461
+ <fo:block text-align="center" font-weight="bold" role="H{$level}">
1458
1462
  <xsl:apply-templates/>
1459
1463
  </fo:block>
1460
1464
  </xsl:template>
@@ -1482,7 +1486,7 @@
1482
1486
  </fo:block> -->
1483
1487
 
1484
1488
  <xsl:template match="iso:copyright-statement/iso:clause[1]/iso:title">
1485
- <fo:block margin-bottom="3mm">
1489
+ <fo:block margin-bottom="3mm" role="H1">
1486
1490
  <fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Attention))}" width="14mm" content-height="13mm" content-width="scale-to-fit" scaling="uniform" fox:alt-text="Image {@alt}"/>
1487
1491
  <!-- <fo:inline padding-left="6mm" font-size="12pt" font-weight="bold">COPYRIGHT PROTECTED DOCUMENT</fo:inline> -->
1488
1492
  <fo:inline padding-left="6mm" font-size="12pt" font-weight="bold"><xsl:apply-templates/></fo:inline>
@@ -1519,8 +1523,9 @@
1519
1523
  <xsl:call-template name="titleAmendment"/>
1520
1524
  </xsl:when>
1521
1525
  <xsl:otherwise>
1522
- <fo:block font-size="16pt" text-align="center" margin-bottom="48pt" keep-with-next="always">
1526
+ <fo:block font-size="16pt" text-align="center" margin-bottom="48pt" keep-with-next="always" role="H1">
1523
1527
  <xsl:apply-templates/>
1528
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
1524
1529
  </fo:block>
1525
1530
  </xsl:otherwise>
1526
1531
  </xsl:choose>
@@ -1533,7 +1538,7 @@
1533
1538
  <xsl:call-template name="titleAmendment"/>
1534
1539
  </xsl:when>
1535
1540
  <xsl:otherwise>
1536
- <fo:block font-size="16pt" font-weight="bold" text-align="center" margin-top="6pt" margin-bottom="36pt" keep-with-next="always">
1541
+ <fo:block font-size="16pt" font-weight="bold" text-align="center" margin-top="6pt" margin-bottom="36pt" keep-with-next="always" role="H1">
1537
1542
  <xsl:apply-templates/>
1538
1543
  </fo:block>
1539
1544
  </xsl:otherwise>
@@ -1566,8 +1571,9 @@
1566
1571
 
1567
1572
  <xsl:choose>
1568
1573
  <xsl:when test="$doctype = 'amendment' and not(ancestor::iso:preface)">
1569
- <fo:block font-size="11pt" font-style="italic" margin-bottom="12pt" keep-with-next="always">
1574
+ <fo:block font-size="11pt" font-style="italic" margin-bottom="12pt" keep-with-next="always" role="H{$level}">
1570
1575
  <xsl:apply-templates/>
1576
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
1571
1577
  </fo:block>
1572
1578
  </xsl:when>
1573
1579
 
@@ -1593,6 +1599,7 @@
1593
1599
  </xsl:choose>
1594
1600
  </xsl:attribute>
1595
1601
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1602
+ <xsl:attribute name="role">H<xsl:value-of select="$level"/></xsl:attribute>
1596
1603
  <xsl:if test="$element-name = 'fo:inline'">
1597
1604
  <xsl:choose>
1598
1605
  <xsl:when test="$lang = 'zh'">
@@ -1604,6 +1611,7 @@
1604
1611
  </xsl:choose>
1605
1612
  </xsl:if>
1606
1613
  <xsl:apply-templates/>
1614
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
1607
1615
  </xsl:element>
1608
1616
 
1609
1617
  <xsl:if test="$element-name = 'fo:inline' and not(following-sibling::iso:p)">
@@ -1784,8 +1792,11 @@
1784
1792
  <xsl:apply-templates select="."/>
1785
1793
  </xsl:template>
1786
1794
 
1787
- <xsl:template match="iso:preferred">
1788
- <fo:block line-height="1.1">
1795
+ <xsl:template match="iso:preferred">
1796
+ <xsl:variable name="levelTerm">
1797
+ <xsl:call-template name="getLevelTermName"/>
1798
+ </xsl:variable>
1799
+ <fo:block line-height="1.1" role="H{$levelTerm}">
1789
1800
  <fo:block font-weight="bold" keep-with-next="always">
1790
1801
  <xsl:apply-templates select="ancestor::iso:term/iso:name" mode="presentation"/>
1791
1802
  </fo:block>
@@ -1949,7 +1960,7 @@
1949
1960
  <fo:block id="{@id}" span="all">
1950
1961
  <xsl:apply-templates select="iso:title"/>
1951
1962
  </fo:block>
1952
- <fo:block>
1963
+ <fo:block role="Index">
1953
1964
  <xsl:apply-templates select="*[not(local-name() = 'title')]"/>
1954
1965
  </fo:block>
1955
1966
  </fo:flow>
@@ -1958,7 +1969,7 @@
1958
1969
 
1959
1970
  <!-- <xsl:template match="iso:clause[@type = 'index']/iso:title" priority="4"> -->
1960
1971
  <xsl:template match="iso:indexsect/iso:title" priority="4">
1961
- <fo:block font-size="16pt" font-weight="bold" margin-bottom="84pt">
1972
+ <fo:block font-size="16pt" font-weight="bold" margin-bottom="84pt" role="H1">
1962
1973
  <!-- Index -->
1963
1974
  <xsl:apply-templates/>
1964
1975
  </fo:block>
@@ -2003,7 +2014,7 @@
2003
2014
  <xsl:template name="insertHeaderFooter">
2004
2015
  <xsl:param name="font-weight" select="'bold'"/>
2005
2016
  <xsl:call-template name="insertHeaderEven"/>
2006
- <fo:static-content flow-name="footer-even">
2017
+ <fo:static-content flow-name="footer-even" role="artifact">
2007
2018
  <fo:block-container> <!-- display-align="after" -->
2008
2019
  <fo:table table-layout="fixed" width="100%">
2009
2020
  <fo:table-column column-width="33%"/>
@@ -2042,12 +2053,12 @@
2042
2053
  </fo:block>
2043
2054
  </fo:block-container>
2044
2055
  </fo:static-content>
2045
- <fo:static-content flow-name="header-odd">
2056
+ <fo:static-content flow-name="header-odd" role="artifact">
2046
2057
  <fo:block-container height="24mm" display-align="before">
2047
2058
  <fo:block font-size="12pt" font-weight="bold" text-align="right" padding-top="12.5mm"><xsl:value-of select="$ISOname"/></fo:block>
2048
2059
  </fo:block-container>
2049
2060
  </fo:static-content>
2050
- <fo:static-content flow-name="footer-odd">
2061
+ <fo:static-content flow-name="footer-odd" role="artifact">
2051
2062
  <fo:block-container> <!-- display-align="after" -->
2052
2063
  <fo:table table-layout="fixed" width="100%">
2053
2064
  <fo:table-column column-width="33%"/>
@@ -2075,7 +2086,7 @@
2075
2086
  </fo:static-content>
2076
2087
  </xsl:template>
2077
2088
  <xsl:template name="insertHeaderEven">
2078
- <fo:static-content flow-name="header-even">
2089
+ <fo:static-content flow-name="header-even" role="artifact">
2079
2090
  <fo:block-container height="24mm" display-align="before">
2080
2091
  <fo:block font-size="12pt" font-weight="bold" padding-top="12.5mm"><xsl:value-of select="$ISOname"/></fo:block>
2081
2092
  </fo:block-container>
@@ -2326,6 +2337,7 @@
2326
2337
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
2327
2338
  <xsl:attribute name="white-space">pre</xsl:attribute>
2328
2339
  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
2340
+ <xsl:attribute name="role">Code</xsl:attribute>
2329
2341
 
2330
2342
  <xsl:attribute name="font-family">Courier New</xsl:attribute>
2331
2343
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
@@ -2350,8 +2362,13 @@
2350
2362
 
2351
2363
  </xsl:attribute-set><xsl:attribute-set name="requirement-label-style">
2352
2364
 
2353
- </xsl:attribute-set><xsl:attribute-set name="requirement-subject-style">
2354
- </xsl:attribute-set><xsl:attribute-set name="requirement-inherit-style">
2365
+ </xsl:attribute-set><xsl:attribute-set name="subject-style">
2366
+ </xsl:attribute-set><xsl:attribute-set name="inherit-style">
2367
+ </xsl:attribute-set><xsl:attribute-set name="description-style">
2368
+ </xsl:attribute-set><xsl:attribute-set name="specification-style">
2369
+ </xsl:attribute-set><xsl:attribute-set name="measurement-target-style">
2370
+ </xsl:attribute-set><xsl:attribute-set name="verification-style">
2371
+ </xsl:attribute-set><xsl:attribute-set name="import-style">
2355
2372
  </xsl:attribute-set><xsl:attribute-set name="recommendation-style">
2356
2373
 
2357
2374
 
@@ -2541,6 +2558,11 @@
2541
2558
 
2542
2559
 
2543
2560
 
2561
+ </xsl:attribute-set><xsl:attribute-set name="table-note-name-style">
2562
+
2563
+
2564
+
2565
+
2544
2566
  </xsl:attribute-set><xsl:attribute-set name="note-p-style">
2545
2567
 
2546
2568
 
@@ -2576,7 +2598,8 @@
2576
2598
 
2577
2599
 
2578
2600
 
2579
- </xsl:attribute-set><xsl:attribute-set name="quote-style">
2601
+ </xsl:attribute-set><xsl:attribute-set name="quote-style">
2602
+ <xsl:attribute name="role">BlockQuote</xsl:attribute>
2580
2603
 
2581
2604
 
2582
2605
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
@@ -2713,13 +2736,20 @@
2713
2736
 
2714
2737
  </xsl:attribute-set><xsl:attribute-set name="list-style">
2715
2738
 
2716
- </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">
2739
+ </xsl:attribute-set><xsl:attribute-set name="toc-style">
2740
+ <xsl:attribute name="line-height">135%</xsl:attribute>
2741
+ </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">
2717
2742
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
2718
2743
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
2719
2744
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
2720
2745
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']" mode="contents"/>
2721
2746
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']" mode="contents"/>
2722
- </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
2747
+ </xsl:template><xsl:template name="processPrefaceSectionsDefault_Contents">
2748
+ <xsl:for-each select="/*/*[local-name()='preface']/*">
2749
+ <xsl:sort select="@displayorder" data-type="number"/>
2750
+ <xsl:apply-templates select="." mode="contents"/>
2751
+ </xsl:for-each>
2752
+ </xsl:template><xsl:template name="OLD_processMainSectionsDefault_Contents">
2723
2753
  <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
2724
2754
 
2725
2755
  <!-- Normative references -->
@@ -2732,13 +2762,33 @@
2732
2762
  <!-- Bibliography -->
2733
2763
  <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"/>
2734
2764
 
2735
- </xsl:template><xsl:template name="processPrefaceSectionsDefault">
2765
+ </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
2766
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
2767
+ <xsl:sort select="@displayorder" data-type="number"/>
2768
+ <xsl:apply-templates select="." mode="contents"/>
2769
+ </xsl:for-each>
2770
+
2771
+ <xsl:for-each select="/*/*[local-name()='annex']">
2772
+ <xsl:sort select="@displayorder" data-type="number"/>
2773
+ <xsl:apply-templates select="." mode="contents"/>
2774
+ </xsl:for-each>
2775
+
2776
+ <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
2777
+ <xsl:sort select="@displayorder" data-type="number"/>
2778
+ <xsl:apply-templates select="." mode="contents"/>
2779
+ </xsl:for-each>
2780
+ </xsl:template><xsl:template name="OLD_processPrefaceSectionsDefault">
2736
2781
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
2737
2782
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
2738
2783
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']"/>
2739
2784
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']"/>
2740
2785
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']"/>
2741
- </xsl:template><xsl:template name="processMainSectionsDefault">
2786
+ </xsl:template><xsl:template name="processPrefaceSectionsDefault">
2787
+ <xsl:for-each select="/*/*[local-name()='preface']/*">
2788
+ <xsl:sort select="@displayorder" data-type="number"/>
2789
+ <xsl:apply-templates select="."/>
2790
+ </xsl:for-each>
2791
+ </xsl:template><xsl:template name="OLD_processMainSectionsDefault">
2742
2792
  <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']"/>
2743
2793
 
2744
2794
  <!-- Normative references -->
@@ -2750,6 +2800,22 @@
2750
2800
  <xsl:apply-templates select="/*/*[local-name()='annex']"/>
2751
2801
  <!-- Bibliography -->
2752
2802
  <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]"/>
2803
+ </xsl:template><xsl:template name="processMainSectionsDefault">
2804
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
2805
+ <xsl:sort select="@displayorder" data-type="number"/>
2806
+ <xsl:apply-templates select="."/>
2807
+
2808
+ </xsl:for-each>
2809
+
2810
+ <xsl:for-each select="/*/*[local-name()='annex']">
2811
+ <xsl:sort select="@displayorder" data-type="number"/>
2812
+ <xsl:apply-templates select="."/>
2813
+ </xsl:for-each>
2814
+
2815
+ <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
2816
+ <xsl:sort select="@displayorder" data-type="number"/>
2817
+ <xsl:apply-templates select="."/>
2818
+ </xsl:for-each>
2753
2819
  </xsl:template><xsl:template match="text()">
2754
2820
  <xsl:value-of select="."/>
2755
2821
  </xsl:template><xsl:template match="*[local-name()='br']">
@@ -2778,7 +2844,9 @@
2778
2844
  <!-- Display table's name before table as standalone block -->
2779
2845
  <!-- $namespace = 'iso' or -->
2780
2846
 
2781
-
2847
+
2848
+
2849
+
2782
2850
 
2783
2851
 
2784
2852
 
@@ -3694,9 +3762,8 @@
3694
3762
 
3695
3763
  <!-- Table's note name (NOTE, for example) -->
3696
3764
 
3697
- <fo:inline padding-right="2mm">
3765
+ <fo:inline padding-right="2mm" xsl:use-attribute-sets="table-note-name-style">
3698
3766
 
3699
-
3700
3767
 
3701
3768
 
3702
3769
 
@@ -4331,6 +4398,8 @@
4331
4398
  <xsl:if test="$font-size != ''">
4332
4399
  <xsl:attribute name="font-size">
4333
4400
  <xsl:choose>
4401
+ <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
4402
+ <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
4334
4403
  <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
4335
4404
  <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
4336
4405
  </xsl:choose>
@@ -4765,12 +4834,43 @@
4765
4834
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
4766
4835
  </xsl:call-template>
4767
4836
 
4837
+
4838
+
4768
4839
  <xsl:variable name="mathml">
4769
4840
  <xsl:apply-templates select="." mode="mathml"/>
4770
4841
  </xsl:variable>
4771
4842
  <fo:instream-foreign-object fox:alt-text="Math">
4772
4843
 
4773
4844
 
4845
+ <xsl:variable name="comment_text_following" select="following-sibling::node()[1][self::comment()]"/>
4846
+ <xsl:variable name="comment_text_">
4847
+ <xsl:choose>
4848
+ <xsl:when test="normalize-space($comment_text_following) != ''">
4849
+ <xsl:value-of select="$comment_text_following"/>
4850
+ </xsl:when>
4851
+ <xsl:otherwise>
4852
+ <xsl:value-of select="normalize-space(translate(.,' ⁢',' '))"/>
4853
+ </xsl:otherwise>
4854
+ </xsl:choose>
4855
+ </xsl:variable>
4856
+ <xsl:variable name="comment_text" select="java:org.metanorma.fop.Util.unescape($comment_text_)"/>
4857
+
4858
+ <xsl:if test="normalize-space($comment_text) != ''">
4859
+ <!-- put Mathin Alternate Text -->
4860
+ <xsl:attribute name="fox:alt-text">
4861
+ <xsl:value-of select="java:org.metanorma.fop.Util.unescape($comment_text)"/>
4862
+ </xsl:attribute>
4863
+ </xsl:if>
4864
+
4865
+ <xsl:variable name="mathml_content">
4866
+ <xsl:apply-templates select="." mode="mathml_actual_text"/>
4867
+ </xsl:variable>
4868
+ <!-- put MathML in Actual Text -->
4869
+ <xsl:attribute name="fox:actual-text">
4870
+ <xsl:value-of select="$mathml_content"/>
4871
+ </xsl:attribute>
4872
+
4873
+
4774
4874
  <xsl:if test="count(ancestor::*[local-name() = 'table']) &gt; 1">
4775
4875
  <xsl:attribute name="width">95%</xsl:attribute>
4776
4876
  <xsl:attribute name="content-height">100%</xsl:attribute>
@@ -4782,6 +4882,27 @@
4782
4882
  <xsl:copy-of select="xalan:nodeset($mathml)"/>
4783
4883
  </fo:instream-foreign-object>
4784
4884
  </fo:inline>
4885
+ </xsl:template><xsl:template match="mathml:*" mode="mathml_actual_text">
4886
+ <!-- <xsl:text>a+b</xsl:text> -->
4887
+ <xsl:text>&lt;</xsl:text>
4888
+ <xsl:value-of select="local-name()"/>
4889
+ <xsl:if test="local-name() = 'math'">
4890
+ <xsl:text> xmlns="http://www.w3.org/1998/Math/MathML"</xsl:text>
4891
+ </xsl:if>
4892
+ <xsl:for-each select="@*">
4893
+ <xsl:text> </xsl:text>
4894
+ <xsl:value-of select="local-name()"/>
4895
+ <xsl:text>="</xsl:text>
4896
+ <xsl:value-of select="."/>
4897
+ <xsl:text>"</xsl:text>
4898
+ </xsl:for-each>
4899
+ <xsl:text>&gt;</xsl:text>
4900
+ <xsl:apply-templates mode="mathml_actual_text"/>
4901
+ <xsl:text>&lt;/</xsl:text>
4902
+ <xsl:value-of select="local-name()"/>
4903
+ <xsl:text>&gt;</xsl:text>
4904
+ </xsl:template><xsl:template match="text()" mode="mathml_actual_text">
4905
+ <xsl:value-of select="normalize-space()"/>
4785
4906
  </xsl:template><xsl:template match="@*|node()" mode="mathml">
4786
4907
  <xsl:copy>
4787
4908
  <xsl:apply-templates select="@*|node()" mode="mathml"/>
@@ -4843,7 +4964,10 @@
4843
4964
  </fo:block>
4844
4965
  <xsl:apply-templates/>
4845
4966
  </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
4846
- <fo:inline><xsl:apply-templates/></fo:inline>
4967
+ <xsl:variable name="level">
4968
+ <xsl:call-template name="getLevel"/>
4969
+ </xsl:variable>
4970
+ <fo:inline role="H{$level}"><xsl:apply-templates/></fo:inline>
4847
4971
  </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
4848
4972
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
4849
4973
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -4878,9 +5002,10 @@
4878
5002
 
4879
5003
  </xsl:variable>
4880
5004
 
5005
+ <xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
4881
5006
  <xsl:choose>
4882
- <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
4883
- <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
5007
+ <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>
5008
+ <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>
4884
5009
  </xsl:choose>
4885
5010
  <xsl:apply-templates/>
4886
5011
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
@@ -5026,7 +5151,10 @@
5026
5151
  </fo:block>
5027
5152
  </xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']" mode="presentation">
5028
5153
  <xsl:if test="normalize-space() != ''">
5029
- <fo:inline>
5154
+ <xsl:variable name="level">
5155
+ <xsl:call-template name="getLevelTermName"/>
5156
+ </xsl:variable>
5157
+ <fo:inline role="H{$level}">
5030
5158
  <xsl:apply-templates/>
5031
5159
  <!-- <xsl:if test="$namespace = 'gb' or $namespace = 'ogc'">
5032
5160
  <xsl:text>.</xsl:text>
@@ -5327,6 +5455,13 @@
5327
5455
  </xsl:attribute>
5328
5456
  <xsl:apply-templates mode="svg_update"/>
5329
5457
  </xsl:copy>
5458
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][*[local-name() = 'svg']]" priority="3">
5459
+ <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
5460
+ <xsl:for-each select="*[local-name() = 'svg']">
5461
+ <xsl:call-template name="image_svg">
5462
+ <xsl:with-param name="name" select="$name"/>
5463
+ </xsl:call-template>
5464
+ </xsl:for-each>
5330
5465
  </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
5331
5466
  <xsl:variable name="svg_content" select="document(@src)"/>
5332
5467
  <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
@@ -5431,7 +5566,7 @@
5431
5566
  </fo:basic-link>
5432
5567
  </fo:block>
5433
5568
  </fo:block-container>
5434
- </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">
5569
+ </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">
5435
5570
  <xsl:apply-templates mode="contents"/>
5436
5571
  <xsl:text> </xsl:text>
5437
5572
  </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">
@@ -5657,6 +5792,7 @@
5657
5792
  </xsl:when>
5658
5793
  <xsl:otherwise>
5659
5794
  <xsl:apply-templates/>
5795
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
5660
5796
  </xsl:otherwise>
5661
5797
  </xsl:choose>
5662
5798
  </fo:block>
@@ -5729,12 +5865,16 @@
5729
5865
  <xsl:if test="$font-size != ''">
5730
5866
  <xsl:attribute name="font-size">
5731
5867
  <xsl:choose>
5868
+ <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
5869
+ <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
5732
5870
  <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
5733
5871
  <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
5734
5872
  </xsl:choose>
5735
5873
  </xsl:attribute>
5736
5874
  </xsl:if>
5737
5875
 
5876
+
5877
+
5738
5878
  <xsl:apply-templates/>
5739
5879
  </fo:block>
5740
5880
 
@@ -5797,14 +5937,6 @@
5797
5937
  <fo:block>
5798
5938
  <fo:inline padding-right="3mm">Obligation</fo:inline><xsl:value-of select="."/>
5799
5939
  </fo:block>
5800
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
5801
- <fo:block xsl:use-attribute-sets="requirement-subject-style">
5802
- <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
5803
- </fo:block>
5804
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'inherit']">
5805
- <fo:block xsl:use-attribute-sets="requirement-inherit-style">
5806
- <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
5807
- </fo:block>
5808
5940
  </xsl:template><xsl:template match="*[local-name() = 'recommendation']">
5809
5941
  <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
5810
5942
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -5821,6 +5953,38 @@
5821
5953
  <fo:block xsl:use-attribute-sets="recommendation-label-style">
5822
5954
  <xsl:apply-templates/>
5823
5955
  </fo:block>
5956
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" priority="2"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
5957
+ <fo:block xsl:use-attribute-sets="subject-style">
5958
+ <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
5959
+ </fo:block>
5960
+ </xsl:template><xsl:template match="*[local-name() = 'subject']">
5961
+ <fo:block xsl:use-attribute-sets="subject-style">
5962
+ <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
5963
+ </fo:block>
5964
+ </xsl:template><xsl:template match="*[local-name() = 'inherit'] | *[local-name() = 'component'][@class = 'inherit']">
5965
+ <fo:block xsl:use-attribute-sets="inherit-style">
5966
+ <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
5967
+ </fo:block>
5968
+ </xsl:template><xsl:template match="*[local-name() = 'description'] | *[local-name() = 'component'][@class = 'description']">
5969
+ <fo:block xsl:use-attribute-sets="description-style">
5970
+ <xsl:apply-templates/>
5971
+ </fo:block>
5972
+ </xsl:template><xsl:template match="*[local-name() = 'specification'] | *[local-name() = 'component'][@class = 'specification']">
5973
+ <fo:block xsl:use-attribute-sets="specification-style">
5974
+ <xsl:apply-templates/>
5975
+ </fo:block>
5976
+ </xsl:template><xsl:template match="*[local-name() = 'measurement-target'] | *[local-name() = 'component'][@class = 'measurement-target']">
5977
+ <fo:block xsl:use-attribute-sets="measurement-target-style">
5978
+ <xsl:apply-templates/>
5979
+ </fo:block>
5980
+ </xsl:template><xsl:template match="*[local-name() = 'verification'] | *[local-name() = 'component'][@class = 'verification']">
5981
+ <fo:block xsl:use-attribute-sets="verification-style">
5982
+ <xsl:apply-templates/>
5983
+ </fo:block>
5984
+ </xsl:template><xsl:template match="*[local-name() = 'import'] | *[local-name() = 'component'][@class = 'import']">
5985
+ <fo:block xsl:use-attribute-sets="import-style">
5986
+ <xsl:apply-templates/>
5987
+ </fo:block>
5824
5988
  </xsl:template><xsl:template match="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
5825
5989
  <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt">
5826
5990
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
@@ -6091,19 +6255,21 @@
6091
6255
  </xsl:if>
6092
6256
  </xsl:template><xsl:variable name="localized.source">
6093
6257
  <xsl:call-template name="getLocalizedString">
6094
- <xsl:with-param name="key">source</xsl:with-param>
6095
- </xsl:call-template>
6258
+ <xsl:with-param name="key">source</xsl:with-param>
6259
+ </xsl:call-template>
6096
6260
  </xsl:variable><xsl:template match="*[local-name() = 'origin']">
6097
6261
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
6098
6262
  <xsl:if test="normalize-space(@citeas) = ''">
6099
6263
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
6100
6264
  </xsl:if>
6101
6265
 
6266
+
6102
6267
  <fo:inline>
6103
6268
 
6104
6269
 
6105
6270
 
6106
6271
 
6272
+
6107
6273
  <xsl:value-of select="$localized.source"/>
6108
6274
  <xsl:text>: </xsl:text>
6109
6275
 
@@ -6115,6 +6281,7 @@
6115
6281
  <fo:inline xsl:use-attribute-sets="origin-style">
6116
6282
  <xsl:apply-templates/>
6117
6283
  </fo:inline>
6284
+
6118
6285
  </fo:basic-link>
6119
6286
  </xsl:template><xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']">
6120
6287
  <fo:inline><xsl:apply-templates/></fo:inline>
@@ -6181,6 +6348,9 @@
6181
6348
 
6182
6349
  </xsl:if>
6183
6350
 
6351
+ <xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets -->
6352
+ <xsl:variable name="text" select="normalize-space()"/>
6353
+
6184
6354
 
6185
6355
 
6186
6356
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
@@ -6193,7 +6363,9 @@
6193
6363
 
6194
6364
 
6195
6365
  </xsl:if>
6196
-
6366
+
6367
+
6368
+
6197
6369
  <xsl:apply-templates/>
6198
6370
  </fo:basic-link>
6199
6371
 
@@ -6531,6 +6703,7 @@
6531
6703
  </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" priority="4">
6532
6704
  <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
6533
6705
  <fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
6706
+
6534
6707
  <xsl:apply-templates/>
6535
6708
  </fo:block>
6536
6709
  </xsl:template><xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
@@ -6725,6 +6898,97 @@
6725
6898
  <fo:block-container border="1pt solid black" width="50%">
6726
6899
  <fo:block> </fo:block>
6727
6900
  </fo:block-container>
6901
+ </xsl:template><xsl:template match="*[local-name() = 'toc']">
6902
+ <xsl:param name="colwidths"/>
6903
+ <xsl:variable name="colwidths_">
6904
+ <xsl:choose>
6905
+ <xsl:when test="not($colwidths)">
6906
+ <xsl:variable name="toc_table_simple">
6907
+ <tbody>
6908
+ <xsl:apply-templates mode="toc_table_width"/>
6909
+ </tbody>
6910
+ </xsl:variable>
6911
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($toc_table_simple)/*/tr[1]/td)"/>
6912
+ <xsl:call-template name="calculate-column-widths">
6913
+ <xsl:with-param name="cols-count" select="$cols-count"/>
6914
+ <xsl:with-param name="table" select="$toc_table_simple"/>
6915
+ </xsl:call-template>
6916
+ </xsl:when>
6917
+ <xsl:otherwise>
6918
+ <xsl:copy-of select="$colwidths"/>
6919
+ </xsl:otherwise>
6920
+ </xsl:choose>
6921
+ </xsl:variable>
6922
+ <fo:block role="TOCI" space-after="16pt">
6923
+ <fo:table width="100%" table-layout="fixed">
6924
+ <xsl:for-each select="xalan:nodeset($colwidths_)/column">
6925
+ <fo:table-column column-width="proportional-column-width({.})"/>
6926
+ </xsl:for-each>
6927
+ <fo:table-body>
6928
+ <xsl:apply-templates/>
6929
+ </fo:table-body>
6930
+ </fo:table>
6931
+ </fo:block>
6932
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']">
6933
+ <fo:table-row min-height="5mm">
6934
+ <xsl:apply-templates/>
6935
+ </fo:table-row>
6936
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']/*[local-name() = 'p']">
6937
+ <xsl:apply-templates/>
6938
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'xref']" priority="3">
6939
+ <!-- <xref target="cgpm9th1948r6">1.6.3<tab/>&#8220;9th CGPM, 1948:<tab/>decision to establish the SI&#8221;</xref> -->
6940
+ <xsl:variable name="target" select="@target"/>
6941
+ <xsl:for-each select="*[local-name() = 'tab']">
6942
+ <xsl:variable name="current_id" select="generate-id()"/>
6943
+ <fo:table-cell>
6944
+ <fo:block>
6945
+ <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
6946
+ <xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
6947
+ <xsl:choose>
6948
+ <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
6949
+ <xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
6950
+ </xsl:choose>
6951
+ </xsl:for-each>
6952
+ </fo:basic-link>
6953
+ </fo:block>
6954
+ </fo:table-cell>
6955
+ </xsl:for-each>
6956
+ <!-- last column - for page numbers -->
6957
+ <fo:table-cell text-align="right" font-size="10pt" font-weight="bold" font-family="Arial">
6958
+ <fo:block>
6959
+ <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
6960
+ <fo:page-number-citation ref-id="{$target}"/>
6961
+ </fo:basic-link>
6962
+ </fo:block>
6963
+ </fo:table-cell>
6964
+ </xsl:template><xsl:template match="*" mode="toc_table_width">
6965
+ <xsl:apply-templates mode="toc_table_width"/>
6966
+ </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">
6967
+ <tr>
6968
+ <xsl:apply-templates mode="toc_table_width"/>
6969
+ </tr>
6970
+ </xsl:template><xsl:template match="*[local-name() = 'xref']" mode="toc_table_width">
6971
+ <!-- <xref target="cgpm9th1948r6">1.6.3<tab/>&#8220;9th CGPM, 1948:<tab/>decision to establish the SI&#8221;</xref> -->
6972
+ <xsl:for-each select="*[local-name() = 'tab']">
6973
+ <xsl:variable name="current_id" select="generate-id()"/>
6974
+ <td>
6975
+ <xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
6976
+ <xsl:copy-of select="."/>
6977
+ </xsl:for-each>
6978
+ </td>
6979
+ </xsl:for-each>
6980
+ <td>333</td> <!-- page number, just for fill -->
6981
+ </xsl:template><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']"/><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
6982
+ <fo:inline padding-right="5mm"> </fo:inline>
6983
+ <fo:inline><xsl:apply-templates/></fo:inline>
6984
+ </xsl:template><xsl:template match="*[local-name() = 'blacksquare']" name="blacksquare">
6985
+ <fo:inline padding-right="2.5mm" baseline-shift="5%">
6986
+ <fo:instream-foreign-object content-height="2mm" content-width="2mm" fox:alt-text="Quad">
6987
+ <svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="0 0 2 2">
6988
+ <rect x="0" y="0" width="2" height="2" fill="black"/>
6989
+ </svg>
6990
+ </fo:instream-foreign-object>
6991
+ </fo:inline>
6728
6992
  </xsl:template><xsl:template name="convertDate">
6729
6993
  <xsl:param name="date"/>
6730
6994
  <xsl:param name="format" select="'short'"/>
@@ -6963,6 +7227,26 @@
6963
7227
  <xsl:value-of select="$level"/>
6964
7228
  </xsl:otherwise>
6965
7229
  </xsl:choose>
7230
+ </xsl:template><xsl:template name="getLevelTermName">
7231
+ <xsl:choose>
7232
+ <xsl:when test="normalize-space(../@depth) != ''">
7233
+ <xsl:value-of select="../@depth"/>
7234
+ </xsl:when>
7235
+ <xsl:otherwise>
7236
+ <xsl:variable name="title_level_">
7237
+ <xsl:for-each select="../preceding-sibling::*[local-name() = 'title'][1]">
7238
+ <xsl:call-template name="getLevel"/>
7239
+ </xsl:for-each>
7240
+ </xsl:variable>
7241
+ <xsl:variable name="title_level" select="normalize-space($title_level_)"/>
7242
+ <xsl:choose>
7243
+ <xsl:when test="$title_level != ''"><xsl:value-of select="$title_level + 1"/></xsl:when>
7244
+ <xsl:otherwise>
7245
+ <xsl:call-template name="getLevel"/>
7246
+ </xsl:otherwise>
7247
+ </xsl:choose>
7248
+ </xsl:otherwise>
7249
+ </xsl:choose>
6966
7250
  </xsl:template><xsl:template name="split">
6967
7251
  <xsl:param name="pText" select="."/>
6968
7252
  <xsl:param name="sep" select="','"/>