metanorma-iso 1.9.1 → 1.9.5

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,8 +2337,9 @@
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
- <xsl:attribute name="font-family">Courier</xsl:attribute>
2342
+ <xsl:attribute name="font-family">Courier New</xsl:attribute>
2331
2343
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2332
2344
 
2333
2345
 
@@ -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
 
@@ -2418,6 +2435,7 @@
2418
2435
 
2419
2436
 
2420
2437
 
2438
+
2421
2439
  <xsl:attribute name="font-size">10pt</xsl:attribute>
2422
2440
  <xsl:attribute name="margin-top">8pt</xsl:attribute>
2423
2441
  <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
@@ -2575,7 +2593,8 @@
2575
2593
 
2576
2594
 
2577
2595
 
2578
- </xsl:attribute-set><xsl:attribute-set name="quote-style">
2596
+ </xsl:attribute-set><xsl:attribute-set name="quote-style">
2597
+ <xsl:attribute name="role">BlockQuote</xsl:attribute>
2579
2598
 
2580
2599
 
2581
2600
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
@@ -2665,7 +2684,7 @@
2665
2684
  </xsl:attribute-set><xsl:attribute-set name="tt-style">
2666
2685
 
2667
2686
 
2668
- <xsl:attribute name="font-family">Courier</xsl:attribute>
2687
+ <xsl:attribute name="font-family">Courier New</xsl:attribute>
2669
2688
 
2670
2689
 
2671
2690
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-name-style">
@@ -2712,13 +2731,20 @@
2712
2731
 
2713
2732
  </xsl:attribute-set><xsl:attribute-set name="list-style">
2714
2733
 
2715
- </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">
2734
+ </xsl:attribute-set><xsl:attribute-set name="toc-style">
2735
+ <xsl:attribute name="line-height">135%</xsl:attribute>
2736
+ </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">
2716
2737
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
2717
2738
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
2718
2739
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
2719
2740
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']" mode="contents"/>
2720
2741
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']" mode="contents"/>
2721
- </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
2742
+ </xsl:template><xsl:template name="processPrefaceSectionsDefault_Contents">
2743
+ <xsl:for-each select="/*/*[local-name()='preface']/*">
2744
+ <xsl:sort select="@displayorder" data-type="number"/>
2745
+ <xsl:apply-templates select="." mode="contents"/>
2746
+ </xsl:for-each>
2747
+ </xsl:template><xsl:template name="OLD_processMainSectionsDefault_Contents">
2722
2748
  <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
2723
2749
 
2724
2750
  <!-- Normative references -->
@@ -2731,13 +2757,33 @@
2731
2757
  <!-- Bibliography -->
2732
2758
  <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"/>
2733
2759
 
2734
- </xsl:template><xsl:template name="processPrefaceSectionsDefault">
2760
+ </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
2761
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
2762
+ <xsl:sort select="@displayorder" data-type="number"/>
2763
+ <xsl:apply-templates select="." mode="contents"/>
2764
+ </xsl:for-each>
2765
+
2766
+ <xsl:for-each select="/*/*[local-name()='annex']">
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()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
2772
+ <xsl:sort select="@displayorder" data-type="number"/>
2773
+ <xsl:apply-templates select="." mode="contents"/>
2774
+ </xsl:for-each>
2775
+ </xsl:template><xsl:template name="OLD_processPrefaceSectionsDefault">
2735
2776
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
2736
2777
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
2737
2778
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']"/>
2738
2779
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']"/>
2739
2780
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']"/>
2740
- </xsl:template><xsl:template name="processMainSectionsDefault">
2781
+ </xsl:template><xsl:template name="processPrefaceSectionsDefault">
2782
+ <xsl:for-each select="/*/*[local-name()='preface']/*">
2783
+ <xsl:sort select="@displayorder" data-type="number"/>
2784
+ <xsl:apply-templates select="."/>
2785
+ </xsl:for-each>
2786
+ </xsl:template><xsl:template name="OLD_processMainSectionsDefault">
2741
2787
  <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']"/>
