metanorma-cc 1.7.9 → 1.7.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d6d309173c4998e196ca07f8ddfb3a5bb78f8b18583b81bcd9d9070178b5914c
4
- data.tar.gz: 9f96d76ec9a043f2bd69e6a0e8a88b9372ffea4d4fb3da7779732a2bb77d704a
3
+ metadata.gz: c5917448961cb03e62b3e84cf77d6043603b1279117ae65c54e3e9a0267473f9
4
+ data.tar.gz: 104e9178cf81e181efde8093cb9fceb16b1897f53be84d3bc189905b1fe5aa18
5
5
  SHA512:
6
- metadata.gz: 742f181837a9d074cc595bf8ee3aa12d73cff5954126eeb1367b135f0ae9164a041d8d096aff1525a724de8e6f9f705a84f1c5c747735471fec0635b42aeb2f7
7
- data.tar.gz: 774c8fc6eca7ff7237a8acc436852e286ac1bc0d2129e9456a6c5eaa9590c408e1066a9e8efad730e4a1551c9886b6f13ce201d4f91d70f6b26de35272e01d34
6
+ metadata.gz: 30647ff3165903705e9a448bf8516e760fa86528363f5b0a5ce1fe2d7ff7b3ed3c36c44d1afb1651bb8129b61f675905fb5529b7630fd10d0674c7f491d81e96
7
+ data.tar.gz: a7e9487a6f81635e740f2af07c6a6abe3bbe7b4ae348198319cac24d25290db5f50cde43d0752ce7a6f9bfb309c971d569b6d9a224168df02ddb174e6cb68bc4
@@ -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
- <attribute name="type">
162
- <choice>
163
- <value>roman</value>
164
- <value>alphabet</value>
165
- <value>arabic</value>
166
- <value>roman_upper</value>
167
- <value>alphabet_upper</value>
168
- </choice>
169
- </attribute>
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>
@@ -12,10 +12,10 @@ module Asciidoctor
12
12
  end
13
13
 
14
14
  ONE_SYMBOLS_WARNING = "Only one Symbols and Abbreviated "\
15
- "Terms section in the standard".freeze
15
+ "Terms section in the standard".freeze
16
16
 
17
17
  NON_DL_SYMBOLS_WARNING = "Symbols and Abbreviated Terms can "\
18
- "only contain a definition list".freeze
18
+ "only contain a definition list".freeze
19
19
 
20
20
  def symbols_validate(root)
21
21
  f = root.xpath("//definitions")
@@ -32,8 +32,9 @@ module Asciidoctor
32
32
  def seqcheck(names, msg, accepted)
33
33
  n = names.shift
34
34
  return [] if n.nil?
35
+
35
36
  test = accepted.map { |a| n.at(a) }
36
- if test.all? { |a| a.nil? }
37
+ if test.all?(&:nil?)
37
38
  @log.add("Style", nil, msg)
38
39
  end
39
40
  names
@@ -45,77 +46,84 @@ module Asciidoctor
45
46
  [
46
47
  {
47
48
  msg: "Initial section must be (content) Foreword",
48
- val: ["./self::foreword"]
49
+ val: ["./self::foreword"],
49
50
  },
50
51
  {
51
52
  msg: "Prefatory material must be followed by (clause) Scope",
52
- val: ["./self::introduction", "./self::clause[@type = 'scope']" ]
53
+ val: ["./self::introduction", "./self::clause[@type = 'scope']"],
53
54
  },
54
55
  {
55
56
  msg: "Prefatory material must be followed by (clause) Scope",
56
- val: ["./self::clause[@type = 'scope']" ]
57
+ val: ["./self::clause[@type = 'scope']"],
57
58
  },
58
59
  {
59
60
  msg: "Normative References must be followed by "\
60
- "Terms and Definitions",
61
- val: ["./self::terms | .//terms"]
61
+ "Terms and Definitions",
62
+ val: ["./self::terms | .//terms"],
62
63
  },
63
- ].freeze
64
+ ].freeze
64
65
 
65
66
  SECTIONS_XPATH =
66
67
  "//foreword | //introduction | //sections/terms | .//annex | "\
