metanorma-itu 2.2.15 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -34,17 +34,19 @@
34
34
  <xsl:variable name="contents_">
35
35
  <contents>
36
36
  <!-- <xsl:apply-templates select="/itu:itu-standard/itu:preface/node()" mode="contents"/> -->
37
- <xsl:apply-templates select="/itu:itu-standard/itu:sections/itu:clause[@type='scope']" mode="contents"/> <!-- @id = 'scope' -->
37
+ <!-- <xsl:apply-templates select="/itu:itu-standard/itu:sections/itu:clause[@type='scope']" mode="contents" /> -->
38
38
 
39
39
  <!-- Normative references -->
40
- <xsl:apply-templates select="/itu:itu-standard/itu:bibliography/itu:references[@normative='true']" mode="contents"/> <!-- @id = 'references' -->
41
-
42
- <xsl:apply-templates select="/itu:itu-standard/itu:sections/*[not(@type='scope')]" mode="contents"/> <!-- @id != 'scope' -->
43
-
44
- <xsl:apply-templates select="/itu:itu-standard/itu:annex" mode="contents"/>
40
+ <!-- <xsl:apply-templates select="/itu:itu-standard/itu:bibliography/itu:references[@normative='true']" mode="contents" />
41
+
42
+ <xsl:apply-templates select="/itu:itu-standard/itu:sections/*[not(@type='scope')]" mode="contents" />
43
+
44
+ <xsl:apply-templates select="/itu:itu-standard/itu:annex" mode="contents"/> -->
45
45
 
46
46
  <!-- Bibliography -->
47
- <xsl:apply-templates select="/itu:itu-standard/itu:bibliography/itu:references[not(@normative='true')]" mode="contents"/> <!-- @id = 'bibliography' -->
47
+ <!-- <xsl:apply-templates select="/itu:itu-standard/itu:bibliography/itu:references[not(@normative='true')]" mode="contents"/> -->
48
+
49
+ <xsl:call-template name="processMainSectionsDefault_Contents"/>
48
50
 
49
51
  <xsl:apply-templates select="//itu:table" mode="contents"/>
50
52
 
@@ -1069,16 +1071,16 @@
1069
1071
 
1070
1072
  <fo:flow flow-name="xsl-region-body">
1071
1073
 
1072
- <xsl:if test="$doctype != 'service-publication'">
1073
- <fo:block-container font-size="14pt">
1074
+ <!-- <xsl:if test="$doctype != 'service-publication' and 1 = 2">
1075
+ <fo:block-container font-size="14pt" >
1074
1076
  <xsl:choose>
1075
1077
  <xsl:when test="$doctype = 'resolution'">
1076
1078
  <fo:block text-align="center">
1077
1079
  <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:title[@type='resolution' and @language = $lang]"/>
1078
1080
  </fo:block>
1079
1081
  </xsl:when>
1080
- <xsl:when test="$doctype = 'implementers-guide'"/>
1081
- <xsl:when test="$doctype = 'recommendation-supplement'">
1082
+ <xsl:when test="$doctype = 'implementers-guide'"></xsl:when>
1083
+ <xsl:when test="$doctype = 'recommendation-supplement'">
1082
1084
  <fo:block font-weight="bold">
1083
1085
  <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:docidentifier[@type = 'ITU-Supplement-Internal']"/>
1084
1086
  </fo:block>
@@ -1086,30 +1088,30 @@
1086
1088
  <xsl:otherwise>
1087
1089
  <fo:block font-weight="bold">
1088
1090
  <xsl:value-of select="$doctypeTitle"/>
1089
- <xsl:text> </xsl:text>
1091
+ <xsl:text>&#xA0;</xsl:text>
1090
1092
  <xsl:value-of select="$docname"/>
1091
1093
  </fo:block>
1092
1094
  </xsl:otherwise>
1093
1095
  </xsl:choose>
1094
-
1096
+
1095
1097
  <fo:block font-weight="bold" text-align="center" margin-top="15pt" margin-bottom="15pt" role="H1">
1096
1098
  <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:title[@type = 'main' and @language = $lang]"/>
1097
-
1099
+
1098
1100
  <xsl:variable name="subtitle" select="/itu:itu-standard/itu:bibdata/itu:title[@type = 'subtitle' and @language = $lang]"/>
