metanorma-itu 2.2.2 → 2.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isodoc/itu/html/_coverpage.css +29 -0
- data/lib/isodoc/itu/html/htmlstyle.css +59 -1
- data/lib/isodoc/itu/itu.implementers-guide.xsl +107 -32
- data/lib/isodoc/itu/itu.in-force.xsl +107 -32
- data/lib/isodoc/itu/itu.recommendation-annex.xsl +107 -32
- data/lib/isodoc/itu/itu.recommendation-supplement.xsl +107 -32
- data/lib/isodoc/itu/itu.recommendation.xsl +107 -32
- data/lib/isodoc/itu/itu.resolution.xsl +107 -32
- data/lib/isodoc/itu/itu.service-publication.xsl +107 -32
- data/lib/isodoc/itu/itu.technical-paper.xsl +107 -32
- data/lib/isodoc/itu/itu.technical-report.xsl +107 -32
- data/lib/isodoc/itu/ref.rb +7 -9
- data/lib/metanorma/itu/biblio.rng +1 -1
- data/lib/metanorma/itu/cleanup.rb +16 -17
- data/lib/metanorma/itu/isodoc.rng +6 -1
- data/lib/metanorma/itu/version.rb +1 -1
- metadata +2 -2
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
<xsl:output method="xml" encoding="UTF-8" indent="no"/>
|
4
4
|
|
5
|
-
<xsl:key name="kfn" match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])
|
5
|
+
<xsl:key name="kfn" match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure' or local-name() = 'localized-strings')] and not(ancestor::*[local-name() = 'name']))]" use="@reference"/>
|
6
6
|
|
7
7
|
<xsl:variable name="debug">false</xsl:variable>
|
8
8
|
|
@@ -1298,21 +1298,42 @@
|
|
1298
1298
|
<!-- PREFACE (Summary, History, ...) -->
|
1299
1299
|
<!-- ============================= -->
|
1300
1300
|
|
1301
|
+
<xsl:template match="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*" priority="3">
|
1302
|
+
<xsl:choose>
|
1303
|
+
<xsl:when test="preceding-sibling::*">
|
1304
|
+
<!-- page-break before 2nd and next elements only -->
|
1305
|
+
<fo:block break-after="page"/>
|
1306
|
+
</xsl:when>
|
1307
|
+
<xsl:otherwise>
|
1308
|
+
<fo:block font-size="12pt">
|
1309
|
+
<xsl:value-of select="$linebreak"/>
|
1310
|
+
<xsl:value-of select="$linebreak"/>
|
1311
|
+
</fo:block>
|
1312
|
+
</xsl:otherwise>
|
1313
|
+
</xsl:choose>
|
1314
|
+
<fo:block>
|
1315
|
+
<xsl:call-template name="setId"/>
|
1316
|
+
<xsl:apply-templates/>
|
1317
|
+
</fo:block>
|
1318
|
+
</xsl:template>
|
1319
|
+
|
1301
1320
|
<!-- Summary -->
|
1302
1321
|
<xsl:template match="itu:itu-standard/itu:preface/itu:abstract[@id = '_summary']" priority="3">
|
1303
1322
|
<fo:block font-size="12pt">
|
1304
1323
|
<xsl:value-of select="$linebreak"/>
|
1305
1324
|
<xsl:value-of select="$linebreak"/>
|
1306
1325
|
</fo:block>
|
1307
|
-
<fo:block
|
1308
|
-
<
|
1309
|
-
<xsl:
|
1310
|
-
<xsl:
|
1311
|
-
|
1312
|
-
|
1313
|
-
|
1326
|
+
<fo:block id="{@id}">
|
1327
|
+
<fo:block font-weight="bold" keep-with-next="always" margin-top="18pt" margin-bottom="18pt" role="H2">
|
1328
|
+
<xsl:variable name="title-summary">
|
1329
|
+
<xsl:call-template name="getTitle">
|
1330
|
+
<xsl:with-param name="name" select="'title-summary'"/>
|
1331
|
+
</xsl:call-template>
|
1332
|
+
</xsl:variable>
|
1333
|
+
<xsl:value-of select="$title-summary"/>
|
1334
|
+
</fo:block>
|
1335
|
+
<xsl:apply-templates/>
|
1314
1336
|
</fo:block>
|
1315
|
-
<xsl:apply-templates/>
|
1316
1337
|
</xsl:template>
|
1317
1338
|
<xsl:template match="itu:itu-standard/itu:preface/itu:abstract[@id = '_summary']/itu:title" priority="4"/>
|
1318
1339
|
|
@@ -2113,14 +2134,14 @@
|
|
2113
2134
|
BUT DON'T put any another conditions together with $namespace = '...' (such conditions will be ignored). For another conditions, please use nested xsl:if or xsl:choose -->
|
2114
2135
|
|
2115
2136
|
<!--
|
2116
|
-
<
|
2137
|
+
<metanorma-extension>
|
2117
2138
|
<presentation-metadata>
|
2118
2139
|
<papersize>letter</papersize>
|
2119
2140
|
</presentation-metadata>
|
2120
|
-
</
|
2141
|
+
</metanorma-extension>
|
2121
2142
|
-->
|
2122
2143
|
|
2123
|
-
<xsl:variable name="papersize" select="java:toLowerCase(java:java.lang.String.new(normalize-space(//*[contains(local-name(), '-standard')]/*[local-name() = '
|
2144
|
+
<xsl:variable name="papersize" select="java:toLowerCase(java:java.lang.String.new(normalize-space(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata']/*[local-name() = 'papersize'])))"/>
|
2124
2145
|
<xsl:variable name="papersize_width_">
|
2125
2146
|
<xsl:choose>
|
2126
2147
|
<xsl:when test="$papersize = 'letter'">215.9</xsl:when>
|
@@ -2235,7 +2256,7 @@
|
|
2235
2256
|
<xsl:variable name="titles" select="xalan:nodeset($titles_)"/>
|
2236
2257
|
|
2237
2258
|
<xsl:variable name="title-list-tables">
|
2238
|
-
<xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = '
|
2259
|
+
<xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']"/>
|
2239
2260
|
<xsl:value-of select="$toc_table_title"/>
|
2240
2261
|
<xsl:if test="normalize-space($toc_table_title) = ''">
|
2241
2262
|
<xsl:call-template name="getTitle">
|
@@ -2245,7 +2266,7 @@
|
|
2245
2266
|
</xsl:variable>
|
2246
2267
|
|
2247
2268
|
<xsl:variable name="title-list-figures">
|
2248
|
-
<xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = '
|
2269
|
+
<xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']"/>
|
2249
2270
|
<xsl:value-of select="$toc_figure_title"/>
|
2250
2271
|
<xsl:if test="normalize-space($toc_figure_title) = ''">
|
2251
2272
|
<xsl:call-template name="getTitle">
|
@@ -2255,7 +2276,7 @@
|
|
2255
2276
|
</xsl:variable>
|
2256
2277
|
|
2257
2278
|
<xsl:variable name="title-list-recommendations">
|
2258
|
-
<xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = '
|
2279
|
+
<xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='requirement']/*[local-name() = 'title']"/>
|
2259
2280
|
<xsl:value-of select="$toc_requirement_title"/>
|
2260
2281
|
<xsl:if test="normalize-space($toc_requirement_title) = ''">
|
2261
2282
|
<xsl:call-template name="getTitle">
|
@@ -2327,7 +2348,7 @@
|
|
2327
2348
|
<xsl:variable name="root-style_" select="xalan:nodeset($root-style)"/>
|
2328
2349
|
|
2329
2350
|
<xsl:variable name="additional_fonts_">
|
2330
|
-
<xsl:for-each select="//*[contains(local-name(), '-standard')][1]/*[local-name() = '
|
2351
|
+
<xsl:for-each select="//*[contains(local-name(), '-standard')][1]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value'] | //*[contains(local-name(), '-standard')][1]/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value']">
|
2331
2352
|
<xsl:value-of select="."/><xsl:if test="position() != last()">, </xsl:if>
|
2332
2353
|
</xsl:for-each>
|
2333
2354
|
</xsl:variable>
|
@@ -3049,17 +3070,28 @@
|
|
3049
3070
|
<!-- admonition -->
|
3050
3071
|
<xsl:attribute-set name="admonition-style">
|
3051
3072
|
|
3073
|
+
<xsl:attribute name="border">0.5pt solid black</xsl:attribute>
|
3074
|
+
<xsl:attribute name="space-before">12pt</xsl:attribute>
|
3075
|
+
<xsl:attribute name="space-after">12pt</xsl:attribute>
|
3076
|
+
|
3052
3077
|
</xsl:attribute-set> <!-- admonition-style -->
|
3053
3078
|
|
3054
3079
|
<xsl:attribute-set name="admonition-container-style">
|
3055
3080
|
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
3056
3081
|
<xsl:attribute name="margin-right">0mm</xsl:attribute>
|
3057
3082
|
|
3083
|
+
<xsl:attribute name="padding">2mm</xsl:attribute>
|
3084
|
+
<xsl:attribute name="padding-top">3mm</xsl:attribute>
|
3085
|
+
|
3058
3086
|
</xsl:attribute-set> <!-- admonition-container-style -->
|
3059
3087
|
|
3060
3088
|
<xsl:attribute-set name="admonition-name-style">
|
3061
3089
|
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
3062
3090
|
|
3091
|
+
<xsl:attribute name="text-align">center</xsl:attribute>
|
3092
|
+
<xsl:attribute name="margin-bottom">6pt</xsl:attribute>
|
3093
|
+
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
3094
|
+
|
3063
3095
|
</xsl:attribute-set> <!-- admonition-name-style -->
|
3064
3096
|
|
3065
3097
|
<xsl:attribute-set name="admonition-p-style">
|
@@ -3381,10 +3413,10 @@
|
|
3381
3413
|
|
3382
3414
|
<xsl:template name="processTablesFigures_Contents">
|
3383
3415
|
<xsl:param name="always"/>
|
3384
|
-
<xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = '
|
3416
|
+
<xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
|
3385
3417
|
<xsl:call-template name="processTables_Contents"/>
|
3386
3418
|
</xsl:if>
|
3387
|
-
<xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = '
|
3419
|
+
<xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
|
3388
3420
|
<xsl:call-template name="processFigures_Contents"/>
|
3389
3421
|
</xsl:if>
|
3390
3422
|
</xsl:template>
|
@@ -3730,6 +3762,8 @@
|
|
3730
3762
|
|
3731
3763
|
<xsl:attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></xsl:attribute>
|
3732
3764
|
|
3765
|
+
<xsl:call-template name="setBordersTableArray"/>
|
3766
|
+
|
3733
3767
|
<xsl:if test="$doctype = 'service-publication'">
|
3734
3768
|
<xsl:attribute name="border">1pt solid rgb(211,211,211)</xsl:attribute>
|
3735
3769
|
</xsl:if>
|
@@ -3878,6 +3912,10 @@
|
|
3878
3912
|
|
3879
3913
|
</xsl:template>
|
3880
3914
|
|
3915
|
+
<xsl:template name="setBordersTableArray">
|
3916
|
+
|
3917
|
+
</xsl:template>
|
3918
|
+
|
3881
3919
|
<xsl:template match="*[local-name()='table']/*[local-name() = 'name']">
|
3882
3920
|
<xsl:param name="continued"/>
|
3883
3921
|
<xsl:if test="normalize-space() != ''">
|
@@ -4367,6 +4405,8 @@
|
|
4367
4405
|
<xsl:attribute name="border">none</xsl:attribute>
|
4368
4406
|
</xsl:if>
|
4369
4407
|
|
4408
|
+
<xsl:call-template name="setBordersTableArray"/>
|
4409
|
+
|
4370
4410
|
<!-- fn will be processed inside 'note' processing -->
|
4371
4411
|
|
4372
4412
|
<xsl:if test="$doctype = 'service-publication'">
|
@@ -4492,6 +4532,8 @@
|
|
4492
4532
|
<xsl:template match="*[local-name()='thead']/*[local-name()='tr']" priority="2">
|
4493
4533
|
<fo:table-row xsl:use-attribute-sets="table-header-row-style">
|
4494
4534
|
|
4535
|
+
<xsl:call-template name="setBordersTableArray"/>
|
4536
|
+
|
4495
4537
|
<xsl:if test="$doctype = 'service-publication'">
|
4496
4538
|
<xsl:attribute name="border-bottom">1.1pt solid black</xsl:attribute>
|
4497
4539
|
</xsl:if>
|
@@ -4519,6 +4561,8 @@
|
|
4519
4561
|
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
4520
4562
|
</xsl:if>
|
4521
4563
|
|
4564
|
+
<xsl:call-template name="setBordersTableArray"/>
|
4565
|
+
|
4522
4566
|
<xsl:call-template name="setTableRowAttributes"/>
|
4523
4567
|
<xsl:apply-templates/>
|
4524
4568
|
</fo:table-row>
|
@@ -4542,6 +4586,8 @@
|
|
4542
4586
|
<xsl:with-param name="default">center</xsl:with-param>
|
4543
4587
|
</xsl:call-template>
|
4544
4588
|
|
4589
|
+
<xsl:call-template name="setBordersTableArray"/>
|
4590
|
+
|
4545
4591
|
<xsl:if test="ancestor::*[local-name()='preface']">
|
4546
4592
|
<xsl:if test="$doctype != 'service-publication'">
|
4547
4593
|
<xsl:attribute name="border">solid black 0pt</xsl:attribute>
|
@@ -4605,6 +4651,8 @@
|
|
4605
4651
|
|
4606
4652
|
<!-- bsi -->
|
4607
4653
|
|
4654
|
+
<xsl:call-template name="setBordersTableArray"/>
|
4655
|
+
|
4608
4656
|
<xsl:if test="ancestor::*[local-name()='preface']">
|
4609
4657
|
<xsl:attribute name="border">solid black 0pt</xsl:attribute>
|
4610
4658
|
</xsl:if>
|
@@ -4667,7 +4715,7 @@
|
|
4667
4715
|
</fn>
|
4668
4716
|
-->
|
4669
4717
|
<!-- footnotes in text (title, bibliography, main body, table's, figure's names), not for tables, figures -->
|
4670
|
-
<xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])
|
4718
|
+
<xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure')] and not(ancestor::*[local-name() = 'name']))]" priority="2" name="fn">
|
4671
4719
|
|
4672
4720
|
<!-- list of footnotes to calculate actual footnotes number -->
|
4673
4721
|
<xsl:variable name="p_fn_">
|
@@ -4724,8 +4772,7 @@
|
|
4724
4772
|
</fo:basic-link>
|
4725
4773
|
</fo:inline>
|
4726
4774
|
</xsl:variable>
|
4727
|
-
|
4728
|
-
gen_id=<xsl:value-of select="$gen_id"/> -->
|
4775
|
+
|
4729
4776
|
<xsl:choose>
|
4730
4777
|
<xsl:when test="normalize-space(@skip_footnote_body) = 'true'">
|
4731
4778
|
<xsl:copy-of select="$footnote_inline"/>
|
@@ -4784,7 +4831,7 @@
|
|
4784
4831
|
<!-- commented:
|
4785
4832
|
.//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] |
|
4786
4833
|
because 'fn' there is in biblio-tag -->
|
4787
|
-
<xsl:for-each select=".//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])
|
4834
|
+
<xsl:for-each select=".//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure')] and not(ancestor::*[local-name() = 'name']))][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
|
4788
4835
|
<!-- copy unique fn -->
|
4789
4836
|
<fn gen_id="{generate-id(.)}">
|
4790
4837
|
<xsl:copy-of select="@*"/>
|
@@ -7350,7 +7397,9 @@
|
|
7350
7397
|
|
7351
7398
|
<xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $width_effective, $height_effective)"/>
|
7352
7399
|
<xsl:if test="number($scale) < 100">
|
7353
|
-
|
7400
|
+
|
7401
|
+
<xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
|
7402
|
+
|
7354
7403
|
</xsl:if>
|
7355
7404
|
|
7356
7405
|
</xsl:if>
|
@@ -8276,7 +8325,7 @@
|
|
8276
8325
|
<!-- sourcecode -->
|
8277
8326
|
<!-- =============== -->
|
8278
8327
|
|
8279
|
-
<xsl:variable name="source-highlighter-css_" select="//*[contains(local-name(), '-standard')]/*[local-name() = '
|
8328
|
+
<xsl:variable name="source-highlighter-css_" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'source-highlighter-css']"/>
|
8280
8329
|
<xsl:variable name="sourcecode_css_" select="java:org.metanorma.fop.Util.parseCSS($source-highlighter-css_)"/>
|
8281
8330
|
<xsl:variable name="sourcecode_css" select="xalan:nodeset($sourcecode_css_)"/>
|
8282
8331
|
|
@@ -8365,6 +8414,12 @@
|
|
8365
8414
|
</xsl:attribute>
|
8366
8415
|
</xsl:for-each>
|
8367
8416
|
|
8417
|
+
<!-- remove margin between rows in the table with sourcecode line numbers -->
|
8418
|
+
<xsl:if test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']">
|
8419
|
+
<xsl:attribute name="margin-top">0pt</xsl:attribute>
|
8420
|
+
<xsl:attribute name="margin-bottom">0pt</xsl:attribute>
|
8421
|
+
</xsl:if>
|
8422
|
+
|
8368
8423
|
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
8369
8424
|
</fo:block>
|
8370
8425
|
|
@@ -8413,7 +8468,7 @@
|
|
8413
8468
|
</xsl:template>
|
8414
8469
|
|
8415
8470
|
<!-- outer table with line numbers for sourcecode -->
|
8416
|
-
<xsl:template match="*[local-name()='
|
8471
|
+
<xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] | -->
|
8417
8472
|
<fo:block>
|
8418
8473
|
<fo:table width="100%" table-layout="fixed">
|
8419
8474
|
<xsl:copy-of select="@id"/>
|
@@ -8425,16 +8480,16 @@
|
|
8425
8480
|
</fo:table>
|
8426
8481
|
</fo:block>
|
8427
8482
|
</xsl:template>
|
8428
|
-
<xsl:template match="*[local-name()='
|
8483
|
+
<xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']/*[local-name() = 'tbody']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody'] | -->
|
8429
8484
|
<xsl:apply-templates/>
|
8430
8485
|
</xsl:template>
|
8431
|
-
<xsl:template match="*[local-name()='
|
8486
|
+
<xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr'] | -->
|
8432
8487
|
<fo:table-row>
|
8433
8488
|
<xsl:apply-templates/>
|
8434
8489
|
</fo:table-row>
|
8435
8490
|
</xsl:template>
|
8436
8491
|
<!-- first td with line numbers -->
|
8437
|
-
<xsl:template match="*[local-name()='
|
8492
|
+
<xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']/*[local-name()='td'][not(preceding-sibling::*)]" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] -->
|
8438
8493
|
<fo:table-cell>
|
8439
8494
|
<fo:block>
|
8440
8495
|
|
@@ -8454,8 +8509,9 @@
|
|
8454
8509
|
</fo:block>
|
8455
8510
|
</fo:table-cell>
|
8456
8511
|
</xsl:template>
|
8512
|
+
|
8457
8513
|
<!-- second td with sourcecode -->
|
8458
|
-
<xsl:template match="*[local-name()='
|
8514
|
+
<xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']/*[local-name()='td'][preceding-sibling::*]" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] -->
|
8459
8515
|
<fo:table-cell>
|
8460
8516
|
<fo:block>
|
8461
8517
|
<xsl:apply-templates/>
|
@@ -8693,7 +8749,25 @@
|
|
8693
8749
|
<xsl:template match="*[local-name()='pre']" name="pre">
|
8694
8750
|
<fo:block xsl:use-attribute-sets="pre-style">
|
8695
8751
|
<xsl:copy-of select="@id"/>
|
8696
|
-
<xsl:
|
8752
|
+
<xsl:choose>
|
8753
|
+
|
8754
|
+
<xsl:when test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name()='td'][1][not(preceding-sibling::*)]"> <!-- pre in the first td in the table with @linenums = 'true' -->
|
8755
|
+
<xsl:if test="ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']"> <!-- is current tr isn't last -->
|
8756
|
+
<xsl:attribute name="margin-top">0pt</xsl:attribute>
|
8757
|
+
<xsl:attribute name="margin-bottom">0pt</xsl:attribute>
|
8758
|
+
</xsl:if>
|
8759
|
+
<fo:instream-foreign-object fox:alt-text="{.}" content-width="95%">
|
8760
|
+
<math xmlns="http://www.w3.org/1998/Math/MathML">
|
8761
|
+
<mtext><xsl:value-of select="."/></mtext>
|
8762
|
+
</math>
|
8763
|
+
</fo:instream-foreign-object>
|
8764
|
+
</xsl:when>
|
8765
|
+
|
8766
|
+
<xsl:otherwise>
|
8767
|
+
<xsl:apply-templates/>
|
8768
|
+
</xsl:otherwise>
|
8769
|
+
|
8770
|
+
</xsl:choose>
|
8697
8771
|
</fo:block>
|
8698
8772
|
</xsl:template>
|
8699
8773
|
<!-- =============== -->
|
@@ -10342,8 +10416,8 @@
|
|
10342
10416
|
|
10343
10417
|
<xsl:variable name="toc_level">
|
10344
10418
|
<!-- https://www.metanorma.org/author/ref/document-attributes/ -->
|
10345
|
-
<xsl:variable name="htmltoclevels" select="normalize-space(//*[local-name() = '
|
10346
|
-
<xsl:variable name="toclevels" select="normalize-space(//*[local-name() = '
|
10419
|
+
<xsl:variable name="htmltoclevels" select="normalize-space(//*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name']/text() = 'HTML TOC Heading Levels']/*[local-name() = 'value'])"/> <!-- :htmltoclevels Number of table of contents levels to render in HTML/PDF output; used to override :toclevels:-->
|
10420
|
+
<xsl:variable name="toclevels" select="normalize-space(//*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name']/text() = 'TOC Heading Levels']/*[local-name() = 'value'])"/> <!-- Number of table of contents levels to render -->
|
10347
10421
|
<xsl:choose>
|
10348
10422
|
<xsl:when test="$htmltoclevels != ''"><xsl:value-of select="number($htmltoclevels)"/></xsl:when> <!-- if there is value in xml -->
|
10349
10423
|
<xsl:when test="$toclevels != ''"><xsl:value-of select="number($toclevels)"/></xsl:when> <!-- if there is value in xml -->
|
@@ -11335,6 +11409,7 @@
|
|
11335
11409
|
<xsl:choose>
|
11336
11410
|
<xsl:when test="$lang = 'ar' and $align = 'left'">start</xsl:when>
|
11337
11411
|
<xsl:when test="$lang = 'ar' and $align = 'right'">end</xsl:when>
|
11412
|
+
<xsl:when test="$align = 'justified'">justify</xsl:when>
|
11338
11413
|
<xsl:when test="$align != '' and not($align = 'indent')"><xsl:value-of select="$align"/></xsl:when>
|
11339
11414
|
<xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
|
11340
11415
|
<xsl:when test="ancestor::*[local-name() = 'th']/@align"><xsl:value-of select="ancestor::*[local-name() = 'th']/@align"/></xsl:when>
|
data/lib/isodoc/itu/ref.rb
CHANGED
@@ -7,7 +7,7 @@ module IsoDoc
|
|
7
7
|
module BaseConvert
|
8
8
|
def nonstd_bibitem(list, bibitem, _ordinal, biblio)
|
9
9
|
list.tr **attr_code(iso_bibitem_entry_attrs(bibitem, biblio)) do |ref|
|
10
|
-
ref.td
|
10
|
+
ref.td style: "vertical-align:top" do |td|
|
11
11
|
tag = bibitem.at(ns("./biblio-tag"))
|
12
12
|
tag&.children&.each { |n| parse(n, td) }
|
13
13
|
end
|
@@ -20,7 +20,7 @@ module IsoDoc
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def biblio_list(clause, div, biblio)
|
23
|
-
div.table
|
23
|
+
div.table class: "biblio", border: "0" do |t|
|
24
24
|
i = 0
|
25
25
|
t.tbody do |tbody|
|
26
26
|
clause.elements.each do |b|
|
@@ -64,14 +64,12 @@ module IsoDoc
|
|
64
64
|
ret
|
65
65
|
end
|
66
66
|
|
67
|
-
IGNORE_IDS = "@type = 'DOI' or @type = 'ISSN' or @type = 'ISBN' or "\
|
68
|
-
"@type = 'rfc-anchor' or @type = 'metanorma-ordinal'".freeze
|
69
|
-
|
70
67
|
def multi_bibitem_ref_code(bibitem)
|
71
|
-
id = bibitem.xpath(ns("./docidentifier[not(@type = 'metanorma' or "\
|
72
|
-
"#{
|
68
|
+
id = bibitem.xpath(ns("./docidentifier[not(@type = 'metanorma' or " \
|
69
|
+
"#{IsoDoc::Function::References::SKIP_DOCID} or " \
|
70
|
+
"@type = 'metanorma-ordinal')]"))
|
73
71
|
id.empty? and
|
74
|
-
id = bibitem.xpath(ns("./docidentifier[not(@type = 'metanorma' or "\
|
72
|
+
id = bibitem.xpath(ns("./docidentifier[not(@type = 'metanorma' or " \
|
75
73
|
"@type = 'metanorma-ordinal')]"))
|
76
74
|
return [] if id.empty?
|
77
75
|
|
@@ -91,7 +89,7 @@ module IsoDoc
|
|
91
89
|
def doctype_title(id)
|
92
90
|
type = id.parent&.at(ns("./ext/doctype"))&.text || "recommendation"
|
93
91
|
if type == "recommendation" &&
|
94
|
-
/^(?<prefix>ITU-[A-Z]
|
92
|
+
/^(?<prefix>ITU-[A-Z][ ][A-Z])[ .-]Sup[a-z]*\.[ ]?(?<num>\d+)$/ =~ id.text
|
95
93
|
"#{prefix}-series Recommendations – Supplement #{num}"
|
96
94
|
else
|
97
95
|
d = docid_prefix(id["type"], id.text.sub(/^\[/, "").sub(/\]$/, ""))
|
@@ -1316,7 +1316,7 @@
|
|
1316
1316
|
<value>commentaryOf</value>
|
1317
1317
|
<value>hasCommentary</value>
|
1318
1318
|
<value>related</value>
|
1319
|
-
<value>
|
1319
|
+
<value>hasComplement</value>
|
1320
1320
|
<value>complementOf</value>
|
1321
1321
|
<value>obsoletes</value>
|
1322
1322
|
<value>obsoletedBy</value>
|
@@ -46,7 +46,7 @@ module Metanorma
|
|
46
46
|
ins = xml.at("//sections").elements.first
|
47
47
|
xml.at("//sections/clause[@type = 'scope']") or
|
48
48
|
ins.previous =
|
49
|
-
"<clause type='scope' #{add_id}><title>#{@i18n.scope}</title><p>"\
|
49
|
+
"<clause type='scope' #{add_id}><title>#{@i18n.scope}</title><p>" \
|
50
50
|
"#{@i18n.clause_empty}</p></clause>"
|
51
51
|
xml&.at("//sentinel")&.remove
|
52
52
|
end
|
@@ -57,7 +57,7 @@ module Metanorma
|
|
57
57
|
"<bibliography><sentinel/></bibliography>"
|
58
58
|
ins = xml.at("//bibliography").elements.first
|
59
59
|
xml.at("//bibliography/references[@normative = 'true']") or
|
60
|
-
ins.previous = "<references #{add_id} normative='true'>"\
|
60
|
+
ins.previous = "<references #{add_id} normative='true'>" \
|
61
61
|
"<title>#{@i18n.normref}</title></references>"
|
62
62
|
xml&.at("//sentinel")&.remove
|
63
63
|
end
|
@@ -72,7 +72,7 @@ module Metanorma
|
|
72
72
|
ins = xml.at("//sections/terms") ||
|
73
73
|
xml.at("//sections/clause[descendant::terms]")
|
74
74
|
unless xml.at("//sections//definitions")
|
75
|
-
ins.next = "<definitions #{add_id}>"\
|
75
|
+
ins.next = "<definitions #{add_id}>" \
|
76
76
|
"<title>#{@i18n.symbolsabbrev}</title></definitions>"
|
77
77
|
end
|
78
78
|
end
|
@@ -81,8 +81,8 @@ module Metanorma
|
|
81
81
|
ins = xml.at("//sections//definitions") ||
|
82
82
|
xml.at("//sections/clause[descendant::definitions]")
|
83
83
|
unless xml.at("//sections/clause[@type = 'conventions']")
|
84
|
-
ins.next = "<clause #{add_id} type='conventions'>"\
|
85
|
-
"<title>#{@i18n.conventions}</title><p>"\
|
84
|
+
ins.next = "<clause #{add_id} type='conventions'>" \
|
85
|
+
"<title>#{@i18n.conventions}</title><p>" \
|
86
86
|
"#{@i18n.clause_empty}</p></clause>"
|
87
87
|
end
|
88
88
|
end
|
@@ -149,14 +149,14 @@ module Metanorma
|
|
149
149
|
def section_names_terms_cleanup(xml)
|
150
150
|
super
|
151
151
|
replace_title(
|
152
|
-
xml, "//terms[@type = 'internal'] | "\
|
153
|
-
"//clause[./terms[@type = 'internal']]"\
|
152
|
+
xml, "//terms[@type = 'internal'] | " \
|
153
|
+
"//clause[./terms[@type = 'internal']]" \
|
154
154
|
"[not(./terms[@type = 'external'])]",
|
155
155
|
@i18n&.internal_termsdef
|
156
156
|
)
|
157
157
|
replace_title(
|
158
|
-
xml, "//terms[@type = 'external'] | "\
|
159
|
-
"//clause[./terms[@type = 'external']]"\
|
158
|
+
xml, "//terms[@type = 'external'] | " \
|
159
|
+
"//clause[./terms[@type = 'external']]" \
|
160
160
|
"[not(./terms[@type = 'internal'])]",
|
161
161
|
@i18n&.external_termsdef
|
162
162
|
)
|
@@ -172,17 +172,16 @@ module Metanorma
|
|
172
172
|
|
173
173
|
def pub_class(bib)
|
174
174
|
return 1 if bib.at("#{PUBLISHER}[abbreviation = 'ITU']")
|
175
|
-
return 1 if bib.at("#{PUBLISHER}[name = 'International "\
|
175
|
+
return 1 if bib.at("#{PUBLISHER}[name = 'International " \
|
176
176
|
"Telecommunication Union']")
|
177
177
|
return 2 if bib.at("#{PUBLISHER}[abbreviation = 'ISO']")
|
178
|
-
return 2 if bib.at("#{PUBLISHER}[name = 'International Organization "\
|
178
|
+
return 2 if bib.at("#{PUBLISHER}[name = 'International Organization " \
|
179
179
|
"for Standardization']")
|
180
180
|
return 3 if bib.at("#{PUBLISHER}[abbreviation = 'IEC']")
|
181
|
-
return 3 if bib.at("#{PUBLISHER}[name = 'International "\
|
181
|
+
return 3 if bib.at("#{PUBLISHER}[name = 'International " \
|
182
182
|
"Electrotechnical Commission']")
|
183
|
-
return 4 if bib.at("./docidentifier[@type][not(
|
184
|
-
"@type = 'metanorma'
|
185
|
-
"'ISBN')]")
|
183
|
+
return 4 if bib.at("./docidentifier[@type][not(#{skip_docid} or " \
|
184
|
+
"@type = 'metanorma')]")
|
186
185
|
|
187
186
|
5
|
188
187
|
end
|
@@ -199,8 +198,8 @@ module Metanorma
|
|
199
198
|
# then title
|
200
199
|
def sort_biblio_key(bib)
|
201
200
|
pubclass = pub_class(bib)
|
202
|
-
id = bib&.at("./docidentifier[not(
|
203
|
-
"'metanorma'
|
201
|
+
id = bib&.at("./docidentifier[not(#{skip_docid} or @type = " \
|
202
|
+
"'metanorma')]")
|
204
203
|
metaid = bib&.at("./docidentifier[@type = 'metanorma']")&.text
|
205
204
|
abbrid = metaid unless /^\[\d+\]$/.match?(metaid)
|
206
205
|
type = id["type"] if id
|
@@ -571,6 +571,11 @@
|
|
571
571
|
<ref name="MultilingualRenderingType"/>
|
572
572
|
</attribute>
|
573
573
|
</optional>
|
574
|
+
<optional>
|
575
|
+
<attribute name="linenums">
|
576
|
+
<data type="boolean"/>
|
577
|
+
</attribute>
|
578
|
+
</optional>
|
574
579
|
<optional>
|
575
580
|
<ref name="tname"/>
|
576
581
|
</optional>
|
@@ -1575,7 +1580,7 @@
|
|
1575
1580
|
</element>
|
1576
1581
|
</define>
|
1577
1582
|
<define name="misccontainer">
|
1578
|
-
<element name="
|
1583
|
+
<element name="metanorma-extension">
|
1579
1584
|
<oneOrMore>
|
1580
1585
|
<ref name="AnyElement"/>
|
1581
1586
|
</oneOrMore>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-itu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: htmlentities
|