metanorma-nist 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/asciidoctor/nist/front.rb +15 -24
- data/lib/isodoc/nist/nist.cswp.xsl +177 -4
- data/lib/isodoc/nist/nist.sp.xsl +177 -4
- data/lib/metanorma/nist/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: 1495072b5486784814d43bda0e9352fbc4945952571260b0226025aa69025ccd
|
4
|
+
data.tar.gz: e90d93ae0853e166cd1b36f954e8ab13b56b3ec87d3a78e347eefa063e05267f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99c3f28c3399dff97c470d7f88207abd2631c023177068b1b6e5076d31500ded0e748a51c0d29bc5bbb73eec2771676b7860af368994125a00737e7474aba744
|
7
|
+
data.tar.gz: 99d118cfd090a5a479f3e496874207ddd6530ac93b83f015fcfa1411b6723373ccc6dd6cb80a633e279a237f655f20af957f9c8250031447f6be72f9972baeb7
|
@@ -5,9 +5,6 @@ require_relative "./front_id.rb"
|
|
5
5
|
|
6
6
|
module Asciidoctor
|
7
7
|
module NIST
|
8
|
-
# A {Converter} implementation that generates RSD output, and a document
|
9
|
-
# schema encapsulation of the document for validation
|
10
|
-
|
11
8
|
class Converter < Standoc::Converter
|
12
9
|
def doctype(node)
|
13
10
|
node.attr("doctype") || "sp-800"
|
@@ -72,13 +69,21 @@ module Asciidoctor
|
|
72
69
|
personal_author(node, xml)
|
73
70
|
end
|
74
71
|
|
72
|
+
def default_publisher
|
73
|
+
"National Institute of Standards and Technology"
|
74
|
+
end
|
75
|
+
|
75
76
|
def metadata_publisher(node, xml)
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
77
|
+
publishers = node.attr("publisher") || default_publisher
|
78
|
+
csv_split(publishers)&.each do |p|
|
79
|
+
xml.contributor do |c|
|
80
|
+
c.role **{ type: "publisher" }
|
81
|
+
c.organization do |a|
|
82
|
+
a.name p
|
83
|
+
if p == default_publisher
|
84
|
+
d = node.attr("nist-division") and a.subdivision d
|
85
|
+
end
|
86
|
+
end
|
82
87
|
end
|
83
88
|
end
|
84
89
|
end
|
@@ -111,20 +116,6 @@ module Asciidoctor
|
|
111
116
|
end
|
112
117
|
end
|
113
118
|
|
114
|
-
def metadata_copyright(node, xml)
|
115
|
-
from = node.attr("copyright-year") || node.attr("copyrightyear") ||
|
116
|
-
Date.today.year
|
117
|
-
xml.copyright do |c|
|
118
|
-
c.from from
|
119
|
-
c.owner do |owner|
|
120
|
-
owner.organization do |o|
|
121
|
-
o.name "National Institute of Standards and Technology"
|
122
|
-
o.abbreviation "NIST"
|
123
|
-
end
|
124
|
-
end
|
125
|
-
end
|
126
|
-
end
|
127
|
-
|
128
119
|
def metadata_source(node, xml)
|
129
120
|
super
|
130
121
|
node.attr("doc-email") && xml.uri(node.attr("doc-email"), type: "email")
|
@@ -157,7 +148,7 @@ module Asciidoctor
|
|
157
148
|
|
158
149
|
def relaton_relation_descriptions
|
159
150
|
super.merge({ "supersedes" => "obsoletes",
|
160
|
-
|
151
|
+
"superseded-by" => "obsoleted-by", })
|
161
152
|
end
|
162
153
|
|
163
154
|
def metadata_getrelation(node, xml, type, desc = nil)
|
@@ -1221,6 +1221,7 @@
|
|
1221
1221
|
</xsl:attribute-set><xsl:attribute-set name="example-body-style">
|
1222
1222
|
|
1223
1223
|
|
1224
|
+
|
1224
1225
|
</xsl:attribute-set><xsl:attribute-set name="example-name-style">
|
1225
1226
|
|
1226
1227
|
|
@@ -1240,6 +1241,8 @@
|
|
1240
1241
|
|
1241
1242
|
|
1242
1243
|
|
1244
|
+
|
1245
|
+
|
1243
1246
|
|
1244
1247
|
|
1245
1248
|
</xsl:attribute-set><xsl:attribute-set name="example-p-style">
|
@@ -1256,6 +1259,8 @@
|
|
1256
1259
|
|
1257
1260
|
|
1258
1261
|
|
1262
|
+
|
1263
|
+
|
1259
1264
|
</xsl:attribute-set><xsl:attribute-set name="termexample-name-style">
|
1260
1265
|
|
1261
1266
|
|
@@ -1279,6 +1284,7 @@
|
|
1279
1284
|
|
1280
1285
|
|
1281
1286
|
|
1287
|
+
|
1282
1288
|
</xsl:attribute-set><xsl:attribute-set name="appendix-style">
|
1283
1289
|
|
1284
1290
|
|
@@ -1396,7 +1402,7 @@
|
|
1396
1402
|
|
1397
1403
|
|
1398
1404
|
|
1399
|
-
|
1405
|
+
|
1400
1406
|
</xsl:attribute-set><xsl:attribute-set name="formula-style">
|
1401
1407
|
|
1402
1408
|
</xsl:attribute-set><xsl:attribute-set name="image-style">
|
@@ -1437,7 +1443,43 @@
|
|
1437
1443
|
</xsl:attribute-set><xsl:attribute-set name="definition-style">
|
1438
1444
|
|
1439
1445
|
|
1440
|
-
</xsl:attribute-set><xsl:template
|
1446
|
+
</xsl:attribute-set><xsl:template name="processPrefaceSectionsDefault_Contents">
|
1447
|
+
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
|
1448
|
+
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
|
1449
|
+
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
|
1450
|
+
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']" mode="contents"/>
|
1451
|
+
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']" mode="contents"/>
|
1452
|
+
</xsl:template><xsl:template name="processMainSectionsDefault_Contents">
|
1453
|
+
<xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
|
1454
|
+
|
1455
|
+
<!-- Normative references -->
|
1456
|
+
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']" mode="contents"/>
|
1457
|
+
<!-- Terms and definitions -->
|
1458
|
+
<xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='terms'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='terms']] | /*/*[local-name()='sections']/*[local-name()='definitions'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='definitions']]" mode="contents"/>
|
1459
|
+
<!-- Another main sections -->
|
1460
|
+
<xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name() != 'terms' and local-name() != 'definitions' and not(@type='scope') and not(local-name() = 'clause' and .//*[local-name()='terms']) and not(local-name() = 'clause' and .//*[local-name()='definitions'])]" mode="contents"/>
|
1461
|
+
<xsl:apply-templates select="/*/*[local-name()='annex']" mode="contents"/>
|
1462
|
+
<!-- Bibliography -->
|
1463
|
+
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]" mode="contents"/>
|
1464
|
+
</xsl:template><xsl:template name="processPrefaceSectionsDefault">
|
1465
|
+
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
|
1466
|
+
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
|
1467
|
+
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']"/>
|
1468
|
+
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']"/>
|
1469
|
+
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']"/>
|
1470
|
+
</xsl:template><xsl:template name="processMainSectionsDefault">
|
1471
|
+
<xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']"/>
|
1472
|
+
|
1473
|
+
<!-- Normative references -->
|
1474
|
+
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']"/>
|
1475
|
+
<!-- Terms and definitions -->
|
1476
|
+
<xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='terms'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='terms']] | /*/*[local-name()='sections']/*[local-name()='definitions'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='definitions']]"/>
|
1477
|
+
<!-- Another main sections -->
|
1478
|
+
<xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name() != 'terms' and local-name() != 'definitions' and not(@type='scope') and not(local-name() = 'clause' and .//*[local-name()='terms']) and not(local-name() = 'clause' and .//*[local-name()='definitions'])]"/>
|
1479
|
+
<xsl:apply-templates select="/*/*[local-name()='annex']"/>
|
1480
|
+
<!-- Bibliography -->
|
1481
|
+
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]"/>
|
1482
|
+
</xsl:template><xsl:template match="text()">
|
1441
1483
|
<xsl:value-of select="."/>
|
1442
1484
|
</xsl:template><xsl:template match="*[local-name()='br']">
|
1443
1485
|
<xsl:value-of select="$linebreak"/>
|
@@ -1516,6 +1558,7 @@
|
|
1516
1558
|
|
1517
1559
|
|
1518
1560
|
|
1561
|
+
|
1519
1562
|
<fo:table id="{@id}" table-layout="fixed" width="100%" margin-left="{$margin-left}mm" margin-right="{$margin-left}mm" table-omit-footer-at-break="true">
|
1520
1563
|
|
1521
1564
|
|
@@ -1538,6 +1581,7 @@
|
|
1538
1581
|
|
1539
1582
|
|
1540
1583
|
|
1584
|
+
|
1541
1585
|
<xsl:for-each select="xalan:nodeset($colwidths)//column">
|
1542
1586
|
<xsl:choose>
|
1543
1587
|
<xsl:when test=". = 1 or . = 0">
|
@@ -1791,6 +1835,14 @@
|
|
1791
1835
|
</fo:table-row>
|
1792
1836
|
</xsl:template><xsl:template match="*[local-name()='th']">
|
1793
1837
|
<fo:table-cell text-align="{@align}" font-weight="bold" border="solid black 1pt" padding-left="1mm" display-align="center">
|
1838
|
+
<xsl:attribute name="text-align">
|
1839
|
+
<xsl:choose>
|
1840
|
+
<xsl:when test="@align">
|
1841
|
+
<xsl:value-of select="@align"/>
|
1842
|
+
</xsl:when>
|
1843
|
+
<xsl:otherwise>center</xsl:otherwise>
|
1844
|
+
</xsl:choose>
|
1845
|
+
</xsl:attribute>
|
1794
1846
|
|
1795
1847
|
|
1796
1848
|
|
@@ -1803,6 +1855,7 @@
|
|
1803
1855
|
|
1804
1856
|
|
1805
1857
|
|
1858
|
+
|
1806
1859
|
<xsl:if test="@colspan">
|
1807
1860
|
<xsl:attribute name="number-columns-spanned">
|
1808
1861
|
<xsl:value-of select="@colspan"/>
|
@@ -1819,6 +1872,14 @@
|
|
1819
1872
|
</fo:table-cell>
|
1820
1873
|
</xsl:template><xsl:template match="*[local-name()='td']">
|
1821
1874
|
<fo:table-cell text-align="{@align}" display-align="center" border="solid black 1pt" padding-left="1mm">
|
1875
|
+
<xsl:attribute name="text-align">
|
1876
|
+
<xsl:choose>
|
1877
|
+
<xsl:when test="@align">
|
1878
|
+
<xsl:value-of select="@align"/>
|
1879
|
+
</xsl:when>
|
1880
|
+
<xsl:otherwise>left</xsl:otherwise>
|
1881
|
+
</xsl:choose>
|
1882
|
+
</xsl:attribute>
|
1822
1883
|
|
1823
1884
|
|
1824
1885
|
|
@@ -3074,6 +3135,117 @@
|
|
3074
3135
|
<fo:block xsl:use-attribute-sets="recommendation-label-style">
|
3075
3136
|
<xsl:apply-templates/>
|
3076
3137
|
</fo:block>
|
3138
|
+
</xsl:template><xsl:template match="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
|
3139
|
+
<fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt">
|
3140
|
+
<fo:block-container margin-left="0mm" margin-right="0mm">
|
3141
|
+
<fo:table id="{@id}" table-layout="fixed" width="100%" border="0pt solid black">
|
3142
|
+
<xsl:variable name="simple-table">
|
3143
|
+
<xsl:call-template name="getSimpleTable"/>
|
3144
|
+
</xsl:variable>
|
3145
|
+
<xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
|
3146
|
+
<xsl:if test="$cols-count = 2 and not(ancestor::*[local-name()='table'])">
|
3147
|
+
<fo:table-column column-width="35mm"/>
|
3148
|
+
<fo:table-column column-width="115mm"/>
|
3149
|
+
</xsl:if>
|
3150
|
+
<xsl:apply-templates mode="requirement"/>
|
3151
|
+
</fo:table>
|
3152
|
+
<!-- fn processing -->
|
3153
|
+
<xsl:if test=".//*[local-name() = 'fn']">
|
3154
|
+
<xsl:for-each select="*[local-name() = 'tbody']">
|
3155
|
+
<fo:block font-size="90%" border-bottom="1.pt solid black">
|
3156
|
+
<xsl:call-template name="fn_display"/>
|
3157
|
+
</fo:block>
|
3158
|
+
</xsl:for-each>
|
3159
|
+
</xsl:if>
|
3160
|
+
</fo:block-container>
|
3161
|
+
</fo:block-container>
|
3162
|
+
</xsl:template><xsl:template match="*[local-name()='thead']" mode="requirement">
|
3163
|
+
<fo:table-header>
|
3164
|
+
<xsl:apply-templates mode="requirement"/>
|
3165
|
+
</fo:table-header>
|
3166
|
+
</xsl:template><xsl:template match="*[local-name()='tbody']" mode="requirement">
|
3167
|
+
<fo:table-body>
|
3168
|
+
<xsl:apply-templates mode="requirement"/>
|
3169
|
+
</fo:table-body>
|
3170
|
+
</xsl:template><xsl:template match="*[local-name()='tr']" mode="requirement">
|
3171
|
+
<fo:table-row>
|
3172
|
+
<xsl:apply-templates mode="requirement"/>
|
3173
|
+
</fo:table-row>
|
3174
|
+
</xsl:template><xsl:template match="*[local-name()='th']" mode="requirement">
|
3175
|
+
<fo:table-cell text-align="{@align}">
|
3176
|
+
<xsl:attribute name="text-align">
|
3177
|
+
<xsl:choose>
|
3178
|
+
<xsl:when test="@align">
|
3179
|
+
<xsl:value-of select="@align"/>
|
3180
|
+
</xsl:when>
|
3181
|
+
<xsl:otherwise>center</xsl:otherwise>
|
3182
|
+
</xsl:choose>
|
3183
|
+
</xsl:attribute>
|
3184
|
+
<xsl:if test="@colspan">
|
3185
|
+
<xsl:attribute name="number-columns-spanned">
|
3186
|
+
<xsl:value-of select="@colspan"/>
|
3187
|
+
</xsl:attribute>
|
3188
|
+
</xsl:if>
|
3189
|
+
<xsl:if test="@rowspan">
|
3190
|
+
<xsl:attribute name="number-rows-spanned">
|
3191
|
+
<xsl:value-of select="@rowspan"/>
|
3192
|
+
</xsl:attribute>
|
3193
|
+
</xsl:if>
|
3194
|
+
|
3195
|
+
<xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
|
3196
|
+
<xsl:attribute name="padding-top">0.5mm</xsl:attribute>
|
3197
|
+
<xsl:attribute name="background-color">rgb(165, 165, 165)</xsl:attribute>
|
3198
|
+
</xsl:if>
|
3199
|
+
<xsl:if test="ancestor::*[local-name()='table']/@type = 'recommendtest'">
|
3200
|
+
<xsl:attribute name="padding-top">0.5mm</xsl:attribute>
|
3201
|
+
<xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute>
|
3202
|
+
</xsl:if>
|
3203
|
+
|
3204
|
+
<fo:block>
|
3205
|
+
<xsl:apply-templates/>
|
3206
|
+
</fo:block>
|
3207
|
+
</fo:table-cell>
|
3208
|
+
</xsl:template><xsl:template match="*[local-name()='td']" mode="requirement">
|
3209
|
+
<fo:table-cell text-align="{@align}">
|
3210
|
+
<xsl:attribute name="text-align">
|
3211
|
+
<xsl:choose>
|
3212
|
+
<xsl:when test="@align">
|
3213
|
+
<xsl:value-of select="@align"/>
|
3214
|
+
</xsl:when>
|
3215
|
+
<xsl:otherwise>left</xsl:otherwise>
|
3216
|
+
</xsl:choose>
|
3217
|
+
</xsl:attribute>
|
3218
|
+
<xsl:if test="@colspan">
|
3219
|
+
<xsl:attribute name="number-columns-spanned">
|
3220
|
+
<xsl:value-of select="@colspan"/>
|
3221
|
+
</xsl:attribute>
|
3222
|
+
</xsl:if>
|
3223
|
+
<xsl:if test="@rowspan">
|
3224
|
+
<xsl:attribute name="number-rows-spanned">
|
3225
|
+
<xsl:value-of select="@rowspan"/>
|
3226
|
+
</xsl:attribute>
|
3227
|
+
</xsl:if>
|
3228
|
+
|
3229
|
+
<xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
|
3230
|
+
<xsl:attribute name="padding-left">0.5mm</xsl:attribute>
|
3231
|
+
<xsl:attribute name="padding-top">0.5mm</xsl:attribute>
|
3232
|
+
<xsl:if test="parent::*[local-name()='tr']/preceding-sibling::*[local-name()='tr'] and not(*[local-name()='table'])"> <!-- 2nd line and below -->
|
3233
|
+
<xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute>
|
3234
|
+
</xsl:if>
|
3235
|
+
</xsl:if>
|
3236
|
+
|
3237
|
+
<fo:block>
|
3238
|
+
<xsl:apply-templates/>
|
3239
|
+
</fo:block>
|
3240
|
+
</fo:table-cell>
|
3241
|
+
</xsl:template><xsl:template match="*[local-name() = 'p'][@class='RecommendationTitle' or @class = 'RecommendationTestTitle']" priority="2">
|
3242
|
+
<fo:block font-size="11pt" font-weight="bold" text-align="center" margin-bottom="4pt">
|
3243
|
+
<xsl:apply-templates/>
|
3244
|
+
</fo:block>
|
3245
|
+
</xsl:template><xsl:template match="*[local-name() = 'p'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]">
|
3246
|
+
<fo:block margin-bottom="10pt">
|
3247
|
+
<xsl:apply-templates/>
|
3248
|
+
</fo:block>
|
3077
3249
|
</xsl:template><xsl:template match="*[local-name() = 'termexample']">
|
3078
3250
|
<fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
|
3079
3251
|
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
@@ -3357,7 +3529,7 @@
|
|
3357
3529
|
<fo:block id="{@id}">
|
3358
3530
|
<xsl:apply-templates/>
|
3359
3531
|
</fo:block>
|
3360
|
-
</xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@
|
3532
|
+
</xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
|
3361
3533
|
|
3362
3534
|
<fo:block break-after="page"/>
|
3363
3535
|
|
@@ -3616,7 +3788,8 @@
|
|
3616
3788
|
|
3617
3789
|
|
3618
3790
|
|
3619
|
-
|
3791
|
+
|
3792
|
+
|
3620
3793
|
</xsl:variable>
|
3621
3794
|
<xsl:if test="$documentNS != $XSLNS">
|
3622
3795
|
<xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
|
data/lib/isodoc/nist/nist.sp.xsl
CHANGED
@@ -2308,6 +2308,7 @@
|
|
2308
2308
|
</xsl:attribute-set><xsl:attribute-set name="example-body-style">
|
2309
2309
|
|
2310
2310
|
|
2311
|
+
|
2311
2312
|
</xsl:attribute-set><xsl:attribute-set name="example-name-style">
|
2312
2313
|
|
2313
2314
|
|
@@ -2328,6 +2329,8 @@
|
|
2328
2329
|
|
2329
2330
|
|
2330
2331
|
|
2332
|
+
|
2333
|
+
|
2331
2334
|
|
2332
2335
|
|
2333
2336
|
</xsl:attribute-set><xsl:attribute-set name="example-p-style">
|
@@ -2342,6 +2345,8 @@
|
|
2342
2345
|
|
2343
2346
|
|
2344
2347
|
|
2348
|
+
|
2349
|
+
|
2345
2350
|
</xsl:attribute-set><xsl:attribute-set name="termexample-name-style">
|
2346
2351
|
|
2347
2352
|
|
@@ -2365,6 +2370,7 @@
|
|
2365
2370
|
|
2366
2371
|
|
2367
2372
|
|
2373
|
+
|
2368
2374
|
</xsl:attribute-set><xsl:attribute-set name="appendix-style">
|
2369
2375
|
|
2370
2376
|
|
@@ -2481,7 +2487,7 @@
|
|
2481
2487
|
|
2482
2488
|
|
2483
2489
|
|
2484
|
-
|
2490
|
+
|
2485
2491
|
</xsl:attribute-set><xsl:attribute-set name="formula-style">
|
2486
2492
|
|
2487
2493
|
</xsl:attribute-set><xsl:attribute-set name="image-style">
|
@@ -2522,7 +2528,43 @@
|
|
2522
2528
|
</xsl:attribute-set><xsl:attribute-set name="definition-style">
|
2523
2529
|
|
2524
2530
|
|
2525
|
-
</xsl:attribute-set><xsl:template
|
2531
|
+
</xsl:attribute-set><xsl:template name="processPrefaceSectionsDefault_Contents">
|
2532
|
+
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
|
2533
|
+
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
|
2534
|
+
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
|
2535
|
+
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']" mode="contents"/>
|
2536
|
+
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']" mode="contents"/>
|
2537
|
+
</xsl:template><xsl:template name="processMainSectionsDefault_Contents">
|
2538
|
+
<xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
|
2539
|
+
|
2540
|
+
<!-- Normative references -->
|
2541
|
+
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']" mode="contents"/>
|
2542
|
+
<!-- Terms and definitions -->
|
2543
|
+
<xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='terms'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='terms']] | /*/*[local-name()='sections']/*[local-name()='definitions'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='definitions']]" mode="contents"/>
|
2544
|
+
<!-- Another main sections -->
|
2545
|
+
<xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name() != 'terms' and local-name() != 'definitions' and not(@type='scope') and not(local-name() = 'clause' and .//*[local-name()='terms']) and not(local-name() = 'clause' and .//*[local-name()='definitions'])]" mode="contents"/>
|
2546
|
+
<xsl:apply-templates select="/*/*[local-name()='annex']" mode="contents"/>
|
2547
|
+
<!-- Bibliography -->
|
2548
|
+
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]" mode="contents"/>
|
2549
|
+
</xsl:template><xsl:template name="processPrefaceSectionsDefault">
|
2550
|
+
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
|
2551
|
+
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
|
2552
|
+
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']"/>
|
2553
|
+
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']"/>
|
2554
|
+
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']"/>
|
2555
|
+
</xsl:template><xsl:template name="processMainSectionsDefault">
|
2556
|
+
<xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']"/>
|
2557
|
+
|
2558
|
+
<!-- Normative references -->
|
2559
|
+
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']"/>
|
2560
|
+
<!-- Terms and definitions -->
|
2561
|
+
<xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='terms'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='terms']] | /*/*[local-name()='sections']/*[local-name()='definitions'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='definitions']]"/>
|
2562
|
+
<!-- Another main sections -->
|
2563
|
+
<xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name() != 'terms' and local-name() != 'definitions' and not(@type='scope') and not(local-name() = 'clause' and .//*[local-name()='terms']) and not(local-name() = 'clause' and .//*[local-name()='definitions'])]"/>
|
2564
|
+
<xsl:apply-templates select="/*/*[local-name()='annex']"/>
|
2565
|
+
<!-- Bibliography -->
|
2566
|
+
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]"/>
|
2567
|
+
</xsl:template><xsl:template match="text()">
|
2526
2568
|
<xsl:value-of select="."/>
|
2527
2569
|
</xsl:template><xsl:template match="*[local-name()='br']">
|
2528
2570
|
<xsl:value-of select="$linebreak"/>
|
@@ -2601,6 +2643,7 @@
|
|
2601
2643
|
|
2602
2644
|
|
2603
2645
|
|
2646
|
+
|
2604
2647
|
<fo:table id="{@id}" table-layout="fixed" width="100%" margin-left="{$margin-left}mm" margin-right="{$margin-left}mm" table-omit-footer-at-break="true">
|
2605
2648
|
|
2606
2649
|
|
@@ -2623,6 +2666,7 @@
|
|
2623
2666
|
|
2624
2667
|
|
2625
2668
|
|
2669
|
+
|
2626
2670
|
<xsl:for-each select="xalan:nodeset($colwidths)//column">
|
2627
2671
|
<xsl:choose>
|
2628
2672
|
<xsl:when test=". = 1 or . = 0">
|
@@ -2876,6 +2920,14 @@
|
|
2876
2920
|
</fo:table-row>
|
2877
2921
|
</xsl:template><xsl:template match="*[local-name()='th']">
|
2878
2922
|
<fo:table-cell text-align="{@align}" font-weight="bold" border="solid black 1pt" padding-left="1mm" display-align="center">
|
2923
|
+
<xsl:attribute name="text-align">
|
2924
|
+
<xsl:choose>
|
2925
|
+
<xsl:when test="@align">
|
2926
|
+
<xsl:value-of select="@align"/>
|
2927
|
+
</xsl:when>
|
2928
|
+
<xsl:otherwise>center</xsl:otherwise>
|
2929
|
+
</xsl:choose>
|
2930
|
+
</xsl:attribute>
|
2879
2931
|
|
2880
2932
|
|
2881
2933
|
|
@@ -2888,6 +2940,7 @@
|
|
2888
2940
|
|
2889
2941
|
|
2890
2942
|
|
2943
|
+
|
2891
2944
|
<xsl:if test="@colspan">
|
2892
2945
|
<xsl:attribute name="number-columns-spanned">
|
2893
2946
|
<xsl:value-of select="@colspan"/>
|
@@ -2904,6 +2957,14 @@
|
|
2904
2957
|
</fo:table-cell>
|
2905
2958
|
</xsl:template><xsl:template match="*[local-name()='td']">
|
2906
2959
|
<fo:table-cell text-align="{@align}" display-align="center" border="solid black 1pt" padding-left="1mm">
|
2960
|
+
<xsl:attribute name="text-align">
|
2961
|
+
<xsl:choose>
|
2962
|
+
<xsl:when test="@align">
|
2963
|
+
<xsl:value-of select="@align"/>
|
2964
|
+
</xsl:when>
|
2965
|
+
<xsl:otherwise>left</xsl:otherwise>
|
2966
|
+
</xsl:choose>
|
2967
|
+
</xsl:attribute>
|
2907
2968
|
|
2908
2969
|
|
2909
2970
|
|
@@ -4161,6 +4222,117 @@
|
|
4161
4222
|
<fo:block xsl:use-attribute-sets="recommendation-label-style">
|
4162
4223
|
<xsl:apply-templates/>
|
4163
4224
|
</fo:block>
|
4225
|
+
</xsl:template><xsl:template match="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
|
4226
|
+
<fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt">
|
4227
|
+
<fo:block-container margin-left="0mm" margin-right="0mm">
|
4228
|
+
<fo:table id="{@id}" table-layout="fixed" width="100%" border="0pt solid black">
|
4229
|
+
<xsl:variable name="simple-table">
|
4230
|
+
<xsl:call-template name="getSimpleTable"/>
|
4231
|
+
</xsl:variable>
|
4232
|
+
<xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
|
4233
|
+
<xsl:if test="$cols-count = 2 and not(ancestor::*[local-name()='table'])">
|
4234
|
+
<fo:table-column column-width="35mm"/>
|
4235
|
+
<fo:table-column column-width="115mm"/>
|
4236
|
+
</xsl:if>
|
4237
|
+
<xsl:apply-templates mode="requirement"/>
|
4238
|
+
</fo:table>
|
4239
|
+
<!-- fn processing -->
|
4240
|
+
<xsl:if test=".//*[local-name() = 'fn']">
|
4241
|
+
<xsl:for-each select="*[local-name() = 'tbody']">
|
4242
|
+
<fo:block font-size="90%" border-bottom="1.pt solid black">
|
4243
|
+
<xsl:call-template name="fn_display"/>
|
4244
|
+
</fo:block>
|
4245
|
+
</xsl:for-each>
|
4246
|
+
</xsl:if>
|
4247
|
+
</fo:block-container>
|
4248
|
+
</fo:block-container>
|
4249
|
+
</xsl:template><xsl:template match="*[local-name()='thead']" mode="requirement">
|
4250
|
+
<fo:table-header>
|
4251
|
+
<xsl:apply-templates mode="requirement"/>
|
4252
|
+
</fo:table-header>
|
4253
|
+
</xsl:template><xsl:template match="*[local-name()='tbody']" mode="requirement">
|
4254
|
+
<fo:table-body>
|
4255
|
+
<xsl:apply-templates mode="requirement"/>
|
4256
|
+
</fo:table-body>
|
4257
|
+
</xsl:template><xsl:template match="*[local-name()='tr']" mode="requirement">
|
4258
|
+
<fo:table-row>
|
4259
|
+
<xsl:apply-templates mode="requirement"/>
|
4260
|
+
</fo:table-row>
|
4261
|
+
</xsl:template><xsl:template match="*[local-name()='th']" mode="requirement">
|
4262
|
+
<fo:table-cell text-align="{@align}">
|
4263
|
+
<xsl:attribute name="text-align">
|
4264
|
+
<xsl:choose>
|
4265
|
+
<xsl:when test="@align">
|
4266
|
+
<xsl:value-of select="@align"/>
|
4267
|
+
</xsl:when>
|
4268
|
+
<xsl:otherwise>center</xsl:otherwise>
|
4269
|
+
</xsl:choose>
|
4270
|
+
</xsl:attribute>
|
4271
|
+
<xsl:if test="@colspan">
|
4272
|
+
<xsl:attribute name="number-columns-spanned">
|
4273
|
+
<xsl:value-of select="@colspan"/>
|
4274
|
+
</xsl:attribute>
|
4275
|
+
</xsl:if>
|
4276
|
+
<xsl:if test="@rowspan">
|
4277
|
+
<xsl:attribute name="number-rows-spanned">
|
4278
|
+
<xsl:value-of select="@rowspan"/>
|
4279
|
+
</xsl:attribute>
|
4280
|
+
</xsl:if>
|
4281
|
+
|
4282
|
+
<xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
|
4283
|
+
<xsl:attribute name="padding-top">0.5mm</xsl:attribute>
|
4284
|
+
<xsl:attribute name="background-color">rgb(165, 165, 165)</xsl:attribute>
|
4285
|
+
</xsl:if>
|
4286
|
+
<xsl:if test="ancestor::*[local-name()='table']/@type = 'recommendtest'">
|
4287
|
+
<xsl:attribute name="padding-top">0.5mm</xsl:attribute>
|
4288
|
+
<xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute>
|
4289
|
+
</xsl:if>
|
4290
|
+
|
4291
|
+
<fo:block>
|
4292
|
+
<xsl:apply-templates/>
|
4293
|
+
</fo:block>
|
4294
|
+
</fo:table-cell>
|
4295
|
+
</xsl:template><xsl:template match="*[local-name()='td']" mode="requirement">
|
4296
|
+
<fo:table-cell text-align="{@align}">
|
4297
|
+
<xsl:attribute name="text-align">
|
4298
|
+
<xsl:choose>
|
4299
|
+
<xsl:when test="@align">
|
4300
|
+
<xsl:value-of select="@align"/>
|
4301
|
+
</xsl:when>
|
4302
|
+
<xsl:otherwise>left</xsl:otherwise>
|
4303
|
+
</xsl:choose>
|
4304
|
+
</xsl:attribute>
|
4305
|
+
<xsl:if test="@colspan">
|
4306
|
+
<xsl:attribute name="number-columns-spanned">
|
4307
|
+
<xsl:value-of select="@colspan"/>
|
4308
|
+
</xsl:attribute>
|
4309
|
+
</xsl:if>
|
4310
|
+
<xsl:if test="@rowspan">
|
4311
|
+
<xsl:attribute name="number-rows-spanned">
|
4312
|
+
<xsl:value-of select="@rowspan"/>
|
4313
|
+
</xsl:attribute>
|
4314
|
+
</xsl:if>
|
4315
|
+
|
4316
|
+
<xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
|
4317
|
+
<xsl:attribute name="padding-left">0.5mm</xsl:attribute>
|
4318
|
+
<xsl:attribute name="padding-top">0.5mm</xsl:attribute>
|
4319
|
+
<xsl:if test="parent::*[local-name()='tr']/preceding-sibling::*[local-name()='tr'] and not(*[local-name()='table'])"> <!-- 2nd line and below -->
|
4320
|
+
<xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute>
|
4321
|
+
</xsl:if>
|
4322
|
+
</xsl:if>
|
4323
|
+
|
4324
|
+
<fo:block>
|
4325
|
+
<xsl:apply-templates/>
|
4326
|
+
</fo:block>
|
4327
|
+
</fo:table-cell>
|
4328
|
+
</xsl:template><xsl:template match="*[local-name() = 'p'][@class='RecommendationTitle' or @class = 'RecommendationTestTitle']" priority="2">
|
4329
|
+
<fo:block font-size="11pt" font-weight="bold" text-align="center" margin-bottom="4pt">
|
4330
|
+
<xsl:apply-templates/>
|
4331
|
+
</fo:block>
|
4332
|
+
</xsl:template><xsl:template match="*[local-name() = 'p'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]">
|
4333
|
+
<fo:block margin-bottom="10pt">
|
4334
|
+
<xsl:apply-templates/>
|
4335
|
+
</fo:block>
|
4164
4336
|
</xsl:template><xsl:template match="*[local-name() = 'termexample']">
|
4165
4337
|
<fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
|
4166
4338
|
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
@@ -4440,7 +4612,7 @@
|
|
4440
4612
|
<fo:block id="{@id}">
|
4441
4613
|
<xsl:apply-templates/>
|
4442
4614
|
</fo:block>
|
4443
|
-
</xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@
|
4615
|
+
</xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
|
4444
4616
|
|
4445
4617
|
<fo:block id="{@id}">
|
4446
4618
|
<xsl:apply-templates/>
|
@@ -4697,7 +4869,8 @@
|
|
4697
4869
|
|
4698
4870
|
|
4699
4871
|
|
4700
|
-
|
4872
|
+
|
4873
|
+
|
4701
4874
|
</xsl:variable>
|
4702
4875
|
<xsl:if test="$documentNS != $XSLNS">
|
4703
4876
|
<xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-nist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: htmlentities
|