metanorma-cc 1.7.8 → 1.7.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ba921a96ef914fa2953f1496d9f0cdb1187fbf899fb290db3e292bacf14a3c63
4
- data.tar.gz: a1200323fce7dc2df2e100a8fe37f3a41e583a7311666da0823e3e0687493574
3
+ metadata.gz: 34a69b49794bfd82ed53dc500231363b0920d187639a8a537668c893b3efd5c4
4
+ data.tar.gz: 3f0f2d66bec679783a7d1209520b30cd174908e36f66778fb45a6484ac0b1633
5
5
  SHA512:
6
- metadata.gz: 6c909ee60a09c15b24769d63cd7abbd23d56953e6c5d01018ed46f903a8a8c994491aea2937e318811f6332fba02fc6a8324cbad2ea18fe463cb93b2d6ed7f1c
7
- data.tar.gz: aa2da60c821b1cefa7e1fef177ded1b9136a73a37b6d91ce449f3887a65e0a93642aad8cdfa7959507a4d73eb0677800a8f2e584f3a7473725d0394a7986945d
6
+ metadata.gz: d32c8758ffad083ddf6ac753f5210978d8d1d08c6e0fef240871ac78575a11c8b95434f5572f2e9d4dd348a106344b89d7f27c66b383b234a6e7889ba553fe77
7
+ data.tar.gz: cb5a314defae0bf1c935e615a92a282daf7ab960c3ba007785c06457f3b647a4cc04d5dc4a4dd31d5b5ab25b3c9ebd82fbbaf4ec19f942231320001b949237c1
@@ -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>
@@ -976,6 +990,16 @@
976
990
  <data type="boolean"/>
977
991
  </attribute>
978
992
  </optional>
993
+ <optional>
994
+ <attribute name="linkmention">
995
+ <data type="boolean"/>
996
+ </attribute>
997
+ </optional>
998
+ <optional>
999
+ <attribute name="linkref">
1000
+ <data type="boolean"/>
1001
+ </attribute>
1002
+ </optional>
979
1003
  <optional>
980
1004
  <element name="refterm">
981
1005
  <zeroOrMore>
@@ -1012,6 +1036,7 @@
1012
1036
  <ref name="svgmap"/>
1013
1037
  <ref name="inputform"/>
1014
1038
  <ref name="toc"/>
1039
+ <ref name="passthrough"/>
1015
1040
  </choice>
1016
1041
  </define>
1017
1042
  <define name="toc">
@@ -1019,6 +1044,14 @@
1019
1044
  <ref name="ul"/>
1020
1045
  </element>
1021
1046
  </define>
1047
+ <define name="passthrough">
1048
+ <element name="passthrough">
1049
+ <optional>
1050
+ <attribute name="formats"/>
1051
+ </optional>
1052
+ <text/>
1053
+ </element>
1054
+ </define>
1022
1055
  <define name="inputform">
1023
1056
  <element name="form">
1024
1057
  <attribute name="id">
@@ -1686,7 +1719,9 @@
1686
1719
  <zeroOrMore>
1687
1720
  <ref name="termgrammar"/>
1688
1721
  </zeroOrMore>
1689
- <ref name="definition"/>
1722
+ <oneOrMore>
1723
+ <ref name="termdefinition"/>
1724
+ </oneOrMore>
1690
1725
  <zeroOrMore>
1691
1726
  <ref name="termnote"/>
1692
1727
  </zeroOrMore>
@@ -1749,7 +1784,7 @@
1749
1784
  </oneOrMore>
1750
1785
  </element>
1751
1786
  </define>
1752
- <define name="definition">
1787
+ <define name="termdefinition">
1753
1788
  <element name="definition">
1754
1789
  <oneOrMore>
1755
1790
  <choice>
@@ -1758,6 +1793,9 @@
1758
1793
  <ref name="formula"/>
1759
1794
  </choice>
1760
1795
  </oneOrMore>
1796
+ <zeroOrMore>
1797
+ <ref name="termsource"/>
1798
+ </zeroOrMore>
1761
1799
  </element>
1762
1800
  </define>
1763
1801
  <define name="termnote">
@@ -64,9 +64,9 @@
64
64
  <optional>
65
65
  <ref name="label"/>
66
66
  </optional>
67
- <optional>
67
+ <zeroOrMore>
68
68
  <ref name="subject"/>
69
- </optional>
69
+ </zeroOrMore>
70
70
  <zeroOrMore>
71
71
  <ref name="reqinherit"/>
72
72
  </zeroOrMore>
@@ -80,6 +80,7 @@
80
80
  <ref name="verification"/>
81
81
  <ref name="import"/>
82
82
  <ref name="description"/>
83
+ <ref name="component"/>
83
84
  </choice>
84
85
  </zeroOrMore>
85
86
  <optional>
@@ -105,12 +106,16 @@
105
106
  </define>
106
107
  <define name="subject">
107
108
  <element name="subject">
108
- <text/>
109
+ <oneOrMore>
110
+ <ref name="TextElement"/>
111
+ </oneOrMore>
109
112
  </element>
110
113
  </define>
111
114
  <define name="reqinherit">
112
115
  <element name="inherit">
113
- <text/>
116
+ <oneOrMore>
117
+ <ref name="TextElement"/>
118
+ </oneOrMore>
114
119
  </element>
115
120
  </define>
116
121
  <define name="measurementtarget">
@@ -138,6 +143,12 @@
138
143
  <ref name="RequirementSubpart"/>
139
144
  </element>
140
145
  </define>
146
+ <define name="component">
147
+ <element name="component">
148
+ <attribute name="class"/>
149
+ <ref name="RequirementSubpart"/>
150
+ </element>
151
+ </define>
141
152
  <define name="reqt_references">
142
153
  <element name="references">
143
154
  <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>
246
-
241
+ <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']"><!-- [not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
247
242
 
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
 
@@ -1083,6 +1099,7 @@
1083
1099
 
1084
1100
 
1085
1101
 
1102
+
1086
1103
  </xsl:attribute-set><xsl:attribute-set name="termexample-name-style">
1087
1104
 
1088
1105
  <xsl:attribute name="padding-right">10mm</xsl:attribute>
@@ -1216,7 +1233,8 @@
1216
1233
 
1217
1234
 
1218
1235
 
1219
- </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>
1220
1238
 
1221
1239
 
1222
1240
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
@@ -1350,13 +1368,20 @@
1350
1368
 
1351
1369
  </xsl:attribute-set><xsl:attribute-set name="list-style">
1352
1370
 
1353
- </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="processPrefaceSectionsDefault_Contents">
1371
+ </xsl:attribute-set><xsl:attribute-set name="toc-style">
1372
+ <xsl:attribute name="line-height">135%</xsl:attribute>
1373
+ </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">
1354
1374
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
1355
1375
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
1356
1376
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
1357
1377
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']" mode="contents"/>
1358
1378
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']" mode="contents"/>
1359
- </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
1379
+ </xsl:template><xsl:template name="processPrefaceSectionsDefault_Contents">
1380
+ <xsl:for-each select="/*/*[local-name()='preface']/*">
1381
+ <xsl:sort select="@displayorder" data-type="number"/>
1382
+ <xsl:apply-templates select="." mode="contents"/>
1383
+ </xsl:for-each>
1384
+ </xsl:template><xsl:template name="OLD_processMainSectionsDefault_Contents">
1360
1385
  <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
1361
1386
 
1362
1387
  <!-- Normative references -->
@@ -1369,13 +1394,33 @@
1369
1394
  <!-- Bibliography -->
1370
1395
  <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"/>
1371
1396
 
1372
- </xsl:template><xsl:template name="processPrefaceSectionsDefault">
1397
+ </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
1398
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
1399
+ <xsl:sort select="@displayorder" data-type="number"/>
1400
+ <xsl:apply-templates select="." mode="contents"/>
1401
+ </xsl:for-each>
1402
+
1403
+ <xsl:for-each select="/*/*[local-name()='annex']">
1404
+ <xsl:sort select="@displayorder" data-type="number"/>
1405
+ <xsl:apply-templates select="." mode="contents"/>
1406
+ </xsl:for-each>
1407
+
1408
+ <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
1409
+ <xsl:sort select="@displayorder" data-type="number"/>
1410
+ <xsl:apply-templates select="." mode="contents"/>
1411
+ </xsl:for-each>
1412
+ </xsl:template><xsl:template name="OLD_processPrefaceSectionsDefault">
1373
1413
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
1374
1414
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
1375
1415
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']"/>
1376
1416
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']"/>
1377
1417
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']"/>
1378
- </xsl:template><xsl:template name="processMainSectionsDefault">
1418
+ </xsl:template><xsl:template name="processPrefaceSectionsDefault">
1419
+ <xsl:for-each select="/*/*[local-name()='preface']/*">
1420
+ <xsl:sort select="@displayorder" data-type="number"/>
1421
+ <xsl:apply-templates select="."/>
1422
+ </xsl:for-each>
1423
+ </xsl:template><xsl:template name="OLD_processMainSectionsDefault">
1379
1424
  <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']"/>
1380
1425
 
1381
1426
  <!-- Normative references -->
@@ -1387,6 +1432,22 @@
1387
1432
  <xsl:apply-templates select="/*/*[local-name()='annex']"/>
1388
1433
  <!-- Bibliography -->
1389
1434
  <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]"/>
1435
+ </xsl:template><xsl:template name="processMainSectionsDefault">
1436
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
1437
+ <xsl:sort select="@displayorder" data-type="number"/>
1438
+ <xsl:apply-templates select="."/>
1439
+
1440
+ </xsl:for-each>
1441
+
1442
+ <xsl:for-each select="/*/*[local-name()='annex']">
1443
+ <xsl:sort select="@displayorder" data-type="number"/>
1444
+ <xsl:apply-templates select="."/>
1445
+ </xsl:for-each>
1446
+
1447
+ <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
1448
+ <xsl:sort select="@displayorder" data-type="number"/>
1449
+ <xsl:apply-templates select="."/>
1450
+ </xsl:for-each>
1390
1451
  </xsl:template><xsl:template match="text()">
1391
1452
  <xsl:value-of select="."/>
1392
1453
  </xsl:template><xsl:template match="*[local-name()='br']">
@@ -1417,7 +1478,9 @@
1417
1478
 
1418
1479
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
1419
1480
 
1420
-
1481
+
1482
+
1483
+
1421
1484
 
1422
1485
  <xsl:call-template name="fn_name_display"/>
1423
1486
 
@@ -1538,6 +1601,8 @@
1538
1601
  <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1539
1602
  </xsl:if>
1540
1603
 
1604
+
1605
+
1541
1606
  <xsl:choose>
1542
1607
  <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
1543
1608
  <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
@@ -1825,9 +1890,9 @@
1825
1890
  <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation">
1826
1891
  <xsl:with-param name="continued">true</xsl:with-param>
1827
1892
  </xsl:apply-templates>
1828
- <xsl:for-each select="ancestor::*[local-name()='table'][1]">
1829
- <xsl:call-template name="fn_name_display"/>
1830
- </xsl:for-each>
1893
+
1894
+
1895
+
1831
1896
 
1832
1897
  </fo:table-cell>
1833
1898
  </fo:table-row>
@@ -1909,7 +1974,11 @@
1909
1974
 
1910
1975
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
1911
1976
 
1912
- <xsl:if test="$isNoteOrFnExist = 'true'">
1977
+ <xsl:variable name="isNoteOrFnExistShowAfterTable">
1978
+
1979
+ </xsl:variable>
1980
+
1981
+ <xsl:if test="$isNoteOrFnExist = 'true' or normalize-space($isNoteOrFnExistShowAfterTable) = 'true'">
1913
1982
 
1914
1983
  <xsl:variable name="cols-count">
1915
1984
  <xsl:choose>
@@ -2050,6 +2119,19 @@
2050
2119
 
2051
2120
  </fo:table-body>
2052
2121
 
2122
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/text()[1]" priority="2" mode="presentation_name">
2123
+ <xsl:choose>
2124
+ <xsl:when test="substring-after(., '—') != ''">
2125
+ <xsl:text>—</xsl:text><xsl:value-of select="substring-after(., '—')"/>
2126
+ </xsl:when>
2127
+ <xsl:otherwise>
2128
+ <xsl:value-of select="."/>
2129
+ </xsl:otherwise>
2130
+ </xsl:choose>
2131
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']" mode="presentation_name">
2132
+ <xsl:apply-templates mode="presentation_name"/>
2133
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/node()" mode="presentation_name">
2134
+ <xsl:apply-templates select="."/>
2053
2135
  </xsl:template><xsl:template match="*[local-name()='tr']">
2054
2136
  <xsl:variable name="parent-name" select="local-name(..)"/>
2055
2137
  <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
@@ -2222,14 +2304,12 @@
2222
2304
  <xsl:apply-templates/>
2223
2305
  </xsl:template><xsl:template name="fn_display">
2224
2306
  <xsl:variable name="references">
2307
+
2225
2308
  <xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']">
2226
- <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
2227
-
2228
-
2229
- <xsl:apply-templates/>
2230
- </fn>
2309
+ <xsl:call-template name="create_fn"/>
2231
2310
  </xsl:for-each>
2232
2311
  </xsl:variable>
2312
+
2233
2313
  <xsl:for-each select="xalan:nodeset($references)//fn">
2234
2314
  <xsl:variable name="reference" select="@reference"/>
2235
2315
  <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
@@ -2265,6 +2345,12 @@
2265
2345
  </fo:block>
2266
2346
  </xsl:if>
2267
2347
  </xsl:for-each>
2348
+ </xsl:template><xsl:template name="create_fn">
2349
+ <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
2350
+
2351
+
2352
+ <xsl:apply-templates/>
2353
+ </fn>
2268
2354
  </xsl:template><xsl:template name="fn_name_display">
2269
2355
  <!-- <xsl:variable name="references">
2270
2356
  <xsl:for-each select="*[local-name()='name']//*[local-name()='fn']">
@@ -3246,16 +3332,68 @@
3246
3332
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
3247
3333
  </xsl:call-template>
3248
3334
 
3335
+
3336
+
3249
3337
  <xsl:variable name="mathml">
3250
3338
  <xsl:apply-templates select="." mode="mathml"/>
3251
3339
  </xsl:variable>
3252
3340
  <fo:instream-foreign-object fox:alt-text="Math">
3253
3341
 
3254
3342
 
3343
+ <xsl:variable name="comment_text_following" select="following-sibling::node()[1][self::comment()]"/>
3344
+ <xsl:variable name="comment_text_">
3345
+ <xsl:choose>
3346
+ <xsl:when test="normalize-space($comment_text_following) != ''">
3347
+ <xsl:value-of select="$comment_text_following"/>
3348
+ </xsl:when>
3349
+ <xsl:otherwise>
3350
+ <xsl:value-of select="normalize-space(translate(.,' ⁢',' '))"/>
3351
+ </xsl:otherwise>
3352
+ </xsl:choose>
3353
+ </xsl:variable>
3354
+ <xsl:variable name="comment_text" select="java:org.metanorma.fop.Util.unescape($comment_text_)"/>
3355
+
3356
+ <xsl:if test="normalize-space($comment_text) != ''">
3357
+ <!-- put Mathin Alternate Text -->
3358
+ <xsl:attribute name="fox:alt-text">
3359
+ <xsl:value-of select="java:org.metanorma.fop.Util.unescape($comment_text)"/>
3360
+ </xsl:attribute>
3361
+ </xsl:if>
3362
+
3363
+ <xsl:variable name="mathml_content">
3364
+ <xsl:apply-templates select="." mode="mathml_actual_text"/>
3365
+ </xsl:variable>
3366
+ <!-- put MathML in Actual Text -->
3367
+ <xsl:attribute name="fox:actual-text">
3368
+ <xsl:value-of select="$mathml_content"/>
3369
+ </xsl:attribute>
3370
+
3371
+
3255
3372
  <!-- <xsl:copy-of select="."/> -->
3256
3373
  <xsl:copy-of select="xalan:nodeset($mathml)"/>
3257
3374
  </fo:instream-foreign-object>
3258
3375
  </fo:inline>
3376
+ </xsl:template><xsl:template match="mathml:*" mode="mathml_actual_text">
3377
+ <!-- <xsl:text>a+b</xsl:text> -->
3378
+ <xsl:text>&lt;</xsl:text>
3379
+ <xsl:value-of select="local-name()"/>
3380
+ <xsl:if test="local-name() = 'math'">
3381
+ <xsl:text> xmlns="http://www.w3.org/1998/Math/MathML"</xsl:text>
3382
+ </xsl:if>
3383
+ <xsl:for-each select="@*">
3384
+ <xsl:text> </xsl:text>
3385
+ <xsl:value-of select="local-name()"/>
3386
+ <xsl:text>="</xsl:text>
3387
+ <xsl:value-of select="."/>
3388
+ <xsl:text>"</xsl:text>
3389
+ </xsl:for-each>
3390
+ <xsl:text>&gt;</xsl:text>
3391
+ <xsl:apply-templates mode="mathml_actual_text"/>
3392
+ <xsl:text>&lt;/</xsl:text>
3393
+ <xsl:value-of select="local-name()"/>
3394
+ <xsl:text>&gt;</xsl:text>
3395
+ </xsl:template><xsl:template match="text()" mode="mathml_actual_text">
3396
+ <xsl:value-of select="normalize-space()"/>
3259
3397
  </xsl:template><xsl:template match="@*|node()" mode="mathml">