2742
2788
 
2743
2789
  <!-- Normative references -->
@@ -2749,6 +2795,22 @@
2749
2795
  <xsl:apply-templates select="/*/*[local-name()='annex']"/>
2750
2796
  <!-- Bibliography -->
2751
2797
  <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]"/>
2798
+ </xsl:template><xsl:template name="processMainSectionsDefault">
2799
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
2800
+ <xsl:sort select="@displayorder" data-type="number"/>
2801
+ <xsl:apply-templates select="."/>
2802
+
2803
+ </xsl:for-each>
2804
+
2805
+ <xsl:for-each select="/*/*[local-name()='annex']">
2806
+ <xsl:sort select="@displayorder" data-type="number"/>
2807
+ <xsl:apply-templates select="."/>
2808
+ </xsl:for-each>
2809
+
2810
+ <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
2811
+ <xsl:sort select="@displayorder" data-type="number"/>
2812
+ <xsl:apply-templates select="."/>
2813
+ </xsl:for-each>
2752
2814
  </xsl:template><xsl:template match="text()">
2753
2815
  <xsl:value-of select="."/>
2754
2816
  </xsl:template><xsl:template match="*[local-name()='br']">
@@ -2777,7 +2839,9 @@
2777
2839
  <!-- Display table's name before table as standalone block -->
2778
2840
  <!-- $namespace = 'iso' or -->
2779
2841
 
2780
-
2842
+
2843
+
2844
+
2781
2845
 
2782
2846
 
2783
2847
 
@@ -2914,6 +2978,8 @@
2914
2978
  <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
2915
2979
  </xsl:if>
2916
2980
 
2981
+
2982
+
2917
2983
  <xsl:choose>
2918
2984
  <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
2919
2985
  <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
@@ -3209,9 +3275,13 @@
3209
3275
  <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation">
3210
3276
  <xsl:with-param name="continued">true</xsl:with-param>
3211
3277
  </xsl:apply-templates>
3212
- <xsl:for-each select="ancestor::*[local-name()='table'][1]">
3213
- <xsl:call-template name="fn_name_display"/>
3214
- </xsl:for-each>
3278
+
3279
+
3280
+ <xsl:for-each select="ancestor::*[local-name()='table'][1]">
3281
+ <xsl:call-template name="fn_name_display"/>
3282
+ </xsl:for-each>
3283
+
3284
+
3215
3285
 
3216
3286
  <fo:block text-align="right" font-style="italic">
3217
3287
  <xsl:text> </xsl:text>
@@ -3300,7 +3370,11 @@
3300
3370
 
3301
3371
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
3302
3372
 
3303
- <xsl:if test="$isNoteOrFnExist = 'true'">
3373
+ <xsl:variable name="isNoteOrFnExistShowAfterTable">
3374
+
3375
+ </xsl:variable>
3376
+
3377
+ <xsl:if test="$isNoteOrFnExist = 'true' or normalize-space($isNoteOrFnExistShowAfterTable) = 'true'">
3304
3378
 
3305
3379
  <xsl:variable name="cols-count">
3306
3380
  <xsl:choose>
@@ -3462,10 +3536,13 @@
3462
3536
 
3463
3537
  <fo:table-row height="0" keep-with-next.within-page="always">
3464
3538
  <fo:table-cell>
3539
+
3540
+
3465
3541
 
3466
3542
 
3467
3543
  <fo:marker marker-class-name="table_continued"/>
3468
3544
 
3545
+
3469
3546
  <fo:block/>
3470
3547
  </fo:table-cell>
3471
3548
  </fo:table-row>
@@ -3485,6 +3562,19 @@
3485
3562
 
3486
3563
  </fo:table-body>
3487
3564
 
3565
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/text()[1]" priority="2" mode="presentation_name">
3566
+ <xsl:choose>
3567
+ <xsl:when test="substring-after(., '—') != ''">
3568
+ <xsl:text>—</xsl:text><xsl:value-of select="substring-after(., '—')"/>
3569
+ </xsl:when>
3570
+ <xsl:otherwise>
3571
+ <xsl:value-of select="."/>
3572
+ </xsl:otherwise>
3573
+ </xsl:choose>
3574
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']" mode="presentation_name">
3575
+ <xsl:apply-templates mode="presentation_name"/>
3576
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/node()" mode="presentation_name">
3577
+ <xsl:apply-templates select="."/>
3488
3578
  </xsl:template><xsl:template match="*[local-name()='tr']">
3489
3579
  <xsl:variable name="parent-name" select="local-name(..)"/>
3490
3580
  <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
@@ -3687,14 +3777,12 @@
3687
3777
  <xsl:apply-templates/>
3688
3778
  </xsl:template><xsl:template name="fn_display">
3689
3779
  <xsl:variable name="references">
3780
+
3690
3781
  <xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']">
3691
- <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
3692
-
3693
-
3694
- <xsl:apply-templates/>
3695
- </fn>
3782
+ <xsl:call-template name="create_fn"/>
3696
3783
  </xsl:for-each>
3697
3784
  </xsl:variable>
3785
+
3698
3786
  <xsl:for-each select="xalan:nodeset($references)//fn">
3699
3787
  <xsl:variable name="reference" select="@reference"/>
3700
3788
  <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
@@ -3733,6 +3821,12 @@
3733
3821
  </fo:block>
3734
3822
  </xsl:if>
3735
3823
  </xsl:for-each>
3824
+ </xsl:template><xsl:template name="create_fn">
3825
+ <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
3826
+
3827
+
3828
+ <xsl:apply-templates/>
3829
+ </fn>
3736
3830
  </xsl:template><xsl:template name="fn_name_display">
3737
3831
  <!-- <xsl:variable name="references">
3738
3832
  <xsl:for-each select="*[local-name()='name']//*[local-name()='fn']">
@@ -3861,7 +3955,7 @@
3861
3955
 
3862
3956
 
3863
3957
 
3864
- <xsl:if test="ancestor::*[local-name()='td']">
3958
+ <xsl:if test="ancestor::*[local-name()='table']">
3865
3959
  <xsl:attribute name="font-weight">normal</xsl:attribute>
3866
3960
  <!-- <xsl:attribute name="alignment-baseline">hanging</xsl:attribute> -->
3867
3961
  <xsl:attribute name="baseline-shift">15%</xsl:attribute>
@@ -4734,12 +4828,43 @@
4734
4828
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
4735
4829
  </xsl:call-template>
4736
4830
 
4831
+
4832
+
4737
4833
  <xsl:variable name="mathml">
4738
4834
  <xsl:apply-templates select="." mode="mathml"/>
4739
4835
  </xsl:variable>
4740
4836
  <fo:instream-foreign-object fox:alt-text="Math">
4741
4837
 
4742
4838
 
4839
+ <xsl:variable name="comment_text_following" select="following-sibling::node()[1][self::comment()]"/>
4840
+ <xsl:variable name="comment_text_">
4841
+ <xsl:choose>
4842
+ <xsl:when test="normalize-space($comment_text_following) != ''">
4843
+ <xsl:value-of select="$comment_text_following"/>
4844
+ </xsl:when>
4845
+ <xsl:otherwise>
4846
+ <xsl:value-of select="normalize-space(translate(.,' ⁢',' '))"/>
4847
+ </xsl:otherwise>
4848
+ </xsl:choose>
4849
+ </xsl:variable>
4850
+ <xsl:variable name="comment_text" select="java:org.metanorma.fop.Util.unescape($comment_text_)"/>
4851
+
4852
+ <xsl:if test="normalize-space($comment_text) != ''">
4853
+ <!-- put Mathin Alternate Text -->
4854
+ <xsl:attribute name="fox:alt-text">
4855
+ <xsl:value-of select="java:org.metanorma.fop.Util.unescape($comment_text)"/>
4856
+ </xsl:attribute>
4857
+ </xsl:if>
4858
+
4859
+ <xsl:variable name="mathml_content">
4860
+ <xsl:apply-templates select="." mode="mathml_actual_text"/>
4861
+ </xsl:variable>
4862
+ <!-- put MathML in Actual Text -->
4863
+ <xsl:attribute name="fox:actual-text">
4864
+ <xsl:value-of select="$mathml_content"/>
4865
+ </xsl:attribute>
4866
+
4867
+
4743
4868
  <xsl:if test="count(ancestor::*[local-name() = 'table']) &gt; 1">
