metanorma-itu 1.3.8 → 1.3.12

Sign up to get free protection for your applications and to get access to all the features.
@@ -125,10 +125,10 @@
125
125
 
126
126
  <xsl:template match="/">
127
127
  <xsl:call-template name="namespaceCheck"/>
128
- <fo:root xsl:use-attribute-sets="root-style">
129
- <xsl:if test="$lang != 'ar'">
128
+ <fo:root xsl:use-attribute-sets="root-style" xml:lang="{$lang}">
129
+ <!-- <xsl:if test="$lang != 'ar'">
130
130
  <xsl:attribute name="xml:lang"><xsl:value-of select="$lang"/></xsl:attribute>
131
- </xsl:if>
131
+ </xsl:if> -->
132
132
  <xsl:if test="$doctype = 'resolution'">
133
133
  <xsl:attribute name="font-size">11pt</xsl:attribute>
134
134
  </xsl:if>
@@ -302,7 +302,7 @@
302
302
  <fo:block font-weight="bold">Title:</fo:block>
303
303
  </fo:table-cell>
304
304
  <fo:table-cell number-columns-spanned="4" padding-top="2mm">
305
- <fo:block><xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:title[@language='en' and @type='main']"/></fo:block>
305
+ <fo:block role="H1"><xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:title[@language='en' and @type='main']"/></fo:block>
306
306
  </fo:table-cell>
307
307
  </fo:table-row>
308
308
  </fo:table-body>
@@ -418,7 +418,7 @@
418
418
  <xsl:variable name="series_main" select="normalize-space(/*/itu:bibdata/itu:series[@type='main']/itu:title)"/>
419
419
  <xsl:variable name="series_secondary" select="normalize-space(/*/itu:bibdata/itu:series[@type='secondary']/itu:title)"/>
420
420
  <xsl:variable name="series_tertiary" select="normalize-space(/*/itu:bibdata/itu:series[@type='tertiary']/itu:title)"/>
421
- <fo:block font-weight="bold">
421
+ <fo:block font-weight="bold" role="H1">
422
422
  <xsl:choose>
423
423
  <xsl:when test="$series_main != '' and $series_secondary != '' and $series_tertiary = ''">
424
424
  <fo:block font-size="16pt">
@@ -774,7 +774,7 @@
774
774
  <fo:table-cell font-size="18pt" number-columns-spanned="3">
775
775
  <fo:block-container>
776
776
  <xsl:call-template name="setWritingMode"/>
777
- <fo:block padding-right="2mm" margin-top="6pt">
777
+ <fo:block padding-right="2mm" margin-top="6pt" role="H1">
778
778
  <xsl:if test="not(/itu:itu-standard/itu:bibdata/itu:title[@type = 'annex' and @language = 'en']) and $isAmendment = '' and $isCorrigendum = ''">
779
779
  <xsl:attribute name="font-weight">bold</xsl:attribute>
780
780
  </xsl:if>
@@ -795,12 +795,12 @@
795
795
  <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:title[@type = 'main' and @language = 'en']"/>
796
796
  </fo:block>
797
797
  <xsl:for-each select="/itu:itu-standard/itu:bibdata/itu:title[@type = 'annex' and @language = 'en']">
798
- <fo:block font-weight="bold">
798
+ <fo:block font-weight="bold" role="H1">
799
799
  <xsl:value-of select="."/>
800
800
  </fo:block>
801
801
  </xsl:for-each>
802
802
  <xsl:if test="$isAmendment != ''">
803
- <fo:block padding-right="2mm" margin-top="6pt" font-weight="bold">
803
+ <fo:block padding-right="2mm" margin-top="6pt" font-weight="bold" role="H1">
804
804
  <xsl:value-of select="$isAmendment"/>
805
805
  <xsl:if test="/itu:itu-standard/itu:bibdata/itu:title[@type = 'amendment']">
806
806
  <xsl:text>: </xsl:text>
@@ -809,7 +809,7 @@
809
809
  </fo:block>
810
810
  </xsl:if>
811
811
  <xsl:if test="$isCorrigendum != ''">
812
- <fo:block padding-right="2mm" margin-top="6pt" font-weight="bold">
812
+ <fo:block padding-right="2mm" margin-top="6pt" font-weight="bold" role="H1">
813
813
  <xsl:value-of select="$isCorrigendum"/>
814
814
  <xsl:if test="/itu:itu-standard/itu:bibdata/itu:title[@type = 'corrigendum']">
815
815
  <xsl:text>: </xsl:text>
@@ -945,7 +945,7 @@
945
945
  </fo:block>
946
946
  </xsl:otherwise>
947
947
  </xsl:choose>
948
- <fo:block text-align="center" margin-top="15pt" margin-bottom="15pt">
948
+ <fo:block text-align="center" margin-top="15pt" margin-bottom="15pt" role="H1">
949
949
  <xsl:if test="$doctype = 'service-publication'">
950
950
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
951
951
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
@@ -997,137 +997,138 @@
997
997
 
998
998
  <xsl:if test="xalan:nodeset($contents)//item[@display = 'true'] and $doctype != 'resolution' and $doctype != 'service-publication'">
999
999
  <fo:block break-after="page"/>
1000
- <fo:block-container>
1001
- <fo:block margin-top="6pt" text-align="center" font-weight="bold">
1002
- <xsl:call-template name="getLocalizedString">
1003
- <xsl:with-param name="key">table_of_contents</xsl:with-param>
1004
- </xsl:call-template>
1005
- </fo:block>
1006
- <fo:block margin-top="6pt" text-align="end" font-weight="bold">
1007
- <xsl:call-template name="getLocalizedString">
1008
- <xsl:with-param name="key">Page.sg</xsl:with-param>
1009
- </xsl:call-template>
1010
- </fo:block>
1011
-
1012
- <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']">
1013
- <fo:block>
1014
- <xsl:if test="@level = 1">
1015
- <xsl:attribute name="margin-top">6pt</xsl:attribute>
1016
- </xsl:if>
1017
- <xsl:if test="@level = 2">
1018
- <xsl:attribute name="margin-top">4pt</xsl:attribute>
1019
- <!-- <xsl:attribute name="margin-left">12mm</xsl:attribute> -->
1020
- </xsl:if>
1021
- <fo:list-block provisional-label-separation="3mm">
1022
- <xsl:attribute name="provisional-distance-between-starts">
1023
- <xsl:choose>
1024
- <xsl:when test="@section != ''">
1025
- <xsl:if test="@level = 1">
1026
- <xsl:choose>
1027
- <xsl:when test="string-length(@section) &gt; 10">27mm</xsl:when>
1028
- <xsl:when test="string-length(@section) &gt; 5">22mm</xsl:when>
1029
- <!-- <xsl:when test="@type = 'annex'">20mm</xsl:when> -->
1030
- <xsl:otherwise>12mm</xsl:otherwise>
1031
- </xsl:choose>
1032
- </xsl:if>
1033
- <xsl:if test="@level = 2">26mm</xsl:if>
1034
- </xsl:when> <!-- -->
1035
- <xsl:otherwise>0mm</xsl:otherwise>
1036
- </xsl:choose>
1037
- </xsl:attribute>
1038
- <fo:list-item>
1039
- <fo:list-item-label end-indent="label-end()">
1040
- <xsl:if test="@level =2">
1041
- <xsl:attribute name="start-indent">12mm</xsl:attribute>
1042
- </xsl:if>
1043
- <fo:block>
1044
- <xsl:if test="@section">
1045
- <xsl:value-of select="@section"/>
1046
- </xsl:if>
1047
- </fo:block>
1048
- </fo:list-item-label>
1049
- <fo:list-item-body start-indent="body-start()">
1050
- <fo:block text-align-last="justify">
1051
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
1052
- <xsl:apply-templates select="title"/>
1053
- <fo:inline keep-together.within-line="always">
1054
- <fo:leader leader-pattern="dots"/>
1055
- <fo:page-number-citation ref-id="{@id}"/>
1056
- </fo:inline>
1057
- </fo:basic-link>
1058
- </fo:block>
1059
- </fo:list-item-body>
1060
- </fo:list-item>
1061
- </fo:list-block>
1062
- </fo:block>
1063
- </xsl:for-each>
1064
-
1065
-
1066
- <xsl:if test="$doctype = 'technical-report' or $doctype = 'technical-paper'">
1067
- <xsl:if test="//itu:table[@id and itu:name]">
1068
- <xsl:variable name="title-list-tables">
1069
- <xsl:call-template name="getTitle">
1070
- <xsl:with-param name="name" select="'title-list-tables'"/>
1071
- </xsl:call-template>
1072
- </xsl:variable>
1073
-
1074
- <fo:block space-before="36pt" text-align="center" font-weight="bold" keep-with-next="always">
1075
- <xsl:value-of select="$title-list-tables"/>
1076
- </fo:block>
1077
- <fo:block margin-top="6pt" text-align="end" font-weight="bold" keep-with-next="always">
1000
+ <fo:block-container>
1001
+ <fo:block role="TOC">
1002
+ <fo:block margin-top="6pt" text-align="center" font-weight="bold" role="H1">
1078
1003
  <xsl:call-template name="getLocalizedString">
