metanorma-iec 2.2.8 → 2.2.9
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.
- checksums.yaml +4 -4
- data/lib/isodoc/iec/base_convert.rb +14 -20
- data/lib/isodoc/iec/html/html_iec_intro.html +0 -1
- data/lib/isodoc/iec/html/word_iec_intro.html +0 -3
- data/lib/isodoc/iec/iec.international-standard.xsl +385 -180
- data/lib/isodoc/iec/presentation_xml_convert.rb +59 -11
- data/lib/isodoc/iec/word_convert.rb +21 -17
- data/lib/metanorma/iec/iec.rng +6 -9
- data/lib/metanorma/iec/isodoc.rng +12 -7
- data/lib/metanorma/iec/isostandard.rng +5 -8
- data/lib/metanorma/iec/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 582be39d0a34200cdd7f77519d2366e23bfa3c07bb5e9c23ffb5dae558f5796b
|
4
|
+
data.tar.gz: c5d650ca2ccab49fd4719ff61f52781fe21f0f530d564412a3b08ac7a747baba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c97a5a76d0bfb9986ccb5bdc05d81464dbb807fd4a3cbf717438b92ae774893b9bc27e05fabde23a7461ef042a01a8767a422ed91bd913925ef74d45978fd41
|
7
|
+
data.tar.gz: dcd178a0bcc682a0ab14b02bb29b8c031bc75983f5f799786dbfc9a238e842f7678527e39e040f82c284a22bf4ec82a2226cbce0c3d33a0df503b113ec75b064
|
@@ -8,32 +8,13 @@ module IsoDoc
|
|
8
8
|
# processed in foreword instead
|
9
9
|
end
|
10
10
|
|
11
|
-
def foreword(
|
12
|
-
f = isoxml.at(ns("//foreword"))
|
13
|
-
b = isoxml.at(ns("//boilerplate/legal-statement"))
|
14
|
-
page_break(out)
|
15
|
-
iec_orgname(out)
|
16
|
-
middle_title(isoxml, out)
|
17
|
-
foreword1(f, b, out)
|
18
|
-
end
|
19
|
-
|
20
|
-
def foreword1(sect, boilerplate, out)
|
11
|
+
def foreword(sect, out)
|
21
12
|
out.div **attr_code(id: sect ? sect["id"] : "") do |s|
|
22
13
|
s.h1(class: "ForewordTitle") { |h1| h1 << @i18n.foreword }
|
23
|
-
@meta.get[:doctype] == "Amendment" or
|
24
|
-
s.div **attr_code(class: "boilerplate_legal") do |s1|
|
25
|
-
boilerplate&.elements&.each { |e| parse(e, s1) }
|
26
|
-
end
|
27
14
|
sect&.elements&.each { |e| parse(e, s) unless e.name == "title" }
|
28
15
|
end
|
29
16
|
end
|
30
17
|
|
31
|
-
def iec_orgname(out)
|
32
|
-
out.p(class: "zzSTDTitle1") { |p| p << @i18n.get["IEC"] }
|
33
|
-
out.p(class: "zzSTDTitle1") { |p| p << "____________" }
|
34
|
-
out.p(class: "zzSTDTitle1") { |p| p << " " }
|
35
|
-
end
|
36
|
-
|
37
18
|
def middle_title(_isoxml, out)
|
38
19
|
title1, title2 = middle_title_parts(out)
|
39
20
|
out.p(class: "zzSTDTitle1") do |p|
|
@@ -94,6 +75,19 @@ module IsoDoc
|
|
94
75
|
def set_termdomain(termdomain)
|
95
76
|
return super unless @is_iev
|
96
77
|
end
|
78
|
+
|
79
|
+
def para_class(node)
|
80
|
+
case node["class"]
|
81
|
+
when "zzSTDTitle1", "zzSTDTitle2" then "zzSTDTitle1"
|
82
|
+
else super
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
def clause_attrs(node)
|
87
|
+
ret = super
|
88
|
+
node["type"] == "boilerplate_legal" and ret["class"] = "boilerplate_legal"
|
89
|
+
ret
|
90
|
+
end
|
97
91
|
end
|
98
92
|
end
|
99
93
|
end
|
@@ -452,10 +452,10 @@
|
|
452
452
|
</fo:block>
|
453
453
|
<fo:block-container margin-left="1.5mm">
|
454
454
|
<fo:block-container margin-left="0mm">
|
455
|
-
<fo:block-container border="0.5pt solid black" font-size="10pt" margin-top="8mm" font-weight="bold" padding-left="1.5mm" padding-top="0.5mm" width="102%" height="11mm" display-align="center">
|
456
|
-
<fo:block margin-left="
|
455
|
+
<fo:block-container border="0.5pt solid black" font-size="10pt" margin-top="8mm" font-weight="bold" padding-left="1.5mm" padding-top="0.5mm" width="102%" height="11mm" display-align="center" id="__internal_layout__warning_block">
|
456
|
+
<fo:block margin-left="1mm">Warning! Make sure that you obtained this publication from an authorized distributor.</fo:block>
|
457
457
|
<xsl:if test="//iec:iec-standard/iec:bibdata/iec:title[@language = 'fr']">
|
458
|
-
<fo:block margin-left="
|
458
|
+
<fo:block margin-left="1mm" margin-top="3pt">Attention! Veuillez vous assurer que vous avez obtenu cette publication via un distributeur agréé.</fo:block>
|
459
459
|
</xsl:if>
|
460
460
|
</fo:block-container>
|
461
461
|
</fo:block-container>
|
@@ -869,9 +869,9 @@
|
|
869
869
|
|
870
870
|
<xsl:for-each select="xalan:nodeset($current_document)">
|
871
871
|
|
872
|
-
<xsl:variable name="docid">
|
872
|
+
<!-- <xsl:variable name="docid">
|
873
873
|
<xsl:call-template name="getDocumentId"/>
|
874
|
-
</xsl:variable>
|
874
|
+
</xsl:variable> -->
|
875
875
|
|
876
876
|
<fo:page-sequence master-reference="document" format="1" force-page-count="no-force"> <!-- initial-page-number="2" -->
|
877
877
|
|
@@ -883,17 +883,22 @@
|
|
883
883
|
</xsl:if>
|
884
884
|
|
885
885
|
<xsl:call-template name="insertHeaderFooter"/>
|
886
|
-
|
886
|
+
<fo:flow flow-name="xsl-region-body">
|
887
|
+
|
888
|
+
<xsl:call-template name="processPrefaceSectionsDefault"/>
|
887
889
|
|
890
|
+
<!--
|
888
891
|
<xsl:call-template name="insertTOCpages">
|
889
892
|
<xsl:with-param name="contents" select="$contents/doc[@id = $docid]"/>
|
890
893
|
</xsl:call-template>
|
891
|
-
|
894
|
+
|
892
895
|
<xsl:call-template name="insertPrefacepages">
|
893
896
|
<xsl:with-param name="lang" select="$lang"/>
|
894
897
|
</xsl:call-template>
|
898
|
+
-->
|
895
899
|
|
896
|
-
|
900
|
+
<fo:block/> <!-- for prevent empty preface -->
|
901
|
+
</fo:flow>
|
897
902
|
</fo:page-sequence>
|
898
903
|
|
899
904
|
<xsl:call-template name="insertBodypages">
|
@@ -1191,7 +1196,7 @@
|
|
1191
1196
|
|
1192
1197
|
<xsl:template name="insertTOCpages">
|
1193
1198
|
<xsl:param name="contents"/>
|
1194
|
-
<fo:block-container>
|
1199
|
+
<!-- <fo:block-container>
|
1195
1200
|
<fo:block role="TOC">
|
1196
1201
|
<fo:block font-size="12pt" text-align="center" margin-bottom="22pt" role="H1">
|
1197
1202
|
<xsl:variable name="title-toc">
|
@@ -1202,90 +1207,90 @@
|
|
1202
1207
|
<xsl:call-template name="addLetterSpacing">
|
1203
1208
|
<xsl:with-param name="text" select="java:toUpperCase(java:java.lang.String.new($title-toc))"/>
|
1204
1209
|
</xsl:call-template>
|
1205
|
-
</fo:block>
|
1206
|
-
|
1207
|
-
|
1208
|
-
|
1209
|
-
|
1210
|
-
|
1211
|
-
|
1212
|
-
|
1213
|
-
</xsl:if>
|
1214
|
-
<xsl:if test="@level = 2">
|
1215
|
-
<xsl:attribute name="margin-bottom">3pt</xsl:attribute>
|
1216
|
-
</xsl:if>
|
1217
|
-
<xsl:if test="@level >= 3">
|
1218
|
-
<xsl:attribute name="margin-bottom">2pt</xsl:attribute>
|
1219
|
-
</xsl:if>
|
1220
|
-
<xsl:if test="@type = 'indexsect'">
|
1221
|
-
<xsl:attribute name="space-before">16pt</xsl:attribute>
|
1222
|
-
</xsl:if>
|
1223
|
-
<xsl:if test="@type = 'references'">
|
1224
|
-
<xsl:attribute name="space-before">5pt</xsl:attribute>
|
1225
|
-
</xsl:if>
|
1226
|
-
|
1227
|
-
<fo:list-block>
|
1228
|
-
<xsl:attribute name="margin-left">
|
1229
|
-
<xsl:choose>
|
1230
|
-
<xsl:when test="title/@variant-title = 'true'">0mm</xsl:when>
|
1231
|
-
<xsl:when test="@level = 2">8mm</xsl:when>
|
1232
|
-
<xsl:when test="@level >= 3"><xsl:value-of select="(@level - 2) * 23"/>mm</xsl:when>
|
1233
|
-
<xsl:otherwise>0mm</xsl:otherwise>
|
1234
|
-
</xsl:choose>
|
1235
|
-
</xsl:attribute>
|
1236
|
-
<xsl:attribute name="provisional-distance-between-starts">
|
1237
|
-
<xsl:choose>
|
1238
|
-
<xsl:when test="@section = ''">0mm</xsl:when>
|
1239
|
-
<xsl:when test="@level = 1">8mm</xsl:when>
|
1240
|
-
<xsl:when test="@level = 2">15mm</xsl:when>
|
1241
|
-
<xsl:when test="@level >= 3"><xsl:value-of select="(@level - 2) * 19"/>mm</xsl:when>
|
1242
|
-
<xsl:otherwise>0mm</xsl:otherwise>
|
1243
|
-
</xsl:choose>
|
1244
|
-
</xsl:attribute>
|
1245
|
-
<fo:list-item>
|
1246
|
-
<fo:list-item-label end-indent="label-end()">
|
1247
|
-
<fo:block>
|
1248
|
-
<xsl:value-of select="@section"/>
|
1249
|
-
</fo:block>
|
1250
|
-
</fo:list-item-label>
|
1251
|
-
<fo:list-item-body start-indent="body-start()">
|
1252
|
-
<fo:block text-align-last="justify">
|
1253
|
-
<fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
|
1254
|
-
<xsl:variable name="title">
|
1255
|
-
<xsl:apply-templates select="title"/>
|
1256
|
-
</xsl:variable>
|
1257
|
-
<xsl:call-template name="addLetterSpacing">
|
1258
|
-
<xsl:with-param name="text" select="$title"/>
|
1259
|
-
</xsl:call-template>
|
1260
|
-
<xsl:text> </xsl:text>
|
1261
|
-
<fo:inline keep-together.within-line="always">
|
1262
|
-
<fo:leader leader-pattern="dots"/>
|
1263
|
-
<fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
|
1264
|
-
</fo:inline>
|
1265
|
-
</fo:basic-link>
|
1266
|
-
</fo:block>
|
1267
|
-
</fo:list-item-body>
|
1268
|
-
</fo:list-item>
|
1269
|
-
</fo:list-block>
|
1270
|
-
</fo:block>
|
1271
|
-
</xsl:for-each>
|
1272
|
-
|
1273
|
-
<xsl:if test="$contents//figures/figure">
|
1274
|
-
<fo:block margin-bottom="5pt"> </fo:block>
|
1275
|
-
<xsl:for-each select="$contents//figures/figure">
|
1276
|
-
<xsl:call-template name="insertListOf_Item"/>
|
1277
|
-
</xsl:for-each>
|
1210
|
+
</fo:block> -->
|
1211
|
+
|
1212
|
+
<xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']"><!-- [@display = 'true']
|
1213
|
+
[@level <= 3]
|
1214
|
+
[not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
|
1215
|
+
<fo:block text-align-last="justify" role="TOCI">
|
1216
|
+
<xsl:if test="@level = 1">
|
1217
|
+
<xsl:attribute name="margin-bottom">5pt</xsl:attribute>
|
1278
1218
|
</xsl:if>
|
1279
|
-
|
1280
|
-
|
1281
|
-
|
1282
|
-
|
1283
|
-
|
1284
|
-
|
1219
|
+
<xsl:if test="@level = 2">
|
1220
|
+
<xsl:attribute name="margin-bottom">3pt</xsl:attribute>
|
1221
|
+
</xsl:if>
|
1222
|
+
<xsl:if test="@level >= 3">
|
1223
|
+
<xsl:attribute name="margin-bottom">2pt</xsl:attribute>
|
1224
|
+
</xsl:if>
|
1225
|
+
<xsl:if test="@type = 'indexsect'">
|
1226
|
+
<xsl:attribute name="space-before">16pt</xsl:attribute>
|
1227
|
+
</xsl:if>
|
1228
|
+
<xsl:if test="@type = 'references'">
|
1229
|
+
<xsl:attribute name="space-before">5pt</xsl:attribute>
|
1285
1230
|
</xsl:if>
|
1286
1231
|
|
1232
|
+
<fo:list-block>
|
1233
|
+
<xsl:attribute name="margin-left">
|
1234
|
+
<xsl:choose>
|
1235
|
+
<xsl:when test="title/@variant-title = 'true'">0mm</xsl:when>
|
1236
|
+
<xsl:when test="@level = 2">8mm</xsl:when>
|
1237
|
+
<xsl:when test="@level >= 3"><xsl:value-of select="(@level - 2) * 23"/>mm</xsl:when>
|
1238
|
+
<xsl:otherwise>0mm</xsl:otherwise>
|
1239
|
+
</xsl:choose>
|
1240
|
+
</xsl:attribute>
|
1241
|
+
<xsl:attribute name="provisional-distance-between-starts">
|
1242
|
+
<xsl:choose>
|
1243
|
+
<xsl:when test="@section = ''">0mm</xsl:when>
|
1244
|
+
<xsl:when test="@level = 1">8mm</xsl:when>
|
1245
|
+
<xsl:when test="@level = 2">15mm</xsl:when>
|
1246
|
+
<xsl:when test="@level >= 3"><xsl:value-of select="(@level - 2) * 19"/>mm</xsl:when>
|
1247
|
+
<xsl:otherwise>0mm</xsl:otherwise>
|
1248
|
+
</xsl:choose>
|
1249
|
+
</xsl:attribute>
|
1250
|
+
<fo:list-item>
|
1251
|
+
<fo:list-item-label end-indent="label-end()">
|
1252
|
+
<fo:block>
|
1253
|
+
<xsl:value-of select="@section"/>
|
1254
|
+
</fo:block>
|
1255
|
+
</fo:list-item-label>
|
1256
|
+
<fo:list-item-body start-indent="body-start()">
|
1257
|
+
<fo:block text-align-last="justify">
|
1258
|
+
<fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
|
1259
|
+
<xsl:variable name="title">
|
1260
|
+
<xsl:apply-templates select="title"/>
|
1261
|
+
</xsl:variable>
|
1262
|
+
<xsl:call-template name="addLetterSpacing">
|
1263
|
+
<xsl:with-param name="text" select="$title"/>
|
1264
|
+
</xsl:call-template>
|
1265
|
+
<xsl:text> </xsl:text>
|
1266
|
+
<fo:inline keep-together.within-line="always">
|
1267
|
+
<fo:leader leader-pattern="dots"/>
|
1268
|
+
<fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
|
1269
|
+
</fo:inline>
|
1270
|
+
</fo:basic-link>
|
1271
|
+
</fo:block>
|
1272
|
+
</fo:list-item-body>
|
1273
|
+
</fo:list-item>
|
1274
|
+
</fo:list-block>
|
1287
1275
|
</fo:block>
|
1288
|
-
</
|
1276
|
+
</xsl:for-each>
|
1277
|
+
|
1278
|
+
<xsl:if test="$contents//figures/figure">
|
1279
|
+
<fo:block margin-bottom="5pt"> </fo:block>
|
1280
|
+
<xsl:for-each select="$contents//figures/figure">
|
1281
|
+
<xsl:call-template name="insertListOf_Item"/>
|
1282
|
+
</xsl:for-each>
|
1283
|
+
</xsl:if>
|
1284
|
+
|
1285
|
+
<xsl:if test="$contents//tables/table">
|
1286
|
+
<fo:block margin-bottom="5pt"> </fo:block>
|
1287
|
+
<xsl:for-each select="$contents//tables/table">
|
1288
|
+
<xsl:call-template name="insertListOf_Item"/>
|
1289
|
+
</xsl:for-each>
|
1290
|
+
</xsl:if>
|
1291
|
+
|
1292
|
+
<!-- </fo:block>
|
1293
|
+
</fo:block-container> -->
|
1289
1294
|
</xsl:template>
|
1290
1295
|
|
1291
1296
|
<xsl:template name="insertListOf_Item">
|
@@ -1300,6 +1305,49 @@
|
|
1300
1305
|
</fo:block>
|
1301
1306
|
</xsl:template>
|
1302
1307
|
|
1308
|
+
<xsl:template match="iec:preface/iec:clause[@type = 'toc']" priority="3">
|
1309
|
+
<fo:block-container>
|
1310
|
+
<fo:block role="TOC">
|
1311
|
+
<xsl:apply-templates/>
|
1312
|
+
|
1313
|
+
<xsl:if test="count(*) = 1 and *[local-name() = 'title']"> <!-- if there isn't user ToC -->
|
1314
|
+
<xsl:variable name="docid">
|
1315
|
+
<xsl:call-template name="getDocumentId"/>
|
1316
|
+
</xsl:variable>
|
1317
|
+
<xsl:call-template name="insertTOCpages">
|
1318
|
+
<xsl:with-param name="contents" select="$contents/doc[@id = $docid]"/>
|
1319
|
+
</xsl:call-template>
|
1320
|
+
</xsl:if>
|
1321
|
+
</fo:block>
|
1322
|
+
</fo:block-container>
|
1323
|
+
</xsl:template>
|
1324
|
+
|
1325
|
+
<xsl:template match="iec:preface/iec:clause[@type = 'toc']/iec:title" priority="3">
|
1326
|
+
<fo:block font-size="12pt" text-align="center" margin-bottom="22pt" role="H1">
|
1327
|
+
<xsl:call-template name="addLetterSpacing">
|
1328
|
+
<xsl:with-param name="text" select="java:toUpperCase(java:java.lang.String.new(.))"/>
|
1329
|
+
</xsl:call-template>
|
1330
|
+
</fo:block>
|
1331
|
+
</xsl:template>
|
1332
|
+
|
1333
|
+
<xsl:template match="iec:preface/iec:pagebreak" priority="3">
|
1334
|
+
<fo:block break-after="page"/>
|
1335
|
+
</xsl:template>
|
1336
|
+
|
1337
|
+
<xsl:template match="*[local-name() = 'preface' or local-name() = 'sections']/iec:p[starts-with(@class, 'zzSTDTitle')]" priority="3">
|
1338
|
+
<fo:block-container font-size="12pt" text-align="center">
|
1339
|
+
<xsl:if test="following-sibling::*[1][not(self::iec:p[starts-with(@class, 'zzSTDTitle')])]">
|
1340
|
+
<xsl:attribute name="margin-bottom">18pt</xsl:attribute>
|
1341
|
+
</xsl:if>
|
1342
|
+
<fo:block>
|
1343
|
+
<xsl:if test="iec:strong"> <!-- title -->
|
1344
|
+
<xsl:attribute name="role">H1</xsl:attribute>
|
1345
|
+
</xsl:if>
|
1346
|
+
<xsl:apply-templates/>
|
1347
|
+
</fo:block>
|
1348
|
+
</fo:block-container>
|
1349
|
+
</xsl:template>
|
1350
|
+
|
1303
1351
|
<xsl:template name="insertPrefacepages">
|
1304
1352
|
<xsl:param name="lang" select="$lang"/>
|
1305
1353
|
<fo:block break-after="page"/>
|
@@ -1622,14 +1670,21 @@
|
|
1622
1670
|
<xsl:with-param name="text" select="iec:title"/>
|
1623
1671
|
</xsl:call-template>
|
1624
1672
|
</fo:block>
|
1625
|
-
|
1673
|
+
<!-- margin-left="6.3mm" -->
|
1674
|
+
<!-- <fo:block font-size="8.2pt" text-align="justify">
|
1626
1675
|
<xsl:apply-templates select="/iec:iec-standard/iec:boilerplate/iec:legal-statement/*"/>
|
1627
|
-
</fo:block>
|
1676
|
+
</fo:block> -->
|
1628
1677
|
<fo:block>
|
1629
1678
|
<xsl:apply-templates select="*[not(local-name() = 'title')]"/>
|
1630
1679
|
</fo:block>
|
1631
1680
|
</xsl:template>
|
1632
1681
|
|
1682
|
+
<xsl:template match="iec:clause[@type = 'boilerplate_legal']" priority="3">
|
1683
|
+
<fo:block font-size="8.2pt" text-align="justify">
|
1684
|
+
<xsl:apply-templates/>
|
1685
|
+
</fo:block>
|
1686
|
+
</xsl:template>
|
1687
|
+
|
1633
1688
|
<xsl:template match="iec:annex//iec:clause" priority="2">
|
1634
1689
|
<fo:block id="{@id}" margin-top="5pt" margin-bottom="10pt" text-align="justify">
|
1635
1690
|
<xsl:apply-templates/>
|
@@ -1806,7 +1861,7 @@
|
|
1806
1861
|
<xsl:if test="ancestor::iec:ul">
|
1807
1862
|
<xsl:attribute name="margin-bottom">3pt</xsl:attribute>
|
1808
1863
|
</xsl:if>
|
1809
|
-
<xsl:if test="ancestor::iec:legal-statement">
|
1864
|
+
<xsl:if test="ancestor::iec:legal-statement or ancestor::iec:clause[@type = 'boilerplate_legal']">
|
1810
1865
|
<xsl:attribute name="margin-bottom">5pt</xsl:attribute>
|
1811
1866
|
</xsl:if>
|
1812
1867
|
<xsl:apply-templates/>
|
@@ -1844,14 +1899,18 @@
|
|
1844
1899
|
</xsl:template>
|
1845
1900
|
|
1846
1901
|
<xsl:template match="iec:xref[@pagenumber = 'true']" priority="2">
|
1847
|
-
<
|
1848
|
-
<
|
1849
|
-
<
|
1850
|
-
<
|
1851
|
-
|
1852
|
-
|
1853
|
-
|
1854
|
-
|
1902
|
+
<xsl:call-template name="insert_basic_link">
|
1903
|
+
<xsl:with-param name="element">
|
1904
|
+
<fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
|
1905
|
+
<fo:inline>
|
1906
|
+
<xsl:if test="@id">
|
1907
|
+
<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
|
1908
|
+
</xsl:if>
|
1909
|
+
<fo:page-number-citation ref-id="{@target}"/>
|
1910
|
+
</fo:inline>
|
1911
|
+
</fo:basic-link>
|
1912
|
+
</xsl:with-param>
|
1913
|
+
</xsl:call-template>
|
1855
1914
|
</xsl:template>
|
1856
1915
|
|
1857
1916
|
<!-- =================== -->
|
@@ -2764,6 +2823,7 @@
|
|
2764
2823
|
</xsl:attribute-set>
|
2765
2824
|
|
2766
2825
|
<xsl:attribute-set name="xref-style">
|
2826
|
+
<xsl:attribute name="keep-together.within-line">always</xsl:attribute>
|
2767
2827
|
|
2768
2828
|
</xsl:attribute-set>
|
2769
2829
|
|
@@ -4862,9 +4922,13 @@
|
|
4862
4922
|
<xsl:attribute name="padding-right">0.5mm</xsl:attribute>
|
4863
4923
|
</xsl:if>
|
4864
4924
|
|
4865
|
-
<
|
4866
|
-
<xsl:
|
4867
|
-
|
4925
|
+
<xsl:call-template name="insert_basic_link">
|
4926
|
+
<xsl:with-param name="element">
|
4927
|
+
<fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
|
4928
|
+
<xsl:value-of select="$current_fn_number_text"/>
|
4929
|
+
</fo:basic-link>
|
4930
|
+
</xsl:with-param>
|
4931
|
+
</xsl:call-template>
|
4868
4932
|
</fo:inline>
|
4869
4933
|
</xsl:variable>
|
4870
4934
|
|
@@ -5210,7 +5274,7 @@
|
|
5210
5274
|
<xsl:apply-templates select="*[local-name()='dt']/*"/>
|
5211
5275
|
|
5212
5276
|
<xsl:text> </xsl:text>
|
5213
|
-
<xsl:apply-templates select="*[local-name()='dd']
|
5277
|
+
<xsl:apply-templates select="*[local-name()='dd']/node()" mode="inline"/>
|
5214
5278
|
</fo:block>
|
5215
5279
|
|
5216
5280
|
</xsl:when> <!-- END: only one component -->
|
@@ -5704,8 +5768,18 @@
|
|
5704
5768
|
</xsl:if>
|
5705
5769
|
</xsl:template>
|
5706
5770
|
|
5707
|
-
<xsl:template match="*[local-name()='dd']/*
|
5708
|
-
<
|
5771
|
+
<xsl:template match="*[local-name()='dd']/*" mode="inline">
|
5772
|
+
<xsl:variable name="is_inline_element_after_where">
|
5773
|
+
<xsl:if test="(local-name() = 'p') and not(preceding-sibling::node()[normalize-space() != ''])">true</xsl:if>
|
5774
|
+
</xsl:variable>
|
5775
|
+
<xsl:choose>
|
5776
|
+
<xsl:when test="$is_inline_element_after_where = 'true'">
|
5777
|
+
<fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
|
5778
|
+
</xsl:when>
|
5779
|
+
<xsl:otherwise>
|
5780
|
+
<xsl:apply-templates select="."/>
|
5781
|
+
</xsl:otherwise>
|
5782
|
+
</xsl:choose>
|
5709
5783
|
</xsl:template>
|
5710
5784
|
|
5711
5785
|
<!-- virtual html table for dl/[dt and dd] for IF (Intermediate Format) -->
|
@@ -7206,6 +7280,79 @@
|
|
7206
7280
|
<xsl:value-of select="."/><xsl:value-of select="$zero_width_space"/>
|
7207
7281
|
</xsl:template>
|
7208
7282
|
|
7283
|
+
<!-- special case for:
|
7284
|
+
<math xmlns="http://www.w3.org/1998/Math/MathML">
|
7285
|
+
<mstyle displaystyle="true">
|
7286
|
+
<msup>
|
7287
|
+
<mi color="#00000000">C</mi>
|
7288
|
+
<mtext>R</mtext>
|
7289
|
+
</msup>
|
7290
|
+
<msubsup>
|
7291
|
+
<mtext>C</mtext>
|
7292
|
+
<mi>n</mi>
|
7293
|
+
<mi>k</mi>
|
7294
|
+
</msubsup>
|
7295
|
+
</mstyle>
|
7296
|
+
</math>
|
7297
|
+
-->
|
7298
|
+
<xsl:template match="mathml:msup/mathml:mi[. = '' or . = ''][not(preceding-sibling::*)][following-sibling::mathml:mtext]" mode="mathml">
|
7299
|
+
<xsl:copy>
|
7300
|
+
<xsl:copy-of select="@*"/>
|
7301
|
+
<xsl:variable name="next_mtext" select="ancestor::mathml:msup/following-sibling::*[1][self::mathml:msubsup or self::mathml:msub or self::mathml:msup]/mathml:mtext"/>
|
7302
|
+
<xsl:if test="string-length($next_mtext) != ''">
|
7303
|
+
<xsl:attribute name="color">#00000000</xsl:attribute>
|
7304
|
+
</xsl:if>
|
7305
|
+
<xsl:apply-templates/>
|
7306
|
+
<xsl:value-of select="$next_mtext"/>
|
7307
|
+
</xsl:copy>
|
7308
|
+
</xsl:template>
|
7309
|
+
|
7310
|
+
<!-- special case for:
|
7311
|
+
<msup>
|
7312
|
+
<mtext/>
|
7313
|
+
<mn>1</mn>
|
7314
|
+
</msup>
|
7315
|
+
convert to (add mspace after mtext and enclose them into mrow):
|
7316
|
+
<msup>
|
7317
|
+
<mrow>
|
7318
|
+
<mtext/>
|
7319
|
+
<mspace height="1.47ex"/>
|
7320
|
+
</mrow>
|
7321
|
+
<mn>1</mn>
|
7322
|
+
</msup>
|
7323
|
+
-->
|
7324
|
+
<xsl:template match="mathml:msup/mathml:mtext[not(preceding-sibling::*)]" mode="mathml">
|
7325
|
+
<mathml:mrow>
|
7326
|
+
<xsl:copy-of select="."/>
|
7327
|
+
<mathml:mspace height="1.47ex"/>
|
7328
|
+
</mathml:mrow>
|
7329
|
+
</xsl:template>
|
7330
|
+
|
7331
|
+
<!-- add space around vertical line -->
|
7332
|
+
<xsl:template match="mathml:mo[normalize-space(text()) = '|']" mode="mathml">
|
7333
|
+
<xsl:copy>
|
7334
|
+
<xsl:apply-templates select="@*" mode="mathml"/>
|
7335
|
+
<xsl:if test="not(@lspace)">
|
7336
|
+
<xsl:attribute name="lspace">0.4em</xsl:attribute>
|
7337
|
+
</xsl:if>
|
7338
|
+
<xsl:if test="not(@rspace)">
|
7339
|
+
<xsl:attribute name="rspace">0.4em</xsl:attribute>
|
7340
|
+
</xsl:if>
|
7341
|
+
<xsl:apply-templates mode="mathml"/>
|
7342
|
+
</xsl:copy>
|
7343
|
+
</xsl:template>
|
7344
|
+
|
7345
|
+
<!-- decrease fontsize for 'Circled Times' char -->
|
7346
|
+
<xsl:template match="mathml:mo[normalize-space(text()) = '⊗']" mode="mathml">
|
7347
|
+
<xsl:copy>
|
7348
|
+
<xsl:apply-templates select="@*" mode="mathml"/>
|
7349
|
+
<xsl:if test="not(@fontsize)">
|
7350
|
+
<xsl:attribute name="fontsize">55%</xsl:attribute>
|
7351
|
+
</xsl:if>
|
7352
|
+
<xsl:apply-templates mode="mathml"/>
|
7353
|
+
</xsl:copy>
|
7354
|
+
</xsl:template>
|
7355
|
+
|
7209
7356
|
<!-- Examples:
|
7210
7357
|
<stem type="AsciiMath">x = 1</stem>
|
7211
7358
|
<stem type="AsciiMath"><asciimath>x = 1</asciimath></stem>
|
@@ -7267,19 +7414,23 @@
|
|
7267
7414
|
<xsl:apply-templates/>
|
7268
7415
|
</xsl:when>
|
7269
7416
|
<xsl:otherwise>
|
7270
|
-
<
|
7271
|
-
<xsl:
|
7272
|
-
<
|
7273
|
-
<xsl:
|
7274
|
-
<xsl:
|
7275
|
-
|
7276
|
-
|
7277
|
-
|
7278
|
-
|
7279
|
-
|
7280
|
-
|
7281
|
-
|
7282
|
-
|
7417
|
+
<xsl:call-template name="insert_basic_link">
|
7418
|
+
<xsl:with-param name="element">
|
7419
|
+
<fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
|
7420
|
+
<xsl:choose>
|
7421
|
+
<xsl:when test="normalize-space(.) = ''">
|
7422
|
+
<xsl:call-template name="add-zero-spaces-link-java">
|
7423
|
+
<xsl:with-param name="text" select="$target_text"/>
|
7424
|
+
</xsl:call-template>
|
7425
|
+
</xsl:when>
|
7426
|
+
<xsl:otherwise>
|
7427
|
+
<!-- output text from <link>text</link> -->
|
7428
|
+
<xsl:apply-templates/>
|
7429
|
+
</xsl:otherwise>
|
7430
|
+
</xsl:choose>
|
7431
|
+
</fo:basic-link>
|
7432
|
+
</xsl:with-param>
|
7433
|
+
</xsl:call-template>
|
7283
7434
|
</xsl:otherwise>
|
7284
7435
|
</xsl:choose>
|
7285
7436
|
</fo:inline>
|
@@ -7342,12 +7493,16 @@
|
|
7342
7493
|
</xsl:template>
|
7343
7494
|
|
7344
7495
|
<xsl:template match="*[local-name() = 'xref']">
|
7345
|
-
<
|
7346
|
-
<xsl:
|
7347
|
-
<
|
7348
|
-
|
7349
|
-
|
7350
|
-
|
7496
|
+
<xsl:call-template name="insert_basic_link">
|
7497
|
+
<xsl:with-param name="element">
|
7498
|
+
<fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
|
7499
|
+
<xsl:if test="parent::*[local-name() = 'add']">
|
7500
|
+
<xsl:call-template name="append_add-style"/>
|
7501
|
+
</xsl:if>
|
7502
|
+
<xsl:apply-templates/>
|
7503
|
+
</fo:basic-link>
|
7504
|
+
</xsl:with-param>
|
7505
|
+
</xsl:call-template>
|
7351
7506
|
</xsl:template>
|
7352
7507
|
|
7353
7508
|
<!-- ====== -->
|
@@ -7732,7 +7887,7 @@
|
|
7732
7887
|
<xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
|
7733
7888
|
</xsl:when>
|
7734
7889
|
<xsl:when test="not(starts-with(@src, 'data:'))">
|
7735
|
-
<xsl:value-of select="concat('url(file
|
7890
|
+
<xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
|
7736
7891
|
</xsl:when>
|
7737
7892
|
<xsl:otherwise>
|
7738
7893
|
<xsl:value-of select="@src"/>
|
@@ -7754,7 +7909,7 @@
|
|
7754
7909
|
</xsl:when>
|
7755
7910
|
<xsl:when test="not(starts-with(@src, 'data:'))">
|
7756
7911
|
<xsl:variable name="src">
|
7757
|
-
<xsl:value-of select="concat('url(file
|
7912
|
+
<xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
|
7758
7913
|
</xsl:variable>
|
7759
7914
|
<xsl:variable name="file" select="java:java.io.File.new(@src)"/>
|
7760
7915
|
<xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
|
@@ -8140,15 +8295,19 @@
|
|
8140
8295
|
<xsl:param name="dest"/>
|
8141
8296
|
<fo:block-container position="absolute" left="{$left}px" top="{$top}px" width="{$width}px" height="{$height}px">
|
8142
8297
|
<fo:block font-size="1pt">
|
8143
|
-
<
|
8144
|
-
<
|
8145
|
-
<fo:
|
8146
|
-
|
8147
|
-
<
|
8148
|
-
|
8149
|
-
|
8150
|
-
|
8151
|
-
|
8298
|
+
<xsl:call-template name="insert_basic_link">
|
8299
|
+
<xsl:with-param name="element">
|
8300
|
+
<fo:basic-link internal-destination="{$dest}" fox:alt-text="svg link">
|
8301
|
+
<fo:inline-container inline-progression-dimension="100%">
|
8302
|
+
<fo:block-container height="{$height - 1}px" width="100%">
|
8303
|
+
<!-- DEBUG <xsl:if test="local-name()='polygon'">
|
8304
|
+
<xsl:attribute name="background-color">magenta</xsl:attribute>
|
8305
|
+
</xsl:if> -->
|
8306
|
+
<fo:block> </fo:block></fo:block-container>
|
8307
|
+
</fo:inline-container>
|
8308
|
+
</fo:basic-link>
|
8309
|
+
</xsl:with-param>
|
8310
|
+
</xsl:call-template>
|
8152
8311
|
</fo:block>
|
8153
8312
|
</fo:block-container>
|
8154
8313
|
</xsl:template>
|
@@ -9711,14 +9870,18 @@
|
|
9711
9870
|
</xsl:template>
|
9712
9871
|
|
9713
9872
|
<xsl:template match="*[local-name() = 'origin']">
|
9714
|
-
<
|
9715
|
-
<xsl:
|
9716
|
-
<
|
9717
|
-
|
9718
|
-
|
9719
|
-
|
9720
|
-
|
9721
|
-
|
9873
|
+
<xsl:call-template name="insert_basic_link">
|
9874
|
+
<xsl:with-param name="element">
|
9875
|
+
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
9876
|
+
<xsl:if test="normalize-space(@citeas) = ''">
|
9877
|
+
<xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
|
9878
|
+
</xsl:if>
|
9879
|
+
<fo:inline xsl:use-attribute-sets="origin-style">
|
9880
|
+
<xsl:apply-templates/>
|
9881
|
+
</fo:inline>
|
9882
|
+
</fo:basic-link>
|
9883
|
+
</xsl:with-param>
|
9884
|
+
</xsl:call-template>
|
9722
9885
|
</xsl:template>
|
9723
9886
|
|
9724
9887
|
<!-- not using, see https://github.com/glossarist/iev-document/issues/23 -->
|
@@ -9792,9 +9955,13 @@
|
|
9792
9955
|
<xsl:if test="../*[local-name() = 'author']">
|
9793
9956
|
<xsl:text>, </xsl:text>
|
9794
9957
|
</xsl:if>
|
9795
|
-
<
|
9796
|
-
<xsl:
|
9797
|
-
|
9958
|
+
<xsl:call-template name="insert_basic_link">
|
9959
|
+
<xsl:with-param name="element">
|
9960
|
+
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
9961
|
+
<xsl:apply-templates/>
|
9962
|
+
</fo:basic-link>
|
9963
|
+
</xsl:with-param>
|
9964
|
+
</xsl:call-template>
|
9798
9965
|
</xsl:template>
|
9799
9966
|
|
9800
9967
|
<xsl:template match="*[local-name() = 'author']">
|
@@ -9843,25 +10010,29 @@
|
|
9843
10010
|
<xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets -->
|
9844
10011
|
<xsl:variable name="text" select="normalize-space()"/>
|
9845
10012
|
|
9846
|
-
<
|
9847
|
-
<xsl:
|
9848
|
-
<
|
9849
|
-
|
9850
|
-
|
10013
|
+
<xsl:call-template name="insert_basic_link">
|
10014
|
+
<xsl:with-param name="element">
|
10015
|
+
<fo:basic-link fox:alt-text="{@citeas}">
|
10016
|
+
<xsl:if test="normalize-space(@citeas) = ''">
|
10017
|
+
<xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
|
10018
|
+
</xsl:if>
|
10019
|
+
<xsl:if test="@type = 'inline'">
|
9851
10020
|
|
9852
|
-
|
10021
|
+
</xsl:if>
|
9853
10022
|
|
9854
|
-
|
9855
|
-
|
9856
|
-
|
9857
|
-
|
9858
|
-
|
9859
|
-
|
9860
|
-
|
9861
|
-
|
10023
|
+
<xsl:choose>
|
10024
|
+
<xsl:when test="$external-destination != ''"> <!-- external hyperlink -->
|
10025
|
+
<xsl:attribute name="external-destination"><xsl:value-of select="$external-destination"/></xsl:attribute>
|
10026
|
+
</xsl:when>
|
10027
|
+
<xsl:otherwise>
|
10028
|
+
<xsl:attribute name="internal-destination"><xsl:value-of select="@bibitemid"/></xsl:attribute>
|
10029
|
+
</xsl:otherwise>
|
10030
|
+
</xsl:choose>
|
9862
10031
|
|
9863
|
-
|
9864
|
-
|
10032
|
+
<xsl:apply-templates/>
|
10033
|
+
</fo:basic-link>
|
10034
|
+
</xsl:with-param>
|
10035
|
+
</xsl:call-template>
|
9865
10036
|
|
9866
10037
|
</fo:inline>
|
9867
10038
|
</xsl:when>
|
@@ -10104,7 +10275,10 @@
|
|
10104
10275
|
<xsl:variable name="ul_labels" select="xalan:nodeset($ul_labels_)"/>
|
10105
10276
|
|
10106
10277
|
<xsl:template name="setULLabel">
|
10107
|
-
<xsl:variable name="
|
10278
|
+
<xsl:variable name="list_level__">
|
10279
|
+
<xsl:value-of select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/>
|
10280
|
+
</xsl:variable>
|
10281
|
+
<xsl:variable name="list_level_" select="number($list_level__)"/>
|
10108
10282
|
<xsl:variable name="list_level">
|
10109
10283
|
<xsl:choose>
|
10110
10284
|
<xsl:when test="$list_level_ <= 3"><xsl:value-of select="$list_level_"/></xsl:when>
|
@@ -10237,9 +10411,11 @@
|
|
10237
10411
|
</fo:block-container>
|
10238
10412
|
</xsl:when>
|
10239
10413
|
<xsl:otherwise>
|
10240
|
-
|
10241
|
-
|
10242
|
-
|
10414
|
+
|
10415
|
+
<fo:block>
|
10416
|
+
<xsl:apply-templates select="." mode="list"/>
|
10417
|
+
</fo:block>
|
10418
|
+
|
10243
10419
|
</xsl:otherwise>
|
10244
10420
|
</xsl:choose>
|
10245
10421
|
</xsl:template>
|
@@ -10255,7 +10431,7 @@
|
|
10255
10431
|
<xsl:variable name="provisional_distance_between_starts_">
|
10256
10432
|
<attributes xsl:use-attribute-sets="list-style">
|
10257
10433
|
|
10258
|
-
<xsl:if test="ancestor::iec:legal-statement">
|
10434
|
+
<xsl:if test="ancestor::iec:legal-statement or ancestor::iec:clause[@type = 'boilerplate_legal']">
|
10259
10435
|
<xsl:attribute name="provisional-distance-between-starts">5mm</xsl:attribute>
|
10260
10436
|
</xsl:if>
|
10261
10437
|
|
@@ -10936,24 +11112,32 @@
|
|
10936
11112
|
<xsl:for-each select="*[local-name() = 'tab']">
|
10937
11113
|
<xsl:variable name="current_id" select="generate-id()"/>
|
10938
11114
|
<fo:table-cell>
|
10939
|
-
<fo:block>
|
10940
|
-
<
|
10941
|
-
<xsl:
|
10942
|
-
<
|
10943
|
-
<xsl:
|
10944
|
-
|
10945
|
-
|
10946
|
-
|
10947
|
-
|
11115
|
+
<fo:block line-height-shift-adjustment="disregard-shifts">
|
11116
|
+
<xsl:call-template name="insert_basic_link">
|
11117
|
+
<xsl:with-param name="element">
|
11118
|
+
<fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
|
11119
|
+
<xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
|
11120
|
+
<xsl:choose>
|
11121
|
+
<xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
|
11122
|
+
<xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
|
11123
|
+
</xsl:choose>
|
11124
|
+
</xsl:for-each>
|
11125
|
+
</fo:basic-link>
|
11126
|
+
</xsl:with-param>
|
11127
|
+
</xsl:call-template>
|
10948
11128
|
</fo:block>
|
10949
11129
|
</fo:table-cell>
|
10950
11130
|
</xsl:for-each>
|
10951
11131
|
<!-- last column - for page numbers -->
|
10952
11132
|
<fo:table-cell text-align="right" font-size="10pt" font-weight="bold" font-family="Arial">
|
10953
11133
|
<fo:block>
|
10954
|
-
<
|
10955
|
-
<
|
10956
|
-
|
11134
|
+
<xsl:call-template name="insert_basic_link">
|
11135
|
+
<xsl:with-param name="element">
|
11136
|
+
<fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
|
11137
|
+
<fo:page-number-citation ref-id="{$target}"/>
|
11138
|
+
</fo:basic-link>
|
11139
|
+
</xsl:with-param>
|
11140
|
+
</xsl:call-template>
|
10957
11141
|
</fo:block>
|
10958
11142
|
</fo:table-cell>
|
10959
11143
|
</xsl:template>
|
@@ -10995,6 +11179,27 @@
|
|
10995
11179
|
<!-- End Table of Contents (ToC) processing -->
|
10996
11180
|
<!-- =================== -->
|
10997
11181
|
|
11182
|
+
<!-- insert fo:basic-link, if external-destination or internal-destination is non-empty, otherwise insert fo:inline -->
|
11183
|
+
<xsl:template name="insert_basic_link">
|
11184
|
+
<xsl:param name="element"/>
|
11185
|
+
<xsl:variable name="element_node" select="xalan:nodeset($element)"/>
|
11186
|
+
<xsl:variable name="external-destination" select="normalize-space(count($element_node/fo:basic-link/@external-destination[. != '']) = 1)"/>
|
11187
|
+
<xsl:variable name="internal-destination" select="normalize-space(count($element_node/fo:basic-link/@internal-destination[. != '']) = 1)"/>
|
11188
|
+
<xsl:choose>
|
11189
|
+
<xsl:when test="$external-destination = 'true' or $internal-destination = 'true'">
|
11190
|
+
<xsl:copy-of select="$element_node"/>
|
11191
|
+
</xsl:when>
|
11192
|
+
<xsl:otherwise>
|
11193
|
+
<fo:inline>
|
11194
|
+
<xsl:for-each select="$element_node/fo:basic-link/@*[local-name() != 'external-destination' and local-name() != 'internal-destination' and local-name() != 'alt-text']">
|
11195
|
+
<xsl:attribute name="{local-name()}"><xsl:value-of select="."/></xsl:attribute>
|
11196
|
+
</xsl:for-each>
|
11197
|
+
<xsl:copy-of select="$element_node/fo:basic-link/node()"/>
|
11198
|
+
</fo:inline>
|
11199
|
+
</xsl:otherwise>
|
11200
|
+
</xsl:choose>
|
11201
|
+
</xsl:template>
|
11202
|
+
|
10998
11203
|
<xsl:template match="*[local-name() = 'variant-title']"/> <!-- [@type = 'sub'] -->
|
10999
11204
|
<xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
|
11000
11205
|
<fo:inline padding-right="5mm"> </fo:inline>
|
@@ -28,9 +28,8 @@ module IsoDoc
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def termclause1(elem)
|
31
|
-
return clause1(elem)
|
32
|
-
|
33
|
-
|
31
|
+
@is_iev or return clause1(elem)
|
32
|
+
@suppressheadingnumbers || elem["unnumbered"] and return
|
34
33
|
lbl = @xrefs.anchor(elem["id"], :label, true) or return
|
35
34
|
prefix_name(elem, " ", "#{lbl}#{clausedelim}", "title")
|
36
35
|
end
|
@@ -88,8 +87,7 @@ module IsoDoc
|
|
88
87
|
end
|
89
88
|
|
90
89
|
def merge_fr_into_en_term(docxml)
|
91
|
-
|
92
|
-
|
90
|
+
@is_iev or return
|
93
91
|
docxml.xpath(ns("//term[@language = 'en'][@tag]")).each do |en|
|
94
92
|
fr = docxml.at(ns("//term[@language = 'fr'][@tag = '#{en['tag']}']"))
|
95
93
|
merge_fr_into_en_term1(en, fr) if fr
|
@@ -108,8 +106,7 @@ module IsoDoc
|
|
108
106
|
end
|
109
107
|
|
110
108
|
def otherlang_designations(docxml)
|
111
|
-
|
112
|
-
|
109
|
+
@is_iev or return
|
113
110
|
docxml.xpath(ns("//term")).each do |t|
|
114
111
|
otherlang_designations1(t, t["language"]&.split(/,/) || %w(en fr))
|
115
112
|
end
|
@@ -133,8 +130,7 @@ module IsoDoc
|
|
133
130
|
script = Metanorma::Utils.default_script(lang)
|
134
131
|
c = HTMLEntities.new
|
135
132
|
xml.traverse do |x|
|
136
|
-
|
137
|
-
|
133
|
+
x.text? or next
|
138
134
|
text = c.encode(c.decode(x.text), :hexadecimal)
|
139
135
|
x.replace(cleanup_entities(l10n(text, lang, script), is_xml: false))
|
140
136
|
end
|
@@ -155,8 +151,7 @@ module IsoDoc
|
|
155
151
|
pr = merge_otherlang_designations(
|
156
152
|
extract_otherlang_designations(term, lgs),
|
157
153
|
)
|
158
|
-
|
159
|
-
|
154
|
+
pr.empty? and return
|
160
155
|
prefs = pr.map do |p|
|
161
156
|
"<dt>#{p[:lang]}</dt>" \
|
162
157
|
"<dd language='#{p[:lang]}' script='#{p[:script]}'>" \
|
@@ -239,6 +234,59 @@ module IsoDoc
|
|
239
234
|
i18nhash: @i18n.get)
|
240
235
|
end
|
241
236
|
|
237
|
+
def rearrange_clauses(docxml)
|
238
|
+
insert_foreword(docxml) # feeds preface_rearrange
|
239
|
+
super
|
240
|
+
insert_middle_title(docxml)
|
241
|
+
end
|
242
|
+
|
243
|
+
def insert_foreword(docxml)
|
244
|
+
@meta.get[:doctype] == "Amendment" and return
|
245
|
+
b = docxml.at(ns("//boilerplate/legal-statement")) or return
|
246
|
+
unless f = docxml.at(ns("//preface/foreword"))
|
247
|
+
ins = toc_title_insert_pt(docxml)
|
248
|
+
f = ins.before(<<~CLAUSE).previous_element
|
249
|
+
<foreword id='_#{UUIDTools::UUID.random_create}'> </foreword>
|
250
|
+
CLAUSE
|
251
|
+
end
|
252
|
+
f.children.empty? and f.children = " "
|
253
|
+
ins = f.at(ns("./title")) || f.children.first.before(" ").previous
|
254
|
+
ins.next =
|
255
|
+
"<clause type='boilerplate_legal'>#{to_xml(b.children)}</clause>"
|
256
|
+
end
|
257
|
+
|
258
|
+
def insert_middle_title(docxml)
|
259
|
+
ins = docxml.at(ns("//preface/clause[@type = 'toc']")) or return
|
260
|
+
title1, title2 = middle_title_parts(nil)
|
261
|
+
title2out = ""
|
262
|
+
title2 and title2out = <<~OUTPUT
|
263
|
+
<p class="zzSTDTitle1"> </p>
|
264
|
+
<p class="zzSTDTitle2"><strong>#{title2}</strong></p>
|
265
|
+
OUTPUT
|
266
|
+
ins.next = <<~OUTPUT
|
267
|
+
<pagebreak/>
|
268
|
+
<p class="zzSTDTitle1">#{@i18n.get['IEC']}</p>
|
269
|
+
<p class="zzSTDTitle1">____________</p>
|
270
|
+
<p class="zzSTDTitle1"> </p>
|
271
|
+
<p class="zzSTDTitle1"><strong>#{title1.upcase}</strong></p>#{title2out}
|
272
|
+
<p class="zzSTDTitle1"> </p>
|
273
|
+
OUTPUT
|
274
|
+
end
|
275
|
+
|
276
|
+
def middle_title_parts(_out)
|
277
|
+
title1 = @meta.get[:doctitlemain]&.sub(/\s+$/, "")
|
278
|
+
@meta.get[:doctitleintro] and
|
279
|
+
title1 = "#{@meta.get[:doctitleintro]} \u2014 #{title1}"
|
280
|
+
title2 = nil
|
281
|
+
if @meta.get[:doctitlepart]
|
282
|
+
title1 += " \u2014"
|
283
|
+
title2 = @meta.get[:doctitlepart]&.sub(/\s+$/, "")
|
284
|
+
@meta.get[:doctitlepartlabel] and
|
285
|
+
title2 = "#{@meta.get[:doctitlepartlabel]}: #{title2}"
|
286
|
+
end
|
287
|
+
[title1, title2]
|
288
|
+
end
|
289
|
+
|
242
290
|
include Init
|
243
291
|
end
|
244
292
|
end
|
@@ -13,16 +13,16 @@ module IsoDoc
|
|
13
13
|
|
14
14
|
def convert(input_filename, file = nil, debug = false,
|
15
15
|
output_filename = nil)
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
16
|
+
file = File.read(input_filename, encoding: "utf-8") if file.nil?
|
17
|
+
@openmathdelim, @closemathdelim = extract_delims(file)
|
18
|
+
docxml, filename, dir = convert_init(file, input_filename, debug)
|
19
|
+
result = convert1(docxml, filename, dir)
|
20
|
+
return result if debug
|
21
|
+
|
22
|
+
output_filename ||= "#{filename}.#{@suffix}"
|
23
|
+
postprocess(result, output_filename, dir)
|
24
|
+
FileUtils.rm_rf dir
|
25
|
+
end
|
26
26
|
|
27
27
|
def font_choice(options)
|
28
28
|
if options[:script] == "Hans" then '"Source Han Sans",serif'
|
@@ -169,8 +169,8 @@ module IsoDoc
|
|
169
169
|
docxml.xpath("//div[@class = 'boilerplate_legal']//li").each do |l|
|
170
170
|
l.replace(l.children)
|
171
171
|
end
|
172
|
-
b = docxml.at("div[@class = 'boilerplate_legal']")
|
173
|
-
b.replace(b.children)
|
172
|
+
b = docxml.at("//div[@class = 'boilerplate_legal']")
|
173
|
+
b and b.replace(b.children)
|
174
174
|
end
|
175
175
|
|
176
176
|
def authority_cleanup(docxml)
|
@@ -202,11 +202,15 @@ module IsoDoc
|
|
202
202
|
{ class: "TableTitle", style: "text-align:center;" }
|
203
203
|
end
|
204
204
|
|
205
|
-
def para_class(
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
205
|
+
def para_class(node)
|
206
|
+
case node["class"]
|
207
|
+
when "zzSTDTitle1", "zzSTDTitle2" then node["class"]
|
208
|
+
else
|
209
|
+
classtype = nil
|
210
|
+
classtype = "MsoCommentText" if @in_comment
|
211
|
+
classtype = "Sourcecode" if @annotation
|
212
|
+
classtype
|
213
|
+
end
|
210
214
|
end
|
211
215
|
|
212
216
|
def annex_name(_annex, name, div)
|
data/lib/metanorma/iec/iec.rng
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<grammar ns=
|
3
|
-
<!--
|
2
|
+
<grammar ns='https://www.metanorma.org/ns/iec' xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
3
|
+
<!--
|
4
|
+
VERSION v1.2.1
|
5
|
+
default namespace = "https://www.metanorma.com/ns/iec"
|
6
|
+
-->
|
4
7
|
<include href="relaton-iec.rng"/>
|
5
8
|
<include href="isostandard.rng">
|
6
9
|
<start>
|
@@ -55,13 +58,7 @@
|
|
55
58
|
-->
|
56
59
|
<define name="iec-standard">
|
57
60
|
<element name="iec-standard">
|
58
|
-
<
|
59
|
-
<attribute name="type">
|
60
|
-
<choice>
|
61
|
-
<value>semantic</value>
|
62
|
-
<value>presentation</value>
|
63
|
-
</choice>
|
64
|
-
</attribute>
|
61
|
+
<ref name="Root-Attributes"/>
|
65
62
|
<ref name="bibdata"/>
|
66
63
|
<zeroOrMore>
|
67
64
|
<ref name="termdocsource"/>
|
@@ -17,6 +17,7 @@
|
|
17
17
|
these elements; we just want one namespace for any child grammars
|
18
18
|
of this.
|
19
19
|
-->
|
20
|
+
<!-- VERSION v1.2.1 -->
|
20
21
|
<grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
21
22
|
<include href="reqt.rng"/>
|
22
23
|
<include href="basicdoc.rng">
|
@@ -1349,15 +1350,19 @@
|
|
1349
1350
|
</choice>
|
1350
1351
|
</element>
|
1351
1352
|
</define>
|
1353
|
+
<define name="Root-Attributes">
|
1354
|
+
<attribute name="version"/>
|
1355
|
+
<attribute name="schema-version"/>
|
1356
|
+
<attribute name="type">
|
1357
|
+
<choice>
|
1358
|
+
<value>semantic</value>
|
1359
|
+
<value>presentation</value>
|
1360
|
+
</choice>
|
1361
|
+
</attribute>
|
1362
|
+
</define>
|
1352
1363
|
<define name="standard-document">
|
1353
1364
|
<element name="standard-document">
|
1354
|
-
<
|
1355
|
-
<attribute name="type">
|
1356
|
-
<choice>
|
1357
|
-
<value>semantic</value>
|
1358
|
-
<value>presentation</value>
|
1359
|
-
</choice>
|
1360
|
-
</attribute>
|
1365
|
+
<ref name="Root-Attributes"/>
|
1361
1366
|
<ref name="bibdata"/>
|
1362
1367
|
<optional>
|
1363
1368
|
<ref name="misccontainer"/>
|
@@ -1,6 +1,9 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
2
|
<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
3
|
-
<!--
|
3
|
+
<!--
|
4
|
+
VERSION v1.2.1
|
5
|
+
default namespace isostandard = "https://www.metanorma.com/ns/iso"
|
6
|
+
-->
|
4
7
|
<include href="isodoc.rng">
|
5
8
|
<start>
|
6
9
|
<ref name="iso-standard"/>
|
@@ -240,13 +243,7 @@
|
|
240
243
|
-->
|
241
244
|
<define name="iso-standard">
|
242
245
|
<element name="iso-standard">
|
243
|
-
<
|
244
|
-
<attribute name="type">
|
245
|
-
<choice>
|
246
|
-
<value>semantic</value>
|
247
|
-
<value>presentation</value>
|
248
|
-
</choice>
|
249
|
-
</attribute>
|
246
|
+
<ref name="Root-Attributes"/>
|
250
247
|
<ref name="bibdata"/>
|
251
248
|
<zeroOrMore>
|
252
249
|
<ref name="termdocsource"/>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-iec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-04-
|
11
|
+
date: 2023-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metanorma-iso
|