67
- "//sections/definitions | //sections/clause | //references[not(parent::clause)] | "\
68
+ "//sections/definitions | //sections/clause | "\
69
+ "//references[not(parent::clause)] | "\
68
70
  "//clause[descendant::references][not(parent::clause)]".freeze
69
71
 
70
72
  def sections_sequence_validate(root)
71
73
  names = root.xpath(SECTIONS_XPATH)
72
- names = seqcheck(names, SEQ[0][:msg], SEQ[0][:val])
74
+ names = seqcheck(names, SEQ[0][:msg], SEQ[0][:val])
73
75
  n = names[0]
74
76
  names = seqcheck(names, SEQ[1][:msg], SEQ[1][:val])
75
77
  if n&.at("./self::introduction")
76
- names = seqcheck(names, SEQ[2][:msg], SEQ[2][:val])
78
+ names = seqcheck(names, SEQ[2][:msg], SEQ[2][:val])
77
79
  end
78
- names = seqcheck(names, SEQ[3][:msg], SEQ[3][:val])
80
+ names = seqcheck(names, SEQ[3][:msg], SEQ[3][:val])
79
81
  n = names.shift
80
82
  if n&.at("./self::definitions")
81
- n = names.shift
83
+ n = names.shift
82
84
  end
83
85
  if n.nil? || n.name != "clause"
84
86
  @log.add("Style", nil, "Document must contain at least one clause")
85
87
  end
86
88
  n&.at("./self::clause") ||
87
89
  @log.add("Style", nil, "Document must contain clause after "\
88
- "Terms and Definitions")
90
+ "Terms and Definitions")
89
91
  n&.at("./self::clause[@type = 'scope']") &&
90
- @log.add("Style", nil, "Scope must occur before Terms and Definitions")
91
- n = names.shift
92
+ @log.add("Style", nil,
93
+ "Scope must occur before Terms and Definitions")
94
+ n = names.shift
92
95
  while n&.name == "clause"
93
96
  n&.at("./self::clause[@type = 'scope']")
94
- @log.add("Style", nil, "Scope must occur before Terms and Definitions")
95
- n = names.shift
97
+ @log.add("Style", nil,
98
+ "Scope must occur before Terms and Definitions")
99
+ n = names.shift
96
100
  end
97
- unless %w(annex references).include? n&.name
98
- @log.add("Style", nil, "Only annexes and references can follow clauses")
101
+ unless %w(annex references).include? n&.name
102
+ @log.add("Style", nil,
103
+ "Only annexes and references can follow clauses")
99
104
  end
100
- while n&.name == "annex"
105
+ while n&.name == "annex"
101
106
  n = names.shift
102
107
  if n.nil?
103
108
  @log.add("Style", nil, "Document must include (references) "\
104
- "Normative References")
109
+ "Normative References")
105
110
  end
106
111
  end
107
- n&.at("./self::references[@normative = 'true']") ||
112
+ n&.at("./self::references[@normative = 'true']") ||
108
113
  @log.add("Style", nil, "Document must include (references) "\
109
- "Normative References")
114
+ "Normative References")
110
115
  n = names&.shift
111
116
  n&.at("./self::references[@normative = 'false']") ||
112
- @log.add("Style", nil, "Final section must be (references) Bibliography")
117
+ @log.add("Style", nil,
118
+ "Final section must be (references) Bibliography")
113
119
  names.empty? ||
114
- @log.add("Style", nil, "There are sections after the final Bibliography")
120
+ @log.add("Style", nil,
121
+ "There are sections after the final Bibliography")
115
122
  end
116
123
 
117
124
  def style_warning(node, msg, text = nil)
118
125
  return if @novalid
126
+
119
127
  w = msg
120
128
  w += ": #{text}" if text
121
129
  @log.add("Style", node, w)
@@ -151,7 +151,7 @@
151
151
  <xsl:text> </xsl:text>
152
152
  </fo:block>
153
153
  </fo:block>
154
- <fo:block font-size="24pt" font-weight="bold" text-align="center">
154
+ <fo:block font-size="24pt" font-weight="bold" text-align="center" role="H1">
155
155
  <xsl:value-of select="/csd:csd-standard/csd:bibdata/csd:title[@language = 'en']"/>