1079
- <xsl:with-param name="key">Page.sg</xsl:with-param>
1080
- </xsl:call-template>
1081
- </fo:block>
1082
-
1083
- <fo:block-container>
1084
- <xsl:for-each select="//itu:table[@id and itu:name]">
1085
- <fo:block text-align-last="justify" margin-top="6pt">
1086
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{itu:name}">
1087
- <xsl:apply-templates select="itu:name" mode="contents"/>
1088
- <fo:inline keep-together.within-line="always">
1089
- <fo:leader leader-pattern="dots"/>
1090
- <fo:page-number-citation ref-id="{@id}"/>
1091
- </fo:inline>
1092
- </fo:basic-link>
1093
- </fo:block>
1094
- </xsl:for-each>
1095
- </fo:block-container>
1096
- </xsl:if>
1097
-
1098
- <xsl:if test="//itu:figure[@id and itu:name]">
1099
- <xsl:variable name="title-list-figures">
1100
- <xsl:call-template name="getTitle">
1101
- <xsl:with-param name="name" select="'title-list-figures'"/>
1004
+ <xsl:with-param name="key">table_of_contents</xsl:with-param>
1102
1005
  </xsl:call-template>
1103
- </xsl:variable>
1104
-
1105
-
1106
- <fo:block space-before="36pt" text-align="center" font-weight="bold" keep-with-next="always">
1107
- <xsl:value-of select="$title-list-figures"/>
1108
1006
  </fo:block>
1109
- <fo:block margin-top="6pt" text-align="end" font-weight="bold" keep-with-next="always">
1007
+ <fo:block margin-top="6pt" text-align="end" font-weight="bold">
1110
1008
  <xsl:call-template name="getLocalizedString">
1111
1009
  <xsl:with-param name="key">Page.sg</xsl:with-param>
1112
1010
  </xsl:call-template>
1113
1011
  </fo:block>
1114
1012
 
1115
- <fo:block-container>
1116
- <xsl:for-each select="//itu:figure[@id and itu:name]">
1117
- <fo:block text-align-last="justify" margin-top="6pt">
1118
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{itu:name}">
1119
- <xsl:apply-templates select="itu:name" mode="contents"/>
1120
- <fo:inline keep-together.within-line="always">
1121
- <fo:leader leader-pattern="dots"/>
1122
- <fo:page-number-citation ref-id="{@id}"/>
1123
- </fo:inline>
1124
- </fo:basic-link>
1125
- </fo:block>
1126
- </xsl:for-each>
1127
- </fo:block-container>
1013
+ <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']">
1014
+ <fo:block role="TOCI">
1015
+ <xsl:if test="@level = 1">
1016
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
1017
+ </xsl:if>
1018
+ <xsl:if test="@level = 2">
1019
+ <xsl:attribute name="margin-top">4pt</xsl:attribute>
1020
+ <!-- <xsl:attribute name="margin-left">12mm</xsl:attribute> -->
1021
+ </xsl:if>
1022
+ <fo:list-block provisional-label-separation="3mm">
1023
+ <xsl:attribute name="provisional-distance-between-starts">
1024
+ <xsl:choose>
1025
+ <xsl:when test="@section != ''">
1026
+ <xsl:if test="@level = 1">
1027
+ <xsl:choose>
1028
+ <xsl:when test="string-length(@section) &gt; 10">27mm</xsl:when>
1029
+ <xsl:when test="string-length(@section) &gt; 5">22mm</xsl:when>
1030
+ <!-- <xsl:when test="@type = 'annex'">20mm</xsl:when> -->
1031
+ <xsl:otherwise>12mm</xsl:otherwise>
1032
+ </xsl:choose>
1033
+ </xsl:if>
1034
+ <xsl:if test="@level = 2">26mm</xsl:if>
1035
+ </xsl:when> <!-- -->
1036
+ <xsl:otherwise>0mm</xsl:otherwise>
1037
+ </xsl:choose>
1038
+ </xsl:attribute>
1039
+ <fo:list-item>
1040
+ <fo:list-item-label end-indent="label-end()">
1041
+ <xsl:if test="@level =2">
1042
+ <xsl:attribute name="start-indent">12mm</xsl:attribute>
1043
+ </xsl:if>
1044
+ <fo:block>
1045
+ <xsl:if test="@section">
1046
+ <xsl:value-of select="@section"/>
1047
+ </xsl:if>
1048
+ </fo:block>
1049
+ </fo:list-item-label>
1050
+ <fo:list-item-body start-indent="body-start()">
1051
+ <fo:block text-align-last="justify">
1052
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
1053
+ <xsl:apply-templates select="title"/>
1054
+ <fo:inline keep-together.within-line="always">
1055
+ <fo:leader leader-pattern="dots"/>
1056
+ <fo:page-number-citation ref-id="{@id}"/>
1057
+ </fo:inline>
1058
+ </fo:basic-link>
1059
+ </fo:block>
1060
+ </fo:list-item-body>
1061
+ </fo:list-item>
1062
+ </fo:list-block>
1063
+ </fo:block>
1064
+ </xsl:for-each>
1065
+
1066
+
1067
+ <xsl:if test="$doctype = 'technical-report' or $doctype = 'technical-paper'">
1068
+ <xsl:if test="//itu:table[@id and itu:name]">
1069
+ <xsl:variable name="title-list-tables">
1070
+ <xsl:call-template name="getTitle">
1071
+ <xsl:with-param name="name" select="'title-list-tables'"/>
1072
+ </xsl:call-template>
1073
+ </xsl:variable>
1074
+
1075
+ <fo:block space-before="36pt" text-align="center" font-weight="bold" keep-with-next="always">
1076
+ <xsl:value-of select="$title-list-tables"/>
1077
+ </fo:block>
1078
+ <fo:block margin-top="6pt" text-align="end" font-weight="bold" keep-with-next="always">
1079
+ <xsl:call-template name="getLocalizedString">
1080
+ <xsl:with-param name="key">Page.sg</xsl:with-param>
1081
+ </xsl:call-template>
1082
+ </fo:block>
1083
+
1084
+ <fo:block-container>
1085
+ <xsl:for-each select="//itu:table[@id and itu:name]">
1086
+ <fo:block text-align-last="justify" margin-top="6pt" role="TOCI">
1087
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{itu:name}">
1088
+ <xsl:apply-templates select="itu:name" mode="contents"/>
1089
+ <fo:inline keep-together.within-line="always">
1090
+ <fo:leader leader-pattern="dots"/>
1091
+ <fo:page-number-citation ref-id="{@id}"/>
1092
+ </fo:inline>
1093
+ </fo:basic-link>
1094
+ </fo:block>
1095
+ </xsl:for-each>
1096
+ </fo:block-container>
1097
+ </xsl:if>
1098
+
1099
+ <xsl:if test="//itu:figure[@id and itu:name]">
1100
+ <xsl:variable name="title-list-figures">
1101
+ <xsl:call-template name="getTitle">
1102
+ <xsl:with-param name="name" select="'title-list-figures'"/>
1103
+ </xsl:call-template>
1104
+ </xsl:variable>
1105
+
1106
+
1107
+ <fo:block space-before="36pt" text-align="center" font-weight="bold" keep-with-next="always">
1108
+ <xsl:value-of select="$title-list-figures"/>
1109
+ </fo:block>
1110
+ <fo:block margin-top="6pt" text-align="end" font-weight="bold" keep-with-next="always">
1111
+ <xsl:call-template name="getLocalizedString">
1112
+ <xsl:with-param name="key">Page.sg</xsl:with-param>
1113
+ </xsl:call-template>
1114
+ </fo:block>
1115
+
1116
+ <fo:block-container>
1117
+ <xsl:for-each select="//itu:figure[@id and itu:name]">
1118
+ <fo:block text-align-last="justify" margin-top="6pt" role="TOCI">
1119
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{itu:name}">
1120
+ <xsl:apply-templates select="itu:name" mode="contents"/>
1121
+ <fo:inline keep-together.within-line="always">
1122
+ <fo:leader leader-pattern="dots"/>
1123
+ <fo:page-number-citation ref-id="{@id}"/>
1124
+ </fo:inline>
1125
+ </fo:basic-link>
1126
+ </fo:block>
1127
+ </xsl:for-each>
1128
+ </fo:block-container>
1129
+ </xsl:if>
1128
1130
  </xsl:if>