1099
1101
  <xsl:if test="$subtitle != ''">
1100
1102
  <fo:block margin-top="18pt" font-weight="normal" font-style="italic">
1101
- <xsl:if test="$lang = 'ar'"> <!-- to prevent rendering `###` due the missing Arabic glyphs in the italic font (Times New Roman) -->
1103
+ <xsl:if test="$lang = 'ar'">
1102
1104
  <xsl:attribute name="font-style">normal</xsl:attribute>
1103
1105
  </xsl:if>
1104
1106
  <xsl:value-of select="$subtitle"/>
1105
- </fo:block>
1107
+ </fo:block>
1106
1108
  </xsl:if>
1107
-
1109
+
1108
1110
  <xsl:variable name="resolution-placedate" select="/itu:itu-standard/itu:bibdata/itu:title[@type = 'resolution-placedate' and @language = $lang]"/>
1109
1111
  <xsl:if test="$doctype = 'resolution' and $resolution-placedate != ''">
1110
1112
  <fo:block font-size="11pt" margin-top="6pt" font-weight="normal">
1111
1113
  <fo:inline font-style="italic">
1112
- <xsl:if test="$lang = 'ar'"> <!-- to prevent rendering `###` due the missing Arabic glyphs in the italic font (Times New Roman) -->
1114
+ <xsl:if test="$lang = 'ar'">
1113
1115
  <xsl:attribute name="font-style">normal</xsl:attribute>
1114
1116
  </xsl:if>
1115
1117
  <xsl:text>(</xsl:text><xsl:value-of select="$resolution-placedate"/><xsl:text>)</xsl:text>
@@ -1119,22 +1121,25 @@
1119
1121
  </xsl:if>
1120
1122
  </fo:block>
1121
1123
  </fo:block-container>
1122
- </xsl:if>
1124
+ </xsl:if> -->
1123
1125
 
1124
1126
  <!-- Clause(s) -->
1125
1127
  <fo:block>
1126
1128
  <!-- Scope -->
1127
- <xsl:apply-templates select="/itu:itu-standard/itu:sections/itu:clause[@type='scope']"/> <!-- @id = 'scope' -->
1129
+ <!-- <xsl:apply-templates select="/itu:itu-standard/itu:sections/itu:clause[@type='scope']" /> -->
1128
1130
 
1129
1131
  <!-- Normative references -->
1130
- <xsl:apply-templates select="/itu:itu-standard/itu:bibliography/itu:references[@normative='true']"/> <!-- @id = 'references' -->
1132
+ <!-- <xsl:apply-templates select="/itu:itu-standard/itu:bibliography/itu:references[@normative='true']" />
1133
+
1134
+ <xsl:apply-templates select="/itu:itu-standard/itu:sections/*[not(@type='scope')]" />
1135
+
1136
+ <xsl:apply-templates select="/itu:itu-standard/itu:annex"/> -->
1131
1137
 
1132
- <xsl:apply-templates select="/itu:itu-standard/itu:sections/*[not(@type='scope')]"/> <!-- @id != 'scope' -->
1138
+ <!-- Bibliography -->
1139
+ <!-- <xsl:apply-templates select="/itu:itu-standard/itu:bibliography/itu:references[not(@normative='true')]"/> -->
1133
1140
 
1134
- <xsl:apply-templates select="/itu:itu-standard/itu:annex"/>
1141
+ <xsl:call-template name="processMainSectionsDefault"/>
1135
1142
 
1136
- <!-- Bibliography -->
1137
- <xsl:apply-templates select="/itu:itu-standard/itu:bibliography/itu:references[not(@normative='true')]"/> <!-- @id = 'bibliography' -->
1138
1143
  </fo:block>
1139
1144
 
1140
1145
  </fo:flow>
@@ -1286,6 +1291,37 @@
1286
1291
  </fo:block>
1287
1292
  </xsl:template>
1288
1293
 
1294
+ <xsl:template match="itu:clause[@type = 'keyword']" priority="4"/>
1295
+
1296
+ <xsl:template match="itu:sections/itu:p[@class = 'zzSTDTitle1']" priority="4">
1297
+ <fo:block font-size="14pt">
1298
+ <xsl:choose>
1299
+ <xsl:when test="$doctype = 'resolution'">
1300
+ <xsl:attribute name="text-align">center</xsl:attribute>
1301
+ </xsl:when>
1302
+ <xsl:otherwise>
1303
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1304
+ </xsl:otherwise>
1305
+ </xsl:choose>
1306
+ <xsl:apply-templates/>
1307
+ </fo:block>
1308
+ </xsl:template>
1309
+
1310
+ <xsl:template match="itu:sections/itu:p[@class = 'zzSTDTitle2']" priority="4">
1311
+ <fo:block font-size="14pt" font-weight="bold" text-align="center" margin-top="15pt" margin-bottom="15pt" role="H1">
1312
+ <xsl:if test="$lang = 'ar'"> <!-- to prevent rendering `###` due the missing Arabic glyphs in the italic font (Times New Roman) -->
1313
+ <xsl:attribute name="font-style">normal</xsl:attribute>
1314
+ </xsl:if>
1315
+ <!-- Example: <p align="center" class="zzSTDTitle2" displayorder="4"><em>(Hammamet, 2016</em>) -->
1316
+ <xsl:if test="@align = 'center'">
1317
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
1318
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
1319
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
1320
+ </xsl:if>
1321
+ <xsl:apply-templates/>
1322
+ </fo:block>
1323
+ </xsl:template>
1324
+
1289
1325
  <xsl:template match="node()">
1290
1326
  <xsl:apply-templates/>
1291
1327
  </xsl:template>
@@ -1740,25 +1776,25 @@
1740
1776
  </xsl:template> -->
1741
1777
 
1742
1778
  <!-- footnotes for title -->
1743
- <xsl:template match="itu:bibdata/itu:note[@type = 'title-footnote']" mode="title_footnote">
1779
+ <!-- <xsl:template match="itu:bibdata/itu:note[@type = 'title-footnote']" mode="title_footnote">
1744
1780
  <xsl:variable name="number" select="position()"/>
1745
1781
  <fo:footnote>
1746
1782
  <fo:inline font-size="60%" keep-with-previous.within-line="always" vertical-align="super">
1747
1783
  <fo:basic-link internal-destination="title_footnote_{$number}" fox:alt-text="titlefootnote {$number}">
1748
1784
  <xsl:value-of select="$number"/>
1749
1785
  </fo:basic-link>
1750
- <xsl:if test="position() != last()">,</xsl:if><!-- <fo:inline baseline-shift="20%">,</fo:inline> -->
1786
+ <xsl:if test="position() != last()">,</xsl:if>
1751
1787
  </fo:inline>
1752
1788
  <fo:footnote-body>
1753
1789
  <fo:block font-size="11pt" margin-bottom="12pt" text-align="justify">
1754
1790
  <fo:inline id="title_footnote_{$number}" font-size="85%" padding-right="2mm" keep-with-next.within-line="always" baseline-shift="30%">
1755
1791
  <xsl:value-of select="$number"/>
1756
1792
  </fo:inline>
1757
- <xsl:apply-templates/>
1793
+ <xsl:apply-templates />
1758
1794
  </fo:block>
1759
1795
  </fo:footnote-body>
1760
1796
  </fo:footnote>
1761
- </xsl:template>
1797
+ </xsl:template> -->
1762
1798
 
1763
1799
  <xsl:template match="*[local-name()='tt']" priority="2">
1764
1800
  <xsl:variable name="element-name">
@@ -6114,6 +6150,9 @@
6114
6150
  <!-- END Definition List -->
6115
6151
  <!-- ===================== -->
6116
6152
 
6153
+ <!-- default: ignore title in sections/p -->
6154
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]" priority="3"/>
6155
+
6117
6156
  <!-- ========================= -->
6118
6157
  <!-- Rich text formatting -->
6119
6158
  <!-- ========================= -->
@@ -8204,25 +8243,45 @@
8204
8243
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
8205
8244
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
8206
8245
 
8207
- <xsl:variable name="img_src">
8208
- <xsl:choose>
8209
- <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
8210
- <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
8211
- </xsl:choose>
8212
- </xsl:variable>
8246
+ <xsl:if test="@width != '' and @width != 'auto'">
8247
+ <xsl:attribute name="width">
8248
+ <xsl:value-of select="@width"/>
8249
+ </xsl:attribute>
8250
+ </xsl:if>
8251
+
8252
+ <xsl:if test="@height != '' and @height != 'auto'">
8253
+ <xsl:attribute name="height">
8254
+ <xsl:value-of select="@height"/>
8255
+ </xsl:attribute>
8256
+ </xsl:if>
8213
8257
 
8214
- <xsl:variable name="image_width_effective">
8258
+ <xsl:choose>
8259
+ <xsl:when test="@width != '' and @width != 'auto' and @height != '' and @height != 'auto'">
8260
+ <xsl:attribute name="scaling">non-uniform</xsl:attribute>
8261
+ </xsl:when>
8262
+ <xsl:otherwise>
8215
8263
 
8216
- <xsl:value-of select="$width_effective"/>
8264
+ <xsl:variable name="img_src">
8265
+ <xsl:choose>
8266
+ <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
8267
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
8268
+ </xsl:choose>
8269
+ </xsl:variable>
8217
8270
 
8218
- </xsl:variable>
8271
+ <xsl:variable name="image_width_effective">
8219
8272
 
8220
- <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
8221
- <xsl:if test="number($scale) &lt; 100">
8273
+ <xsl:value-of select="$width_effective"/>
8222
8274
 
8223
- <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
8275
+ </xsl:variable>
8224
8276
 
8225
- </xsl:if>
8277
+ <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
8278
+ <xsl:if test="number($scale) &lt; 100">
8279
+
8280
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
8281
+
8282
+ </xsl:if>
8283
+ </xsl:otherwise>
8284
+ </xsl:choose>
8226
8285
 
8227
8286
  </xsl:if>
8228
8287
 
@@ -11911,7 +11970,7 @@
11911
11970
  <xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
11912
11971
  <xsl:apply-templates mode="update_xml_step1"/>
11913
11972
  </xsl:template>
11914
- <xsl:template match="*[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
11973
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]/*[local-name() = 'span'][@class] | *[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
11915
11974
  <xsl:copy>
11916
11975
  <xsl:copy-of select="@*"/>
11917
11976
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -34,17 +34,19 @@
34
34
  <xsl:variable name="contents_">
35
35
  <contents>
36
36
  <!-- <xsl:apply-templates select="/itu:itu-standard/itu:preface/node()" mode="contents"/> -->
37
- <xsl:apply-templates select="/itu:itu-standard/itu:sections/itu:clause[@type='scope']" mode="contents"/> <!-- @id = 'scope' -->
37
+ <!-- <xsl:apply-templates select="/itu:itu-standard/itu:sections/itu:clause[@type='scope']" mode="contents" /> -->
38
38
 
39
39
  <!-- Normative references -->
40
- <xsl:apply-templates select="/itu:itu-standard/itu:bibliography/itu:references[@normative='true']" mode="contents"/> <!-- @id = 'references' -->
41
-
42
- <xsl:apply-templates select="/itu:itu-standard/itu:sections/*[not(@type='scope')]" mode="contents"/> <!-- @id != 'scope' -->
43
-
44
- <xsl:apply-templates select="/itu:itu-standard/itu:annex" mode="contents"/>
40
+ <!-- <xsl:apply-templates select="/itu:itu-standard/itu:bibliography/itu:references[@normative='true']" mode="contents" />
41
+
42
+ <xsl:apply-templates select="/itu:itu-standard/itu:sections/*[not(@type='scope')]" mode="contents" />
43
+
44
+ <xsl:apply-templates select="/itu:itu-standard/itu:annex" mode="contents"/> -->
45
45
 
46
46
  <!-- Bibliography -->
47
- <xsl:apply-templates select="/itu:itu-standard/itu:bibliography/itu:references[not(@normative='true')]" mode="contents"/> <!-- @id = 'bibliography' -->
47
+ <!-- <xsl:apply-templates select="/itu:itu-standard/itu:bibliography/itu:references[not(@normative='true')]" mode="contents"/> -->
48
+
49
+ <xsl:call-template name="processMainSectionsDefault_Contents"/>
48
50
 
49
51
  <xsl:apply-templates select="//itu:table" mode="contents"/>
50
52
 
@@ -1069,16 +1071,16 @@
1069
1071
 
1070
1072
  <fo:flow flow-name="xsl-region-body">
1071
1073
 
1072
- <xsl:if test="$doctype != 'service-publication'">
1073
- <fo:block-container font-size="14pt">
1074
+ <!-- <xsl:if test="$doctype != 'service-publication' and 1 = 2">
1075
+ <fo:block-container font-size="14pt" >
1074
1076
  <xsl:choose>
1075
1077
  <xsl:when test="$doctype = 'resolution'">
1076
1078
  <fo:block text-align="center">
1077
1079
  <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:title[@type='resolution' and @language = $lang]"/>
1078
1080
  </fo:block>
1079
1081
  </xsl:when>
1080
- <xsl:when test="$doctype = 'implementers-guide'"/>
1081
- <xsl:when test="$doctype = 'recommendation-supplement'">
1082
+ <xsl:when test="$doctype = 'implementers-guide'"></xsl:when>
1083
+ <xsl:when test="$doctype = 'recommendation-supplement'">
1082
1084
  <fo:block font-weight="bold">
1083
1085
  <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:docidentifier[@type = 'ITU-Supplement-Internal']"/>
1084
1086
  </fo:block>
@@ -1086,30 +1088,30 @@
1086
1088
  <xsl:otherwise>
1087
1089
  <fo:block font-weight="bold">
1088
1090
  <xsl:value-of select="$doctypeTitle"/>
1089
- <xsl:text> </xsl:text>
1091
+ <xsl:text>&#xA0;</xsl:text>
1090
1092
  <xsl:value-of select="$docname"/>
1091
1093
  </fo:block>
1092
1094
  </xsl:otherwise>
1093
1095
  </xsl:choose>
1094
-
1096
+
1095
1097
  <fo:block font-weight="bold" text-align="center" margin-top="15pt" margin-bottom="15pt" role="H1">
1096
1098
  <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:title[@type = 'main' and @language = $lang]"/>
1097
-
1099
+
1098
1100
  <xsl:variable name="subtitle" select="/itu:itu-standard/itu:bibdata/itu:title[@type = 'subtitle' and @language = $lang]"/>
1099
1101
  <xsl:if test="$subtitle != ''">
1100
1102
  <fo:block margin-top="18pt" font-weight="normal" font-style="italic">
1101
- <xsl:if test="$lang = 'ar'"> <!-- to prevent rendering `###` due the missing Arabic glyphs in the italic font (Times New Roman) -->
1103
+ <xsl:if test="$lang = 'ar'">
1102
1104
  <xsl:attribute name="font-style">normal</xsl:attribute>
1103
1105
  </xsl:if>
1104
1106
  <xsl:value-of select="$subtitle"/>
1105
- </fo:block>
1107
+ </fo:block>
1106
1108
  </xsl:if>
1107
-
1109
+
1108
1110
  <xsl:variable name="resolution-placedate" select="/itu:itu-standard/itu:bibdata/itu:title[@type = 'resolution-placedate' and @language = $lang]"/>
1109
1111
  <xsl:if test="$doctype = 'resolution' and $resolution-placedate != ''">
1110
1112
  <fo:block font-size="11pt" margin-top="6pt" font-weight="normal">
1111
1113
  <fo:inline font-style="italic">
1112
- <xsl:if test="$lang = 'ar'"> <!-- to prevent rendering `###` due the missing Arabic glyphs in the italic font (Times New Roman) -->
1114
+ <xsl:if test="$lang = 'ar'">
1113
1115
  <xsl:attribute name="font-style">normal</xsl:attribute>
1114
1116
  </xsl:if>
1115
1117
  <xsl:text>(</xsl:text><xsl:value-of select="$resolution-placedate"/><xsl:text>)</xsl:text>
@@ -1119,22 +1121,25 @@
1119
1121
  </xsl:if>
1120
1122
  </fo:block>
1121
1123
  </fo:block-container>
1122
- </xsl:if>
1124
+ </xsl:if> -->
1123
1125
 
1124
1126
  <!-- Clause(s) -->
1125
1127
  <fo:block>
1126
1128
  <!-- Scope -->
1127
- <xsl:apply-templates select="/itu:itu-standard/itu:sections/itu:clause[@type='scope']"/> <!-- @id = 'scope' -->
1129
+ <!-- <xsl:apply-templates select="/itu:itu-standard/itu:sections/itu:clause[@type='scope']" /> -->
1128
1130
 
1129
1131
  <!-- Normative references -->
1130
- <xsl:apply-templates select="/itu:itu-standard/itu:bibliography/itu:references[@normative='true']"/> <!-- @id = 'references' -->
1132
+ <!-- <xsl:apply-templates select="/itu:itu-standard/itu:bibliography/itu:references[@normative='true']" />
1133
+
1134
+ <xsl:apply-templates select="/itu:itu-standard/itu:sections/*[not(@type='scope')]" />
1135
+
1136
+ <xsl:apply-templates select="/itu:itu-standard/itu:annex"/> -->
1131
1137
 
1132
- <xsl:apply-templates select="/itu:itu-standard/itu:sections/*[not(@type='scope')]"/> <!-- @id != 'scope' -->
1138
+ <!-- Bibliography -->
1139
+ <!-- <xsl:apply-templates select="/itu:itu-standard/itu:bibliography/itu:references[not(@normative='true')]"/> -->
1133
1140
 
1134
- <xsl:apply-templates select="/itu:itu-standard/itu:annex"/>
1141
+ <xsl:call-template name="processMainSectionsDefault"/>
1135
1142
 
1136
- <!-- Bibliography -->
1137
- <xsl:apply-templates select="/itu:itu-standard/itu:bibliography/itu:references[not(@normative='true')]"/> <!-- @id = 'bibliography' -->
1138
1143
  </fo:block>
1139
1144
 
1140
1145
  </fo:flow>
@@ -1286,6 +1291,37 @@
1286
1291
  </fo:block>
1287
1292
  </xsl:template>
1288
1293
 
1294
+ <xsl:template match="itu:clause[@type = 'keyword']" priority="4"/>
1295
+
1296
+ <xsl:template match="itu:sections/itu:p[@class = 'zzSTDTitle1']" priority="4">
1297
+ <fo:block font-size="14pt">
1298
+ <xsl:choose>
1299
+ <xsl:when test="$doctype = 'resolution'">
1300
+ <xsl:attribute name="text-align">center</xsl:attribute>
1301
+ </xsl:when>
1302
+ <xsl:otherwise>
1303
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1304
+ </xsl:otherwise>
1305
+ </xsl:choose>
1306
+ <xsl:apply-templates/>
1307
+ </fo:block>
1308
+ </xsl:template>
1309
+
1310
+ <xsl:template match="itu:sections/itu:p[@class = 'zzSTDTitle2']" priority="4">
1311
+ <fo:block font-size="14pt" font-weight="bold" text-align="center" margin-top="15pt" margin-bottom="15pt" role="H1">
1312
+ <xsl:if test="$lang = 'ar'"> <!-- to prevent rendering `###` due the missing Arabic glyphs in the italic font (Times New Roman) -->
1313
+ <xsl:attribute name="font-style">normal</xsl:attribute>
1314
+ </xsl:if>
1315
+ <!-- Example: <p align="center" class="zzSTDTitle2" displayorder="4"><em>(Hammamet, 2016</em>) -->
1316
+ <xsl:if test="@align = 'center'">
1317
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
1318
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
1319
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
1320
+ </xsl:if>
1321
+ <xsl:apply-templates/>
1322
+ </fo:block>
1323
+ </xsl:template>
1324
+
1289
1325
  <xsl:template match="node()">
1290
1326
  <xsl:apply-templates/>
1291
1327
  </xsl:template>
@@ -1740,25 +1776,25 @@
1740
1776
  </xsl:template> -->
1741
1777
 
1742
1778
  <!-- footnotes for title -->
1743
- <xsl:template match="itu:bibdata/itu:note[@type = 'title-footnote']" mode="title_footnote">
1779
+ <!-- <xsl:template match="itu:bibdata/itu:note[@type = 'title-footnote']" mode="title_footnote">
1744
1780
  <xsl:variable name="number" select="position()"/>
1745
1781
  <fo:footnote>
1746
1782
  <fo:inline font-size="60%" keep-with-previous.within-line="always" vertical-align="super">
1747
1783
  <fo:basic-link internal-destination="title_footnote_{$number}" fox:alt-text="titlefootnote {$number}">
1748
1784
  <xsl:value-of select="$number"/>
1749
1785
  </fo:basic-link>
1750
- <xsl:if test="position() != last()">,</xsl:if><!-- <fo:inline baseline-shift="20%">,</fo:inline> -->
1786
+ <xsl:if test="position() != last()">,</xsl:if>
1751
1787
  </fo:inline>
1752
1788
  <fo:footnote-body>
1753
1789
  <fo:block font-size="11pt" margin-bottom="12pt" text-align="justify">
1754
1790
  <fo:inline id="title_footnote_{$number}" font-size="85%" padding-right="2mm" keep-with-next.within-line="always" baseline-shift="30%">
1755
1791
  <xsl:value-of select="$number"/>
1756
1792
  </fo:inline>
1757
- <xsl:apply-templates/>
1793
+ <xsl:apply-templates />
1758
1794
  </fo:block>
1759
1795
  </fo:footnote-body>
1760
1796
  </fo:footnote>
1761
- </xsl:template>
1797
+ </xsl:template> -->
1762
1798
 
1763
1799
  <xsl:template match="*[local-name()='tt']" priority="2">
1764
1800
  <xsl:variable name="element-name">
@@ -6114,6 +6150,9 @@
6114
6150
  <!-- END Definition List -->
6115
6151
  <!-- ===================== -->
6116
6152
 
6153
+ <!-- default: ignore title in sections/p -->
6154
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]" priority="3"/>
6155
+
6117
6156
  <!-- ========================= -->
6118
6157
  <!-- Rich text formatting -->
6119
6158
  <!-- ========================= -->
@@ -8204,25 +8243,45 @@
8204
8243
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
8205
8244
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
8206
8245
 
8207
- <xsl:variable name="img_src">
8208
- <xsl:choose>
8209
- <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
8210
- <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
8211
- </xsl:choose>
8212
- </xsl:variable>
8246
+ <xsl:if test="@width != '' and @width != 'auto'">
8247
+ <xsl:attribute name="width">
8248
+ <xsl:value-of select="@width"/>
8249
+ </xsl:attribute>
8250
+ </xsl:if>
8251
+
8252
+ <xsl:if test="@height != '' and @height != 'auto'">
8253
+ <xsl:attribute name="height">
8254
+ <xsl:value-of select="@height"/>
8255
+ </xsl:attribute>
8256
+ </xsl:if>
8213
8257
 
8214
- <xsl:variable name="image_width_effective">
8258
+ <xsl:choose>
8259
+ <xsl:when test="@width != '' and @width != 'auto' and @height != '' and @height != 'auto'">
8260
+ <xsl:attribute name="scaling">non-uniform</xsl:attribute>
8261
+ </xsl:when>
8262
+ <xsl:otherwise>
8215
8263
 
8216
- <xsl:value-of select="$width_effective"/>
8264
+ <xsl:variable name="img_src">
8265
+ <xsl:choose>
8266
+ <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
8267
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
8268
+ </xsl:choose>
8269
+ </xsl:variable>
8217
8270
 
8218
- </xsl:variable>
8271
+ <xsl:variable name="image_width_effective">
8219
8272
 
8220
- <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
8221
- <xsl:if test="number($scale) &lt; 100">
8273
+ <xsl:value-of select="$width_effective"/>
8222
8274
 
8223
- <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
8275
+ </xsl:variable>
8224
8276
 
8225
- </xsl:if>
8277
+ <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
8278
+ <xsl:if test="number($scale) &lt; 100">
8279
+
8280
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
8281
+
8282
+ </xsl:if>
8283
+ </xsl:otherwise>
8284
+ </xsl:choose>
8226
8285
 
8227
8286
  </xsl:if>
8228
8287
 
@@ -11911,7 +11970,7 @@
11911
11970
  <xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
11912
11971
  <xsl:apply-templates mode="update_xml_step1"/>
11913
11972
  </xsl:template>
11914
- <xsl:template match="*[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
11973
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]/*[local-name() = 'span'][@class] | *[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
11915
11974
  <xsl:copy>
11916
11975
  <xsl:copy-of select="@*"/>
11917
11976
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -40,7 +40,7 @@ module IsoDoc
40
40
 
41
41
  def bibdata_title_service_population(bib)
42
42
  date = bib&.at(ns("./date[@type = 'published']"))&.text or return
43
- text = l10n(@i18n.get["position_on"].sub(/%/, ddmmmmyyyy(date)))
43
+ text = l10n(@i18n.get["position_on"].sub("%", ddmmmmyyyy(date)))
44
44
  ins = bib.at(ns("./title"))
45
45
  ins.next = <<~INS
46
46
  <title language="#{@lang}" format="text/plain" type="position-sp">#{text}</title>
@@ -0,0 +1,78 @@
1
+ module IsoDoc
2
+ module ITU
3
+ class PresentationXMLConvert < IsoDoc::PresentationXMLConvert
4
+ def insert_preface_sections(docxml)
5
+ x = insert_editors_clause(docxml) and
6
+ editors_insert_pt(docxml).next = x
7
+ end
8
+
9
+ def editors_insert_pt(docxml)
10
+ docxml.at(ns("//preface")) || docxml.at(ns("//sections"))
11
+ .add_previous_sibling("<preface> </preface>").first
12
+ ins = docxml.at(ns("//preface/acknolwedgements")) and return ins
13
+ docxml.at(ns("//preface")).children[-1]
14
+ end
15
+
16
+ def insert_editors_clause(doc)
17
+ ret = extract_editors(doc) or return
18
+ eds = ret[:names].each_with_object([]).with_index do |(_x, acc), i|
19
+ acc << { name: ret[:names][i], affiliation: ret[:affiliations][i],
20
+ email: ret[:emails][i] }
21
+ end
22
+ editors_clause(eds)
23
+ end
24
+
25
+ def extract_editors(doc)
26
+ e = doc.xpath(ns("//bibdata/contributor[role/@type = 'editor']/person"))
27
+ e.empty? and return
28
+ { names: @meta.extract_person_names(e),
29
+ affiliations: @meta.extract_person_affiliations(e),
30
+ emails: e.reduce([]) { |ret, p| ret << p.at(ns("./email"))&.text } }
31
+ end
32
+
33
+ def editors_clause(eds)
34
+ ed_lbl = @i18n.inflect(@i18n.get["editor_full"],
35
+ number: eds.size > 1 ? "pl" : "sg")
36
+ ed_lbl &&= l10n("#{ed_lbl.capitalize}:")
37
+ mail_lbl = l10n("#{@i18n.get['email']}: ")
38
+ ret = <<~SUBMITTING
39
+ <clause id="_#{UUIDTools::UUID.random_create}" type="editors">
40
+ <table id="_#{UUIDTools::UUID.random_create}" unnumbered="true"><tbody>
41
+ SUBMITTING
42
+ ret += editor_table_entries(eds, ed_lbl, mail_lbl)
43
+ "#{ret}</tbody></table></clause>"
44
+ end
45
+
46
+ def editor_table_entries(eds, ed_lbl, mail_lbl)
47
+ eds.each_with_index.with_object([]) do |(n, i), m|
48
+ mail = ""
49
+ n[:email] and
50
+ mail = "#{mail_lbl}<link target='mailto:#{n[:email]}'>" \
51
+ "#{n[:email]}</link>"
52
+ aff = n[:affiliation].empty? ? "" : "<br/>#{n[:affiliation]}"
53
+ th = "<th>#{i.zero? ? ed_lbl : ''}</th>"
54
+ m << "<tr>#{th}<td>#{n[:name]}#{aff}</td><td>#{mail}</td></tr>"
55
+ end.join("\n")
56
+ end
57
+
58
+ def rearrange_clauses(docxml)
59
+ super
60
+ k = keywords(docxml) or return
61
+ if a = docxml.at(ns("//preface/abstract"))
62
+ a.next = k
63
+ elsif a = docxml.at(ns("//preface"))
64
+ a.children.first.previous = k
65
+ end
66
+ end
67
+
68
+ def keywords(_docxml)
69
+ kw = @meta.get[:keywords]
70
+ kw.nil? || kw.empty? and return
71
+ "<clause type='keyword'><title>#{@i18n.keywords}</title>" \
72
+ "<p>#{kw.join(', ')}.</p>"
73
+ end
74
+
75
+ include Init
76
+ end
77
+ end
78
+ end