156
156
  <xsl:value-of select="$linebreak"/>
157
157
  </fo:block>
@@ -230,50 +230,52 @@
230
230
  <fo:block break-after="page"/>
231
231
 
232
232
  <fo:block-container font-weight="bold" line-height="115%">
233
- <xsl:variable name="title-toc">
234
- <xsl:call-template name="getTitle">
235
- <xsl:with-param name="name" select="'title-toc'"/>
236
- </xsl:call-template>
237
- </xsl:variable>
238
- <fo:block font-size="14pt" margin-bottom="15.5pt"><xsl:value-of select="$title-toc"/></fo:block>
239
-
240
- <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']"><!-- [not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
233
+ <fo:block role="TOC">
234
+ <xsl:variable name="title-toc">
235
+ <xsl:call-template name="getTitle">
236
+ <xsl:with-param name="name" select="'title-toc'"/>
237
+ </xsl:call-template>
238
+ </xsl:variable>
239
+ <fo:block font-size="14pt" margin-bottom="15.5pt" role="H1"><xsl:value-of select="$title-toc"/></fo:block>
241
240
 
242
- <fo:block>
243
- <xsl:if test="@level = 1">
244
- <xsl:attribute name="margin-top">6pt</xsl:attribute>
245
- </xsl:if>
241
+ <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']"><!-- [not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
246
242
 
247
-
248
- <fo:list-block>
249
- <xsl:attribute name="provisional-distance-between-starts">
250
- <xsl:choose>
251
- <!-- skip 0 section without subsections -->
252
- <xsl:when test="@section != ''">8mm</xsl:when> <!-- and not(@display-section = 'false') -->
253
- <xsl:otherwise>0mm</xsl:otherwise>
254
- </xsl:choose>
255
- </xsl:attribute>
256
- <fo:list-item>
257
- <fo:list-item-label end-indent="label-end()">
258
- <fo:block>
259
- <xsl:value-of select="@section"/>
260
- </fo:block>
261
- </fo:list-item-label>
262
- <fo:list-item-body start-indent="body-start()">
263
- <fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm">
264
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
265
- <xsl:apply-templates select="title"/>
266
- <fo:inline keep-together.within-line="always">
267
- <fo:leader leader-pattern="dots"/>
268
- <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
269
- </fo:inline>
270
- </fo:basic-link>
271
- </fo:block>
272
- </fo:list-item-body>
273
- </fo:list-item>
274
- </fo:list-block>
275
- </fo:block>
276
- </xsl:for-each>
243
+ <fo:block role="TOCI">
244
+ <xsl:if test="@level = 1">
245
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
246
+ </xsl:if>
247
+
248
+
249
+ <fo:list-block>
250
+ <xsl:attribute name="provisional-distance-between-starts">
251
+ <xsl:choose>
252
+ <!-- skip 0 section without subsections -->
253
+ <xsl:when test="@section != ''">8mm</xsl:when> <!-- and not(@display-section = 'false') -->
254
+ <xsl:otherwise>0mm</xsl:otherwise>
255
+ </xsl:choose>
256
+ </xsl:attribute>
257
+ <fo:list-item>
258
+ <fo:list-item-label end-indent="label-end()">
259
+ <fo:block>
260
+ <xsl:value-of select="@section"/>
261
+ </fo:block>
262
+ </fo:list-item-label>
263
+ <fo:list-item-body start-indent="body-start()">
264
+ <fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm">
265
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
266
+ <xsl:apply-templates select="title"/>
267
+ <fo:inline keep-together.within-line="always">
268
+ <fo:leader leader-pattern="dots"/>
269
+ <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
270
+ </fo:inline>
271
+ </fo:basic-link>
272
+ </fo:block>
273
+ </fo:list-item-body>
274
+ </fo:list-item>
275
+ </fo:list-block>
276
+ </fo:block>
277
+ </xsl:for-each>
278
+ </fo:block>
277
279
  </fo:block-container>
278
280
 
279
281
  <!-- Foreword, Introduction -->
@@ -292,7 +294,7 @@
292
294
  </fo:static-content>
293
295
  <xsl:call-template name="insertHeaderFooter"/>
294
296
  <fo:flow flow-name="xsl-region-body">