3260
3398
  <xsl:copy>
3261
3399
  <xsl:apply-templates select="@*|node()" mode="mathml"/>
@@ -3265,19 +3403,6 @@
3265
3403
  <!-- replace start and end spaces to non-break space -->
3266
3404
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
3267
3405
  </xsl:copy>
3268
- </xsl:template><xsl:template match="mathml:mi[. = ',' and not(following-sibling::*[1][local-name() = 'mtext' and text() = ' '])]" mode="mathml">
3269
- <xsl:copy>
3270
- <xsl:apply-templates select="@*|node()" mode="mathml"/>
3271
- </xsl:copy>
3272
- <xsl:choose>
3273
- <!-- if in msub, then don't add space -->
3274
- <xsl:when test="ancestor::mathml:mrow[parent::mathml:msub and preceding-sibling::*[1][self::mathml:mrow]]"/>
3275
- <!-- if next char in digit, don't add space -->
3276
- <xsl:when test="translate(substring(following-sibling::*[1]/text(),1,1),'0123456789','') = ''"/>
3277
- <xsl:otherwise>
3278
- <mathml:mspace width="0.5ex"/>
3279
- </xsl:otherwise>
3280
- </xsl:choose>
3281
3406
  </xsl:template><xsl:template match="mathml:math/*[local-name()='unit']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='prefix']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='dimension']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='quantity']" mode="mathml"/><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
3282
3407
  <xsl:variable name="target">
3283
3408
  <xsl:choose>
@@ -3330,7 +3455,10 @@
3330
3455
  </fo:block>
3331
3456
  <xsl:apply-templates/>
3332
3457
  </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
3333
- <fo:inline><xsl:apply-templates/></fo:inline>
3458
+ <xsl:variable name="level">
3459
+ <xsl:call-template name="getLevel"/>
3460
+ </xsl:variable>
3461
+ <fo:inline role="H{$level}"><xsl:apply-templates/></fo:inline>
3334
3462
  </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
3335
3463
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
3336
3464
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -3365,9 +3493,10 @@
3365
3493
 
3366
3494
  </xsl:variable>
3367
3495
 
3496
+ <xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
3368
3497
  <xsl:choose>
3369
- <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
3370
- <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
3498
+ <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>
3499
+ <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>
3371
3500
  </xsl:choose>
3372
3501
  <xsl:apply-templates/>
3373
3502
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
@@ -3511,7 +3640,10 @@
3511
3640
  </fo:block>
3512
3641
  </xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']" mode="presentation">
3513
3642
  <xsl:if test="normalize-space() != ''">
3514
- <fo:inline>
3643
+ <xsl:variable name="level">
3644
+ <xsl:call-template name="getLevelTermName"/>
3645
+ </xsl:variable>
3646
+ <fo:inline role="H{$level}">
3515
3647
  <xsl:apply-templates/>
3516
3648
  <!-- <xsl:if test="$namespace = 'gb' or $namespace = 'ogc'">
3517
3649
  <xsl:text>.</xsl:text>
@@ -3812,6 +3944,13 @@
3812
3944
  </xsl:attribute>
3813
3945
  <xsl:apply-templates mode="svg_update"/>
3814
3946
  </xsl:copy>
3947
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][*[local-name() = 'svg']]" priority="3">
3948
+ <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
3949
+ <xsl:for-each select="*[local-name() = 'svg']">
3950
+ <xsl:call-template name="image_svg">
3951
+ <xsl:with-param name="name" select="$name"/>
3952
+ </xsl:call-template>
3953
+ </xsl:for-each>
3815
3954
  </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
3816
3955
  <xsl:variable name="svg_content" select="document(@src)"/>
3817
3956
  <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
@@ -3916,7 +4055,7 @@
3916
4055
  </fo:basic-link>
3917
4056
  </fo:block>
3918
4057
  </fo:block-container>
3919
- </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">
4058
+ </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">
3920
4059
  <xsl:apply-templates mode="contents"/>
3921
4060
  <xsl:text> </xsl:text>
3922
4061
  </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">
@@ -4142,6 +4281,7 @@
4142
4281
  </xsl:when>
4143
4282
  <xsl:otherwise>
4144
4283
  <xsl:apply-templates/>
4284
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
4145
4285
  </xsl:otherwise>
4146
4286
  </xsl:choose>
4147
4287
  </fo:block>
@@ -4282,14 +4422,6 @@
4282
4422
  <fo:block>