4744
4869
  <xsl:attribute name="width">95%</xsl:attribute>
4745
4870
  <xsl:attribute name="content-height">100%</xsl:attribute>
@@ -4751,6 +4876,27 @@
4751
4876
  <xsl:copy-of select="xalan:nodeset($mathml)"/>
4752
4877
  </fo:instream-foreign-object>
4753
4878
  </fo:inline>
4879
+ </xsl:template><xsl:template match="mathml:*" mode="mathml_actual_text">
4880
+ <!-- <xsl:text>a+b</xsl:text> -->
4881
+ <xsl:text>&lt;</xsl:text>
4882
+ <xsl:value-of select="local-name()"/>
4883
+ <xsl:if test="local-name() = 'math'">
4884
+ <xsl:text> xmlns="http://www.w3.org/1998/Math/MathML"</xsl:text>
4885
+ </xsl:if>
4886
+ <xsl:for-each select="@*">
4887
+ <xsl:text> </xsl:text>
4888
+ <xsl:value-of select="local-name()"/>
4889
+ <xsl:text>="</xsl:text>
4890
+ <xsl:value-of select="."/>
4891
+ <xsl:text>"</xsl:text>
4892
+ </xsl:for-each>
4893
+ <xsl:text>&gt;</xsl:text>
4894
+ <xsl:apply-templates mode="mathml_actual_text"/>
4895
+ <xsl:text>&lt;/</xsl:text>
4896
+ <xsl:value-of select="local-name()"/>
4897
+ <xsl:text>&gt;</xsl:text>
4898
+ </xsl:template><xsl:template match="text()" mode="mathml_actual_text">
4899
+ <xsl:value-of select="normalize-space()"/>
4754
4900
  </xsl:template><xsl:template match="@*|node()" mode="mathml">
4755
4901
  <xsl:copy>
4756
4902
  <xsl:apply-templates select="@*|node()" mode="mathml"/>
@@ -4760,19 +4906,6 @@
4760
4906
  <!-- replace start and end spaces to non-break space -->
4761
4907
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
4762
4908
  </xsl:copy>
4763
- </xsl:template><xsl:template match="mathml:mi[. = ',' and not(following-sibling::*[1][local-name() = 'mtext' and text() = ' '])]" mode="mathml">
4764
- <xsl:copy>
4765
- <xsl:apply-templates select="@*|node()" mode="mathml"/>
4766
- </xsl:copy>
4767
- <xsl:choose>
4768
- <!-- if in msub, then don't add space -->
4769
- <xsl:when test="ancestor::mathml:mrow[parent::mathml:msub and preceding-sibling::*[1][self::mathml:mrow]]"/>
4770
- <!-- if next char in digit, don't add space -->
4771
- <xsl:when test="translate(substring(following-sibling::*[1]/text(),1,1),'0123456789','') = ''"/>
4772
- <xsl:otherwise>
4773
- <mathml:mspace width="0.5ex"/>
4774
- </xsl:otherwise>
4775
- </xsl:choose>
4776
4909
  </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">
4777
4910
  <xsl:variable name="target">
4778
4911
  <xsl:choose>
@@ -4825,7 +4958,10 @@
4825
4958
  </fo:block>
4826
4959
  <xsl:apply-templates/>
4827
4960
  </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
4828
- <fo:inline><xsl:apply-templates/></fo:inline>
4961
+ <xsl:variable name="level">
4962
+ <xsl:call-template name="getLevel"/>
4963
+ </xsl:variable>
4964
+ <fo:inline role="H{$level}"><xsl:apply-templates/></fo:inline>
4829
4965
  </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
4830
4966
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
4831
4967
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -4860,9 +4996,10 @@
4860
4996
 
4861
4997
  </xsl:variable>
4862
4998
 
4999
+ <xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
4863
5000
  <xsl:choose>
4864
- <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
4865
- <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
5001
+ <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>
5002
+ <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>
4866
5003
  </xsl:choose>
4867
5004
  <xsl:apply-templates/>
4868
5005
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
@@ -5008,7 +5145,10 @@
5008
5145
  </fo:block>
5009
5146
  </xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']" mode="presentation">
5010
5147
  <xsl:if test="normalize-space() != ''">
5011
- <fo:inline>
5148
+ <xsl:variable name="level">
5149
+ <xsl:call-template name="getLevelTermName"/>
5150
+ </xsl:variable>
5151
+ <fo:inline role="H{$level}">
5012
5152
  <xsl:apply-templates/>
5013
5153
  <!-- <xsl:if test="$namespace = 'gb' or $namespace = 'ogc'">
5014
5154
  <xsl:text>.</xsl:text>
@@ -5309,6 +5449,13 @@
5309
5449
  </xsl:attribute>
5310
5450
  <xsl:apply-templates mode="svg_update"/>
5311
5451
  </xsl:copy>
5452
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][*[local-name() = 'svg']]" priority="3">
5453
+ <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
5454
+ <xsl:for-each select="*[local-name() = 'svg']">
5455
+ <xsl:call-template name="image_svg">
5456
+ <xsl:with-param name="name" select="$name"/>
5457
+ </xsl:call-template>
5458
+ </xsl:for-each>
5312
5459
  </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
5313
5460
  <xsl:variable name="svg_content" select="document(@src)"/>
5314
5461
  <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
@@ -5413,7 +5560,7 @@
5413
5560
  </fo:basic-link>
5414
5561
  </fo:block>
5415
5562
  </fo:block-container>
5416
- </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">
5563
+ </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">
5417
5564
  <xsl:apply-templates mode="contents"/>
5418
5565
  <xsl:text> </xsl:text>
5419
5566
  </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">
@@ -5639,6 +5786,7 @@
5639
5786
  </xsl:when>
5640
5787
  <xsl:otherwise>
5641
5788
  <xsl:apply-templates/>
5789
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
5642
5790
  </xsl:otherwise>
5643
5791
  </xsl:choose>
5644
5792
  </fo:block>
@@ -5779,14 +5927,6 @@
5779
5927
  <fo:block>
5780
5928
  <fo:inline padding-right="3mm">Obligation</fo:inline><xsl:value-of select="."/>
5781
5929
  </fo:block>
5782
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
5783
- <fo:block xsl:use-attribute-sets="requirement-subject-style">
5784
- <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
5785
- </fo:block>
5786
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'inherit']">
5787
- <fo:block xsl:use-attribute-sets="requirement-inherit-style">
5788
- <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
5789
- </fo:block>
5790
5930
  </xsl:template><xsl:template match="*[local-name() = 'recommendation']">
5791
5931
  <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
5792
5932
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -5803,6 +5943,38 @@
5803
5943
  <fo:block xsl:use-attribute-sets="recommendation-label-style">
5804
5944
  <xsl:apply-templates/>
5805
5945
  </fo:block>
5946
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" priority="2"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
5947
+ <fo:block xsl:use-attribute-sets="subject-style">
5948
+ <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
5949
+ </fo:block>
5950
+ </xsl:template><xsl:template match="*[local-name() = 'subject']">
5951
+ <fo:block xsl:use-attribute-sets="subject-style">
5952
+ <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
5953
+ </fo:block>
5954
+ </xsl:template><xsl:template match="*[local-name() = 'inherit'] | *[local-name() = 'component'][@class = 'inherit']">
5955
+ <fo:block xsl:use-attribute-sets="inherit-style">
5956
+ <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
5957
+ </fo:block>
5958
+ </xsl:template><xsl:template match="*[local-name() = 'description'] | *[local-name() = 'component'][@class = 'description']">
5959
+ <fo:block xsl:use-attribute-sets="description-style">
5960
+ <xsl:apply-templates/>
5961
+ </fo:block>
5962
+ </xsl:template><xsl:template match="*[local-name() = 'specification'] | *[local-name() = 'component'][@class = 'specification']">
5963
+ <fo:block xsl:use-attribute-sets="specification-style">
5964
+ <xsl:apply-templates/>
5965
+ </fo:block>
5966
+ </xsl:template><xsl:template match="*[local-name() = 'measurement-target'] | *[local-name() = 'component'][@class = 'measurement-target']">
5967
+ <fo:block xsl:use-attribute-sets="measurement-target-style">
5968
+ <xsl:apply-templates/>
5969
+ </fo:block>
5970
+ </xsl:template><xsl:template match="*[local-name() = 'verification'] | *[local-name() = 'component'][@class = 'verification']">
5971
+ <fo:block xsl:use-attribute-sets="verification-style">
5972
+ <xsl:apply-templates/>
5973
+ </fo:block>
5974
+ </xsl:template><xsl:template match="*[local-name() = 'import'] | *[local-name() = 'component'][@class = 'import']">
5975
+ <fo:block xsl:use-attribute-sets="import-style">
5976
+ <xsl:apply-templates/>
5977
+ </fo:block>
5806
5978
  </xsl:template><xsl:template match="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
5807
5979
  <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt">
5808
5980
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
@@ -5954,7 +6126,19 @@
5954
6126
  </fo:inline>
5955
6127
  </xsl:if>
5956
6128
  </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'p']">
5957
- <fo:inline><xsl:apply-templates/></fo:inline>
6129
+ <xsl:variable name="element">inline
6130
+
6131
+ </xsl:variable>
6132
+ <xsl:choose>
6133
+ <xsl:when test="contains($element, 'block')">
6134
+ <fo:block xsl:use-attribute-sets="example-p-style">
6135
+ <xsl:apply-templates/>
6136
+ </fo:block>
6137
+ </xsl:when>
6138
+ <xsl:otherwise>
6139
+ <fo:inline><xsl:apply-templates/></fo:inline>
6140
+ </xsl:otherwise>
6141
+ </xsl:choose>
5958
6142
  </xsl:template><xsl:template match="*[local-name() = 'example']">
5959
6143
  <fo:block id="{@id}" xsl:use-attribute-sets="example-style">
5960
6144
 
@@ -6061,19 +6245,21 @@
6061
6245
  </xsl:if>
6062
6246
  </xsl:template><xsl:variable name="localized.source">
6063
6247
  <xsl:call-template name="getLocalizedString">
6064
- <xsl:with-param name="key">source</xsl:with-param>
6065
- </xsl:call-template>
6248
+ <xsl:with-param name="key">source</xsl:with-param>
6249
+ </xsl:call-template>
6066
6250
  </xsl:variable><xsl:template match="*[local-name() = 'origin']">
6067
6251
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
6068
6252
  <xsl:if test="normalize-space(@citeas) = ''">
6069
6253
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
6070
6254
  </xsl:if>
6071
6255
 
6256
+
6072
6257
  <fo:inline>
6073
6258
 
6074
6259
 
6075
6260
 
6076
6261
 
6262
+
6077
6263
  <xsl:value-of select="$localized.source"/>
6078
6264
  <xsl:text>: </xsl:text>
6079
6265
 
@@ -6085,6 +6271,7 @@
6085
6271
  <fo:inline xsl:use-attribute-sets="origin-style">
6086
6272
  <xsl:apply-templates/>
6087
6273
  </fo:inline>
6274
+
6088
6275
  </fo:basic-link>
6089
6276
  </xsl:template><xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']">
6090
6277
  <fo:inline><xsl:apply-templates/></fo:inline>
@@ -6151,6 +6338,9 @@
6151
6338
 
6152
6339
  </xsl:if>
6153
6340
 
6341
+ <xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets -->
6342
+ <xsl:variable name="text" select="normalize-space()"/>
6343
+
6154
6344
 
6155
6345
 
6156
6346
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
@@ -6163,7 +6353,9 @@
6163
6353
 
6164
6354
 
6165
6355
  </xsl:if>
6166
-
6356
+
6357
+
6358
+
6167
6359
  <xsl:apply-templates/>
6168
6360
  </fo:basic-link>
6169
6361
 
@@ -6501,6 +6693,7 @@
6501
6693
  </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" priority="4">
6502
6694
  <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
6503
6695
  <fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
6696
+
6504
6697
  <xsl:apply-templates/>
6505
6698
  </fo:block>
6506
6699
  </xsl:template><xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
@@ -6540,7 +6733,6 @@
6540
6733
  </xsl:template><xsl:template name="processBibitem">
6541
6734
 
6542
6735
 
6543
- <!-- end BIPM bibitem processing-->
6544
6736
 
6545
6737
 
6546
6738
 
@@ -6696,6 +6888,97 @@
6696
6888
  <fo:block-container border="1pt solid black" width="50%">
6697
6889
  <fo:block> </fo:block>
6698
6890
  </fo:block-container>
6891
+ </xsl:template><xsl:template match="*[local-name() = 'toc']">
6892
+ <xsl:param name="colwidths"/>
6893
+ <xsl:variable name="colwidths_">
6894
+ <xsl:choose>
6895
+ <xsl:when test="not($colwidths)">
6896
+ <xsl:variable name="toc_table_simple">
6897
+ <tbody>
6898
+ <xsl:apply-templates mode="toc_table_width"/>
6899
+ </tbody>
6900
+ </xsl:variable>
6901
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($toc_table_simple)/*/tr[1]/td)"/>
6902
+ <xsl:call-template name="calculate-column-widths">
6903
+ <xsl:with-param name="cols-count" select="$cols-count"/>
6904
+ <xsl:with-param name="table" select="$toc_table_simple"/>
6905
+ </xsl:call-template>
6906
+ </xsl:when>
6907
+ <xsl:otherwise>
6908
+ <xsl:copy-of select="$colwidths"/>
6909
+ </xsl:otherwise>
6910
+ </xsl:choose>
6911
+ </xsl:variable>
6912
+ <fo:block role="TOCI" space-after="16pt">
6913
+ <fo:table width="100%" table-layout="fixed">
6914
+ <xsl:for-each select="xalan:nodeset($colwidths_)/column">
6915
+ <fo:table-column column-width="proportional-column-width({.})"/>
6916
+ </xsl:for-each>
6917
+ <fo:table-body>
6918
+ <xsl:apply-templates/>
6919
+ </fo:table-body>
6920
+ </fo:table>
6921
+ </fo:block>
6922
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']">
6923
+ <fo:table-row min-height="5mm">
6924
+ <xsl:apply-templates/>
6925
+ </fo:table-row>
6926
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']/*[local-name() = 'p']">
6927
+ <xsl:apply-templates/>
6928
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'xref']" priority="3">
6929
+ <!-- <xref target="cgpm9th1948r6">1.6.3<tab/>&#8220;9th CGPM, 1948:<tab/>decision to establish the SI&#8221;</xref> -->
6930
+ <xsl:variable name="target" select="@target"/>
6931
+ <xsl:for-each select="*[local-name() = 'tab']">
6932
+ <xsl:variable name="current_id" select="generate-id()"/>
6933
+ <fo:table-cell>
6934
+ <fo:block>
6935
+ <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
6936
+ <xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
6937
+ <xsl:choose>
6938
+ <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
6939
+ <xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
6940
+ </xsl:choose>
6941
+ </xsl:for-each>
6942
+ </fo:basic-link>
6943
+ </fo:block>
6944
+ </fo:table-cell>
6945
+ </xsl:for-each>
6946
+ <!-- last column - for page numbers -->
6947
+ <fo:table-cell text-align="right" font-size="10pt" font-weight="bold" font-family="Arial">
6948
+ <fo:block>
6949
+ <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
6950
+ <fo:page-number-citation ref-id="{$target}"/>
6951
+ </fo:basic-link>
6952
+ </fo:block>
6953
+ </fo:table-cell>
6954
+ </xsl:template><xsl:template match="*" mode="toc_table_width">
6955
+ <xsl:apply-templates mode="toc_table_width"/>
6956
+ </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">
6957
+ <tr>
6958
+ <xsl:apply-templates mode="toc_table_width"/>
6959
+ </tr>
6960
+ </xsl:template><xsl:template match="*[local-name() = 'xref']" mode="toc_table_width">
6961
+ <!-- <xref target="cgpm9th1948r6">1.6.3<tab/>&#8220;9th CGPM, 1948:<tab/>decision to establish the SI&#8221;</xref> -->
6962
+ <xsl:for-each select="*[local-name() = 'tab']">
6963
+ <xsl:variable name="current_id" select="generate-id()"/>
6964
+ <td>
6965
+ <xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
6966
+ <xsl:copy-of select="."/>
6967
+ </xsl:for-each>
6968
+ </td>
6969
+ </xsl:for-each>
6970
+ <td>333</td> <!-- page number, just for fill -->
6971
+ </xsl:template><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']"/><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
6972
+ <fo:inline padding-right="5mm"> </fo:inline>
6973
+ <fo:inline><xsl:apply-templates/></fo:inline>
6974
+ </xsl:template><xsl:template match="*[local-name() = 'blacksquare']" name="blacksquare">
6975
+ <fo:inline padding-right="2.5mm" baseline-shift="5%">
6976
+ <fo:instream-foreign-object content-height="2mm" content-width="2mm" fox:alt-text="Quad">
6977
+ <svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="0 0 2 2">
6978
+ <rect x="0" y="0" width="2" height="2" fill="black"/>
6979
+ </svg>
6980
+ </fo:instream-foreign-object>
6981
+ </fo:inline>
6699
6982
  </xsl:template><xsl:template name="convertDate">
6700
6983
  <xsl:param name="date"/>
6701
6984
  <xsl:param name="format" select="'short'"/>
@@ -6934,6 +7217,26 @@
6934
7217
  <xsl:value-of select="$level"/>
6935
7218
  </xsl:otherwise>
6936
7219
  </xsl:choose>
7220
+ </xsl:template><xsl:template name="getLevelTermName">
7221
+ <xsl:choose>
7222
+ <xsl:when test="normalize-space(../@depth) != ''">
7223
+ <xsl:value-of select="../@depth"/>
7224
+ </xsl:when>
7225
+ <xsl:otherwise>
7226
+ <xsl:variable name="title_level_">
7227
+ <xsl:for-each select="../preceding-sibling::*[local-name() = 'title'][1]">
7228
+ <xsl:call-template name="getLevel"/>
7229
+ </xsl:for-each>
7230
+ </xsl:variable>
7231
+ <xsl:variable name="title_level" select="normalize-space($title_level_)"/>
7232
+ <xsl:choose>
7233
+ <xsl:when test="$title_level != ''"><xsl:value-of select="$title_level + 1"/></xsl:when>
7234
+ <xsl:otherwise>
7235
+ <xsl:call-template name="getLevel"/>
7236
+ </xsl:otherwise>
7237
+ </xsl:choose>
7238
+ </xsl:otherwise>
7239
+ </xsl:choose>
6937
7240
  </xsl:template><xsl:template name="split">
6938
7241
  <xsl:param name="pText" select="."/>
6939
7242
  <xsl:param name="sep" select="','"/>