295
- <fo:block font-size="16pt" font-weight="bold" margin-bottom="17pt">
297
+ <fo:block font-size="16pt" font-weight="bold" margin-bottom="17pt" role="H1">
296
298
  <xsl:value-of select="/csd:csd-standard/csd:bibdata/csd:title[@language = 'en']"/>
297
299
  </fo:block>
298
300
  <fo:block>
@@ -366,7 +368,10 @@
366
368
 
367
369
 
368
370
  <xsl:template match="csd:license-statement//csd:title">
369
- <fo:block text-align="center" font-weight="bold">
371
+ <xsl:variable name="level">
372
+ <xsl:call-template name="getLevel"/>
373
+ </xsl:variable>
374
+ <fo:block text-align="center" font-weight="bold" role="H{$level}">
370
375
  <xsl:apply-templates/>
371
376
  </fo:block>
372
377
  </xsl:template>
@@ -446,7 +451,9 @@
446
451
  <xsl:if test="ancestor::csd:sections">
447
452
  <xsl:attribute name="margin-top">13.5pt</xsl:attribute>
448
453
  </xsl:if>
454
+ <xsl:attribute name="role">H<xsl:value-of select="$level"/></xsl:attribute>
449
455
  <xsl:apply-templates/>
456
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
450
457
  </xsl:element>
451
458
  </xsl:template>
452
459
 
@@ -637,7 +644,10 @@
637
644
  <xsl:otherwise>12pt</xsl:otherwise>
638
645
  </xsl:choose>
639
646
  </xsl:variable>
640
- <fo:block font-size="{$font-size}" line-height="1.1">
647
+ <xsl:variable name="levelTerm">
648
+ <xsl:call-template name="getLevelTermName"/>
649
+ </xsl:variable>
650
+ <fo:block font-size="{$font-size}" line-height="1.1" role="H{$levelTerm}">
641
651
  <fo:block font-weight="bold" keep-with-next="always">
642
652
  <xsl:apply-templates select="ancestor::csd:term/csd:name" mode="presentation"/>
643
653
  </fo:block>
@@ -754,14 +764,14 @@
754
764
 
755
765
 
756
766
  <xsl:template name="insertHeaderFooter">
757
- <fo:static-content flow-name="header-even">
767
+ <fo:static-content flow-name="header-even" role="artifact">
758
768
  <fo:block-container height="17mm" display-align="before">
759
769
  <fo:block padding-top="12.5mm">
760
770
  <xsl:value-of select="$header"/>
761
771
  </fo:block>
762
772
  </fo:block-container>
763
773
  </fo:static-content>
764
- <fo:static-content flow-name="footer-even">
774
+ <fo:static-content flow-name="footer-even" role="artifact">
765
775
  <fo:block-container font-size="10pt" height="100%" display-align="after">
766
776
  <fo:table table-layout="fixed" width="100%">
767
777
  <fo:table-column column-width="10%"/>
@@ -779,14 +789,14 @@
779
789
  </fo:table>
780
790
  </fo:block-container>
781
791
  </fo:static-content>
782
- <fo:static-content flow-name="header-odd">
792
+ <fo:static-content flow-name="header-odd" role="artifact">
783
793
  <fo:block-container height="17mm" display-align="before">
784
794
  <fo:block text-align="right" padding-top="12.5mm">
785
795
  <xsl:value-of select="$header"/>
786
796
  </fo:block>
787
797
  </fo:block-container>
788
798
  </fo:static-content>
789
- <fo:static-content flow-name="footer-odd">
799
+ <fo:static-content flow-name="footer-odd" role="artifact">
790
800
  <fo:block-container font-size="10pt" height="100%" display-align="after">
791
801
  <fo:table table-layout="fixed" width="100%">
792
802
  <fo:table-column column-width="90%"/>
@@ -978,6 +988,7 @@
978
988
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
979
989
  <xsl:attribute name="white-space">pre</xsl:attribute>
980
990
  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
991
+ <xsl:attribute name="role">Code</xsl:attribute>
981
992
 
982
993
 
983
994
 
@@ -1003,8 +1014,13 @@
1003
1014
 
1004
1015
  </xsl:attribute-set><xsl:attribute-set name="requirement-label-style">
1005
1016
 
1006
- </xsl:attribute-set><xsl:attribute-set name="requirement-subject-style">
1007
- </xsl:attribute-set><xsl:attribute-set name="requirement-inherit-style">
1017
+ </xsl:attribute-set><xsl:attribute-set name="subject-style">
1018
+ </xsl:attribute-set><xsl:attribute-set name="inherit-style">
1019
+ </xsl:attribute-set><xsl:attribute-set name="description-style">
1020
+ </xsl:attribute-set><xsl:attribute-set name="specification-style">
1021
+ </xsl:attribute-set><xsl:attribute-set name="measurement-target-style">
1022
+ </xsl:attribute-set><xsl:attribute-set name="verification-style">
1023
+ </xsl:attribute-set><xsl:attribute-set name="import-style">
1008
1024
  </xsl:attribute-set><xsl:attribute-set name="recommendation-style">
1009
1025
 
1010
1026
 
@@ -1217,7 +1233,8 @@
1217
1233
 
1218
1234
 
1219
1235
 
1220
- </xsl:attribute-set><xsl:attribute-set name="quote-style">
1236
+ </xsl:attribute-set><xsl:attribute-set name="quote-style">
1237
+ <xsl:attribute name="role">BlockQuote</xsl:attribute>
1221
1238
 
1222
1239
 
1223
1240
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
@@ -1418,7 +1435,9 @@
1418
1435
 
1419
1436
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
1420
1437
 
1421
-
1438
+
1439
+
1440
+
1422
1441
 
1423
1442
  <xsl:call-template name="fn_name_display"/>
1424
1443
 
@@ -3270,16 +3289,68 @@
3270
3289
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
3271
3290
  </xsl:call-template>
3272
3291
 
3292
+
3293
+
3273
3294
  <xsl:variable name="mathml">
3274
3295
  <xsl:apply-templates select="." mode="mathml"/>
3275
3296
  </xsl:variable>
3276
3297
  <fo:instream-foreign-object fox:alt-text="Math">
3277
3298
 
3278
3299
 
3300
+ <xsl:variable name="comment_text_following" select="following-sibling::node()[1][self::comment()]"/>
3301
+ <xsl:variable name="comment_text_">
3302
+ <xsl:choose>
3303
+ <xsl:when test="normalize-space($comment_text_following) != ''">
3304
+ <xsl:value-of select="$comment_text_following"/>
3305
+ </xsl:when>
3306
+ <xsl:otherwise>
3307
+ <xsl:value-of select="normalize-space(translate(.,' ⁢',' '))"/>
3308
+ </xsl:otherwise>
3309
+ </xsl:choose>
3310
+ </xsl:variable>
3311
+ <xsl:variable name="comment_text" select="java:org.metanorma.fop.Util.unescape($comment_text_)"/>
3312
+
3313
+ <xsl:if test="normalize-space($comment_text) != ''">
3314
+ <!-- put Mathin Alternate Text -->
3315
+ <xsl:attribute name="fox:alt-text">
3316
+ <xsl:value-of select="java:org.metanorma.fop.Util.unescape($comment_text)"/>
3317
+ </xsl:attribute>
3318
+ </xsl:if>
3319
+
3320
+ <xsl:variable name="mathml_content">
3321
+ <xsl:apply-templates select="." mode="mathml_actual_text"/>
3322
+ </xsl:variable>
3323
+ <!-- put MathML in Actual Text -->
3324
+ <xsl:attribute name="fox:actual-text">
3325
+ <xsl:value-of select="$mathml_content"/>
3326
+ </xsl:attribute>
3327
+
3328
+
3279
3329
  <!-- <xsl:copy-of select="."/> -->
3280
3330
  <xsl:copy-of select="xalan:nodeset($mathml)"/>
3281
3331
  </fo:instream-foreign-object>
3282
3332
  </fo:inline>
