metanorma-cc 1.7.6 → 1.7.10

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: 9800409f83f05968a5bbc1b3fb23acc9b16b0791e97dd43897ec541c9f2309cd
4
- data.tar.gz: fba0e90b9902ec515e4b61c337c1923bb7dd8377169739dbf8caa40fcf2d0eb0
3
+ metadata.gz: c5917448961cb03e62b3e84cf77d6043603b1279117ae65c54e3e9a0267473f9
4
+ data.tar.gz: 104e9178cf81e181efde8093cb9fceb16b1897f53be84d3bc189905b1fe5aa18
5
5
  SHA512:
6
- metadata.gz: 1fca6f832f5332ac625d052864674a9a28d9d7485dab97f58e29a1a12ebffbc3bc83d52bd986dce067e0ea88d633912d52a8b9ae61e31ab819af6e20737d3e4d
7
- data.tar.gz: 8aa8cd87c0d718a424de2787afdf58f7979d03cebe279df6e7f5f90608910ffdb8fd6b70978a90ff21e43a6756e743eb0f3fbdc835e6ecdae49342c71a39c724
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>
@@ -204,6 +218,18 @@
204
218
  </zeroOrMore>
205
219
  </element>
206
220
  </define>
221
+ <define name="dt">
222
+ <element name="dt">
223
+ <optional>
224
+ <attribute name="id">
225
+ <data type="ID"/>
226
+ </attribute>
227
+ </optional>
228
+ <zeroOrMore>
229
+ <ref name="TextElement"/>
230
+ </zeroOrMore>
231
+ </element>
232
+ </define>
207
233
  <define name="example">
208
234
  <element name="example">
209
235
  <attribute name="id">
@@ -899,7 +925,7 @@
899
925
  </include>
900
926
  <!-- end overrides -->
901
927
  <define name="docsubtype">
902
- <element name="docsubtype">
928
+ <element name="subdoctype">
903
929
  <ref name="DocumentSubtype"/>
904
930
  </element>
905
931
  </define>
@@ -954,6 +980,16 @@
954
980
  </define>
955
981
  <define name="concept">
956
982
  <element name="concept">
983
+ <optional>
984
+ <attribute name="ital">
985
+ <data type="boolean"/>
986
+ </attribute>
987
+ </optional>
988
+ <optional>
989
+ <attribute name="ref">
990
+ <data type="boolean"/>
991
+ </attribute>
992
+ </optional>
957
993
  <optional>
958
994
  <element name="refterm">
959
995
  <zeroOrMore>
@@ -989,8 +1025,14 @@
989
1025
  <ref name="imagemap"/>
990
1026
  <ref name="svgmap"/>
991
1027
  <ref name="inputform"/>
1028
+ <ref name="toc"/>
992
1029
  </choice>
993
1030
  </define>
1031
+ <define name="toc">
1032
+ <element name="toc">
1033
+ <ref name="ul"/>
1034
+ </element>
1035
+ </define>
994
1036
  <define name="inputform">
995
1037
  <element name="form">
996
1038
  <attribute name="id">
@@ -998,6 +1040,9 @@
998
1040
  </attribute>
999
1041
  <attribute name="name"/>
1000
1042
  <attribute name="action"/>
1043
+ <optional>
1044
+ <attribute name="class"/>
1045
+ </optional>
1001
1046
  <zeroOrMore>
1002
1047
  <choice>
1003
1048
  <ref name="TextElement"/>
@@ -1229,6 +1274,12 @@
1229
1274
  <optional>
1230
1275
  <attribute name="type"/>
1231
1276
  </optional>
1277
+ <optional>
1278
+ <attribute name="identifier"/>
1279
+ </optional>
1280
+ <optional>
1281
+ <attribute name="prefix"/>
1282
+ </optional>
1232
1283
  <text/>
1233
1284
  </define>
1234
1285
  <define name="ics">
@@ -1490,26 +1541,26 @@
1490
1541
  <optional>
1491
1542
  <ref name="section-title"/>
1492
1543
  </optional>
1493
- <group>
1544
+ <choice>
1494
1545
  <choice>
1495
1546
  <group>
1496
- <zeroOrMore>
1547
+ <oneOrMore>
1497
1548
  <ref name="BasicBlock"/>
1498
- </zeroOrMore>
1549
+ </oneOrMore>
1499
1550
  <zeroOrMore>
1500
1551
  <ref name="note"/>
1501
1552
  </zeroOrMore>
1502
1553
  </group>
1503
1554
  <ref name="amend"/>
1504
1555
  </choice>
1505
- <zeroOrMore>
1556
+ <oneOrMore>
1506
1557
  <choice>
1507
1558
  <ref name="clause-subsection"/>
1508
1559
  <ref name="terms"/>
1509
1560
  <ref name="definitions"/>
1510
1561
  </choice>
1511
- </zeroOrMore>
1512
- </group>
1562
+ </oneOrMore>
1563
+ </choice>
1513
1564
  </define>
1514
1565
  <define name="Annex-Section">
1515
1566
  <optional>
@@ -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>
@@ -1091,7 +1108,9 @@
1091
1108
 
1092
1109
 
1093
1110
 
1094
- </xsl:attribute-set><xsl:attribute-set name="table-name-style">
1111
+ </xsl:attribute-set><xsl:variable name="table-border_">
1112
+
1113
+ </xsl:variable><xsl:variable name="table-border" select="normalize-space($table-border_)"/><xsl:attribute-set name="table-name-style">
1095
1114
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1096
1115
 
1097
1116
 
@@ -1214,7 +1233,8 @@
1214
1233
 
1215
1234
 
1216
1235
 
1217
- </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>
1218
1238
 
1219
1239
 
1220
1240
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
@@ -1409,11 +1429,15 @@
1409
1429
  <fo:block>&#xA0;</fo:block>
1410
1430
  </xsl:if> -->
1411
1431
 
1432
+
1433
+ <!-- Display table's name before table as standalone block -->
1412
1434
  <!-- $namespace = 'iso' or -->
1413
1435
 
1414
1436
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
1415
1437
 
1416
-
1438
+
1439
+
1440
+
1417
1441
 
1418
1442
  <xsl:call-template name="fn_name_display"/>
1419
1443
 
@@ -1486,6 +1510,12 @@
1486
1510
 
1487
1511
 
1488
1512
 
1513
+
1514
+
1515
+
1516
+ <!-- display table's name before table for PAS inside block-container (2-columnn layout) -->
1517
+
1518
+
1489
1519
  <xsl:variable name="table_width">
1490
1520
  <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
1491
1521
  100%
@@ -1504,6 +1534,7 @@
1504
1534
 
1505
1535
 
1506
1536
 
1537
+
1507
1538
 
1508
1539
 
1509
1540
 
@@ -1527,6 +1558,8 @@
1527
1558
  <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1528
1559
  </xsl:if>
1529
1560
 
1561
+
1562
+
1530
1563
  <xsl:choose>
1531
1564
  <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
1532
1565
  <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
@@ -1814,9 +1847,9 @@
1814
1847
  <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation">
1815
1848
  <xsl:with-param name="continued">true</xsl:with-param>
1816
1849
  </xsl:apply-templates>
1817
- <xsl:for-each select="ancestor::*[local-name()='table'][1]">
1818
- <xsl:call-template name="fn_name_display"/>
1819
- </xsl:for-each>
1850
+
1851
+
1852
+
1820
1853
 
1821
1854
  </fo:table-cell>
1822
1855
  </fo:table-row>
@@ -1898,7 +1931,11 @@
1898
1931
 
1899
1932
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
1900
1933
 
1901
- <xsl:if test="$isNoteOrFnExist = 'true'">
1934
+ <xsl:variable name="isNoteOrFnExistShowAfterTable">
1935
+
1936
+ </xsl:variable>
1937
+
1938
+ <xsl:if test="$isNoteOrFnExist = 'true' or normalize-space($isNoteOrFnExistShowAfterTable) = 'true'">
1902
1939
 
1903
1940
  <xsl:variable name="cols-count">
1904
1941
  <xsl:choose>
@@ -1927,6 +1964,8 @@
1927
1964
  </xsl:choose>
1928
1965
  </xsl:for-each>
1929
1966
 
1967
+
1968
+
1930
1969
  <xsl:choose>
1931
1970
  <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
1932
1971
  <xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
@@ -1953,6 +1992,7 @@
1953
1992
 
1954
1993
 
1955
1994
 
1995
+
1956
1996
  <!-- fn will be processed inside 'note' processing -->
1957
1997
 
1958
1998
 
@@ -1961,6 +2001,11 @@
1961
2001
 
1962
2002
 
1963
2003
 
2004
+
2005
+
2006
+ <!-- for BSI (not PAS) display Notes before footnotes -->
2007
+
2008
+
1964
2009
  <!-- except gb -->
1965
2010
 
1966
2011
  <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
@@ -1986,6 +2031,10 @@
1986
2031
  <!-- fn processing -->
1987
2032
  <xsl:call-template name="fn_display"/>
1988
2033
 
2034
+
2035
+ <!-- for PAS display Notes after footnotes -->
2036
+
2037
+
1989
2038
  </fo:table-cell>
1990
2039
  </fo:table-row>
1991
2040
  </fo:table-body>
@@ -2027,6 +2076,19 @@
2027
2076
 
2028
2077
  </fo:table-body>
2029
2078
 
2079
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/text()[1]" priority="2" mode="presentation_name">
2080
+ <xsl:choose>
2081
+ <xsl:when test="substring-after(., '—') != ''">
2082
+ <xsl:text>—</xsl:text><xsl:value-of select="substring-after(., '—')"/>
2083
+ </xsl:when>
2084
+ <xsl:otherwise>
2085
+ <xsl:value-of select="."/>
2086
+ </xsl:otherwise>
2087
+ </xsl:choose>
2088
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']" mode="presentation_name">
2089
+ <xsl:apply-templates mode="presentation_name"/>
2090
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/node()" mode="presentation_name">
2091
+ <xsl:apply-templates select="."/>
2030
2092
  </xsl:template><xsl:template match="*[local-name()='tr']">
2031
2093
  <xsl:variable name="parent-name" select="local-name(..)"/>
2032
2094
  <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
@@ -2039,10 +2101,13 @@
2039
2101
 
2040
2102
 
2041
2103
 
2104
+
2105
+
2042
2106
  </xsl:if>
2043
2107
  <xsl:if test="$parent-name = 'tfoot'">
2044
2108
 
2045
2109
 
2110
+
2046
2111
  </xsl:if>
2047
2112
 
2048
2113
 
@@ -2052,6 +2117,8 @@
2052
2117
 
2053
2118
 
2054
2119
 
2120
+
2121
+
2055
2122
  <!-- <xsl:if test="$namespace = 'bipm'">
2056
2123
  <xsl:attribute name="height">8mm</xsl:attribute>
2057
2124
  </xsl:if> -->
@@ -2171,8 +2238,13 @@
2171
2238
 
2172
2239
 
2173
2240
 
2241
+
2242
+ <!-- Table's note name (NOTE, for example) -->
2243
+
2174
2244
  <fo:inline padding-right="2mm">
2175
2245
 
2246
+
2247
+
2176
2248
 
2177
2249
 
2178
2250
 
@@ -2180,6 +2252,8 @@
2180
2252
 
2181
2253
  </fo:inline>
2182
2254
 
2255
+
2256
+
2183
2257
  <xsl:apply-templates mode="process"/>
2184
2258
  </fo:block>
2185
2259
 
@@ -2187,18 +2261,18 @@
2187
2261
  <xsl:apply-templates/>
2188
2262
  </xsl:template><xsl:template name="fn_display">
2189
2263
  <xsl:variable name="references">
2264
+
2190
2265
  <xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']">
2191
- <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
2192
-
2193
-
2194
- <xsl:apply-templates/>
2195
- </fn>
2266
+ <xsl:call-template name="create_fn"/>
2196
2267
  </xsl:for-each>
2197
2268
  </xsl:variable>
2269
+
2198
2270
  <xsl:for-each select="xalan:nodeset($references)//fn">
2199
2271
  <xsl:variable name="reference" select="@reference"/>
2200
2272
  <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
2201
2273
  <fo:block margin-bottom="12pt">
2274
+
2275
+
2202
2276
 
2203
2277
 
2204
2278
 
@@ -2218,6 +2292,7 @@
2218
2292
  <xsl:value-of select="@reference"/>
2219
2293
 
2220
2294
 
2295
+
2221
2296
  </fo:inline>
2222
2297
  <fo:inline>
2223
2298
 
@@ -2227,6 +2302,12 @@
2227
2302
  </fo:block>
2228
2303
  </xsl:if>
2229
2304
  </xsl:for-each>
2305
+ </xsl:template><xsl:template name="create_fn">
2306
+ <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
2307
+
2308
+
2309
+ <xsl:apply-templates/>
2310
+ </fn>
2230
2311
  </xsl:template><xsl:template name="fn_name_display">
2231
2312
  <!-- <xsl:variable name="references">
2232
2313
  <xsl:for-each select="*[local-name()='name']//*[local-name()='fn']">
@@ -2367,6 +2448,7 @@
2367
2448
 
2368
2449
  <xsl:value-of select="@reference"/>
2369
2450
 
2451
+
2370
2452
  </fo:basic-link>
2371
2453
  </fo:inline>
2372
2454
  </xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
@@ -3207,16 +3289,68 @@
3207
3289
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
3208
3290
  </xsl:call-template>
3209
3291
 
3292
+
3293
+
3210
3294
  <xsl:variable name="mathml">
3211
3295
  <xsl:apply-templates select="." mode="mathml"/>
3212
3296
  </xsl:variable>
3213
3297
  <fo:instream-foreign-object fox:alt-text="Math">
3214
3298
 
3215
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
+
3216
3329
  <!-- <xsl:copy-of select="."/> -->
3217
3330
  <xsl:copy-of select="xalan:nodeset($mathml)"/>
3218
3331
  </fo:instream-foreign-object>
3219
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()"/>
3220
3354
  </xsl:template><xsl:template match="@*|node()" mode="mathml">
3221
3355
  <xsl:copy>
3222
3356
  <xsl:apply-templates select="@*|node()" mode="mathml"/>
@@ -3226,19 +3360,6 @@
3226
3360
  <!-- replace start and end spaces to non-break space -->
3227
3361
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
3228
3362
  </xsl:copy>
3229
- </xsl:template><xsl:template match="mathml:mi[. = ',' and not(following-sibling::*[1][local-name() = 'mtext' and text() = ' '])]" mode="mathml">
3230
- <xsl:copy>
3231
- <xsl:apply-templates select="@*|node()" mode="mathml"/>
3232
- </xsl:copy>
3233
- <xsl:choose>
3234
- <!-- if in msub, then don't add space -->
3235
- <xsl:when test="ancestor::mathml:mrow[parent::mathml:msub and preceding-sibling::*[1][self::mathml:mrow]]"/>
3236
- <!-- if next char in digit, don't add space -->
3237
- <xsl:when test="translate(substring(following-sibling::*[1]/text(),1,1),'0123456789','') = ''"/>
3238
- <xsl:otherwise>
3239
- <mathml:mspace width="0.5ex"/>
3240
- </xsl:otherwise>
3241
- </xsl:choose>
3242
3363
  </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">
3243
3364
  <xsl:variable name="target">
3244
3365
  <xsl:choose>
@@ -3291,7 +3412,10 @@
3291
3412
  </fo:block>
3292
3413
  <xsl:apply-templates/>
3293
3414
  </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
3294
- <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>
3295
3419
  </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
3296
3420
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
3297
3421
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -3326,9 +3450,10 @@
3326
3450
 
3327
3451
  </xsl:variable>
3328
3452
 
3453
+ <xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
3329
3454
  <xsl:choose>
3330
- <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
3331
- <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>
3332
3457
  </xsl:choose>
3333
3458
  <xsl:apply-templates/>
3334
3459
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
@@ -3372,6 +3497,7 @@
3372
3497
 
3373
3498
 
3374
3499
 
3500
+
3375
3501
  <fo:block-container margin-left="0mm">
3376
3502
 
3377
3503
 
@@ -3471,7 +3597,10 @@
3471
3597
  </fo:block>
3472
3598
  </xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']" mode="presentation">
3473
3599
  <xsl:if test="normalize-space() != ''">
3474
- <fo:inline>
3600
+ <xsl:variable name="level">
3601
+ <xsl:call-template name="getLevelTermName"/>
3602
+ </xsl:variable>
3603
+ <fo:inline role="H{$level}">
3475
3604
  <xsl:apply-templates/>
3476
3605
  <!-- <xsl:if test="$namespace = 'gb' or $namespace = 'ogc'">
3477
3606
  <xsl:text>.</xsl:text>
@@ -3544,7 +3673,24 @@
3544
3673
  </fo:instream-foreign-object>
3545
3674
  </xsl:when>
3546
3675
  <xsl:otherwise>
3547
- <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
3676
+ <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
3677
+ <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
3678
+
3679
+ <xsl:variable name="img_src">
3680
+ <xsl:choose>
3681
+ <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
3682
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
3683
+ </xsl:choose>
3684
+ </xsl:variable>
3685
+
3686
+ <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $width_effective, $height_effective)"/>
3687
+ <xsl:if test="number($scale) &lt; 100">
3688
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
3689
+ </xsl:if>
3690
+
3691
+ </xsl:if>
3692
+
3693
+ </fo:external-graphic>
3548
3694
  </xsl:otherwise>
3549
3695
  </xsl:choose>
3550
3696
 
@@ -3715,11 +3861,13 @@
3715
3861
  <xsl:attribute name="width">100%</xsl:attribute>
3716
3862
  <xsl:attribute name="content-height">100%</xsl:attribute>
3717
3863
  <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
3864
+ <xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
3865
+ <xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
3718
3866
  <!-- effective height 297 - 27.4 - 13 = 256.6 -->
3719
3867
  <!-- effective width 210 - 12.5 - 25 = 172.5 -->
3720
3868
  <!-- effective height / width = 1.48, 1.4 - with title -->
3721
- <xsl:if test="@height &gt; (@width * 1.4)"> <!-- for images with big height -->
3722
- <xsl:variable name="width" select="((@width * 1.4) div @height) * 100"/>
3869
+ <xsl:if test="$svg_height &gt; ($svg_width * 1.4)"> <!-- for images with big height -->
3870
+ <xsl:variable name="width" select="(($svg_width * 1.4) div $svg_height) * 100"/>
3723
3871
  <xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
3724
3872
  </xsl:if>
3725
3873
  <xsl:attribute name="scaling">uniform</xsl:attribute>
@@ -3736,6 +3884,23 @@
3736
3884
  <xsl:attribute name="href" namespace="http://www.w3.org/1999/xlink">
3737
3885
  <xsl:value-of select="."/>
3738
3886
  </xsl:attribute>
3887
+ </xsl:template><xsl:template match="*[local-name() = 'svg'][not(@width and @height)]" mode="svg_update">
3888
+ <xsl:copy>
3889
+ <xsl:apply-templates select="@*" mode="svg_update"/>
3890
+ <xsl:variable name="viewbox">
3891
+ <xsl:call-template name="split">
3892
+ <xsl:with-param name="pText" select="@viewBox"/>
3893
+ <xsl:with-param name="sep" select="' '"/>
3894
+ </xsl:call-template>
3895
+ </xsl:variable>
3896
+ <xsl:attribute name="width">
3897
+ <xsl:value-of select="round(xalan:nodeset($viewbox)//item[3])"/>
3898
+ </xsl:attribute>
3899
+ <xsl:attribute name="height">
3900
+ <xsl:value-of select="round(xalan:nodeset($viewbox)//item[4])"/>
3901
+ </xsl:attribute>
3902
+ <xsl:apply-templates mode="svg_update"/>
3903
+ </xsl:copy>
3739
3904
  </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
3740
3905
  <xsl:variable name="svg_content" select="document(@src)"/>
3741
3906
  <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
@@ -4066,6 +4231,7 @@
4066
4231
  </xsl:when>
4067
4232
  <xsl:otherwise>
4068
4233
  <xsl:apply-templates/>
4234
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
4069
4235
  </xsl:otherwise>
4070
4236
  </xsl:choose>
4071
4237
  </fo:block>
@@ -4206,14 +4372,6 @@
4206
4372
  <fo:block>
4207
4373
  <fo:inline padding-right="3mm">Obligation</fo:inline><xsl:value-of select="."/>
4208
4374
  </fo:block>
4209
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
4210
- <fo:block xsl:use-attribute-sets="requirement-subject-style">
4211
- <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
4212
- </fo:block>
4213
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'inherit']">
4214
- <fo:block xsl:use-attribute-sets="requirement-inherit-style">
4215
- <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
4216
- </fo:block>
4217
4375
  </xsl:template><xsl:template match="*[local-name() = 'recommendation']">
4218
4376
  <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
4219
4377
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -4230,6 +4388,38 @@
4230
4388
  <fo:block xsl:use-attribute-sets="recommendation-label-style">
4231
4389
  <xsl:apply-templates/>
4232
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>
4233
4423
  </xsl:template><xsl:template match="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
4234
4424
  <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt">
4235
4425
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
@@ -4381,7 +4571,19 @@
4381
4571
  </fo:inline>
4382
4572
  </xsl:if>
4383
4573
  </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'p']">
4384
- <fo:inline><xsl:apply-templates/></fo:inline>
4574
+ <xsl:variable name="element">inline
4575
+
4576
+ </xsl:variable>
4577
+ <xsl:choose>
4578
+ <xsl:when test="contains($element, 'block')">
4579
+ <fo:block xsl:use-attribute-sets="example-p-style">
4580
+ <xsl:apply-templates/>
4581
+ </fo:block>
4582
+ </xsl:when>
4583
+ <xsl:otherwise>
4584
+ <fo:inline><xsl:apply-templates/></fo:inline>
4585
+ </xsl:otherwise>
4586
+ </xsl:choose>
4385
4587
  </xsl:template><xsl:template match="*[local-name() = 'example']">
4386
4588
  <fo:block id="{@id}" xsl:use-attribute-sets="example-style">
4387
4589
 
@@ -4574,9 +4776,10 @@
4574
4776
 
4575
4777
 
4576
4778
  </xsl:if>
4577
-
4779
+
4780
+
4781
+
4578
4782
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
4579
-
4580
4783
  <xsl:if test="normalize-space(@citeas) = ''">
4581
4784
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
4582
4785
  </xsl:if>
@@ -4587,6 +4790,7 @@
4587
4790
 
4588
4791
 
4589
4792
 
4793
+
4590
4794
  </xsl:if>
4591
4795
 
4592
4796
  <xsl:apply-templates/>
@@ -4966,7 +5170,6 @@
4966
5170
  </xsl:template><xsl:template name="processBibitem">
4967
5171
 
4968
5172
 
4969
- <!-- end BIPM bibitem processing-->
4970
5173
 
4971
5174
 
4972
5175
 
@@ -5096,6 +5299,9 @@
5096
5299
  <fo:block-container border="1pt solid black" width="50%">
5097
5300
  <fo:block> </fo:block>
5098
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>
5099
5305
  </xsl:template><xsl:template name="convertDate">
5100
5306
  <xsl:param name="date"/>
5101
5307
  <xsl:param name="format" select="'short'"/>
@@ -5334,6 +5540,26 @@
5334
5540
  <xsl:value-of select="$level"/>
5335
5541
  </xsl:otherwise>
5336
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>
5337
5563
  </xsl:template><xsl:template name="split">
5338
5564
  <xsl:param name="pText" select="."/>
5339
5565
  <xsl:param name="sep" select="','"/>
@@ -5431,20 +5657,40 @@
5431
5657
  </xsl:call-template>
5432
5658
  </xsl:if>
5433
5659
  </xsl:template><xsl:template name="getLocalizedString">
5434
- <xsl:param name="key"/>
5660
+ <xsl:param name="key"/>
5661
+ <xsl:param name="formatted">false</xsl:param>
5435
5662
 
5436
5663
  <xsl:variable name="curr_lang">
5437
5664
  <xsl:call-template name="getLang"/>
5438
5665
  </xsl:variable>
5439
5666
 
5440
- <xsl:variable name="data_value" select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
5667
+ <xsl:variable name="data_value">
5668
+ <xsl:choose>
5669
+ <xsl:when test="$formatted = 'true'">
5670
+ <xsl:apply-templates select="xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
5671
+ </xsl:when>
5672
+ <xsl:otherwise>
5673
+ <xsl:value-of select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
5674
+ </xsl:otherwise>
5675
+ </xsl:choose>
5676
+ </xsl:variable>
5441
5677
 
5442
5678
  <xsl:choose>
5443
- <xsl:when test="$data_value != ''">
5444
- <xsl:value-of select="$data_value"/>
5679
+ <xsl:when test="normalize-space($data_value) != ''">
5680
+ <xsl:choose>
5681
+ <xsl:when test="$formatted = 'true'"><xsl:copy-of select="$data_value"/></xsl:when>
5682
+ <xsl:otherwise><xsl:value-of select="$data_value"/></xsl:otherwise>
5683
+ </xsl:choose>
5445
5684
  </xsl:when>
5446
5685
  <xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
5447
- <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
5686
+ <xsl:choose>
5687
+ <xsl:when test="$formatted = 'true'">
5688
+ <xsl:apply-templates select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
5689
+ </xsl:when>
5690
+ <xsl:otherwise>
5691
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
5692
+ </xsl:otherwise>
5693
+ </xsl:choose>
5448
5694
  </xsl:when>
5449
5695
  <xsl:otherwise>
5450
5696
  <xsl:variable name="key_">
@@ -5455,7 +5701,7 @@
5455
5701
  <xsl:value-of select="$key_"/>
5456
5702
  </xsl:otherwise>
5457
5703
  </xsl:choose>
5458
-
5704
+
5459
5705
  </xsl:template><xsl:template name="setTrackChangesStyles">
5460
5706
  <xsl:param name="isAdded"/>
5461
5707
  <xsl:param name="isDeleted"/>
@@ -5506,4 +5752,100 @@
5506
5752
  <xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
5507
5753
  </xsl:choose>
5508
5754
  </xsl:attribute>
5755
+ </xsl:template><xsl:template name="number-to-words">
5756
+ <xsl:param name="number"/>
5757
+ <xsl:param name="first"/>
5758
+ <xsl:if test="$number != ''">
5759
+ <xsl:variable name="words">
5760
+ <words>
5761
+ <word cardinal="1">One-</word>
5762
+ <word ordinal="1">First </word>
5763
+ <word cardinal="2">Two-</word>
5764
+ <word ordinal="2">Second </word>
5765
+ <word cardinal="3">Three-</word>
5766
+ <word ordinal="3">Third </word>
5767
+ <word cardinal="4">Four-</word>
5768
+ <word ordinal="4">Fourth </word>
5769
+ <word cardinal="5">Five-</word>
5770
+ <word ordinal="5">Fifth </word>
5771
+ <word cardinal="6">Six-</word>
5772
+ <word ordinal="6">Sixth </word>
5773
+ <word cardinal="7">Seven-</word>
5774
+ <word ordinal="7">Seventh </word>
5775
+ <word cardinal="8">Eight-</word>
5776
+ <word ordinal="8">Eighth </word>
5777
+ <word cardinal="9">Nine-</word>
5778
+ <word ordinal="9">Ninth </word>
5779
+ <word ordinal="10">Tenth </word>
5780
+ <word ordinal="11">Eleventh </word>
5781
+ <word ordinal="12">Twelfth </word>
5782
+ <word ordinal="13">Thirteenth </word>
5783
+ <word ordinal="14">Fourteenth </word>
5784
+ <word ordinal="15">Fifteenth </word>
5785
+ <word ordinal="16">Sixteenth </word>
5786
+ <word ordinal="17">Seventeenth </word>
5787
+ <word ordinal="18">Eighteenth </word>
5788
+ <word ordinal="19">Nineteenth </word>
5789
+ <word cardinal="20">Twenty-</word>
5790
+ <word ordinal="20">Twentieth </word>
5791
+ <word cardinal="30">Thirty-</word>
5792
+ <word ordinal="30">Thirtieth </word>
5793
+ <word cardinal="40">Forty-</word>
5794
+ <word ordinal="40">Fortieth </word>
5795
+ <word cardinal="50">Fifty-</word>
5796
+ <word ordinal="50">Fiftieth </word>
5797
+ <word cardinal="60">Sixty-</word>
5798
+ <word ordinal="60">Sixtieth </word>
5799
+ <word cardinal="70">Seventy-</word>
5800
+ <word ordinal="70">Seventieth </word>
5801
+ <word cardinal="80">Eighty-</word>
5802
+ <word ordinal="80">Eightieth </word>
5803
+ <word cardinal="90">Ninety-</word>
5804
+ <word ordinal="90">Ninetieth </word>
5805
+ <word cardinal="100">Hundred-</word>
5806
+ <word ordinal="100">Hundredth </word>
5807
+ </words>
5808
+ </xsl:variable>
5809
+
5810
+ <xsl:variable name="ordinal" select="xalan:nodeset($words)//word[@ordinal = $number]/text()"/>
5811
+
5812
+ <xsl:variable name="value">
5813
+ <xsl:choose>
5814
+ <xsl:when test="$ordinal != ''">
5815
+ <xsl:value-of select="$ordinal"/>
5816
+ </xsl:when>
5817
+ <xsl:otherwise>
5818
+ <xsl:choose>
5819
+ <xsl:when test="$number &lt; 100">
5820
+ <xsl:variable name="decade" select="concat(substring($number,1,1), '0')"/>
5821
+ <xsl:variable name="digit" select="substring($number,2)"/>
5822
+ <xsl:value-of select="xalan:nodeset($words)//word[@cardinal = $decade]/text()"/>
5823
+ <xsl:value-of select="xalan:nodeset($words)//word[@ordinal = $digit]/text()"/>
5824
+ </xsl:when>
5825
+ <xsl:otherwise>
5826
+ <!-- more 100 -->
5827
+ <xsl:variable name="hundred" select="substring($number,1,1)"/>
5828
+ <xsl:variable name="digits" select="number(substring($number,2))"/>
5829
+ <xsl:value-of select="xalan:nodeset($words)//word[@cardinal = $hundred]/text()"/>
5830
+ <xsl:value-of select="xalan:nodeset($words)//word[@cardinal = '100']/text()"/>
5831
+ <xsl:call-template name="number-to-words">
5832
+ <xsl:with-param name="number" select="$digits"/>
5833
+ </xsl:call-template>
5834
+ </xsl:otherwise>
5835
+ </xsl:choose>
5836
+ </xsl:otherwise>
5837
+ </xsl:choose>
5838
+ </xsl:variable>
5839
+ <xsl:choose>
5840
+ <xsl:when test="$first = 'true'">
5841
+ <xsl:variable name="value_lc" select="java:toLowerCase(java:java.lang.String.new($value))"/>
5842
+ <xsl:call-template name="capitalize">
5843
+ <xsl:with-param name="str" select="$value_lc"/>
5844
+ </xsl:call-template>
5845
+ </xsl:when>
5846
+ <xsl:otherwise>
5847
+ <xsl:value-of select="$value"/>
5848
+ </xsl:otherwise>
5849
+ </xsl:choose>
5850
+ </xsl:if>
5509
5851
  </xsl:template></xsl:stylesheet>