1129
- </xsl:if>
1130
-
1131
+ </fo:block>
1131
1132
  </fo:block-container>
1132
1133
  </xsl:if>
1133
1134
 
@@ -1178,7 +1179,7 @@
1178
1179
  </xsl:otherwise>
1179
1180
  </xsl:choose>
1180
1181
 
1181
- <fo:block font-weight="bold" text-align="center" margin-top="15pt" margin-bottom="15pt">
1182
+ <fo:block font-weight="bold" text-align="center" margin-top="15pt" margin-bottom="15pt" role="H1">
1182
1183
  <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:title[@type = 'main' and @language = $lang]"/>
1183
1184
 
1184
1185
  <xsl:variable name="subtitle" select="/itu:itu-standard/itu:bibdata/itu:title[@type = 'subtitle' and @language = $lang]"/>
@@ -1387,13 +1388,17 @@
1387
1388
  <fo:block>&#xa0;</fo:block>
1388
1389
  <fo:block>&#xa0;</fo:block>
1389
1390
  </xsl:if> -->
1390
- <fo:block font-weight="bold" margin-top="18pt" margin-bottom="18pt" keep-with-next="always">
1391
+ <xsl:variable name="level">
1392
+ <xsl:call-template name="getLevel"/>
1393
+ </xsl:variable>
1394
+ <fo:block font-weight="bold" margin-top="18pt" margin-bottom="18pt" keep-with-next="always" role="H{$level}">
1391
1395
  <xsl:if test="$doctype = 'service-publication'">
1392
1396
  <xsl:attribute name="margin-top">24pt</xsl:attribute>
1393
1397
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1394
1398
  <xsl:attribute name="font-size">12pt</xsl:attribute>
1395
1399
  </xsl:if>
1396
1400
  <xsl:apply-templates/>
1401
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
1397
1402
  </fo:block>
1398
1403
  <!-- <xsl:if test="$doctype = 'service-publication'">
1399
1404
  <fo:block keep-with-next="always">&#xa0;</fo:block>
@@ -1582,14 +1587,16 @@
1582
1587
 
1583
1588
 
1584
1589
  <xsl:template match="itu:clause[@id='draft-warning']/itu:title" mode="caution">
1585
- <fo:block font-size="16pt" font-family="Times New Roman" font-style="italic" font-weight="bold" text-align="center" space-after="6pt">
1590
+ <fo:block font-size="16pt" font-family="Times New Roman" font-style="italic" font-weight="bold" text-align="center" space-after="6pt" role="H1">
1586
1591
  <xsl:apply-templates/>
1592
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
1587
1593
  </fo:block>
1588
1594
  </xsl:template>
1589
1595
 
1590
1596
  <xsl:template match="itu:clause[@id='draft-warning']/itu:p" mode="caution">
1591
1597
  <fo:block font-size="12pt" font-family="Times New Roman" text-align="justify">
1592
1598
  <xsl:apply-templates/>
1599
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
1593
1600
  </fo:block>
1594
1601
  </xsl:template>
1595
1602
 
@@ -1597,8 +1604,11 @@
1597
1604
  <!-- title -->
1598
1605
  <!-- ====== -->
1599
1606
  <xsl:template match="itu:annex/itu:title">
1600
- <fo:block font-size="14pt" font-weight="bold" text-align="center" margin-bottom="18pt">
1601
- <fo:block><xsl:apply-templates/></fo:block>
1607
+ <fo:block font-size="14pt" font-weight="bold" text-align="center" margin-bottom="18pt" role="H1">
1608
+ <fo:block>
1609
+ <xsl:apply-templates/>
1610
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
1611
+ </fo:block>
1602
1612
  <xsl:if test="$doctype != 'resolution'">
1603
1613
  <fo:block font-size="12pt" font-weight="normal" margin-top="6pt">
1604
1614
  <xsl:choose>
@@ -1616,7 +1626,7 @@
1616
1626
 
1617
1627
  <!-- Bibliography -->
1618
1628
  <xsl:template match="itu:references[not(@normative='true')]/itu:title">