3333
+ </xsl:template><xsl:template match="mathml:*" mode="mathml_actual_text">
3334
+ <!-- <xsl:text>a+b</xsl:text> -->
3335
+ <xsl:text>&lt;</xsl:text>
3336
+ <xsl:value-of select="local-name()"/>
3337
+ <xsl:if test="local-name() = 'math'">
3338
+ <xsl:text> xmlns="http://www.w3.org/1998/Math/MathML"</xsl:text>
3339
+ </xsl:if>
3340
+ <xsl:for-each select="@*">
3341
+ <xsl:text> </xsl:text>
3342
+ <xsl:value-of select="local-name()"/>
3343
+ <xsl:text>="</xsl:text>
3344
+ <xsl:value-of select="."/>
3345
+ <xsl:text>"</xsl:text>
3346
+ </xsl:for-each>
3347
+ <xsl:text>&gt;</xsl:text>
3348
+ <xsl:apply-templates mode="mathml_actual_text"/>
3349
+ <xsl:text>&lt;/</xsl:text>
3350
+ <xsl:value-of select="local-name()"/>
3351
+ <xsl:text>&gt;</xsl:text>
3352
+ </xsl:template><xsl:template match="text()" mode="mathml_actual_text">
3353
+ <xsl:value-of select="normalize-space()"/>
3283
3354
  </xsl:template><xsl:template match="@*|node()" mode="mathml">
3284
3355
  <xsl:copy>
3285
3356
  <xsl:apply-templates select="@*|node()" mode="mathml"/>
@@ -3341,7 +3412,10 @@
3341
3412
  </fo:block>
3342
3413
  <xsl:apply-templates/>
3343
3414
  </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
3344
- <fo:inline><xsl:apply-templates/></fo:inline>
3415
+ <xsl:variable name="level">
3416
+ <xsl:call-template name="getLevel"/>
3417
+ </xsl:variable>
3418
+ <fo:inline role="H{$level}"><xsl:apply-templates/></fo:inline>
3345
3419
  </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
3346
3420
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
3347
3421
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -3376,9 +3450,10 @@
3376
3450
 
3377
3451
  </xsl:variable>
3378
3452
 
3453
+ <xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
3379
3454
  <xsl:choose>
3380
- <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
3381
- <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
3455
+ <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>
3456
+ <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>
3382
3457
  </xsl:choose>
3383
3458
  <xsl:apply-templates/>
3384
3459
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
@@ -3522,7 +3597,10 @@
3522
3597
  </fo:block>
3523
3598
  </xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']" mode="presentation">
3524
3599
  <xsl:if test="normalize-space() != ''">
3525
- <fo:inline>
3600
+ <xsl:variable name="level">
3601
+ <xsl:call-template name="getLevelTermName"/>
3602
+ </xsl:variable>
3603
+ <fo:inline role="H{$level}">
3526
3604
  <xsl:apply-templates/>
3527
3605
  <!-- <xsl:if test="$namespace = 'gb' or $namespace = 'ogc'">
3528
3606
  <xsl:text>.</xsl:text>
@@ -4153,6 +4231,7 @@
4153
4231
  </xsl:when>
4154
4232
  <xsl:otherwise>
4155
4233
  <xsl:apply-templates/>
4234
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
4156
4235
  </xsl:otherwise>
4157
4236
  </xsl:choose>
4158
4237
  </fo:block>
@@ -4293,14 +4372,6 @@
4293
4372
  <fo:block>
4294
4373
  <fo:inline padding-right="3mm">Obligation</fo:inline><xsl:value-of select="."/>
4295
4374
  </fo:block>
4296
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
4297
- <fo:block xsl:use-attribute-sets="requirement-subject-style">
4298
- <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
4299
- </fo:block>
4300
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'inherit']">
4301
- <fo:block xsl:use-attribute-sets="requirement-inherit-style">
4302
- <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
4303
- </fo:block>
4304
4375
  </xsl:template><xsl:template match="*[local-name() = 'recommendation']">
4305
4376
  <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
4306
4377
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -4317,6 +4388,38 @@
4317
4388
  <fo:block xsl:use-attribute-sets="recommendation-label-style">
4318
4389
  <xsl:apply-templates/>
4319
4390
  </fo:block>
4391
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" priority="2"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
4392
+ <fo:block xsl:use-attribute-sets="subject-style">
4393
+ <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
4394
+ </fo:block>
4395
+ </xsl:template><xsl:template match="*[local-name() = 'subject']">
4396
+ <fo:block xsl:use-attribute-sets="subject-style">
4397
+ <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
4398
+ </fo:block>
4399
+ </xsl:template><xsl:template match="*[local-name() = 'inherit'] | *[local-name() = 'component'][@class = 'inherit']">
4400
+ <fo:block xsl:use-attribute-sets="inherit-style">
4401
+ <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
4402
+ </fo:block>
4403
+ </xsl:template><xsl:template match="*[local-name() = 'description'] | *[local-name() = 'component'][@class = 'description']">
4404
+ <fo:block xsl:use-attribute-sets="description-style">
4405
+ <xsl:apply-templates/>
4406
+ </fo:block>
4407
+ </xsl:template><xsl:template match="*[local-name() = 'specification'] | *[local-name() = 'component'][@class = 'specification']">
4408
+ <fo:block xsl:use-attribute-sets="specification-style">
4409
+ <xsl:apply-templates/>
4410
+ </fo:block>
4411
+ </xsl:template><xsl:template match="*[local-name() = 'measurement-target'] | *[local-name() = 'component'][@class = 'measurement-target']">
4412
+ <fo:block xsl:use-attribute-sets="measurement-target-style">
4413
+ <xsl:apply-templates/>
4414
+ </fo:block>
4415
+ </xsl:template><xsl:template match="*[local-name() = 'verification'] | *[local-name() = 'component'][@class = 'verification']">
4416
+ <fo:block xsl:use-attribute-sets="verification-style">
4417
+ <xsl:apply-templates/>
4418
+ </fo:block>
4419
+ </xsl:template><xsl:template match="*[local-name() = 'import'] | *[local-name() = 'component'][@class = 'import']">
4420
+ <fo:block xsl:use-attribute-sets="import-style">
4421
+ <xsl:apply-templates/>
4422
+ </fo:block>
4320
4423
  </xsl:template><xsl:template match="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
4321
4424
  <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt">
4322
4425
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
@@ -5196,6 +5299,9 @@
5196
5299
  <fo:block-container border="1pt solid black" width="50%">
5197
5300
  <fo:block> </fo:block>
5198
5301
  </fo:block-container>
5302
+ </xsl:template><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']"/><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
5303
+ <fo:inline padding-right="5mm"> </fo:inline>
5304
+ <fo:inline><xsl:apply-templates/></fo:inline>
5199
5305
  </xsl:template><xsl:template name="convertDate">
5200
5306
  <xsl:param name="date"/>
5201
5307
  <xsl:param name="format" select="'short'"/>
@@ -5434,6 +5540,26 @@
5434
5540
  <xsl:value-of select="$level"/>
5435
5541
  </xsl:otherwise>
5436
5542
  </xsl:choose>
5543
+ </xsl:template><xsl:template name="getLevelTermName">
5544
+ <xsl:choose>
5545
+ <xsl:when test="normalize-space(../@depth) != ''">
5546
+ <xsl:value-of select="../@depth"/>
5547
+ </xsl:when>
5548
+ <xsl:otherwise>
5549
+ <xsl:variable name="title_level_">
5550
+ <xsl:for-each select="../preceding-sibling::*[local-name() = 'title'][1]">
5551
+ <xsl:call-template name="getLevel"/>
5552
+ </xsl:for-each>
5553
+ </xsl:variable>
5554
+ <xsl:variable name="title_level" select="normalize-space($title_level_)"/>
5555
+ <xsl:choose>
5556
+ <xsl:when test="$title_level != ''"><xsl:value-of select="$title_level + 1"/></xsl:when>
5557
+ <xsl:otherwise>
5558
+ <xsl:call-template name="getLevel"/>
5559
+ </xsl:otherwise>
5560
+ </xsl:choose>
5561
+ </xsl:otherwise>
5562
+ </xsl:choose>
5437
5563
  </xsl:template><xsl:template name="split">
5438
5564
  <xsl:param name="pText" select="."/>
5439
5565
  <xsl:param name="sep" select="','"/>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module CC
3
- VERSION = "1.7.9".freeze
3
+ VERSION = "1.7.10".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-cc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.9
4
+ version: 1.7.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-16 00:00:00.000000000 Z
11
+ date: 2021-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic