metanorma-csa 1.8.10 → 1.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/asciidoctor/csa/basicdoc.rng +21 -4
- data/lib/asciidoctor/csa/isodoc.rng +435 -78
- data/lib/asciidoctor/csa/reqt.rng +23 -2
- data/lib/isodoc/csa/base_convert.rb +1 -1
- data/lib/isodoc/csa/csa.standard.xsl +174 -11
- data/lib/isodoc/csa/html/wordstyle.css +12 -1
- data/lib/isodoc/csa/html/wordstyle.scss +12 -1
- data/lib/isodoc/csa/word_convert.rb +4 -5
- data/lib/metanorma/csa/version.rb +1 -1
- data/metanorma-csa.gemspec +1 -1
- metadata +5 -5
@@ -58,6 +58,14 @@
|
|
58
58
|
<optional>
|
59
59
|
<attribute name="type"/>
|
60
60
|
</optional>
|
61
|
+
<optional>
|
62
|
+
<attribute name="tag"/>
|
63
|
+
</optional>
|
64
|
+
<optional>
|
65
|
+
<attribute name="multilingual-rendering">
|
66
|
+
<ref name="MultilingualRenderingType"/>
|
67
|
+
</attribute>
|
68
|
+
</optional>
|
61
69
|
<optional>
|
62
70
|
<ref name="reqtitle"/>
|
63
71
|
</optional>
|
@@ -101,7 +109,9 @@
|
|
101
109
|
</define>
|
102
110
|
<define name="label">
|
103
111
|
<element name="label">
|
104
|
-
<
|
112
|
+
<oneOrMore>
|
113
|
+
<ref name="TextElement"/>
|
114
|
+
</oneOrMore>
|
105
115
|
</element>
|
106
116
|
</define>
|
107
117
|
<define name="subject">
|
@@ -175,8 +185,19 @@
|
|
175
185
|
<data type="boolean"/>
|
176
186
|
</attribute>
|
177
187
|
</optional>
|
188
|
+
<optional>
|
189
|
+
<attribute name="tag"/>
|
190
|
+
</optional>
|
191
|
+
<optional>
|
192
|
+
<attribute name="multilingual-rendering">
|
193
|
+
<ref name="MultilingualRenderingType"/>
|
194
|
+
</attribute>
|
195
|
+
</optional>
|
178
196
|
<oneOrMore>
|
179
|
-
<
|
197
|
+
<choice>
|
198
|
+
<ref name="BasicBlock"/>
|
199
|
+
<ref name="component"/>
|
200
|
+
</choice>
|
180
201
|
</oneOrMore>
|
181
202
|
</define>
|
182
203
|
<define name="ObligationType">
|
@@ -992,6 +992,8 @@
|
|
992
992
|
|
993
993
|
<title-list-figures lang="en">List of Figures</title-list-figures>
|
994
994
|
|
995
|
+
<title-table-figures lang="en">Table of Figures</title-table-figures>
|
996
|
+
|
995
997
|
<title-list-recommendations lang="en">List of Recommendations</title-list-recommendations>
|
996
998
|
|
997
999
|
<title-acknowledgements lang="en">Acknowledgements</title-acknowledgements>
|
@@ -1276,6 +1278,11 @@
|
|
1276
1278
|
|
1277
1279
|
|
1278
1280
|
|
1281
|
+
</xsl:attribute-set><xsl:attribute-set name="table-note-name-style">
|
1282
|
+
|
1283
|
+
|
1284
|
+
|
1285
|
+
|
1279
1286
|
</xsl:attribute-set><xsl:attribute-set name="note-p-style">
|
1280
1287
|
|
1281
1288
|
<xsl:attribute name="margin-top">12pt</xsl:attribute>
|
@@ -1449,13 +1456,20 @@
|
|
1449
1456
|
|
1450
1457
|
</xsl:attribute-set><xsl:attribute-set name="list-style">
|
1451
1458
|
|
1452
|
-
</xsl:attribute-set><xsl:
|
1459
|
+
</xsl:attribute-set><xsl:attribute-set name="toc-style">
|
1460
|
+
<xsl:attribute name="line-height">135%</xsl:attribute>
|
1461
|
+
</xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:template name="OLD_processPrefaceSectionsDefault_Contents">
|
1453
1462
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
|
1454
1463
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
|
1455
1464
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
|
1456
1465
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']" mode="contents"/>
|
1457
1466
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']" mode="contents"/>
|
1458
|
-
</xsl:template><xsl:template name="
|
1467
|
+
</xsl:template><xsl:template name="processPrefaceSectionsDefault_Contents">
|
1468
|
+
<xsl:for-each select="/*/*[local-name()='preface']/*">
|
1469
|
+
<xsl:sort select="@displayorder" data-type="number"/>
|
1470
|
+
<xsl:apply-templates select="." mode="contents"/>
|
1471
|
+
</xsl:for-each>
|
1472
|
+
</xsl:template><xsl:template name="OLD_processMainSectionsDefault_Contents">
|
1459
1473
|
<xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
|
1460
1474
|
|
1461
1475
|
<!-- Normative references -->
|
@@ -1468,13 +1482,33 @@
|
|
1468
1482
|
<!-- Bibliography -->
|
1469
1483
|
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]" mode="contents"/>
|
1470
1484
|
|
1471
|
-
</xsl:template><xsl:template name="
|
1485
|
+
</xsl:template><xsl:template name="processMainSectionsDefault_Contents">
|
1486
|
+
<xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
|
1487
|
+
<xsl:sort select="@displayorder" data-type="number"/>
|
1488
|
+
<xsl:apply-templates select="." mode="contents"/>
|
1489
|
+
</xsl:for-each>
|
1490
|
+
|
1491
|
+
<xsl:for-each select="/*/*[local-name()='annex']">
|
1492
|
+
<xsl:sort select="@displayorder" data-type="number"/>
|
1493
|
+
<xsl:apply-templates select="." mode="contents"/>
|
1494
|
+
</xsl:for-each>
|
1495
|
+
|
1496
|
+
<xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
|
1497
|
+
<xsl:sort select="@displayorder" data-type="number"/>
|
1498
|
+
<xsl:apply-templates select="." mode="contents"/>
|
1499
|
+
</xsl:for-each>
|
1500
|
+
</xsl:template><xsl:template name="OLD_processPrefaceSectionsDefault">
|
1472
1501
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
|
1473
1502
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
|
1474
1503
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']"/>
|
1475
1504
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']"/>
|
1476
1505
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']"/>
|
1477
|
-
</xsl:template><xsl:template name="
|
1506
|
+
</xsl:template><xsl:template name="processPrefaceSectionsDefault">
|
1507
|
+
<xsl:for-each select="/*/*[local-name()='preface']/*">
|
1508
|
+
<xsl:sort select="@displayorder" data-type="number"/>
|
1509
|
+
<xsl:apply-templates select="."/>
|
1510
|
+
</xsl:for-each>
|
1511
|
+
</xsl:template><xsl:template name="OLD_processMainSectionsDefault">
|
1478
1512
|
<xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']"/>
|
1479
1513
|
|
1480
1514
|
<!-- Normative references -->
|
@@ -1486,6 +1520,22 @@
|
|
1486
1520
|
<xsl:apply-templates select="/*/*[local-name()='annex']"/>
|
1487
1521
|
<!-- Bibliography -->
|
1488
1522
|
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]"/>
|
1523
|
+
</xsl:template><xsl:template name="processMainSectionsDefault">
|
1524
|
+
<xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
|
1525
|
+
<xsl:sort select="@displayorder" data-type="number"/>
|
1526
|
+
<xsl:apply-templates select="."/>
|
1527
|
+
|
1528
|
+
</xsl:for-each>
|
1529
|
+
|
1530
|
+
<xsl:for-each select="/*/*[local-name()='annex']">
|
1531
|
+
<xsl:sort select="@displayorder" data-type="number"/>
|
1532
|
+
<xsl:apply-templates select="."/>
|
1533
|
+
</xsl:for-each>
|
1534
|
+
|
1535
|
+
<xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
|
1536
|
+
<xsl:sort select="@displayorder" data-type="number"/>
|
1537
|
+
<xsl:apply-templates select="."/>
|
1538
|
+
</xsl:for-each>
|
1489
1539
|
</xsl:template><xsl:template match="text()">
|
1490
1540
|
<xsl:value-of select="."/>
|
1491
1541
|
</xsl:template><xsl:template match="*[local-name()='br']">
|
@@ -2318,9 +2368,8 @@
|
|
2318
2368
|
|
2319
2369
|
<!-- Table's note name (NOTE, for example) -->
|
2320
2370
|
|
2321
|
-
<fo:inline padding-right="2mm">
|
2371
|
+
<fo:inline padding-right="2mm" xsl:use-attribute-sets="table-note-name-style">
|
2322
2372
|
|
2323
|
-
|
2324
2373
|
|
2325
2374
|
|
2326
2375
|
|
@@ -2928,6 +2977,8 @@
|
|
2928
2977
|
<xsl:if test="$font-size != ''">
|
2929
2978
|
<xsl:attribute name="font-size">
|
2930
2979
|
<xsl:choose>
|
2980
|
+
<xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
|
2981
|
+
<xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
|
2931
2982
|
<xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
|
2932
2983
|
<xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
|
2933
2984
|
</xsl:choose>
|
@@ -3731,6 +3782,7 @@
|
|
3731
3782
|
<xsl:otherwise>
|
3732
3783
|
<fo:block xsl:use-attribute-sets="image-style">
|
3733
3784
|
|
3785
|
+
|
3734
3786
|
<xsl:variable name="src">
|
3735
3787
|
<xsl:call-template name="image_src"/>
|
3736
3788
|
</xsl:variable>
|
@@ -3978,6 +4030,13 @@
|
|
3978
4030
|
</xsl:attribute>
|
3979
4031
|
<xsl:apply-templates mode="svg_update"/>
|
3980
4032
|
</xsl:copy>
|
4033
|
+
</xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][*[local-name() = 'svg']]" priority="3">
|
4034
|
+
<xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
|
4035
|
+
<xsl:for-each select="*[local-name() = 'svg']">
|
4036
|
+
<xsl:call-template name="image_svg">
|
4037
|
+
<xsl:with-param name="name" select="$name"/>
|
4038
|
+
</xsl:call-template>
|
4039
|
+
</xsl:for-each>
|
3981
4040
|
</xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
|
3982
4041
|
<xsl:variable name="svg_content" select="document(@src)"/>
|
3983
4042
|
<xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
|
@@ -4082,7 +4141,7 @@
|
|
4082
4141
|
</fo:basic-link>
|
4083
4142
|
</fo:block>
|
4084
4143
|
</fo:block-container>
|
4085
|
-
</xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
|
4144
|
+
</xsl:template><xsl:template match="*[local-name() = 'emf']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
|
4086
4145
|
<xsl:apply-templates mode="contents"/>
|
4087
4146
|
<xsl:text> </xsl:text>
|
4088
4147
|
</xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="bookmarks">
|
@@ -4090,7 +4149,7 @@
|
|
4090
4149
|
<xsl:text> </xsl:text>
|
4091
4150
|
</xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']/text()" mode="contents" priority="2">
|
4092
4151
|
<xsl:value-of select="."/>
|
4093
|
-
</xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']
|
4152
|
+
</xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']//text()" mode="bookmarks" priority="2">
|
4094
4153
|
<xsl:value-of select="."/>
|
4095
4154
|
</xsl:template><xsl:template match="node()" mode="contents">
|
4096
4155
|
<xsl:apply-templates mode="contents"/>
|
@@ -4188,6 +4247,8 @@
|
|
4188
4247
|
|
4189
4248
|
|
4190
4249
|
|
4250
|
+
|
4251
|
+
|
4191
4252
|
</fo:bookmark-tree>
|
4192
4253
|
</xsl:if>
|
4193
4254
|
</xsl:template><xsl:template name="insertFigureBookmarks">
|
@@ -4381,12 +4442,16 @@
|
|
4381
4442
|
<xsl:if test="$font-size != ''">
|
4382
4443
|
<xsl:attribute name="font-size">
|
4383
4444
|
<xsl:choose>
|
4445
|
+
<xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
|
4446
|
+
<xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
|
4384
4447
|
<xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
|
4385
4448
|
<xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
|
4386
4449
|
</xsl:choose>
|
4387
4450
|
</xsl:attribute>
|
4388
4451
|
</xsl:if>
|
4389
4452
|
|
4453
|
+
|
4454
|
+
|
4390
4455
|
<xsl:apply-templates/>
|
4391
4456
|
</fo:block>
|
4392
4457
|
|
@@ -4734,6 +4799,7 @@
|
|
4734
4799
|
</xsl:choose>
|
4735
4800
|
</xsl:template><xsl:template match="*[local-name() = 'termsource']" name="termsource">
|
4736
4801
|
<fo:block xsl:use-attribute-sets="termsource-style">
|
4802
|
+
|
4737
4803
|
<!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
|
4738
4804
|
<xsl:variable name="termsource_text">
|
4739
4805
|
<xsl:apply-templates/>
|
@@ -4762,14 +4828,15 @@
|
|
4762
4828
|
</xsl:if>
|
4763
4829
|
</xsl:template><xsl:variable name="localized.source">
|
4764
4830
|
<xsl:call-template name="getLocalizedString">
|
4765
|
-
|
4766
|
-
|
4831
|
+
<xsl:with-param name="key">source</xsl:with-param>
|
4832
|
+
</xsl:call-template>
|
4767
4833
|
</xsl:variable><xsl:template match="*[local-name() = 'origin']">
|
4768
4834
|
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
4769
4835
|
<xsl:if test="normalize-space(@citeas) = ''">
|
4770
4836
|
<xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
|
4771
4837
|
</xsl:if>
|
4772
4838
|
|
4839
|
+
|
4773
4840
|
<fo:inline>
|
4774
4841
|
|
4775
4842
|
|
@@ -4777,6 +4844,7 @@
|
|
4777
4844
|
|
4778
4845
|
|
4779
4846
|
|
4847
|
+
|
4780
4848
|
<xsl:call-template name="getTitle">
|
4781
4849
|
<xsl:with-param name="name" select="'title-source'"/>
|
4782
4850
|
</xsl:call-template>
|
@@ -4788,6 +4856,7 @@
|
|
4788
4856
|
<fo:inline xsl:use-attribute-sets="origin-style">
|
4789
4857
|
<xsl:apply-templates/>
|
4790
4858
|
</fo:inline>
|
4859
|
+
|
4791
4860
|
</fo:basic-link>
|
4792
4861
|
</xsl:template><xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']">
|
4793
4862
|
<fo:inline><xsl:apply-templates/></fo:inline>
|
@@ -4854,6 +4923,9 @@
|
|
4854
4923
|
|
4855
4924
|
</xsl:if>
|
4856
4925
|
|
4926
|
+
<xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets -->
|
4927
|
+
<xsl:variable name="text" select="normalize-space()"/>
|
4928
|
+
|
4857
4929
|
|
4858
4930
|
|
4859
4931
|
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
@@ -4866,7 +4938,9 @@
|
|
4866
4938
|
|
4867
4939
|
|
4868
4940
|
</xsl:if>
|
4869
|
-
|
4941
|
+
|
4942
|
+
|
4943
|
+
|
4870
4944
|
<xsl:apply-templates/>
|
4871
4945
|
</fo:basic-link>
|
4872
4946
|
|
@@ -5199,6 +5273,7 @@
|
|
5199
5273
|
</xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" priority="4">
|
5200
5274
|
<xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
|
5201
5275
|
<fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
|
5276
|
+
|
5202
5277
|
<xsl:apply-templates/>
|
5203
5278
|
</fo:block>
|
5204
5279
|
</xsl:template><xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
|
@@ -5367,9 +5442,97 @@
|
|
5367
5442
|
<fo:block-container border="1pt solid black" width="50%">
|
5368
5443
|
<fo:block> </fo:block>
|
5369
5444
|
</fo:block-container>
|
5445
|
+
</xsl:template><xsl:template match="*[local-name() = 'toc']">
|
5446
|
+
<xsl:param name="colwidths"/>
|
5447
|
+
<xsl:variable name="colwidths_">
|
5448
|
+
<xsl:choose>
|
5449
|
+
<xsl:when test="not($colwidths)">
|
5450
|
+
<xsl:variable name="toc_table_simple">
|
5451
|
+
<tbody>
|
5452
|
+
<xsl:apply-templates mode="toc_table_width"/>
|
5453
|
+
</tbody>
|
5454
|
+
</xsl:variable>
|
5455
|
+
<xsl:variable name="cols-count" select="count(xalan:nodeset($toc_table_simple)/*/tr[1]/td)"/>
|
5456
|
+
<xsl:call-template name="calculate-column-widths">
|
5457
|
+
<xsl:with-param name="cols-count" select="$cols-count"/>
|
5458
|
+
<xsl:with-param name="table" select="$toc_table_simple"/>
|
5459
|
+
</xsl:call-template>
|
5460
|
+
</xsl:when>
|
5461
|
+
<xsl:otherwise>
|
5462
|
+
<xsl:copy-of select="$colwidths"/>
|
5463
|
+
</xsl:otherwise>
|
5464
|
+
</xsl:choose>
|
5465
|
+
</xsl:variable>
|
5466
|
+
<fo:block role="TOCI" space-after="16pt">
|
5467
|
+
<fo:table width="100%" table-layout="fixed">
|
5468
|
+
<xsl:for-each select="xalan:nodeset($colwidths_)/column">
|
5469
|
+
<fo:table-column column-width="proportional-column-width({.})"/>
|
5470
|
+
</xsl:for-each>
|
5471
|
+
<fo:table-body>
|
5472
|
+
<xsl:apply-templates/>
|
5473
|
+
</fo:table-body>
|
5474
|
+
</fo:table>
|
5475
|
+
</fo:block>
|
5476
|
+
</xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']">
|
5477
|
+
<fo:table-row min-height="5mm">
|
5478
|
+
<xsl:apply-templates/>
|
5479
|
+
</fo:table-row>
|
5480
|
+
</xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']/*[local-name() = 'p']">
|
5481
|
+
<xsl:apply-templates/>
|
5482
|
+
</xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'xref']" priority="3">
|
5483
|
+
<!-- <xref target="cgpm9th1948r6">1.6.3<tab/>“9th CGPM, 1948:<tab/>decision to establish the SI”</xref> -->
|
5484
|
+
<xsl:variable name="target" select="@target"/>
|
5485
|
+
<xsl:for-each select="*[local-name() = 'tab']">
|
5486
|
+
<xsl:variable name="current_id" select="generate-id()"/>
|
5487
|
+
<fo:table-cell>
|
5488
|
+
<fo:block>
|
5489
|
+
<fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
|
5490
|
+
<xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
|
5491
|
+
<xsl:choose>
|
5492
|
+
<xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
|
5493
|
+
<xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
|
5494
|
+
</xsl:choose>
|
5495
|
+
</xsl:for-each>
|
5496
|
+
</fo:basic-link>
|
5497
|
+
</fo:block>
|
5498
|
+
</fo:table-cell>
|
5499
|
+
</xsl:for-each>
|
5500
|
+
<!-- last column - for page numbers -->
|
5501
|
+
<fo:table-cell text-align="right" font-size="10pt" font-weight="bold" font-family="Arial">
|
5502
|
+
<fo:block>
|
5503
|
+
<fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
|
5504
|
+
<fo:page-number-citation ref-id="{$target}"/>
|
5505
|
+
</fo:basic-link>
|
5506
|
+
</fo:block>
|
5507
|
+
</fo:table-cell>
|
5508
|
+
</xsl:template><xsl:template match="*" mode="toc_table_width">
|
5509
|
+
<xsl:apply-templates mode="toc_table_width"/>
|
5510
|
+
</xsl:template><xsl:template match="*[local-name() = 'clause'][@type = 'toc']/*[local-name() = 'title']" mode="toc_table_width"/><xsl:template match="*[local-name() = 'clause'][not(@type = 'toc')]/*[local-name() = 'title']" mode="toc_table_width"/><xsl:template match="*[local-name() = 'li']" mode="toc_table_width">
|
5511
|
+
<tr>
|
5512
|
+
<xsl:apply-templates mode="toc_table_width"/>
|
5513
|
+
</tr>
|
5514
|
+
</xsl:template><xsl:template match="*[local-name() = 'xref']" mode="toc_table_width">
|
5515
|
+
<!-- <xref target="cgpm9th1948r6">1.6.3<tab/>“9th CGPM, 1948:<tab/>decision to establish the SI”</xref> -->
|
5516
|
+
<xsl:for-each select="*[local-name() = 'tab']">
|
5517
|
+
<xsl:variable name="current_id" select="generate-id()"/>
|
5518
|
+
<td>
|
5519
|
+
<xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
|
5520
|
+
<xsl:copy-of select="."/>
|
5521
|
+
</xsl:for-each>
|
5522
|
+
</td>
|
5523
|
+
</xsl:for-each>
|
5524
|
+
<td>333</td> <!-- page number, just for fill -->
|
5370
5525
|
</xsl:template><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']"/><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
|
5371
5526
|
<fo:inline padding-right="5mm"> </fo:inline>
|
5372
5527
|
<fo:inline><xsl:apply-templates/></fo:inline>
|
5528
|
+
</xsl:template><xsl:template match="*[local-name() = 'blacksquare']" name="blacksquare">
|
5529
|
+
<fo:inline padding-right="2.5mm" baseline-shift="5%">
|
5530
|
+
<fo:instream-foreign-object content-height="2mm" content-width="2mm" fox:alt-text="Quad">
|
5531
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" viewBox="0 0 2 2">
|
5532
|
+
<rect x="0" y="0" width="2" height="2" fill="black"/>
|
5533
|
+
</svg>
|
5534
|
+
</fo:instream-foreign-object>
|
5535
|
+
</fo:inline>
|
5373
5536
|
</xsl:template><xsl:template name="convertDate">
|
5374
5537
|
<xsl:param name="date"/>
|
5375
5538
|
<xsl:param name="format" select="'short'"/>
|
@@ -152,6 +152,7 @@ p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxS
|
|
152
152
|
|
153
153
|
p.MsoCommentText, li.MsoCommentText, div.MsoCommentText {
|
154
154
|
mso-style-noshow: yes;
|
155
|
+
mso-style-name: "Comment Text";
|
155
156
|
mso-style-unhide: no;
|
156
157
|
margin: 0cm;
|
157
158
|
margin-bottom: .0001pt;
|
@@ -373,6 +374,7 @@ h1 {
|
|
373
374
|
mso-style-priority: 1;
|
374
375
|
mso-style-unhide: no;
|
375
376
|
mso-style-qformat: yes;
|
377
|
+
mso-style-name: "Heading 1";
|
376
378
|
mso-style-link: "Heading 1 Char";
|
377
379
|
mso-style-next: Normal;
|
378
380
|
margin-top: 13.5pt;
|
@@ -459,6 +461,7 @@ h2 {
|
|
459
461
|
mso-style-priority: 2;
|
460
462
|
mso-style-unhide: no;
|
461
463
|
mso-style-qformat: yes;
|
464
|
+
mso-style-name: "Heading 2";
|
462
465
|
mso-style-parent: "Heading 1";
|
463
466
|
mso-style-link: "Heading 2 Char";
|
464
467
|
mso-style-next: Normal;
|
@@ -487,7 +490,8 @@ h3 {
|
|
487
490
|
mso-style-priority: 3;
|
488
491
|
mso-style-unhide: no;
|
489
492
|
mso-style-qformat: yes;
|
490
|
-
mso-style-
|
493
|
+
mso-style-name: "Heading 3";
|
494
|
+
mso-style-parent: "Heading 2";
|
491
495
|
mso-style-link: "Heading 3 Char";
|
492
496
|
mso-style-next: Normal;
|
493
497
|
margin-top: 3.0pt;
|
@@ -514,6 +518,7 @@ h4 {
|
|
514
518
|
mso-style-priority: 4;
|
515
519
|
mso-style-unhide: no;
|
516
520
|
mso-style-qformat: yes;
|
521
|
+
mso-style-name: "Heading 4";
|
517
522
|
mso-style-parent: "Heading 3";
|
518
523
|
mso-style-link: "Heading 4 Char";
|
519
524
|
mso-style-next: Normal;
|
@@ -541,6 +546,7 @@ h5 {
|
|
541
546
|
mso-style-priority: 5;
|
542
547
|
mso-style-unhide: no;
|
543
548
|
mso-style-qformat: yes;
|
549
|
+
mso-style-name: "Heading 5";
|
544
550
|
mso-style-parent: "Heading 4";
|
545
551
|
mso-style-link: "Heading 5 Char";
|
546
552
|
mso-style-next: Normal;
|
@@ -568,6 +574,7 @@ h6 {
|
|
568
574
|
mso-style-priority: 6;
|
569
575
|
mso-style-unhide: no;
|
570
576
|
mso-style-qformat: yes;
|
577
|
+
mso-style-name: "Heading 6";
|
571
578
|
mso-style-parent: "Heading 5";
|
572
579
|
mso-style-link: "Heading 6 Char";
|
573
580
|
mso-style-next: Normal;
|
@@ -594,6 +601,7 @@ h6 {
|
|
594
601
|
p.MsoToc1, li.MsoToc1, div.MsoToc1 {
|
595
602
|
mso-style-priority: 39;
|
596
603
|
mso-style-unhide: no;
|
604
|
+
mso-style-name: "TOC 1";
|
597
605
|
mso-style-next: Normal;
|
598
606
|
margin-top: 6.0pt;
|
599
607
|
margin-right: 25.0pt;
|
@@ -617,6 +625,7 @@ p.MsoToc2, li.MsoToc2, div.MsoToc2 {
|
|
617
625
|
mso-style-noshow: yes;
|
618
626
|
mso-style-priority: 39;
|
619
627
|
mso-style-unhide: no;
|
628
|
+
mso-style-name: "TOC 2";
|
620
629
|
mso-style-parent: "TOC 1";
|
621
630
|
mso-style-next: Normal;
|
622
631
|
margin-top: 0cm;
|
@@ -641,6 +650,7 @@ p.MsoToc3, li.MsoToc3, div.MsoToc3 {
|
|
641
650
|
mso-style-noshow: yes;
|
642
651
|
mso-style-priority: 39;
|
643
652
|
mso-style-unhide: no;
|
653
|
+
mso-style-name: "TOC 3";
|
644
654
|
mso-style-parent: "TOC 2";
|
645
655
|
mso-style-next: Normal;
|
646
656
|
margin-top: 0cm;
|
@@ -663,6 +673,7 @@ p.MsoToc3, li.MsoToc3, div.MsoToc3 {
|
|
663
673
|
|
664
674
|
span.MsoFootnoteReference {
|
665
675
|
mso-style-priority: 99;
|
676
|
+
mso-style-name: "Footnote Reference";
|
666
677
|
vertical-align: super; }
|
667
678
|
|
668
679
|
p.MsoFootnoteText, li.MsoFootnoteText, div.MsoFootnoteText {
|
@@ -138,6 +138,7 @@ p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxS
|
|
138
138
|
|
139
139
|
p.MsoCommentText, li.MsoCommentText, div.MsoCommentText
|
140
140
|
{mso-style-noshow:yes;
|
141
|
+
mso-style-name:"Comment Text";
|
141
142
|
mso-style-unhide:no;
|
142
143
|
margin:0cm;
|
143
144
|
margin-bottom:.0001pt;
|
@@ -343,6 +344,7 @@ h1
|
|
343
344
|
{mso-style-priority:1;
|
344
345
|
mso-style-unhide:no;
|
345
346
|
mso-style-qformat:yes;
|
347
|
+
mso-style-name:"Heading 1";
|
346
348
|
mso-style-link:"Heading 1 Char";
|
347
349
|
mso-style-next:Normal;
|
348
350
|
margin-top:13.5pt;
|
@@ -426,6 +428,7 @@ h2
|
|
426
428
|
{mso-style-priority:2;
|
427
429
|
mso-style-unhide:no;
|
428
430
|
mso-style-qformat:yes;
|
431
|
+
mso-style-name:"Heading 2";
|
429
432
|
mso-style-parent:"Heading 1";
|
430
433
|
mso-style-link:"Heading 2 Char";
|
431
434
|
mso-style-next:Normal;
|
@@ -453,7 +456,8 @@ h3
|
|
453
456
|
{mso-style-priority:3;
|
454
457
|
mso-style-unhide:no;
|
455
458
|
mso-style-qformat:yes;
|
456
|
-
|
459
|
+
mso-style-name:"Heading 3";
|
460
|
+
mso-style-parent:"Heading 2";
|
457
461
|
mso-style-link:"Heading 3 Char";
|
458
462
|
mso-style-next:Normal;
|
459
463
|
margin-top:3.0pt;
|
@@ -479,6 +483,7 @@ h4
|
|
479
483
|
{mso-style-priority:4;
|
480
484
|
mso-style-unhide:no;
|
481
485
|
mso-style-qformat:yes;
|
486
|
+
mso-style-name:"Heading 4";
|
482
487
|
mso-style-parent:"Heading 3";
|
483
488
|
mso-style-link:"Heading 4 Char";
|
484
489
|
mso-style-next:Normal;
|
@@ -505,6 +510,7 @@ h5
|
|
505
510
|
{mso-style-priority:5;
|
506
511
|
mso-style-unhide:no;
|
507
512
|
mso-style-qformat:yes;
|
513
|
+
mso-style-name:"Heading 5";
|
508
514
|
mso-style-parent:"Heading 4";
|
509
515
|
mso-style-link:"Heading 5 Char";
|
510
516
|
mso-style-next:Normal;
|
@@ -531,6 +537,7 @@ h6
|
|
531
537
|
{mso-style-priority:6;
|
532
538
|
mso-style-unhide:no;
|
533
539
|
mso-style-qformat:yes;
|
540
|
+
mso-style-name:"Heading 6";
|
534
541
|
mso-style-parent:"Heading 5";
|
535
542
|
mso-style-link:"Heading 6 Char";
|
536
543
|
mso-style-next:Normal;
|
@@ -556,6 +563,7 @@ h6
|
|
556
563
|
p.MsoToc1, li.MsoToc1, div.MsoToc1
|
557
564
|
{mso-style-priority:39;
|
558
565
|
mso-style-unhide:no;
|
566
|
+
mso-style-name:"TOC 1";
|
559
567
|
mso-style-next:Normal;
|
560
568
|
margin-top:6.0pt;
|
561
569
|
margin-right:25.0pt;
|
@@ -578,6 +586,7 @@ p.MsoToc2, li.MsoToc2, div.MsoToc2
|
|
578
586
|
{mso-style-noshow:yes;
|
579
587
|
mso-style-priority:39;
|
580
588
|
mso-style-unhide:no;
|
589
|
+
mso-style-name:"TOC 2";
|
581
590
|
mso-style-parent:"TOC 1";
|
582
591
|
mso-style-next:Normal;
|
583
592
|
margin-top:0cm;
|
@@ -601,6 +610,7 @@ p.MsoToc3, li.MsoToc3, div.MsoToc3
|
|
601
610
|
{mso-style-noshow:yes;
|
602
611
|
mso-style-priority:39;
|
603
612
|
mso-style-unhide:no;
|
613
|
+
mso-style-name:"TOC 3";
|
604
614
|
mso-style-parent:"TOC 2";
|
605
615
|
mso-style-next:Normal;
|
606
616
|
margin-top:0cm;
|
@@ -622,6 +632,7 @@ p.MsoToc3, li.MsoToc3, div.MsoToc3
|
|
622
632
|
mso-bidi-font-weight:normal;}
|
623
633
|
span.MsoFootnoteReference
|
624
634
|
{mso-style-priority:99;
|
635
|
+
mso-style-name:"Footnote Reference";
|
625
636
|
vertical-align:super;}
|
626
637
|
p.MsoFootnoteText, li.MsoFootnoteText, div.MsoFootnoteText
|
627
638
|
{mso-style-noshow:yes;
|
@@ -1,16 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
3
|
+
require_relative "base_convert"
|
4
4
|
require "isodoc/generic/word_convert"
|
5
|
-
require_relative
|
6
|
-
require
|
5
|
+
require_relative "init"
|
6
|
+
require "isodoc"
|
7
7
|
|
8
8
|
module IsoDoc
|
9
9
|
module Csa
|
10
10
|
# A {Converter} implementation that generates CSA output, and a document
|
11
11
|
# schema encapsulation of the document for validation
|
12
|
-
class WordConvert < IsoDoc::WordConvert
|
13
|
-
|
12
|
+
class WordConvert < IsoDoc::Generic::WordConvert
|
14
13
|
include BaseConvert
|
15
14
|
include Init
|
16
15
|
end
|
data/metanorma-csa.gemspec
CHANGED
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.require_paths = ["lib"]
|
29
29
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
|
30
30
|
|
31
|
-
spec.add_dependency "metanorma-generic", "~> 1.
|
31
|
+
spec.add_dependency "metanorma-generic", "~> 1.11.0"
|
32
32
|
|
33
33
|
spec.add_development_dependency "byebug", "~> 9.1"
|
34
34
|
spec.add_development_dependency "equivalent-xml", "~> 0.6"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-csa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metanorma-generic
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: 1.11.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.
|
26
|
+
version: 1.11.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: byebug
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -248,7 +248,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
248
248
|
- !ruby/object:Gem::Version
|
249
249
|
version: '0'
|
250
250
|
requirements: []
|
251
|
-
rubygems_version: 3.
|
251
|
+
rubygems_version: 3.2.22
|
252
252
|
signing_key:
|
253
253
|
specification_version: 4
|
254
254
|
summary: metanorma-csa lets you write CSA Normal Documents (CSAND) in AsciiDoc.
|