1619
- <fo:block font-size="14pt" font-weight="bold" text-align="center" margin-bottom="18pt">
1629
+ <fo:block font-size="14pt" font-weight="bold" text-align="center" margin-bottom="18pt" role="H1">
1620
1630
  <xsl:if test="$doctype = 'implementers-guide'">
1621
1631
  <xsl:attribute name="text-align">left</xsl:attribute>
1622
1632
  <xsl:attribute name="font-size">12pt</xsl:attribute>
@@ -1692,7 +1702,9 @@
1692
1702
  </xsl:choose>
1693
1703
  </xsl:attribute>
1694
1704
  </xsl:if>
1705
+ <xsl:attribute name="role">H<xsl:value-of select="$level"/></xsl:attribute>
1695
1706
  <xsl:apply-templates/>
1707
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
1696
1708
  </xsl:element>
1697
1709
 
1698
1710
  <xsl:if test="$element-name = 'fo:inline' and not(following-sibling::itu:p)">
@@ -1703,7 +1715,10 @@
1703
1715
 
1704
1716
 
1705
1717
  <xsl:template match="itu:legal-statement//itu:title | itu:license-statement//itu:title">
1706
- <fo:block text-align="center" margin-top="6pt">
1718
+ <xsl:variable name="level">
1719
+ <xsl:call-template name="getLevel"/>
1720
+ </xsl:variable>
1721
+ <fo:block text-align="center" margin-top="6pt" role="H{$level}">
1707
1722
  <xsl:apply-templates/>
1708
1723
  </fo:block>
1709
1724
  </xsl:template>
@@ -1737,11 +1752,14 @@
1737
1752
 
1738
1753
  <xsl:template match="itu:preferred">
1739
1754
  <!-- DEBUG need -->
1740
- <fo:block space-before="6pt" text-align="justify">
1755
+ <xsl:variable name="level">
1756
+ <xsl:call-template name="getLevel"/>
1757
+ </xsl:variable>
1758
+ <xsl:variable name="levelTerm">
1759
+ <xsl:call-template name="getLevelTermName"/>
1760
+ </xsl:variable>
1761
+ <fo:block space-before="6pt" text-align="justify" role="H{$levelTerm}">
1741
1762
  <fo:inline padding-right="5mm" font-weight="bold">
1742
- <xsl:variable name="level">
1743
- <xsl:call-template name="getLevel"/>
1744
- </xsl:variable>
1745
1763
  <!-- level=<xsl:value-of select="$level"/> -->
1746
1764
  <xsl:attribute name="padding-right">
1747
1765
  <xsl:choose>
@@ -1891,7 +1909,7 @@
1891
1909
  </xsl:choose>
1892
1910
  </xsl:variable>
1893
1911
  <xsl:element name="{$element-name}">
1894
- <xsl:attribute name="font-family">Courier</xsl:attribute>
1912
+ <xsl:attribute name="font-family">Courier New</xsl:attribute>
1895
1913
  <xsl:attribute name="font-size">10pt</xsl:attribute>
1896
1914
  <xsl:if test="local-name(..) != 'dt' and not(ancestor::itu:dd) and not(ancestor::itu:title)">
1897
1915
  <xsl:attribute name="text-align">center</xsl:attribute>
@@ -2127,7 +2145,7 @@
2127
2145
 
2128
2146
 
2129
2147
  <xsl:template name="insertHeaderFooter">
2130
- <fo:static-content flow-name="footer-even" font-family="Times New Roman" font-size="11pt">
2148
+ <fo:static-content flow-name="footer-even" font-family="Times New Roman" font-size="11pt" role="artifact">
2131
2149
  <fo:block-container height="19mm" display-align="after">
2132
2150
  <fo:table table-layout="fixed" width="100%" display-align="after">
2133
2151
  <fo:table-column column-width="10%"/>
@@ -2145,7 +2163,7 @@
2145
2163
  </fo:table>
2146
2164
  </fo:block-container>
2147
2165
  </fo:static-content>
2148
- <fo:static-content flow-name="footer-odd" font-family="Times New Roman" font-size="11pt">
2166
+ <fo:static-content flow-name="footer-odd" font-family="Times New Roman" font-size="11pt" role="artifact">
2149
2167
  <fo:block-container height="19mm" display-align="after">
2150
2168
  <fo:table table-layout="fixed" width="100%" display-align="after">
2151
2169
  <fo:table-column column-width="90%"/>
@@ -2166,7 +2184,7 @@
2166
2184
  </xsl:template>
2167
2185
 
2168
2186
  <xsl:template name="insertHeaderFooterSP">
2169
- <fo:static-content flow-name="footer-even">
2187
+ <fo:static-content flow-name="footer-even" role="artifact">
2170
2188
  <fo:block-container height="20mm">
2171
2189
  <fo:table table-layout="fixed" width="100%" margin-top="3mm">
2172
2190
  <fo:table-column column-width="proportional-column-width(2)"/>
@@ -2188,7 +2206,7 @@
2188
2206
  </fo:table>
2189
2207
  </fo:block-container>
2190
2208
  </fo:static-content>
2191
- <fo:static-content flow-name="footer-odd">
2209
+ <fo:static-content flow-name="footer-odd" role="artifact">
2192
2210
  <fo:block-container height="20mm">
2193
2211
  <fo:table table-layout="fixed" width="100%" margin-top="3mm">
2194
2212
  <fo:table-column column-width="proportional-column-width(2)"/>
@@ -2500,12 +2518,13 @@
2500
2518
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
2501
2519
  <xsl:attribute name="white-space">pre</xsl:attribute>
2502
2520
  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
2521
+ <xsl:attribute name="role">Code</xsl:attribute>
2503
2522
 
2504
2523
 
2505
2524
 
2506
2525
 
2507
2526
 
2508
- <xsl:attribute name="font-family">Courier</xsl:attribute>
2527
+ <xsl:attribute name="font-family">Courier New</xsl:attribute>
2509
2528
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
2510
2529
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
2511
2530
 
@@ -2525,8 +2544,13 @@
2525
2544
 
2526
2545
  </xsl:attribute-set><xsl:attribute-set name="requirement-label-style">
2527
2546
 
2528
- </xsl:attribute-set><xsl:attribute-set name="requirement-subject-style">
2529
- </xsl:attribute-set><xsl:attribute-set name="requirement-inherit-style">
2547
+ </xsl:attribute-set><xsl:attribute-set name="subject-style">
2548
+ </xsl:attribute-set><xsl:attribute-set name="inherit-style">
2549
+ </xsl:attribute-set><xsl:attribute-set name="description-style">
2550
+ </xsl:attribute-set><xsl:attribute-set name="specification-style">
2551
+ </xsl:attribute-set><xsl:attribute-set name="measurement-target-style">
2552
+ </xsl:attribute-set><xsl:attribute-set name="verification-style">
2553
+ </xsl:attribute-set><xsl:attribute-set name="import-style">
2530
2554
  </xsl:attribute-set><xsl:attribute-set name="recommendation-style">
2531
2555
 
2532
2556
 
@@ -2589,6 +2613,7 @@
2589
2613
 
2590
2614
 
2591
2615
 
2616
+
2592
2617
  <xsl:attribute name="font-size">10pt</xsl:attribute>
2593
2618
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
2594
2619
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
@@ -2725,7 +2750,8 @@
2725
2750
 
2726
2751
 
2727
2752
 
2728
- </xsl:attribute-set><xsl:attribute-set name="quote-style">
2753
+ </xsl:attribute-set><xsl:attribute-set name="quote-style">
2754
+ <xsl:attribute name="role">BlockQuote</xsl:attribute>
2729
2755
 
2730
2756
 
2731
2757
 
@@ -2862,13 +2888,20 @@
2862
2888
 
2863
2889
  </xsl:attribute-set><xsl:attribute-set name="list-style">
2864
2890
 
2865
- </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">
2891
+ </xsl:attribute-set><xsl:attribute-set name="toc-style">
2892
+ <xsl:attribute name="line-height">135%</xsl:attribute>
2893
+ </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">
2866
2894
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
2867
2895
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
2868
2896
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
2869
2897
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']" mode="contents"/>
2870
2898
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']" mode="contents"/>
2871
- </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
2899
+ </xsl:template><xsl:template name="processPrefaceSectionsDefault_Contents">
2900
+ <xsl:for-each select="/*/*[local-name()='preface']/*">
2901
+ <xsl:sort select="@displayorder" data-type="number"/>
2902
+ <xsl:apply-templates select="." mode="contents"/>
2903
+ </xsl:for-each>
2904
+ </xsl:template><xsl:template name="OLD_processMainSectionsDefault_Contents">
2872
2905
  <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
2873
2906
 
2874
2907
  <!-- Normative references -->
@@ -2881,13 +2914,33 @@
2881
2914
  <!-- Bibliography -->
2882
2915
  <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"/>
2883
2916
 
2884
- </xsl:template><xsl:template name="processPrefaceSectionsDefault">
2917
+ </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
2918
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
2919
+ <xsl:sort select="@displayorder" data-type="number"/>
2920
+ <xsl:apply-templates select="." mode="contents"/>
2921
+ </xsl:for-each>
2922
+
2923
+ <xsl:for-each select="/*/*[local-name()='annex']">
2924
+ <xsl:sort select="@displayorder" data-type="number"/>
2925
+ <xsl:apply-templates select="." mode="contents"/>
2926
+ </xsl:for-each>
2927
+
2928
+ <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
2929
+ <xsl:sort select="@displayorder" data-type="number"/>
2930
+ <xsl:apply-templates select="." mode="contents"/>
2931
+ </xsl:for-each>
2932
+ </xsl:template><xsl:template name="OLD_processPrefaceSectionsDefault">
2885
2933
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
2886
2934
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
2887
2935
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']"/>
2888
2936
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']"/>
2889
2937
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']"/>
2890
- </xsl:template><xsl:template name="processMainSectionsDefault">
2938
+ </xsl:template><xsl:template name="processPrefaceSectionsDefault">
2939
+ <xsl:for-each select="/*/*[local-name()='preface']/*">
2940
+ <xsl:sort select="@displayorder" data-type="number"/>
2941
+ <xsl:apply-templates select="."/>
2942
+ </xsl:for-each>
2943
+ </xsl:template><xsl:template name="OLD_processMainSectionsDefault">
2891
2944
  <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']"/>
2892
2945
 
2893
2946
  <!-- Normative references -->
@@ -2899,6 +2952,22 @@
2899
2952
  <xsl:apply-templates select="/*/*[local-name()='annex']"/>
2900
2953
  <!-- Bibliography -->
2901
2954
  <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]"/>
2955
+ </xsl:template><xsl:template name="processMainSectionsDefault">
2956
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
2957
+ <xsl:sort select="@displayorder" data-type="number"/>
2958
+ <xsl:apply-templates select="."/>
2959
+
2960
+ </xsl:for-each>
2961
+
2962
+ <xsl:for-each select="/*/*[local-name()='annex']">
2963
+ <xsl:sort select="@displayorder" data-type="number"/>
2964
+ <xsl:apply-templates select="."/>
2965
+ </xsl:for-each>
2966
+
2967
+ <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
2968
+ <xsl:sort select="@displayorder" data-type="number"/>
2969
+ <xsl:apply-templates select="."/>
2970
+ </xsl:for-each>
2902
2971
  </xsl:template><xsl:template match="text()">
2903
2972
  <xsl:value-of select="."/>
2904
2973
  </xsl:template><xsl:template match="*[local-name()='br']">
@@ -2933,7 +3002,9 @@
2933
3002
 
2934
3003
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
2935
3004
 
2936
-
3005
+
3006
+
3007
+
2937
3008
 
2938
3009
  <xsl:call-template name="fn_name_display"/>
2939
3010
 
@@ -3070,6 +3141,8 @@
3070
3141
  <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
3071
3142
  </xsl:if>
3072
3143
 
3144
+
3145
+
3073
3146
  <xsl:choose>
3074
3147
  <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
3075
3148
  <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
@@ -3357,9 +3430,9 @@
3357
3430
  <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation">
3358
3431
  <xsl:with-param name="continued">true</xsl:with-param>
3359
3432
  </xsl:apply-templates>
3360
- <xsl:for-each select="ancestor::*[local-name()='table'][1]">
3361
- <xsl:call-template name="fn_name_display"/>
3362
- </xsl:for-each>
3433
+
3434
+
3435
+
3363
3436
 
3364
3437
  </fo:table-cell>
3365
3438
  </fo:table-row>
@@ -3445,7 +3518,11 @@
3445
3518
 
3446
3519
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
3447
3520
 
3448
- <xsl:if test="$isNoteOrFnExist = 'true'">
3521
+ <xsl:variable name="isNoteOrFnExistShowAfterTable">
3522
+
3523
+ </xsl:variable>
3524
+
3525
+ <xsl:if test="$isNoteOrFnExist = 'true' or normalize-space($isNoteOrFnExistShowAfterTable) = 'true'">
3449
3526
 
3450
3527
  <xsl:variable name="cols-count">
3451
3528
  <xsl:choose>
@@ -3603,6 +3680,19 @@
3603
3680
 
3604
3681
  </fo:table-body>
3605
3682
 
3683
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/text()[1]" priority="2" mode="presentation_name">
3684
+ <xsl:choose>
3685
+ <xsl:when test="substring-after(., '—') != ''">
3686
+ <xsl:text>—</xsl:text><xsl:value-of select="substring-after(., '—')"/>
3687
+ </xsl:when>
3688
+ <xsl:otherwise>
3689
+ <xsl:value-of select="."/>
3690
+ </xsl:otherwise>
3691
+ </xsl:choose>
3692
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']" mode="presentation_name">
3693
+ <xsl:apply-templates mode="presentation_name"/>
3694
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/node()" mode="presentation_name">
3695
+ <xsl:apply-templates select="."/>
3606
3696
  </xsl:template><xsl:template match="*[local-name()='tr']">
3607
3697
  <xsl:variable name="parent-name" select="local-name(..)"/>
3608
3698
  <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
@@ -3801,18 +3891,12 @@
3801
3891
  <xsl:apply-templates/>
3802
3892
  </xsl:template><xsl:template name="fn_display">
3803
3893
  <xsl:variable name="references">
3894
+
3804
3895
  <xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']">
3805
- <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
3806
-
3807
- <xsl:if test="ancestor::*[local-name()='preface']">
3808
- <xsl:attribute name="preface">true</xsl:attribute>
3809
- </xsl:if>
3810
-
3811
-
3812
- <xsl:apply-templates/>
3813
- </fn>
3896
+ <xsl:call-template name="create_fn"/>
3814
3897
  </xsl:for-each>
3815
3898
  </xsl:variable>
3899
+
3816
3900
  <xsl:for-each select="xalan:nodeset($references)//fn">
3817
3901
  <xsl:variable name="reference" select="@reference"/>
3818
3902
  <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
@@ -3860,6 +3944,16 @@
3860
3944
  </fo:block>
3861
3945
  </xsl:if>
3862
3946
  </xsl:for-each>
3947
+ </xsl:template><xsl:template name="create_fn">
3948
+ <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
3949
+
3950
+ <xsl:if test="ancestor::*[local-name()='preface']">
3951
+ <xsl:attribute name="preface">true</xsl:attribute>
3952
+ </xsl:if>
3953
+
3954
+
3955
+ <xsl:apply-templates/>
3956
+ </fn>
3863
3957
  </xsl:template><xsl:template name="fn_name_display">
3864
3958
  <!-- <xsl:variable name="references">
3865
3959
  <xsl:for-each select="*[local-name()='name']//*[local-name()='fn']">
@@ -4861,16 +4955,68 @@
4861
4955
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
4862
4956
  </xsl:call-template>
4863
4957
 
4958
+
4959
+
4864
4960
  <xsl:variable name="mathml">
4865
4961
  <xsl:apply-templates select="." mode="mathml"/>
4866
4962
  </xsl:variable>
4867
4963
  <fo:instream-foreign-object fox:alt-text="Math">
4868
4964
 
4869
4965
 
4966
+ <xsl:variable name="comment_text_following" select="following-sibling::node()[1][self::comment()]"/>
4967
+ <xsl:variable name="comment_text_">
4968
+ <xsl:choose>
4969
+ <xsl:when test="normalize-space($comment_text_following) != ''">
4970
+ <xsl:value-of select="$comment_text_following"/>
4971
+ </xsl:when>
4972
+ <xsl:otherwise>
4973
+ <xsl:value-of select="normalize-space(translate(.,' ⁢',' '))"/>
4974
+ </xsl:otherwise>
4975
+ </xsl:choose>
4976
+ </xsl:variable>
4977
+ <xsl:variable name="comment_text" select="java:org.metanorma.fop.Util.unescape($comment_text_)"/>
4978
+
4979
+ <xsl:if test="normalize-space($comment_text) != ''">
4980
+ <!-- put Mathin Alternate Text -->
4981
+ <xsl:attribute name="fox:alt-text">
4982
+ <xsl:value-of select="java:org.metanorma.fop.Util.unescape($comment_text)"/>
4983
+ </xsl:attribute>
4984
+ </xsl:if>
4985
+
4986
+ <xsl:variable name="mathml_content">
4987
+ <xsl:apply-templates select="." mode="mathml_actual_text"/>
4988
+ </xsl:variable>
4989
+ <!-- put MathML in Actual Text -->
4990
+ <xsl:attribute name="fox:actual-text">
4991
+ <xsl:value-of select="$mathml_content"/>
4992
+ </xsl:attribute>
4993
+
4994
+
4870
4995
  <!-- <xsl:copy-of select="."/> -->
4871
4996
  <xsl:copy-of select="xalan:nodeset($mathml)"/>
4872
4997
  </fo:instream-foreign-object>
4873
4998
  </fo:inline>
4999
+ </xsl:template><xsl:template match="mathml:*" mode="mathml_actual_text">
5000
+ <!-- <xsl:text>a+b</xsl:text> -->
5001
+ <xsl:text>&lt;</xsl:text>
5002
+ <xsl:value-of select="local-name()"/>
5003
+ <xsl:if test="local-name() = 'math'">
5004
+ <xsl:text> xmlns="http://www.w3.org/1998/Math/MathML"</xsl:text>
5005
+ </xsl:if>
5006
+ <xsl:for-each select="@*">
5007
+ <xsl:text> </xsl:text>
5008
+ <xsl:value-of select="local-name()"/>
5009
+ <xsl:text>="</xsl:text>
5010
+ <xsl:value-of select="."/>
5011
+ <xsl:text>"</xsl:text>
5012
+ </xsl:for-each>
5013
+ <xsl:text>&gt;</xsl:text>
5014
+ <xsl:apply-templates mode="mathml_actual_text"/>
5015
+ <xsl:text>&lt;/</xsl:text>
5016
+ <xsl:value-of select="local-name()"/>
5017
+ <xsl:text>&gt;</xsl:text>
5018
+ </xsl:template><xsl:template match="text()" mode="mathml_actual_text">
5019
+ <xsl:value-of select="normalize-space()"/>
4874
5020
  </xsl:template><xsl:template match="@*|node()" mode="mathml">
4875
5021
  <xsl:copy>
4876
5022
  <xsl:apply-templates select="@*|node()" mode="mathml"/>
@@ -4880,19 +5026,6 @@
4880
5026
  <!-- replace start and end spaces to non-break space -->
4881
5027
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
4882
5028
  </xsl:copy>
4883
- </xsl:template><xsl:template match="mathml:mi[. = ',' and not(following-sibling::*[1][local-name() = 'mtext' and text() = ' '])]" mode="mathml">
4884
- <xsl:copy>
4885
- <xsl:apply-templates select="@*|node()" mode="mathml"/>
4886
- </xsl:copy>
4887
- <xsl:choose>
4888
- <!-- if in msub, then don't add space -->
4889
- <xsl:when test="ancestor::mathml:mrow[parent::mathml:msub and preceding-sibling::*[1][self::mathml:mrow]]"/>
4890
- <!-- if next char in digit, don't add space -->
4891
- <xsl:when test="translate(substring(following-sibling::*[1]/text(),1,1),'0123456789','') = ''"/>
4892
- <xsl:otherwise>
4893
- <mathml:mspace width="0.5ex"/>
4894
- </xsl:otherwise>
4895
- </xsl:choose>
4896
5029
  </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">
4897
5030
  <xsl:variable name="target">
4898
5031
  <xsl:choose>
@@ -4945,7 +5078,10 @@
4945
5078
  </fo:block>
4946
5079
  <xsl:apply-templates/>
4947
5080
  </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
4948
- <fo:inline><xsl:apply-templates/></fo:inline>
5081
+ <xsl:variable name="level">
5082
+ <xsl:call-template name="getLevel"/>
5083
+ </xsl:variable>
5084
+ <fo:inline role="H{$level}"><xsl:apply-templates/></fo:inline>
4949
5085
  </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
4950
5086
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
4951
5087
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -4980,9 +5116,10 @@
4980
5116
 
4981
5117
  </xsl:variable>
4982
5118
 
5119
+ <xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
4983
5120
  <xsl:choose>
4984
- <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
4985
- <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
5121
+ <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>
5122
+ <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>
4986
5123
  </xsl:choose>
4987
5124
  <xsl:apply-templates/>
4988
5125
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
@@ -5134,7 +5271,10 @@
5134
5271
  </fo:block>
5135
5272
  </xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']" mode="presentation">
5136
5273
  <xsl:if test="normalize-space() != ''">
5137
- <fo:inline>
5274
+ <xsl:variable name="level">
5275
+ <xsl:call-template name="getLevelTermName"/>
5276
+ </xsl:variable>
5277
+ <fo:inline role="H{$level}">
5138
5278
  <xsl:apply-templates/>
5139
5279
  <!-- <xsl:if test="$namespace = 'gb' or $namespace = 'ogc'">
5140
5280
  <xsl:text>.</xsl:text>
@@ -5435,6 +5575,13 @@
5435
5575
  </xsl:attribute>
5436
5576
  <xsl:apply-templates mode="svg_update"/>
5437
5577
  </xsl:copy>
5578
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][*[local-name() = 'svg']]" priority="3">
5579
+ <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
5580
+ <xsl:for-each select="*[local-name() = 'svg']">
5581
+ <xsl:call-template name="image_svg">
5582
+ <xsl:with-param name="name" select="$name"/>
5583
+ </xsl:call-template>
5584
+ </xsl:for-each>
5438
5585
  </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
5439
5586
  <xsl:variable name="svg_content" select="document(@src)"/>
5440
5587
  <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
@@ -5539,7 +5686,7 @@
5539
5686
  </fo:basic-link>
5540
5687
  </fo:block>
5541
5688
  </fo:block-container>
5542
- </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">
5689
+ </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">
5543
5690
  <xsl:apply-templates mode="contents"/>
5544
5691
  <xsl:text> </xsl:text>
5545
5692
  </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">
@@ -5765,6 +5912,7 @@
5765
5912
  </xsl:when>
5766
5913
  <xsl:otherwise>
5767
5914
  <xsl:apply-templates/>
5915
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
5768
5916
  </xsl:otherwise>
5769
5917
  </xsl:choose>
5770
5918
  </fo:block>
@@ -5905,14 +6053,6 @@
5905
6053
  <fo:block>
5906
6054
  <fo:inline padding-right="3mm">Obligation</fo:inline><xsl:value-of select="."/>
5907
6055
  </fo:block>
5908
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
5909
- <fo:block xsl:use-attribute-sets="requirement-subject-style">
5910
- <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
5911
- </fo:block>
5912
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'inherit']">
5913
- <fo:block xsl:use-attribute-sets="requirement-inherit-style">
5914
- <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
5915
- </fo:block>
5916
6056
  </xsl:template><xsl:template match="*[local-name() = 'recommendation']">
5917
6057
  <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
5918
6058
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -5929,6 +6069,38 @@
5929
6069
  <fo:block xsl:use-attribute-sets="recommendation-label-style">
5930
6070
  <xsl:apply-templates/>
5931
6071
  </fo:block>
6072
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" priority="2"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
6073
+ <fo:block xsl:use-attribute-sets="subject-style">
6074
+ <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
6075
+ </fo:block>
6076
+ </xsl:template><xsl:template match="*[local-name() = 'subject']">
6077
+ <fo:block xsl:use-attribute-sets="subject-style">
6078
+ <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
6079
+ </fo:block>
6080
+ </xsl:template><xsl:template match="*[local-name() = 'inherit'] | *[local-name() = 'component'][@class = 'inherit']">
6081
+ <fo:block xsl:use-attribute-sets="inherit-style">
6082
+ <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
6083
+ </fo:block>
6084
+ </xsl:template><xsl:template match="*[local-name() = 'description'] | *[local-name() = 'component'][@class = 'description']">
6085
+ <fo:block xsl:use-attribute-sets="description-style">
6086
+ <xsl:apply-templates/>
6087
+ </fo:block>
6088
+ </xsl:template><xsl:template match="*[local-name() = 'specification'] | *[local-name() = 'component'][@class = 'specification']">
6089
+ <fo:block xsl:use-attribute-sets="specification-style">
6090
+ <xsl:apply-templates/>
6091
+ </fo:block>
6092
+ </xsl:template><xsl:template match="*[local-name() = 'measurement-target'] | *[local-name() = 'component'][@class = 'measurement-target']">
6093
+ <fo:block xsl:use-attribute-sets="measurement-target-style">
6094
+ <xsl:apply-templates/>
6095
+ </fo:block>
6096
+ </xsl:template><xsl:template match="*[local-name() = 'verification'] | *[local-name() = 'component'][@class = 'verification']">
6097
+ <fo:block xsl:use-attribute-sets="verification-style">
6098
+ <xsl:apply-templates/>
6099
+ </fo:block>
6100
+ </xsl:template><xsl:template match="*[local-name() = 'import'] | *[local-name() = 'component'][@class = 'import']">
6101
+ <fo:block xsl:use-attribute-sets="import-style">
6102
+ <xsl:apply-templates/>
6103
+ </fo:block>
5932
6104
  </xsl:template><xsl:template match="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
5933
6105
  <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt">
5934
6106
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
@@ -6080,7 +6252,19 @@
6080
6252
  </fo:inline>
6081
6253
  </xsl:if>
6082
6254
  </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'p']">
6083
- <fo:inline><xsl:apply-templates/></fo:inline>
6255
+ <xsl:variable name="element">inline
6256
+
6257
+ </xsl:variable>
6258
+ <xsl:choose>
6259
+ <xsl:when test="contains($element, 'block')">
6260
+ <fo:block xsl:use-attribute-sets="example-p-style">
6261
+ <xsl:apply-templates/>
6262
+ </fo:block>
6263
+ </xsl:when>
6264
+ <xsl:otherwise>
6265
+ <fo:inline><xsl:apply-templates/></fo:inline>
6266
+ </xsl:otherwise>
6267
+ </xsl:choose>
6084
6268
  </xsl:template><xsl:template match="*[local-name() = 'example']">
6085
6269
  <fo:block id="{@id}" xsl:use-attribute-sets="example-style">
6086
6270
 
@@ -6182,8 +6366,8 @@
6182
6366
  </xsl:if>
6183
6367
  </xsl:template><xsl:variable name="localized.source">
6184
6368
  <xsl:call-template name="getLocalizedString">
6185
- <xsl:with-param name="key">source</xsl:with-param>
6186
- </xsl:call-template>
6369
+ <xsl:with-param name="key">source</xsl:with-param>
6370
+ </xsl:call-template>
6187
6371
  </xsl:variable><xsl:template match="*[local-name() = 'origin']">
6188
6372
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
6189
6373
  <xsl:if test="normalize-space(@citeas) = ''">
@@ -6193,6 +6377,7 @@
6193
6377
  <fo:inline xsl:use-attribute-sets="origin-style">
6194
6378
  <xsl:apply-templates/>
6195
6379
  </fo:inline>
6380
+
6196
6381
  </fo:basic-link>
6197
6382
  </xsl:template><xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']">
6198
6383
  <fo:inline><xsl:apply-templates/></fo:inline>
@@ -6259,6 +6444,9 @@
6259
6444
 
6260
6445
  </xsl:if>
6261
6446
 
6447
+ <xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets -->
6448
+ <xsl:variable name="text" select="normalize-space()"/>
6449
+
6262
6450
 
6263
6451
 
6264
6452
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
@@ -6271,7 +6459,9 @@
6271
6459
 
6272
6460
 
6273
6461
  </xsl:if>
6274
-
6462
+
6463
+
6464
+
6275
6465
  <xsl:apply-templates/>
6276
6466
  </fo:basic-link>
6277
6467
 
@@ -6618,6 +6808,7 @@
6618
6808
  </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" priority="4">
6619
6809
  <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
6620
6810
  <fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
6811
+
6621
6812
  <xsl:apply-templates/>
6622
6813
  </fo:block>
6623
6814
  </xsl:template><xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
@@ -6657,7 +6848,6 @@
6657
6848
  </xsl:template><xsl:template name="processBibitem">
6658
6849
 
6659
6850
 
6660
- <!-- end BIPM bibitem processing-->
6661
6851
 
6662
6852
 
6663
6853
 
@@ -6787,6 +6977,97 @@
6787
6977
  <fo:block-container border="1pt solid black" width="50%">
6788
6978
  <fo:block> </fo:block>
6789
6979
  </fo:block-container>
6980
+ </xsl:template><xsl:template match="*[local-name() = 'toc']">
6981
+ <xsl:param name="colwidths"/>
6982
+ <xsl:variable name="colwidths_">
6983
+ <xsl:choose>
6984
+ <xsl:when test="not($colwidths)">
6985
+ <xsl:variable name="toc_table_simple">
6986
+ <tbody>
6987
+ <xsl:apply-templates mode="toc_table_width"/>
6988
+ </tbody>
6989
+ </xsl:variable>
6990
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($toc_table_simple)/*/tr[1]/td)"/>
6991
+ <xsl:call-template name="calculate-column-widths">
6992
+ <xsl:with-param name="cols-count" select="$cols-count"/>
6993
+ <xsl:with-param name="table" select="$toc_table_simple"/>
6994
+ </xsl:call-template>
6995
+ </xsl:when>
6996
+ <xsl:otherwise>
6997
+ <xsl:copy-of select="$colwidths"/>
6998
+ </xsl:otherwise>
6999
+ </xsl:choose>
7000
+ </xsl:variable>
7001
+ <fo:block role="TOCI" space-after="16pt">
7002
+ <fo:table width="100%" table-layout="fixed">
7003
+ <xsl:for-each select="xalan:nodeset($colwidths_)/column">
7004
+ <fo:table-column column-width="proportional-column-width({.})"/>
7005
+ </xsl:for-each>
7006
+ <fo:table-body>
7007
+ <xsl:apply-templates/>
7008
+ </fo:table-body>
7009
+ </fo:table>
7010
+ </fo:block>
7011
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']">
7012
+ <fo:table-row min-height="5mm">
7013
+ <xsl:apply-templates/>
7014
+ </fo:table-row>
7015
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']/*[local-name() = 'p']">
7016
+ <xsl:apply-templates/>
7017
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'xref']" priority="3">
7018
+ <!-- <xref target="cgpm9th1948r6">1.6.3<tab/>&#8220;9th CGPM, 1948:<tab/>decision to establish the SI&#8221;</xref> -->
7019
+ <xsl:variable name="target" select="@target"/>
7020
+ <xsl:for-each select="*[local-name() = 'tab']">
7021
+ <xsl:variable name="current_id" select="generate-id()"/>
7022
+ <fo:table-cell>
7023
+ <fo:block>
7024
+ <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
7025
+ <xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
7026
+ <xsl:choose>
7027
+ <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
7028
+ <xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
7029
+ </xsl:choose>
7030
+ </xsl:for-each>
7031
+ </fo:basic-link>
7032
+ </fo:block>
7033
+ </fo:table-cell>
7034
+ </xsl:for-each>
7035
+ <!-- last column - for page numbers -->
7036
+ <fo:table-cell text-align="right" font-size="10pt" font-weight="bold" font-family="Arial">
7037
+ <fo:block>
7038
+ <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
7039
+ <fo:page-number-citation ref-id="{$target}"/>
7040
+ </fo:basic-link>
7041
+ </fo:block>
7042
+ </fo:table-cell>
7043
+ </xsl:template><xsl:template match="*" mode="toc_table_width">
7044
+ <xsl:apply-templates mode="toc_table_width"/>
7045
+ </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">
7046
+ <tr>
7047
+ <xsl:apply-templates mode="toc_table_width"/>
7048
+ </tr>
7049
+ </xsl:template><xsl:template match="*[local-name() = 'xref']" mode="toc_table_width">
7050
+ <!-- <xref target="cgpm9th1948r6">1.6.3<tab/>&#8220;9th CGPM, 1948:<tab/>decision to establish the SI&#8221;</xref> -->
7051
+ <xsl:for-each select="*[local-name() = 'tab']">
7052
+ <xsl:variable name="current_id" select="generate-id()"/>
7053
+ <td>
7054
+ <xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
7055
+ <xsl:copy-of select="."/>
7056
+ </xsl:for-each>
7057
+ </td>
7058
+ </xsl:for-each>
7059
+ <td>333</td> <!-- page number, just for fill -->
7060
+ </xsl:template><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']"/><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
7061
+ <fo:inline padding-right="5mm"> </fo:inline>
7062
+ <fo:inline><xsl:apply-templates/></fo:inline>
7063
+ </xsl:template><xsl:template match="*[local-name() = 'blacksquare']" name="blacksquare">
7064
+ <fo:inline padding-right="2.5mm" baseline-shift="5%">
7065
+ <fo:instream-foreign-object content-height="2mm" content-width="2mm" fox:alt-text="Quad">
7066
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" viewBox="0 0 2 2">
7067
+ <rect x="0" y="0" width="2" height="2" fill="black"/>
7068
+ </svg>
7069
+ </fo:instream-foreign-object>
7070
+ </fo:inline>
6790
7071
  </xsl:template><xsl:template name="convertDate">
6791
7072
  <xsl:param name="date"/>
6792
7073
  <xsl:param name="format" select="'short'"/>
@@ -7025,6 +7306,26 @@
7025
7306
  <xsl:value-of select="$level"/>
7026
7307
  </xsl:otherwise>
7027
7308
  </xsl:choose>
7309
+ </xsl:template><xsl:template name="getLevelTermName">
7310
+ <xsl:choose>
7311
+ <xsl:when test="normalize-space(../@depth) != ''">
7312
+ <xsl:value-of select="../@depth"/>
7313
+ </xsl:when>
7314
+ <xsl:otherwise>
7315
+ <xsl:variable name="title_level_">
7316
+ <xsl:for-each select="../preceding-sibling::*[local-name() = 'title'][1]">
7317
+ <xsl:call-template name="getLevel"/>
7318
+ </xsl:for-each>
7319
+ </xsl:variable>
7320
+ <xsl:variable name="title_level" select="normalize-space($title_level_)"/>
7321
+ <xsl:choose>
7322
+ <xsl:when test="$title_level != ''"><xsl:value-of select="$title_level + 1"/></xsl:when>
7323
+ <xsl:otherwise>
7324
+ <xsl:call-template name="getLevel"/>
7325
+ </xsl:otherwise>
7326
+ </xsl:choose>
7327
+ </xsl:otherwise>
7328
+ </xsl:choose>
7028
7329
  </xsl:template><xsl:template name="split">
7029
7330
  <xsl:param name="pText" select="."/>
7030
7331
  <xsl:param name="sep" select="','"/>