4283
4423
  <fo:inline padding-right="3mm">Obligation</fo:inline><xsl:value-of select="."/>
4284
4424
  </fo:block>
4285
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
4286
- <fo:block xsl:use-attribute-sets="requirement-subject-style">
4287
- <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
4288
- </fo:block>
4289
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'inherit']">
4290
- <fo:block xsl:use-attribute-sets="requirement-inherit-style">
4291
- <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
4292
- </fo:block>
4293
4425
  </xsl:template><xsl:template match="*[local-name() = 'recommendation']">
4294
4426
  <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
4295
4427
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -4306,6 +4438,38 @@
4306
4438
  <fo:block xsl:use-attribute-sets="recommendation-label-style">
4307
4439
  <xsl:apply-templates/>
4308
4440
  </fo:block>
4441
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" priority="2"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
4442
+ <fo:block xsl:use-attribute-sets="subject-style">
4443
+ <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
4444
+ </fo:block>
4445
+ </xsl:template><xsl:template match="*[local-name() = 'subject']">
4446
+ <fo:block xsl:use-attribute-sets="subject-style">
4447
+ <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
4448
+ </fo:block>
4449
+ </xsl:template><xsl:template match="*[local-name() = 'inherit'] | *[local-name() = 'component'][@class = 'inherit']">
4450
+ <fo:block xsl:use-attribute-sets="inherit-style">
4451
+ <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
4452
+ </fo:block>
4453
+ </xsl:template><xsl:template match="*[local-name() = 'description'] | *[local-name() = 'component'][@class = 'description']">
4454
+ <fo:block xsl:use-attribute-sets="description-style">
4455
+ <xsl:apply-templates/>
4456
+ </fo:block>
4457
+ </xsl:template><xsl:template match="*[local-name() = 'specification'] | *[local-name() = 'component'][@class = 'specification']">
4458
+ <fo:block xsl:use-attribute-sets="specification-style">
4459
+ <xsl:apply-templates/>
4460
+ </fo:block>
4461
+ </xsl:template><xsl:template match="*[local-name() = 'measurement-target'] | *[local-name() = 'component'][@class = 'measurement-target']">
4462
+ <fo:block xsl:use-attribute-sets="measurement-target-style">
4463
+ <xsl:apply-templates/>
4464
+ </fo:block>
4465
+ </xsl:template><xsl:template match="*[local-name() = 'verification'] | *[local-name() = 'component'][@class = 'verification']">
4466
+ <fo:block xsl:use-attribute-sets="verification-style">
4467
+ <xsl:apply-templates/>
4468
+ </fo:block>
4469
+ </xsl:template><xsl:template match="*[local-name() = 'import'] | *[local-name() = 'component'][@class = 'import']">
4470
+ <fo:block xsl:use-attribute-sets="import-style">
4471
+ <xsl:apply-templates/>
4472
+ </fo:block>
4309
4473
  </xsl:template><xsl:template match="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
4310
4474
  <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt">
4311
4475
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
@@ -4457,7 +4621,19 @@
4457
4621
  </fo:inline>
4458
4622
  </xsl:if>
4459
4623
  </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'p']">
4460
- <fo:inline><xsl:apply-templates/></fo:inline>
4624
+ <xsl:variable name="element">inline
4625
+
4626
+ </xsl:variable>
4627
+ <xsl:choose>
4628
+ <xsl:when test="contains($element, 'block')">
4629
+ <fo:block xsl:use-attribute-sets="example-p-style">
4630
+ <xsl:apply-templates/>
4631
+ </fo:block>
4632
+ </xsl:when>
4633
+ <xsl:otherwise>
4634
+ <fo:inline><xsl:apply-templates/></fo:inline>
4635
+ </xsl:otherwise>
4636
+ </xsl:choose>
4461
4637
  </xsl:template><xsl:template match="*[local-name() = 'example']">
4462
4638
  <fo:block id="{@id}" xsl:use-attribute-sets="example-style">
4463
4639
 
@@ -4559,14 +4735,15 @@
4559
4735
  </xsl:if>
4560
4736
  </xsl:template><xsl:variable name="localized.source">
4561
4737
  <xsl:call-template name="getLocalizedString">
4562
- <xsl:with-param name="key">source</xsl:with-param>
4563
- </xsl:call-template>
4738
+ <xsl:with-param name="key">source</xsl:with-param>
4739
+ </xsl:call-template>
4564
4740
  </xsl:variable><xsl:template match="*[local-name() = 'origin']">
4565
4741
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
4566
4742
  <xsl:if test="normalize-space(@citeas) = ''">
4567
4743
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
4568
4744
  </xsl:if>
4569
4745
 
4746
+
4570
4747
  <fo:inline>
4571
4748
 
4572
4749
 
@@ -4574,6 +4751,7 @@
4574
4751
 
4575
4752
 
4576
4753
 
4754
+
4577
4755
  <xsl:call-template name="getTitle">
4578
4756
  <xsl:with-param name="name" select="'title-source'"/>
4579
4757
  </xsl:call-template>
@@ -4585,6 +4763,7 @@
4585
4763
  <fo:inline xsl:use-attribute-sets="origin-style">
4586
4764
  <xsl:apply-templates/>
4587
4765
  </fo:inline>
4766
+
4588
4767
  </fo:basic-link>
4589
4768
  </xsl:template><xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']">
4590
4769
  <fo:inline><xsl:apply-templates/></fo:inline>
@@ -4651,6 +4830,9 @@
4651
4830
 
4652
4831
  </xsl:if>
4653
4832
 
4833
+ <xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets -->
4834
+ <xsl:variable name="text" select="normalize-space()"/>
4835
+
4654
4836
 
4655
4837
 
4656
4838
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
@@ -4666,7 +4848,9 @@
4666
4848
 
4667
4849
 
4668
4850
  </xsl:if>
4669
-
4851
+
4852
+
4853
+
4670
4854
  <xsl:apply-templates/>
4671
4855
  </fo:basic-link>
4672
4856
 
@@ -5005,6 +5189,7 @@
5005
5189
  </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" priority="4">
5006
5190
  <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
5007
5191
  <fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
5192
+
5008
5193
  <xsl:apply-templates/>
5009
5194
  </fo:block>
5010
5195
  </xsl:template><xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
@@ -5044,7 +5229,6 @@
5044
5229
  </xsl:template><xsl:template name="processBibitem">
5045
5230
 
5046
5231
 
5047
- <!-- end BIPM bibitem processing-->
5048
5232
 
5049
5233
 
5050
5234
 
@@ -5174,6 +5358,97 @@
5174
5358
  <fo:block-container border="1pt solid black" width="50%">
5175
5359
  <fo:block> </fo:block>
5176
5360
  </fo:block-container>
5361
+ </xsl:template><xsl:template match="*[local-name() = 'toc']">
5362
+ <xsl:param name="colwidths"/>
5363
+ <xsl:variable name="colwidths_">
5364
+ <xsl:choose>
5365
+ <xsl:when test="not($colwidths)">
5366
+ <xsl:variable name="toc_table_simple">
5367
+ <tbody>
5368
+ <xsl:apply-templates mode="toc_table_width"/>
5369
+ </tbody>
5370
+ </xsl:variable>
5371
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($toc_table_simple)/*/tr[1]/td)"/>
5372
+ <xsl:call-template name="calculate-column-widths">
5373
+ <xsl:with-param name="cols-count" select="$cols-count"/>
5374
+ <xsl:with-param name="table" select="$toc_table_simple"/>
5375
+ </xsl:call-template>
5376
+ </xsl:when>
5377
+ <xsl:otherwise>
5378
+ <xsl:copy-of select="$colwidths"/>
5379
+ </xsl:otherwise>
5380
+ </xsl:choose>
5381
+ </xsl:variable>
5382
+ <fo:block role="TOCI" space-after="16pt">
5383
+ <fo:table width="100%" table-layout="fixed">
5384
+ <xsl:for-each select="xalan:nodeset($colwidths_)/column">
5385
+ <fo:table-column column-width="proportional-column-width({.})"/>
5386
+ </xsl:for-each>
5387
+ <fo:table-body>
5388
+ <xsl:apply-templates/>
5389
+ </fo:table-body>
5390
+ </fo:table>
5391
+ </fo:block>
5392
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']">
5393
+ <fo:table-row min-height="5mm">
5394
+ <xsl:apply-templates/>
5395
+ </fo:table-row>
5396
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']/*[local-name() = 'p']">
5397
+ <xsl:apply-templates/>
5398
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'xref']" priority="3">
5399
+ <!-- <xref target="cgpm9th1948r6">1.6.3<tab/>&#8220;9th CGPM, 1948:<tab/>decision to establish the SI&#8221;</xref> -->
5400
+ <xsl:variable name="target" select="@target"/>
5401
+ <xsl:for-each select="*[local-name() = 'tab']">
5402
+ <xsl:variable name="current_id" select="generate-id()"/>
5403
+ <fo:table-cell>
5404
+ <fo:block>
5405
+ <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
5406
+ <xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
5407
+ <xsl:choose>
5408
+ <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
5409
+ <xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
5410
+ </xsl:choose>
5411
+ </xsl:for-each>
5412
+ </fo:basic-link>
5413
+ </fo:block>
5414
+ </fo:table-cell>
5415
+ </xsl:for-each>
5416
+ <!-- last column - for page numbers -->
5417
+ <fo:table-cell text-align="right" font-size="10pt" font-weight="bold" font-family="Arial">
5418
+ <fo:block>
5419
+ <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
5420
+ <fo:page-number-citation ref-id="{$target}"/>
5421
+ </fo:basic-link>
5422
+ </fo:block>
5423
+ </fo:table-cell>
5424
+ </xsl:template><xsl:template match="*" mode="toc_table_width">
5425
+ <xsl:apply-templates mode="toc_table_width"/>
5426
+ </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">
5427
+ <tr>
5428
+ <xsl:apply-templates mode="toc_table_width"/>
5429
+ </tr>
5430
+ </xsl:template><xsl:template match="*[local-name() = 'xref']" mode="toc_table_width">
5431
+ <!-- <xref target="cgpm9th1948r6">1.6.3<tab/>&#8220;9th CGPM, 1948:<tab/>decision to establish the SI&#8221;</xref> -->
5432
+ <xsl:for-each select="*[local-name() = 'tab']">
5433
+ <xsl:variable name="current_id" select="generate-id()"/>
5434
+ <td>
5435
+ <xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
5436
+ <xsl:copy-of select="."/>
5437
+ </xsl:for-each>
5438
+ </td>
5439
+ </xsl:for-each>
5440
+ <td>333</td> <!-- page number, just for fill -->
5441
+ </xsl:template><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']"/><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
5442
+ <fo:inline padding-right="5mm"> </fo:inline>
5443
+ <fo:inline><xsl:apply-templates/></fo:inline>
5444
+ </xsl:template><xsl:template match="*[local-name() = 'blacksquare']" name="blacksquare">
5445
+ <fo:inline padding-right="2.5mm" baseline-shift="5%">
5446
+ <fo:instream-foreign-object content-height="2mm" content-width="2mm" fox:alt-text="Quad">
5447
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" viewBox="0 0 2 2">
5448
+ <rect x="0" y="0" width="2" height="2" fill="black"/>
5449
+ </svg>
5450
+ </fo:instream-foreign-object>
5451
+ </fo:inline>
5177
5452
  </xsl:template><xsl:template name="convertDate">
5178
5453
  <xsl:param name="date"/>
5179
5454
  <xsl:param name="format" select="'short'"/>
@@ -5412,6 +5687,26 @@
5412
5687
  <xsl:value-of select="$level"/>
5413
5688
  </xsl:otherwise>
5414
5689
  </xsl:choose>
5690
+ </xsl:template><xsl:template name="getLevelTermName">
5691
+ <xsl:choose>
5692
+ <xsl:when test="normalize-space(../@depth) != ''">
5693
+ <xsl:value-of select="../@depth"/>
5694
+ </xsl:when>
5695
+ <xsl:otherwise>
5696
+ <xsl:variable name="title_level_">
5697
+ <xsl:for-each select="../preceding-sibling::*[local-name() = 'title'][1]">
5698
+ <xsl:call-template name="getLevel"/>
5699
+ </xsl:for-each>
5700
+ </xsl:variable>
5701
+ <xsl:variable name="title_level" select="normalize-space($title_level_)"/>
5702
+ <xsl:choose>
5703
+ <xsl:when test="$title_level != ''"><xsl:value-of select="$title_level + 1"/></xsl:when>
5704
+ <xsl:otherwise>
5705
+ <xsl:call-template name="getLevel"/>
5706
+ </xsl:otherwise>
5707
+ </xsl:choose>
5708
+ </xsl:otherwise>
5709
+ </xsl:choose>
5415
5710
  </xsl:template><xsl:template name="split">
5416
5711
  <xsl:param name="pText" select="."/>
5417
5712
  <xsl:param name="sep" select="','"/>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module CC
3
- VERSION = "1.7.8".freeze
3
+ VERSION = "1.7.12".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.8
4
+ version: 1.7.12
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-02 00:00:00.000000000 Z
11
+ date: 2021-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic