metanorma-csa 1.8.9 → 1.8.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/asciidoctor/csa/converter.rb +33 -31
- data/lib/asciidoctor/csa/isodoc.rng +23 -9
- data/lib/isodoc/csa/csa.standard.xsl +161 -30
- data/lib/metanorma/csa/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: 535e26923fac74da1e84685f312a1fb35b1a3fedd763f26cb2297b0c37a834ec
|
|
4
|
+
data.tar.gz: fdf62f0bf68fd064ba5b71fc13765c6bc7e49a3c3c6298771c85554c7f39eab0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '075165019c0f2e2a7b76c81b219058c92a16d4f2b225982d2c5eccf74d2f27881e6cacef7e69ede64ec3c51584ae12e658e7e81b3f54b11aadb5081367d04fa4'
|
|
7
|
+
data.tar.gz: e280c5fd4fc6a77fc1e4210d4e0670a3736ee6aecea82d3cc44cc828aef2902bcf9f516735779e524afb27db052fc396b5e278cf3aae83633322a85568022e65
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require
|
|
4
|
-
require
|
|
5
|
-
require
|
|
6
|
-
require
|
|
7
|
-
require
|
|
8
|
-
require
|
|
9
|
-
require
|
|
10
|
-
require
|
|
3
|
+
require "asciidoctor"
|
|
4
|
+
require "metanorma-generic"
|
|
5
|
+
require "isodoc/csa/html_convert"
|
|
6
|
+
require "isodoc/csa/pdf_convert"
|
|
7
|
+
require "isodoc/csa/word_convert"
|
|
8
|
+
require "isodoc/csa/presentation_xml_convert"
|
|
9
|
+
require "metanorma/csa"
|
|
10
|
+
require "fileutils"
|
|
11
11
|
|
|
12
12
|
module Asciidoctor
|
|
13
13
|
module Csa
|
|
14
14
|
class Converter < ::Asciidoctor::Generic::Converter
|
|
15
|
-
XML_ROOT_TAG = "csa-standard"
|
|
16
|
-
XML_NAMESPACE = "https://www.metanorma.org/ns/csa"
|
|
15
|
+
XML_ROOT_TAG = "csa-standard"
|
|
16
|
+
XML_NAMESPACE = "https://www.metanorma.org/ns/csa"
|
|
17
17
|
|
|
18
18
|
register_for "csa"
|
|
19
19
|
|
|
@@ -21,46 +21,47 @@ module Asciidoctor
|
|
|
21
21
|
Metanorma::Csa.configuration
|
|
22
22
|
end
|
|
23
23
|
|
|
24
|
-
def personal_role(node,
|
|
24
|
+
def personal_role(node, contrib, suffix)
|
|
25
25
|
role = node.attr("role#{suffix}")&.downcase || "full author"
|
|
26
|
-
|
|
26
|
+
contrib.role **{ type: role == "editor" ? "editor" : "author" } do |r|
|
|
27
27
|
r.description role.strip.gsub(/\s/, "-")
|
|
28
28
|
end
|
|
29
29
|
end
|
|
30
30
|
|
|
31
31
|
def metadata_committee(node, xml)
|
|
32
32
|
return unless node.attr("technical-committee")
|
|
33
|
+
|
|
33
34
|
xml.editorialgroup do |a|
|
|
34
35
|
a.committee node.attr("technical-committee"),
|
|
35
|
-
|
|
36
|
+
**attr_code(type: node.attr("technical-committee-type"))
|
|
36
37
|
i = 2
|
|
37
|
-
while node.attr("technical-committee_#{i}")
|
|
38
|
+
while node.attr("technical-committee_#{i}")
|
|
38
39
|
a.committee node.attr("technical-committee_#{i}"),
|
|
39
|
-
|
|
40
|
+
**attr_code(type: node.attr("technical-committee-type_#{i}"))
|
|
40
41
|
i += 1
|
|
41
42
|
end
|
|
42
43
|
end
|
|
43
44
|
end
|
|
44
45
|
|
|
45
|
-
def title_validate(
|
|
46
|
+
def title_validate(_root)
|
|
46
47
|
nil
|
|
47
48
|
end
|
|
48
49
|
|
|
49
50
|
def outputs(node, ret)
|
|
50
|
-
File.open(@filename
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
51
|
+
File.open("#{@filename}.xml", "w:UTF-8") { |f| f.write(ret) }
|
|
52
|
+
presentation_xml_converter(node).convert("#{@filename}.xml")
|
|
53
|
+
html_converter(node).convert("#{@filename}.presentation.xml",
|
|
54
|
+
nil, false, "#{@filename}.html")
|
|
55
|
+
doc_converter(node).convert("#{@filename}.presentation.xml",
|
|
56
|
+
nil, false, "#{@filename}.doc")
|
|
57
|
+
pdf_converter(node)&.convert("#{@filename}.presentation.xml",
|
|
58
|
+
nil, false, "#{@filename}.pdf")
|
|
58
59
|
end
|
|
59
60
|
|
|
60
|
-
def sections_cleanup(
|
|
61
|
+
def sections_cleanup(xml)
|
|
61
62
|
super
|
|
62
|
-
|
|
63
|
-
h.delete(
|
|
63
|
+
xml.xpath("//*[@inline-header]").each do |h|
|
|
64
|
+
h.delete("inline-header")
|
|
64
65
|
end
|
|
65
66
|
end
|
|
66
67
|
|
|
@@ -74,13 +75,13 @@ module Asciidoctor
|
|
|
74
75
|
r["type"] == "author" or next
|
|
75
76
|
role = r.at("./description").text
|
|
76
77
|
%w{full-author contributor staff reviewer}.include?(role) or
|
|
77
|
-
|
|
78
|
-
|
|
78
|
+
@log.add("Document Attributes", nil,
|
|
79
|
+
"#{role} is not a recognised role")
|
|
79
80
|
end
|
|
80
81
|
end
|
|
81
82
|
|
|
82
|
-
def style(
|
|
83
|
-
|
|
83
|
+
def style(_node, _text)
|
|
84
|
+
nil
|
|
84
85
|
end
|
|
85
86
|
|
|
86
87
|
def html_converter(node)
|
|
@@ -89,6 +90,7 @@ module Asciidoctor
|
|
|
89
90
|
|
|
90
91
|
def pdf_converter(node)
|
|
91
92
|
return if node.attr("no-pdf")
|
|
93
|
+
|
|
92
94
|
IsoDoc::Csa::PdfConvert.new(html_extract_attributes(node))
|
|
93
95
|
end
|
|
94
96
|
|
|
@@ -32,6 +32,18 @@
|
|
|
32
32
|
<ref name="DocumentType"/>
|
|
33
33
|
</element>
|
|
34
34
|
</define>
|
|
35
|
+
<define name="section-title">
|
|
36
|
+
<element name="title">
|
|
37
|
+
<zeroOrMore>
|
|
38
|
+
<ref name="TextElement"/>
|
|
39
|
+
</zeroOrMore>
|
|
40
|
+
</element>
|
|
41
|
+
<zeroOrMore>
|
|
42
|
+
<element name="variant-title">
|
|
43
|
+
<ref name="TypedTitleString"/>
|
|
44
|
+
</element>
|
|
45
|
+
</zeroOrMore>
|
|
46
|
+
</define>
|
|
35
47
|
<define name="hyperlink">
|
|
36
48
|
<element name="link">
|
|
37
49
|
<attribute name="target">
|
|
@@ -158,15 +170,17 @@
|
|
|
158
170
|
<data type="boolean"/>
|
|
159
171
|
</attribute>
|
|
160
172
|
</optional>
|
|
161
|
-
<
|
|
162
|
-
<
|
|
163
|
-
<
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
173
|
+
<optional>
|
|
174
|
+
<attribute name="type">
|
|
175
|
+
<choice>
|
|
176
|
+
<value>roman</value>
|
|
177
|
+
<value>alphabet</value>
|
|
178
|
+
<value>arabic</value>
|
|
179
|
+
<value>roman_upper</value>
|
|
180
|
+
<value>alphabet_upper</value>
|
|
181
|
+
</choice>
|
|
182
|
+
</attribute>
|
|
183
|
+
</optional>
|
|
170
184
|
<oneOrMore>
|
|
171
185
|
<ref name="li"/>
|
|
172
186
|
</oneOrMore>
|
|
@@ -86,12 +86,12 @@
|
|
|
86
86
|
<fo:flow flow-name="xsl-region-body">
|
|
87
87
|
|
|
88
88
|
<fo:block-container width="136mm" margin-bottom="12pt">
|
|
89
|
-
<fo:block font-size="36pt" font-weight="bold" color="rgb(54, 59, 74)">
|
|
89
|
+
<fo:block font-size="36pt" font-weight="bold" color="rgb(54, 59, 74)" role="H1">
|
|
90
90
|
<xsl:value-of select="/csa:csa-standard/csa:bibdata/csa:title[@language = 'en']"/>
|
|
91
91
|
</fo:block>
|
|
92
92
|
</fo:block-container>
|
|
93
93
|
|
|
94
|
-
<fo:block font-size="26pt" color="rgb(55, 60, 75)">
|
|
94
|
+
<fo:block font-size="26pt" color="rgb(55, 60, 75)" role="H2">
|
|
95
95
|
<xsl:value-of select="/csa:csa-standard/csa:bibdata/csa:title[@language = 'en' and @type = 'subtitle']"/>
|
|
96
96
|
</fo:block>
|
|
97
97
|
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
<xsl:with-param name="name" select="'title-acknowledgements'"/>
|
|
146
146
|
</xsl:call-template>
|
|
147
147
|
</xsl:variable>
|
|
148
|
-
<fo:block font-size="26pt" margin-bottom="18pt"><xsl:value-of select="$title-acknowledgements"/></fo:block>
|
|
148
|
+
<fo:block font-size="26pt" margin-bottom="18pt" role="H1"><xsl:value-of select="$title-acknowledgements"/></fo:block>
|
|
149
149
|
|
|
150
150
|
<xsl:variable name="persons">
|
|
151
151
|
<xsl:for-each select="/csa:csa-standard/csa:bibdata/csa:contributor[csa:person]">
|
|
@@ -206,11 +206,11 @@
|
|
|
206
206
|
<xsl:with-param name="name" select="'title-toc'"/>
|
|
207
207
|
</xsl:call-template>
|
|
208
208
|
</xsl:variable>
|
|
209
|
-
<fo:block font-size="26pt" color="black" margin-top="2pt" margin-bottom="30pt"><xsl:value-of select="$title-toc"/></fo:block>
|
|
209
|
+
<fo:block font-size="26pt" color="black" margin-top="2pt" margin-bottom="30pt" role="H1"><xsl:value-of select="$title-toc"/></fo:block>
|
|
210
210
|
|
|
211
|
-
<fo:block margin-left="-3mm">
|
|
211
|
+
<fo:block margin-left="-3mm" role="TOC">
|
|
212
212
|
<xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']">
|
|
213
|
-
<fo:block>
|
|
213
|
+
<fo:block role="TOCI">
|
|
214
214
|
<fo:list-block>
|
|
215
215
|
<xsl:attribute name="provisional-distance-between-starts">
|
|
216
216
|
<xsl:choose>
|
|
@@ -315,7 +315,10 @@
|
|
|
315
315
|
|
|
316
316
|
|
|
317
317
|
<xsl:template match="csa:license-statement//csa:title">
|
|
318
|
-
<
|
|
318
|
+
<xsl:variable name="level">
|
|
319
|
+
<xsl:call-template name="getLevel"/>
|
|
320
|
+
</xsl:variable>
|
|
321
|
+
<fo:block text-align="center" font-weight="bold" margin-top="4pt" role="H{$level}">
|
|
319
322
|
<xsl:apply-templates/>
|
|
320
323
|
</fo:block>
|
|
321
324
|
</xsl:template>
|
|
@@ -336,7 +339,10 @@
|
|
|
336
339
|
</xsl:template>
|
|
337
340
|
|
|
338
341
|
<xsl:template match="csa:copyright-statement//csa:title">
|
|
339
|
-
<
|
|
342
|
+
<xsl:variable name="level">
|
|
343
|
+
<xsl:call-template name="getLevel"/>
|
|
344
|
+
</xsl:variable>
|
|
345
|
+
<fo:block font-weight="bold" text-align="center" role="H{$level}">
|
|
340
346
|
<xsl:apply-templates/>
|
|
341
347
|
</fo:block>
|
|
342
348
|
</xsl:template>
|
|
@@ -366,7 +372,10 @@
|
|
|
366
372
|
</xsl:template>
|
|
367
373
|
|
|
368
374
|
<xsl:template match="csa:legal-statement//csa:title">
|
|
369
|
-
<
|
|
375
|
+
<xsl:variable name="level">
|
|
376
|
+
<xsl:call-template name="getLevel"/>
|
|
377
|
+
</xsl:variable>
|
|
378
|
+
<fo:block text-align="center" font-weight="bold" padding-top="2mm" margin-bottom="6pt" role="H{$level}">
|
|
370
379
|
<xsl:apply-templates/>
|
|
371
380
|
</fo:block>
|
|
372
381
|
</xsl:template>
|
|
@@ -402,8 +411,9 @@
|
|
|
402
411
|
<xsl:otherwise>black</xsl:otherwise>
|
|
403
412
|
</xsl:choose>
|
|
404
413
|
</xsl:variable>
|
|
405
|
-
<fo:block font-size="12pt" text-align="center" margin-bottom="12pt" keep-with-next="always" color="{$color}">
|
|
414
|
+
<fo:block font-size="12pt" text-align="center" margin-bottom="12pt" keep-with-next="always" color="{$color}" role="H{$level}">
|
|
406
415
|
<xsl:apply-templates/>
|
|
416
|
+
<xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
|
|
407
417
|
</fo:block>
|
|
408
418
|
</xsl:template>
|
|
409
419
|
|
|
@@ -454,6 +464,7 @@
|
|
|
454
464
|
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
|
455
465
|
<xsl:attribute name="color"><xsl:value-of select="$color"/></xsl:attribute>
|
|
456
466
|
<xsl:attribute name="line-height">120%</xsl:attribute>
|
|
467
|
+
<xsl:attribute name="role">H<xsl:value-of select="$level"/></xsl:attribute>
|
|
457
468
|
|
|
458
469
|
<xsl:if test="$level = 2">
|
|
459
470
|
<fo:inline padding-right="1mm">
|
|
@@ -462,7 +473,8 @@
|
|
|
462
473
|
</xsl:if>
|
|
463
474
|
|
|
464
475
|
<xsl:apply-templates/>
|
|
465
|
-
|
|
476
|
+
<xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
|
|
477
|
+
|
|
466
478
|
</xsl:element>
|
|
467
479
|
|
|
468
480
|
</xsl:template>
|
|
@@ -718,7 +730,10 @@
|
|
|
718
730
|
<xsl:otherwise>12pt</xsl:otherwise>
|
|
719
731
|
</xsl:choose>
|
|
720
732
|
</xsl:variable>
|
|
721
|
-
<
|
|
733
|
+
<xsl:variable name="levelTerm">
|
|
734
|
+
<xsl:call-template name="getLevelTermName"/>
|
|
735
|
+
</xsl:variable>
|
|
736
|
+
<fo:block font-size="{$font-size}" role="H{$levelTerm}">
|
|
722
737
|
<fo:block font-weight="bold" keep-with-next="always">
|
|
723
738
|
<xsl:apply-templates select="ancestor::csa:term/csa:name" mode="presentation"/>
|
|
724
739
|
</fo:block>
|
|
@@ -860,12 +875,12 @@
|
|
|
860
875
|
</xsl:template>
|
|
861
876
|
|
|
862
877
|
<xsl:template name="insertHeaderFooter">
|
|
863
|
-
<fo:static-content flow-name="header">
|
|
878
|
+
<fo:static-content flow-name="header" role="artifact">
|
|
864
879
|
<fo:block-container height="2.5mm" background-color="{$color-header-document}">
|
|
865
880
|
<fo:block font-size="1pt"> </fo:block>
|
|
866
881
|
</fo:block-container>
|
|
867
882
|
</fo:static-content>
|
|
868
|
-
<fo:static-content flow-name="footer">
|
|
883
|
+
<fo:static-content flow-name="footer" role="artifact">
|
|
869
884
|
<fo:block-container font-family="Azo Sans Lt" font-size="10.1pt" height="100%" display-align="after"> <!-- 11.5pt -->
|
|
870
885
|
<fo:block padding-bottom="13mm" text-align="right" color="rgb(144, 144, 144)">
|
|
871
886
|
<fo:inline padding-right="7mm"><xsl:value-of select="$copyright"/></fo:inline>
|
|
@@ -1054,6 +1069,7 @@
|
|
|
1054
1069
|
</xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
|
|
1055
1070
|
<xsl:attribute name="white-space">pre</xsl:attribute>
|
|
1056
1071
|
<xsl:attribute name="wrap-option">wrap</xsl:attribute>
|
|
1072
|
+
<xsl:attribute name="role">Code</xsl:attribute>
|
|
1057
1073
|
|
|
1058
1074
|
|
|
1059
1075
|
<xsl:attribute name="font-family">Source Code Pro</xsl:attribute>
|
|
@@ -1080,8 +1096,13 @@
|
|
|
1080
1096
|
|
|
1081
1097
|
</xsl:attribute-set><xsl:attribute-set name="requirement-label-style">
|
|
1082
1098
|
|
|
1083
|
-
</xsl:attribute-set><xsl:attribute-set name="
|
|
1084
|
-
</xsl:attribute-set><xsl:attribute-set name="
|
|
1099
|
+
</xsl:attribute-set><xsl:attribute-set name="subject-style">
|
|
1100
|
+
</xsl:attribute-set><xsl:attribute-set name="inherit-style">
|
|
1101
|
+
</xsl:attribute-set><xsl:attribute-set name="description-style">
|
|
1102
|
+
</xsl:attribute-set><xsl:attribute-set name="specification-style">
|
|
1103
|
+
</xsl:attribute-set><xsl:attribute-set name="measurement-target-style">
|
|
1104
|
+
</xsl:attribute-set><xsl:attribute-set name="verification-style">
|
|
1105
|
+
</xsl:attribute-set><xsl:attribute-set name="import-style">
|
|
1085
1106
|
</xsl:attribute-set><xsl:attribute-set name="recommendation-style">
|
|
1086
1107
|
|
|
1087
1108
|
|
|
@@ -1288,7 +1309,8 @@
|
|
|
1288
1309
|
|
|
1289
1310
|
|
|
1290
1311
|
|
|
1291
|
-
</xsl:attribute-set><xsl:attribute-set name="quote-style">
|
|
1312
|
+
</xsl:attribute-set><xsl:attribute-set name="quote-style">
|
|
1313
|
+
<xsl:attribute name="role">BlockQuote</xsl:attribute>
|
|
1292
1314
|
|
|
1293
1315
|
<xsl:attribute name="margin-top">12pt</xsl:attribute>
|
|
1294
1316
|
<xsl:attribute name="margin-left">13mm</xsl:attribute>
|
|
@@ -1494,7 +1516,9 @@
|
|
|
1494
1516
|
|
|
1495
1517
|
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
|
1496
1518
|
|
|
1497
|
-
|
|
1519
|
+
|
|
1520
|
+
|
|
1521
|
+
|
|
1498
1522
|
|
|
1499
1523
|
|
|
1500
1524
|
|
|
@@ -3338,16 +3362,68 @@
|
|
|
3338
3362
|
<xsl:with-param name="isDeleted" select="$isDeleted"/>
|
|
3339
3363
|
</xsl:call-template>
|
|
3340
3364
|
|
|
3365
|
+
|
|
3366
|
+
|
|
3341
3367
|
<xsl:variable name="mathml">
|
|
3342
3368
|
<xsl:apply-templates select="." mode="mathml"/>
|
|
3343
3369
|
</xsl:variable>
|
|
3344
3370
|
<fo:instream-foreign-object fox:alt-text="Math">
|
|
3345
3371
|
|
|
3346
3372
|
|
|
3373
|
+
<xsl:variable name="comment_text_following" select="following-sibling::node()[1][self::comment()]"/>
|
|
3374
|
+
<xsl:variable name="comment_text_">
|
|
3375
|
+
<xsl:choose>
|
|
3376
|
+
<xsl:when test="normalize-space($comment_text_following) != ''">
|
|
3377
|
+
<xsl:value-of select="$comment_text_following"/>
|
|
3378
|
+
</xsl:when>
|
|
3379
|
+
<xsl:otherwise>
|
|
3380
|
+
<xsl:value-of select="normalize-space(translate(.,' ',' '))"/>
|
|
3381
|
+
</xsl:otherwise>
|
|
3382
|
+
</xsl:choose>
|
|
3383
|
+
</xsl:variable>
|
|
3384
|
+
<xsl:variable name="comment_text" select="java:org.metanorma.fop.Util.unescape($comment_text_)"/>
|
|
3385
|
+
|
|
3386
|
+
<xsl:if test="normalize-space($comment_text) != ''">
|
|
3387
|
+
<!-- put Mathin Alternate Text -->
|
|
3388
|
+
<xsl:attribute name="fox:alt-text">
|
|
3389
|
+
<xsl:value-of select="java:org.metanorma.fop.Util.unescape($comment_text)"/>
|
|
3390
|
+
</xsl:attribute>
|
|
3391
|
+
</xsl:if>
|
|
3392
|
+
|
|
3393
|
+
<xsl:variable name="mathml_content">
|
|
3394
|
+
<xsl:apply-templates select="." mode="mathml_actual_text"/>
|
|
3395
|
+
</xsl:variable>
|
|
3396
|
+
<!-- put MathML in Actual Text -->
|
|
3397
|
+
<xsl:attribute name="fox:actual-text">
|
|
3398
|
+
<xsl:value-of select="$mathml_content"/>
|
|
3399
|
+
</xsl:attribute>
|
|
3400
|
+
|
|
3401
|
+
|
|
3347
3402
|
<!-- <xsl:copy-of select="."/> -->
|
|
3348
3403
|
<xsl:copy-of select="xalan:nodeset($mathml)"/>
|
|
3349
3404
|
</fo:instream-foreign-object>
|
|
3350
3405
|
</fo:inline>
|
|
3406
|
+
</xsl:template><xsl:template match="mathml:*" mode="mathml_actual_text">
|
|
3407
|
+
<!-- <xsl:text>a+b</xsl:text> -->
|
|
3408
|
+
<xsl:text><</xsl:text>
|
|
3409
|
+
<xsl:value-of select="local-name()"/>
|
|
3410
|
+
<xsl:if test="local-name() = 'math'">
|
|
3411
|
+
<xsl:text> xmlns="http://www.w3.org/1998/Math/MathML"</xsl:text>
|
|
3412
|
+
</xsl:if>
|
|
3413
|
+
<xsl:for-each select="@*">
|
|
3414
|
+
<xsl:text> </xsl:text>
|
|
3415
|
+
<xsl:value-of select="local-name()"/>
|
|
3416
|
+
<xsl:text>="</xsl:text>
|
|
3417
|
+
<xsl:value-of select="."/>
|
|
3418
|
+
<xsl:text>"</xsl:text>
|
|
3419
|
+
</xsl:for-each>
|
|
3420
|
+
<xsl:text>></xsl:text>
|
|
3421
|
+
<xsl:apply-templates mode="mathml_actual_text"/>
|
|
3422
|
+
<xsl:text></</xsl:text>
|
|
3423
|
+
<xsl:value-of select="local-name()"/>
|
|
3424
|
+
<xsl:text>></xsl:text>
|
|
3425
|
+
</xsl:template><xsl:template match="text()" mode="mathml_actual_text">
|
|
3426
|
+
<xsl:value-of select="normalize-space()"/>
|
|
3351
3427
|
</xsl:template><xsl:template match="@*|node()" mode="mathml">
|
|
3352
3428
|
<xsl:copy>
|
|
3353
3429
|
<xsl:apply-templates select="@*|node()" mode="mathml"/>
|
|
@@ -3409,7 +3485,10 @@
|
|
|
3409
3485
|
</fo:block>
|
|
3410
3486
|
<xsl:apply-templates/>
|
|
3411
3487
|
</xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
|
|
3412
|
-
<
|
|
3488
|
+
<xsl:variable name="level">
|
|
3489
|
+
<xsl:call-template name="getLevel"/>
|
|
3490
|
+
</xsl:variable>
|
|
3491
|
+
<fo:inline role="H{$level}"><xsl:apply-templates/></fo:inline>
|
|
3413
3492
|
</xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
|
|
3414
3493
|
<fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
|
|
3415
3494
|
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
|
@@ -3444,9 +3523,10 @@
|
|
|
3444
3523
|
|
|
3445
3524
|
</xsl:variable>
|
|
3446
3525
|
|
|
3526
|
+
<xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
|
|
3447
3527
|
<xsl:choose>
|
|
3448
|
-
<xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
|
|
3449
|
-
<xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
|
|
3528
|
+
<xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text>—</xsl:text></xsl:if></xsl:when>
|
|
3529
|
+
<xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text> — </xsl:text></xsl:if></xsl:otherwise>
|
|
3450
3530
|
</xsl:choose>
|
|
3451
3531
|
<xsl:apply-templates/>
|
|
3452
3532
|
</xsl:template><xsl:template match="*[local-name() = 'xref']">
|
|
@@ -3594,7 +3674,10 @@
|
|
|
3594
3674
|
</fo:block>
|
|
3595
3675
|
</xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']" mode="presentation">
|
|
3596
3676
|
<xsl:if test="normalize-space() != ''">
|
|
3597
|
-
<
|
|
3677
|
+
<xsl:variable name="level">
|
|
3678
|
+
<xsl:call-template name="getLevelTermName"/>
|
|
3679
|
+
</xsl:variable>
|
|
3680
|
+
<fo:inline role="H{$level}">
|
|
3598
3681
|
<xsl:apply-templates/>
|
|
3599
3682
|
<!-- <xsl:if test="$namespace = 'gb' or $namespace = 'ogc'">
|
|
3600
3683
|
<xsl:text>.</xsl:text>
|
|
@@ -4225,6 +4308,7 @@
|
|
|
4225
4308
|
</xsl:when>
|
|
4226
4309
|
<xsl:otherwise>
|
|
4227
4310
|
<xsl:apply-templates/>
|
|
4311
|
+
<xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
|
|
4228
4312
|
</xsl:otherwise>
|
|
4229
4313
|
</xsl:choose>
|
|
4230
4314
|
</fo:block>
|
|
@@ -4365,14 +4449,6 @@
|
|
|
4365
4449
|
<fo:block>
|
|
4366
4450
|
<fo:inline padding-right="3mm">Obligation</fo:inline><xsl:value-of select="."/>
|
|
4367
4451
|
</fo:block>
|
|
4368
|
-
</xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
|
|
4369
|
-
<fo:block xsl:use-attribute-sets="requirement-subject-style">
|
|
4370
|
-
<xsl:text>Target Type </xsl:text><xsl:apply-templates/>
|
|
4371
|
-
</fo:block>
|
|
4372
|
-
</xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'inherit']">
|
|
4373
|
-
<fo:block xsl:use-attribute-sets="requirement-inherit-style">
|
|
4374
|
-
<xsl:text>Dependency </xsl:text><xsl:apply-templates/>
|
|
4375
|
-
</fo:block>
|
|
4376
4452
|
</xsl:template><xsl:template match="*[local-name() = 'recommendation']">
|
|
4377
4453
|
<fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
|
|
4378
4454
|
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
|
@@ -4389,6 +4465,38 @@
|
|
|
4389
4465
|
<fo:block xsl:use-attribute-sets="recommendation-label-style">
|
|
4390
4466
|
<xsl:apply-templates/>
|
|
4391
4467
|
</fo:block>
|
|
4468
|
+
</xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" priority="2"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
|
|
4469
|
+
<fo:block xsl:use-attribute-sets="subject-style">
|
|
4470
|
+
<xsl:text>Target Type </xsl:text><xsl:apply-templates/>
|
|
4471
|
+
</fo:block>
|
|
4472
|
+
</xsl:template><xsl:template match="*[local-name() = 'subject']">
|
|
4473
|
+
<fo:block xsl:use-attribute-sets="subject-style">
|
|
4474
|
+
<xsl:text>Target Type </xsl:text><xsl:apply-templates/>
|
|
4475
|
+
</fo:block>
|
|
4476
|
+
</xsl:template><xsl:template match="*[local-name() = 'inherit'] | *[local-name() = 'component'][@class = 'inherit']">
|
|
4477
|
+
<fo:block xsl:use-attribute-sets="inherit-style">
|
|
4478
|
+
<xsl:text>Dependency </xsl:text><xsl:apply-templates/>
|
|
4479
|
+
</fo:block>
|
|
4480
|
+
</xsl:template><xsl:template match="*[local-name() = 'description'] | *[local-name() = 'component'][@class = 'description']">
|
|
4481
|
+
<fo:block xsl:use-attribute-sets="description-style">
|
|
4482
|
+
<xsl:apply-templates/>
|
|
4483
|
+
</fo:block>
|
|
4484
|
+
</xsl:template><xsl:template match="*[local-name() = 'specification'] | *[local-name() = 'component'][@class = 'specification']">
|
|
4485
|
+
<fo:block xsl:use-attribute-sets="specification-style">
|
|
4486
|
+
<xsl:apply-templates/>
|
|
4487
|
+
</fo:block>
|
|
4488
|
+
</xsl:template><xsl:template match="*[local-name() = 'measurement-target'] | *[local-name() = 'component'][@class = 'measurement-target']">
|
|
4489
|
+
<fo:block xsl:use-attribute-sets="measurement-target-style">
|
|
4490
|
+
<xsl:apply-templates/>
|
|
4491
|
+
</fo:block>
|
|
4492
|
+
</xsl:template><xsl:template match="*[local-name() = 'verification'] | *[local-name() = 'component'][@class = 'verification']">
|
|
4493
|
+
<fo:block xsl:use-attribute-sets="verification-style">
|
|
4494
|
+
<xsl:apply-templates/>
|
|
4495
|
+
</fo:block>
|
|
4496
|
+
</xsl:template><xsl:template match="*[local-name() = 'import'] | *[local-name() = 'component'][@class = 'import']">
|
|
4497
|
+
<fo:block xsl:use-attribute-sets="import-style">
|
|
4498
|
+
<xsl:apply-templates/>
|
|
4499
|
+
</fo:block>
|
|
4392
4500
|
</xsl:template><xsl:template match="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
|
|
4393
4501
|
<fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt">
|
|
4394
4502
|
<xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
|
|
@@ -5259,6 +5367,9 @@
|
|
|
5259
5367
|
<fo:block-container border="1pt solid black" width="50%">
|
|
5260
5368
|
<fo:block> </fo:block>
|
|
5261
5369
|
</fo:block-container>
|
|
5370
|
+
</xsl:template><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']"/><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
|
|
5371
|
+
<fo:inline padding-right="5mm"> </fo:inline>
|
|
5372
|
+
<fo:inline><xsl:apply-templates/></fo:inline>
|
|
5262
5373
|
</xsl:template><xsl:template name="convertDate">
|
|
5263
5374
|
<xsl:param name="date"/>
|
|
5264
5375
|
<xsl:param name="format" select="'short'"/>
|
|
@@ -5497,6 +5608,26 @@
|
|
|
5497
5608
|
<xsl:value-of select="$level"/>
|
|
5498
5609
|
</xsl:otherwise>
|
|
5499
5610
|
</xsl:choose>
|
|
5611
|
+
</xsl:template><xsl:template name="getLevelTermName">
|
|
5612
|
+
<xsl:choose>
|
|
5613
|
+
<xsl:when test="normalize-space(../@depth) != ''">
|
|
5614
|
+
<xsl:value-of select="../@depth"/>
|
|
5615
|
+
</xsl:when>
|
|
5616
|
+
<xsl:otherwise>
|
|
5617
|
+
<xsl:variable name="title_level_">
|
|
5618
|
+
<xsl:for-each select="../preceding-sibling::*[local-name() = 'title'][1]">
|
|
5619
|
+
<xsl:call-template name="getLevel"/>
|
|
5620
|
+
</xsl:for-each>
|
|
5621
|
+
</xsl:variable>
|
|
5622
|
+
<xsl:variable name="title_level" select="normalize-space($title_level_)"/>
|
|
5623
|
+
<xsl:choose>
|
|
5624
|
+
<xsl:when test="$title_level != ''"><xsl:value-of select="$title_level + 1"/></xsl:when>
|
|
5625
|
+
<xsl:otherwise>
|
|
5626
|
+
<xsl:call-template name="getLevel"/>
|
|
5627
|
+
</xsl:otherwise>
|
|
5628
|
+
</xsl:choose>
|
|
5629
|
+
</xsl:otherwise>
|
|
5630
|
+
</xsl:choose>
|
|
5500
5631
|
</xsl:template><xsl:template name="split">
|
|
5501
5632
|
<xsl:param name="pText" select="."/>
|
|
5502
5633
|
<xsl:param name="sep" select="','"/>
|
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.8.
|
|
4
|
+
version: 1.8.10
|
|
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-08-
|
|
11
|
+
date: 2021-08-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: metanorma-generic
|