metanorma-ogc 2.9.8 → 2.9.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -34,133 +34,156 @@
34
34
  <xsl:variable name="copyright-owner" select="java:toUpperCase(java:java.lang.String.new(/mn:metanorma/mn:bibdata/mn:copyright/mn:owner/mn:organization/mn:name))"/>
35
35
  <copyright-owner><xsl:value-of select="$copyright-owner"/></copyright-owner>
36
36
 
37
- </mnx:doc>
38
- </xsl:for-each>
39
- </xsl:for-each>
40
- </xsl:variable>
41
- <xsl:variable name="variables" select="xalan:nodeset($variables_)"/>
37
+ <!---examples: 2013, 2024 -->
38
+ <xsl:variable name="document_scheme" select="normalize-space(/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:document-scheme)"/>
42
39
 
43
- <xsl:variable name="layoutVersion_">
44
- <xsl:choose>
45
- <xsl:when test="$document_scheme = '' or $document_scheme = '2022'">2022</xsl:when>
46
- <xsl:otherwise>2018</xsl:otherwise>
47
- </xsl:choose>
48
- </xsl:variable>
49
- <xsl:variable name="layoutVersion" select="normalize-space($layoutVersion_)"/>
40
+ <xsl:variable name="layoutVersion_">
41
+ <xsl:choose>
42
+ <xsl:when test="$document_scheme = '' or $document_scheme = '2022'">2022</xsl:when>
43
+ <xsl:otherwise>2018</xsl:otherwise>
44
+ </xsl:choose>
45
+ </xsl:variable>
46
+ <xsl:variable name="layoutVersion" select="normalize-space($layoutVersion_)"/>
50
47
 
51
- <xsl:variable name="presentation_metadata_color_text" select="normalize-space(//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:color-text)"/>
52
- <xsl:variable name="color_main">
53
- <xsl:choose>
54
- <xsl:when test="$presentation_metadata_color_text != ''"><xsl:value-of select="$presentation_metadata_color_text"/></xsl:when>
55
- <xsl:otherwise>rgb(88, 89, 91)</xsl:otherwise>
56
- </xsl:choose>
57
- </xsl:variable>
48
+ <xsl:variable name="presentation_metadata_color_text" select="normalize-space(/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:color-text)"/>
49
+ <xsl:variable name="color_main">
50
+ <xsl:choose>
51
+ <xsl:when test="$presentation_metadata_color_text != ''"><xsl:value-of select="$presentation_metadata_color_text"/></xsl:when>
52
+ <xsl:otherwise>rgb(88, 89, 91)</xsl:otherwise>
53
+ </xsl:choose>
54
+ </xsl:variable>
55
+ <color_main><xsl:value-of select="$color_main"/></color_main>
58
56
 
59
- <xsl:variable name="presentation_metadata_color_secondary_shade_1" select="normalize-space(//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:color-secondary-shade-1)"/>
60
- <xsl:variable name="color_design">
61
- <xsl:choose>
62
- <xsl:when test="$presentation_metadata_color_secondary_shade_1 != ''"><xsl:value-of select="$presentation_metadata_color_secondary_shade_1"/></xsl:when>
63
- <xsl:when test="$layoutVersion = '2022'">rgb(0, 177, 255)</xsl:when>
64
- <xsl:otherwise>rgb(237, 193, 35)</xsl:otherwise>
65
- </xsl:choose>
66
- </xsl:variable>
57
+ <xsl:variable name="presentation_metadata_color_secondary_shade_1" select="normalize-space(/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:color-secondary-shade-1)"/>
58
+ <xsl:variable name="color_design">
59
+ <xsl:choose>
60
+ <xsl:when test="$presentation_metadata_color_secondary_shade_1 != ''"><xsl:value-of select="$presentation_metadata_color_secondary_shade_1"/></xsl:when>
61
+ <xsl:when test="$layoutVersion = '2022'">rgb(0, 177, 255)</xsl:when>
62
+ <xsl:otherwise>rgb(237, 193, 35)</xsl:otherwise>
63
+ </xsl:choose>
64
+ </xsl:variable>
65
+ <color_design><xsl:value-of select="$color_design"/></color_design>
67
66
 
68
- <xsl:variable name="presentation_metadata_color_secondary_shade_2" select="normalize-space(//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:color-secondary-shade-2)"/>
69
- <xsl:variable name="color_design_light">
70
- <xsl:choose>
71
- <xsl:when test="$presentation_metadata_color_secondary_shade_2 != ''"><xsl:value-of select="$presentation_metadata_color_secondary_shade_2"/></xsl:when>
72
- <xsl:when test="$layoutVersion = '2022'">rgb(0, 177, 255)</xsl:when>
73
- <xsl:otherwise>rgb(246, 223, 140)</xsl:otherwise>
74
- </xsl:choose>
75
- </xsl:variable>
67
+ <xsl:variable name="presentation_metadata_color_secondary_shade_2" select="normalize-space(/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:color-secondary-shade-2)"/>
68
+ <xsl:variable name="color_design_light">
69
+ <xsl:choose>
70
+ <xsl:when test="$presentation_metadata_color_secondary_shade_2 != ''"><xsl:value-of select="$presentation_metadata_color_secondary_shade_2"/></xsl:when>
71
+ <xsl:when test="$layoutVersion = '2022'">rgb(0, 177, 255)</xsl:when>
72
+ <xsl:otherwise>rgb(246, 223, 140)</xsl:otherwise>
73
+ </xsl:choose>
74
+ </xsl:variable>
75
+ <color_design_light><xsl:value-of select="$color_design_light"/></color_design_light>
76
76
 
77
- <xsl:variable name="presentation_metadata_color_background_definition_term" select="normalize-space(//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:color-background-definition-term)"/>
78
- <xsl:variable name="color_dl_dt">
79
- <xsl:choose>
80
- <xsl:when test="$presentation_metadata_color_background_definition_term != ''"><xsl:value-of select="$presentation_metadata_color_background_definition_term"/></xsl:when>
81
- <xsl:otherwise>rgb(215, 243, 255)</xsl:otherwise>
82
- </xsl:choose>
83
- </xsl:variable>
77
+ <xsl:variable name="presentation_metadata_color_background_definition_term" select="normalize-space(/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:color-background-definition-term)"/>
78
+ <xsl:variable name="color_dl_dt">
79
+ <xsl:choose>
80
+ <xsl:when test="$presentation_metadata_color_background_definition_term != ''"><xsl:value-of select="$presentation_metadata_color_background_definition_term"/></xsl:when>
81
+ <xsl:otherwise>rgb(215, 243, 255)</xsl:otherwise>
82
+ </xsl:choose>
83
+ </xsl:variable>
84
+ <color_dl_dt><xsl:value-of select="$color_dl_dt"/></color_dl_dt>
84
85
 
85
- <xsl:variable name="presentation_metadata_color_background_definition_description" select="normalize-space(//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:color-background-definition-description)"/>
86
- <xsl:variable name="color_dl_dd">
87
- <xsl:choose>
88
- <xsl:when test="$presentation_metadata_color_background_definition_description != ''"><xsl:value-of select="$presentation_metadata_color_background_definition_description"/></xsl:when>
89
- <xsl:otherwise>rgb(242, 251, 255)</xsl:otherwise>
90
- </xsl:choose>
91
- </xsl:variable>
86
+ <xsl:variable name="presentation_metadata_color_background_definition_description" select="normalize-space(/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:color-background-definition-description)"/>
87
+ <xsl:variable name="color_dl_dd">
88
+ <xsl:choose>
89
+ <xsl:when test="$presentation_metadata_color_background_definition_description != ''"><xsl:value-of select="$presentation_metadata_color_background_definition_description"/></xsl:when>
90
+ <xsl:otherwise>rgb(242, 251, 255)</xsl:otherwise>
91
+ </xsl:choose>
92
+ </xsl:variable>
93
+ <color_dl_dd><xsl:value-of select="$color_dl_dd"/></color_dl_dd>
92
94
 
93
- <xsl:variable name="presentation_metadata_color_text_title" select="normalize-space(//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:color-text-title)"/>
94
- <xsl:variable name="color_text_title">
95
- <xsl:choose>
96
- <xsl:when test="$presentation_metadata_color_text_title != ''"><xsl:value-of select="$presentation_metadata_color_text_title"/></xsl:when>
97
- <xsl:otherwise>rgb(33, 55, 92)</xsl:otherwise>
98
- </xsl:choose>
99
- </xsl:variable>
95
+ <xsl:variable name="presentation_metadata_color_text_title" select="normalize-space(/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:color-text-title)"/>
96
+ <xsl:variable name="color_text_title">
97
+ <xsl:choose>
98
+ <xsl:when test="$presentation_metadata_color_text_title != ''"><xsl:value-of select="$presentation_metadata_color_text_title"/></xsl:when>
99
+ <xsl:otherwise>rgb(33, 55, 92)</xsl:otherwise>
100
+ </xsl:choose>
101
+ </xsl:variable>
102
+ <color_text_title><xsl:value-of select="$color_text_title"/></color_text_title>
100
103
 
101
- <xsl:variable name="presentation_metadata_color_background_page" select="normalize-space(//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:color-background-page)"/>
102
- <xsl:variable name="color-background-page">
103
- <xsl:choose>
104
- <xsl:when test="$presentation_metadata_color_background_page != ''"><xsl:value-of select="$presentation_metadata_color_background_page"/></xsl:when>
105
- <xsl:otherwise>rgb(33, 55, 92)</xsl:otherwise>
106
- </xsl:choose>
107
- </xsl:variable>
104
+ <xsl:variable name="presentation_metadata_color_background_page" select="normalize-space(/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:color-background-page)"/>
105
+ <xsl:variable name="color_background_page">
106
+ <xsl:choose>
107
+ <xsl:when test="$presentation_metadata_color_background_page != ''"><xsl:value-of select="$presentation_metadata_color_background_page"/></xsl:when>
108
+ <xsl:otherwise>rgb(33, 55, 92)</xsl:otherwise>
109
+ </xsl:choose>
110
+ </xsl:variable>
111
+ <color_background_page><xsl:value-of select="$color_background_page"/></color_background_page>
108
112
 
109
- <xsl:variable name="presentation_metadata_color_background_text_label_legacy" select="normalize-space(//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:color-background-text-label-legacy)"/>
110
- <xsl:variable name="color_background_blue">
111
- <xsl:choose>
112
- <xsl:when test="$presentation_metadata_color_background_text_label_legacy != ''"><xsl:value-of select="$presentation_metadata_color_background_text_label_legacy"/></xsl:when>
113
- <xsl:otherwise>rgb(33, 60, 107)</xsl:otherwise>
114
- </xsl:choose>
115
- </xsl:variable>
113
+ <xsl:variable name="presentation_metadata_color_background_text_label_legacy" select="normalize-space(/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:color-background-text-label-legacy)"/>
114
+ <xsl:variable name="color_background_blue">
115
+ <xsl:choose>
116
+ <xsl:when test="$presentation_metadata_color_background_text_label_legacy != ''"><xsl:value-of select="$presentation_metadata_color_background_text_label_legacy"/></xsl:when>
117
+ <xsl:otherwise>rgb(33, 60, 107)</xsl:otherwise>
118
+ </xsl:choose>
119
+ </xsl:variable>
120
+ <color_background_blue><xsl:value-of select="$color_background_blue"/></color_background_blue>
116
121
 
117
- <xsl:variable name="presentation_metadata_color_background_term_preferred_label" select="normalize-space(//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:color-background-term-preferred-label)"/>
118
- <xsl:variable name="color_term_preferred">
119
- <xsl:choose>
120
- <xsl:when test="$presentation_metadata_color_background_term_preferred_label != ''"><xsl:value-of select="$presentation_metadata_color_background_term_preferred_label"/></xsl:when>
121
- <xsl:otherwise>rgb(249, 235, 187)</xsl:otherwise>
122
- </xsl:choose>
123
- </xsl:variable>
122
+ <xsl:variable name="presentation_metadata_color_background_term_preferred_label" select="normalize-space(/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:color-background-term-preferred-label)"/>
123
+ <xsl:variable name="color_term_preferred">
124
+ <xsl:choose>
125
+ <xsl:when test="$presentation_metadata_color_background_term_preferred_label != ''"><xsl:value-of select="$presentation_metadata_color_background_term_preferred_label"/></xsl:when>
126
+ <xsl:otherwise>rgb(249, 235, 187)</xsl:otherwise>
127
+ </xsl:choose>
128
+ </xsl:variable>
129
+ <color_term_preferred><xsl:value-of select="$color_term_preferred"/></color_term_preferred>
124
130
 
125
- <xsl:variable name="presentation_metadata_color_background_term_deprecated_label" select="normalize-space(//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:color-background-term-deprecated-label)"/>
126
- <xsl:variable name="color_term_deprecated">
127
- <xsl:choose>
128
- <xsl:when test="$presentation_metadata_color_background_term_deprecated_label != ''"><xsl:value-of select="$presentation_metadata_color_background_term_deprecated_label"/></xsl:when>
129
- <xsl:otherwise>rgb(237, 237, 238)</xsl:otherwise>
130
- </xsl:choose>
131
- </xsl:variable>
131
+ <xsl:variable name="presentation_metadata_color_background_term_deprecated_label" select="normalize-space(/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:color-background-term-deprecated-label)"/>
132
+ <xsl:variable name="color_term_deprecated">
133
+ <xsl:choose>
134
+ <xsl:when test="$presentation_metadata_color_background_term_deprecated_label != ''"><xsl:value-of select="$presentation_metadata_color_background_term_deprecated_label"/></xsl:when>
135
+ <xsl:otherwise>rgb(237, 237, 238)</xsl:otherwise>
136
+ </xsl:choose>
137
+ </xsl:variable>
138
+ <color_term_deprecated><xsl:value-of select="$color_term_deprecated"/></color_term_deprecated>
132
139
 
133
- <xsl:variable name="presentation_metadata_color_background_term_admitted_label" select="normalize-space(//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:color-background-term-admitted-label)"/>
134
- <xsl:variable name="color_term_admitted">
135
- <xsl:choose>
136
- <xsl:when test="$presentation_metadata_color_background_term_admitted_label != ''"><xsl:value-of select="$presentation_metadata_color_background_term_admitted_label"/></xsl:when>
137
- <xsl:otherwise>rgb(223, 236, 249)</xsl:otherwise>
138
- </xsl:choose>
139
- </xsl:variable>
140
+ <xsl:variable name="presentation_metadata_color_background_term_admitted_label" select="normalize-space(/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:color-background-term-admitted-label)"/>
141
+ <xsl:variable name="color_term_admitted">
142
+ <xsl:choose>
143
+ <xsl:when test="$presentation_metadata_color_background_term_admitted_label != ''"><xsl:value-of select="$presentation_metadata_color_background_term_admitted_label"/></xsl:when>
144
+ <xsl:otherwise>rgb(223, 236, 249)</xsl:otherwise>
145
+ </xsl:choose>
146
+ </xsl:variable>
147
+ <color_term_admitted><xsl:value-of select="$color_term_admitted"/></color_term_admitted>
140
148
 
141
- <xsl:variable name="presentation_metadata_color_background_table_header" select="normalize-space(//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:color-background-table-header)"/>
142
- <xsl:variable name="color_table_header_row">
143
- <xsl:choose>
144
- <xsl:when test="$presentation_metadata_color_background_table_header != ''"><xsl:value-of select="$presentation_metadata_color_background_table_header"/></xsl:when>
145
- <xsl:otherwise>rgb(33, 55, 92)</xsl:otherwise>
146
- </xsl:choose>
147
- </xsl:variable>
149
+ <xsl:variable name="presentation_metadata_color_background_table_header" select="normalize-space(/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:color-background-table-header)"/>
150
+ <xsl:variable name="color_table_header_row">
151
+ <xsl:choose>
152
+ <xsl:when test="$presentation_metadata_color_background_table_header != ''"><xsl:value-of select="$presentation_metadata_color_background_table_header"/></xsl:when>
153
+ <xsl:otherwise>rgb(33, 55, 92)</xsl:otherwise>
154
+ </xsl:choose>
155
+ </xsl:variable>
156
+ <color_table_header_row><xsl:value-of select="$color_table_header_row"/></color_table_header_row>
148
157
 
149
- <xsl:variable name="presentation_metadata_color_background_table_row_even" select="normalize-space(//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:color-background-table-row-even)"/>
150
- <xsl:variable name="color_table_row_even">
151
- <xsl:choose>
152
- <xsl:when test="$presentation_metadata_color_background_table_row_even != ''"><xsl:value-of select="$presentation_metadata_color_background_table_row_even"/></xsl:when>
153
- <xsl:otherwise>rgb(252, 246, 222)</xsl:otherwise>
154
- </xsl:choose>
155
- </xsl:variable>
158
+ <xsl:variable name="presentation_metadata_color_background_table_row_even" select="normalize-space(/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:color-background-table-row-even)"/>
159
+ <xsl:variable name="color_table_row_even">
160
+ <xsl:choose>
161
+ <xsl:when test="$presentation_metadata_color_background_table_row_even != ''"><xsl:value-of select="$presentation_metadata_color_background_table_row_even"/></xsl:when>
162
+ <xsl:otherwise>rgb(252, 246, 222)</xsl:otherwise>
163
+ </xsl:choose>
164
+ </xsl:variable>
165
+ <color_table_row_even><xsl:value-of select="$color_table_row_even"/></color_table_row_even>
156
166
 
157
- <xsl:variable name="presentation_metadata_color_background_table_row_odd" select="normalize-space(//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:color-background-table-row-odd)"/>
158
- <xsl:variable name="color_table_row_odd">
159
- <xsl:choose>
160
- <xsl:when test="$presentation_metadata_color_background_table_row_odd != ''"><xsl:value-of select="$presentation_metadata_color_background_table_row_odd"/></xsl:when>
161
- <xsl:otherwise>rgb(254, 252, 245)</xsl:otherwise>
162
- </xsl:choose>
167
+ <xsl:variable name="presentation_metadata_color_background_table_row_odd" select="normalize-space(/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:color-background-table-row-odd)"/>
168
+ <xsl:variable name="color_table_row_odd">
169
+ <xsl:choose>
170
+ <xsl:when test="$presentation_metadata_color_background_table_row_odd != ''"><xsl:value-of select="$presentation_metadata_color_background_table_row_odd"/></xsl:when>
171
+ <xsl:otherwise>rgb(254, 252, 245)</xsl:otherwise>
172
+ </xsl:choose>
173
+ </xsl:variable>
174
+ <color_table_row_odd><xsl:value-of select="$color_table_row_odd"/></color_table_row_odd>
175
+
176
+ </mnx:doc>
177
+ </xsl:for-each>
178
+ </xsl:for-each>
163
179
  </xsl:variable>
180
+ <xsl:variable name="variables" select="xalan:nodeset($variables_)"/>
181
+
182
+ <xsl:template name="getVariable">
183
+ <xsl:param name="variable"/>
184
+ <xsl:variable name="num" select="number(java:org.metanorma.fop.global.Variables.getVariable('num'))"/>
185
+ <xsl:value-of select="$variables/mnx:doc[@num = $num]/*[local-name() = $variable]"/>
186
+ </xsl:template>
164
187
 
165
188
  <xsl:variable name="toc_recommendations_">
166
189
  <xsl:for-each select="//mn:metanorma">
@@ -173,7 +196,7 @@
173
196
  <xsl:for-each select="xalan:nodeset($current_document)">
174
197
  <mnx:doc num="{$num}">
175
198
 
176
- <xsl:if test="//mn:metanorma/mn:metanorma-extension/mn:toc[@type='recommendation']/mn:title">
199
+ <xsl:if test="//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='recommendation']/mn:title">
177
200
  <xsl:for-each select="//mn:table[.//mn:p[@class = 'RecommendationTitle']]">
178
201
  <xsl:variable name="table_id" select="@id"/>
179
202
  <recommendation alt-text="{.//mn:p[@class = 'RecommendationTitle'][1]}">
@@ -349,7 +372,7 @@
349
372
  <xsl:if test="$contents//mnx:tables/mnx:table">
350
373
  <fo:bookmark internal-destination="empty_bookmark" starting-state="hide">
351
374
  <fo:bookmark-title>
352
- <xsl:value-of select="$title-list-tables"/>
375
+ <xsl:value-of select="$toc_title_lists/mnx:doc[@num = 1]/mnx:title-list-tables"/>
353
376
  </fo:bookmark-title>
354
377
  <xsl:for-each select="$contents//mnx:tables/mnx:table">
355
378
  <fo:bookmark internal-destination="{@id}">
@@ -365,7 +388,7 @@
365
388
  <xsl:if test="$contents//mnx:figures/mnx:figure">
366
389
  <fo:bookmark internal-destination="empty_bookmark" starting-state="hide">
367
390
  <fo:bookmark-title>
368
- <xsl:value-of select="$title-list-figures"/>
391
+ <xsl:value-of select="$toc_title_lists/mnx:doc[@num = 1]/mnx:title-list-figures"/>
369
392
  </fo:bookmark-title>
370
393
  <xsl:for-each select="$contents//mnx:figures/mnx:figure">
371
394
  <fo:bookmark internal-destination="{@id}">
@@ -381,7 +404,7 @@
381
404
  <xsl:if test="$contents//mnx:examples/mnx:example">
382
405
  <fo:bookmark internal-destination="empty_bookmark" starting-state="hide">
383
406
  <fo:bookmark-title>
384
- <xsl:value-of select="$title-list-examples"/>
407
+ <xsl:value-of select="$toc_title_lists/mnx:doc[@num = 1]/mnx:title-list-examples"/>
385
408
  </fo:bookmark-title>
386
409
  <xsl:for-each select="$contents//mnx:examples/mnx:example">
387
410
  <fo:bookmark internal-destination="{@id}">
@@ -397,7 +420,7 @@
397
420
  <xsl:if test="$toc_recommendations//*[normalize-space(@id) != '']">
398
421
  <fo:bookmark internal-destination="empty_bookmark" starting-state="hide">
399
422
  <fo:bookmark-title>
400
- <xsl:value-of select="$title-list-recommendations"/>
423
+ <xsl:value-of select="$toc_title_lists/mnx:doc[@num = 1]/mnx:title-list-recommendations"/>
401
424
  </fo:bookmark-title>
402
425
  <xsl:for-each select="$toc_recommendations//*[normalize-space(@id) != '']">
403
426
  <fo:bookmark internal-destination="{@id}">
@@ -416,6 +439,8 @@
416
439
  <xsl:for-each select="xalan:nodeset($updated_xml_step1)//mn:metanorma">
417
440
  <xsl:variable name="num"><xsl:number level="any" count="mn:metanorma"/></xsl:variable>
418
441
 
442
+ <xsl:variable name="setVariable" select="java:org.metanorma.fop.global.Variables.setVariable('num', $num)"/>
443
+
419
444
  <xsl:variable name="current_document">
420
445
  <xsl:copy-of select="."/>
421
446
  </xsl:variable>
@@ -428,6 +453,10 @@
428
453
 
429
454
  <xsl:call-template name="inner-cover-page"/>
430
455
 
456
+ <xsl:variable name="color_design_light">
457
+ <xsl:call-template name="getVariable"><xsl:with-param name="variable">color_design_light</xsl:with-param></xsl:call-template>
458
+ </xsl:variable>
459
+
431
460
  <!-- Copyright, Content, Foreword, etc. pages -->
432
461
  <fo:page-sequence xsl:use-attribute-sets="page-sequence-preface">
433
462
  <xsl:call-template name="refine_page-sequence-preface"/>
@@ -607,6 +636,15 @@
607
636
  <xsl:call-template name="insertCoverPageFullImage"/>
608
637
  </xsl:when>
609
638
  <xsl:otherwise>
639
+
640
+ <xsl:variable name="color_design">
641
+ <xsl:call-template name="getVariable"><xsl:with-param name="variable">color_design</xsl:with-param></xsl:call-template>
642
+ </xsl:variable>
643
+
644
+ <xsl:variable name="color_background_blue">
645
+ <xsl:call-template name="getVariable"><xsl:with-param name="variable">color_background_blue</xsl:with-param></xsl:call-template>
646
+ </xsl:variable>
647
+
610
648
  <fo:page-sequence master-reference="cover-page" force-page-count="no-force" initial-page-number="1">
611
649
  <xsl:call-template name="insertFootnoteSeparatorCommon"/>
612
650
 
@@ -939,7 +977,11 @@
939
977
  <xsl:with-param name="value" select="@alt-text"/>
940
978
  </xsl:call-template>
941
979
  <!-- <xsl:copy-of select="node()"/> -->
942
- <xsl:apply-templates select="." mode="contents"/>
980
+ <xsl:variable name="item">
981
+ <!-- mnx:table/mn:fmt-name, mnx:figure/mn:fmt-name, mnx:example/mn:fmt-name -->
982
+ <xsl:apply-templates select="mn:fmt-name" mode="contents_item"/>
983
+ </xsl:variable>
984
+ <xsl:apply-templates select="xalan:nodeset($item)/node()"/>
943
985
  <fo:inline keep-together.within-line="always">
944
986
  <fo:leader xsl:use-attribute-sets="toc-leader-style"><xsl:call-template name="refine_toc-leader-style"/></fo:leader>
945
987
  <fo:page-number-citation ref-id="{@id}"/>
@@ -950,6 +992,9 @@
950
992
 
951
993
  <xsl:template match="mn:preface//mn:clause[@type = 'toc']" name="toc" priority="4">
952
994
  <xsl:param name="num"/>
995
+ <xsl:variable name="color_text_title">
996
+ <xsl:call-template name="getVariable"><xsl:with-param name="variable">color_text_title</xsl:with-param></xsl:call-template>
997
+ </xsl:variable>
953
998
  <fo:block color="{$color_text_title}">
954
999
 
955
1000
  <xsl:apply-templates/>
@@ -1032,7 +1077,7 @@
1032
1077
  <!-- List of Tables -->
1033
1078
  <xsl:if test="$contents/mnx:doc[@num = $num]//mnx:tables/mnx:table">
1034
1079
  <xsl:call-template name="insertListOf_Title">
1035
- <xsl:with-param name="title" select="$title-list-tables"/>
1080
+ <xsl:with-param name="title" select="$toc_title_lists/mnx:doc[@num = $num]/mnx:title-list-tables"/>
1036
1081
  </xsl:call-template>
1037
1082
  <fo:block-container line-height="130%" role="TOC">
1038
1083
  <xsl:for-each select="$contents/mnx:doc[@num = $num]//mnx:tables/mnx:table">
@@ -1044,7 +1089,7 @@
1044
1089
  <!-- List of Figures -->
1045
1090
  <xsl:if test="$contents/mnx:doc[@num = $num]//mnx:figures/mnx:figure">
1046
1091
  <xsl:call-template name="insertListOf_Title">
1047
- <xsl:with-param name="title" select="$title-list-figures"/>
1092
+ <xsl:with-param name="title" select="$toc_title_lists/mnx:doc[@num = $num]/mnx:title-list-figures"/>
1048
1093
  </xsl:call-template>
1049
1094
  <fo:block-container line-height="130%" role="TOC">
1050
1095
  <xsl:for-each select="$contents/mnx:doc[@num = $num]//mnx:figures/mnx:figure">
@@ -1056,7 +1101,7 @@
1056
1101
  <!-- List of Examples -->
1057
1102
  <xsl:if test="$contents/mnx:doc[@num = $num]//mnx:examples/mnx:example">
1058
1103
  <xsl:call-template name="insertListOf_Title">
1059
- <xsl:with-param name="title" select="$title-list-examples"/>
1104
+ <xsl:with-param name="title" select="$toc_title_lists/mnx:doc[@num = $num]/mnx:title-list-examples"/>
1060
1105
  </xsl:call-template>
1061
1106
  <fo:block-container line-height="130%" role="TOC">
1062
1107
  <xsl:for-each select="$contents/mnx:doc[@num = $num]//mnx:examples/mnx:example">
@@ -1070,7 +1115,7 @@
1070
1115
  <!-- List of Recommendations -->
1071
1116
  <xsl:if test="$toc_recommendations/mnx:doc[@num = $num]/*[normalize-space(@id) != '']">
1072
1117
  <xsl:call-template name="insertListOf_Title">
1073
- <xsl:with-param name="title" select="$title-list-recommendations"/>
1118
+ <xsl:with-param name="title" select="$toc_title_lists/mnx:doc[@num = $num]/mnx:title-list-recommendations"/>
1074
1119
  </xsl:call-template>
1075
1120
  <fo:block-container line-height="130%" role="TOC">
1076
1121
  <xsl:for-each select="$toc_recommendations/mnx:doc[@num = $num]/*[normalize-space(@id) != '']">
@@ -1622,6 +1667,9 @@
1622
1667
  <fo:block xsl:use-attribute-sets="term-number-style">
1623
1668
  <xsl:call-template name="refine_term-number-style"/>
1624
1669
  <xsl:call-template name="setIDforNamedDestination"/>
1670
+ <xsl:variable name="color_text_title">
1671
+ <xsl:call-template name="getVariable"><xsl:with-param name="variable">color_text_title</xsl:with-param></xsl:call-template>
1672
+ </xsl:variable>
1625
1673
  <fo:list-block color="{$color_text_title}" keep-with-next="always" provisional-distance-between-starts="{string-length()*3.25}mm">
1626
1674
  <fo:list-item>
1627
1675
  <fo:list-item-label end-indent="label-end()">
@@ -1686,6 +1734,15 @@
1686
1734
  <fo:inline font-size="11pt" padding="1mm" padding-bottom="0.5mm" baseline-shift="25%">
1687
1735
  <xsl:variable name="kind" select="@class"/>
1688
1736
  <xsl:variable name="label" select="text()"/>
1737
+ <xsl:variable name="color_term_preferred">
1738
+ <xsl:call-template name="getVariable"><xsl:with-param name="variable">color_term_preferred</xsl:with-param></xsl:call-template>
1739
+ </xsl:variable>
1740
+ <xsl:variable name="color_term_deprecated">
1741
+ <xsl:call-template name="getVariable"><xsl:with-param name="variable">color_term_deprecated</xsl:with-param></xsl:call-template>
1742
+ </xsl:variable>
1743
+ <xsl:variable name="color_term_admitted">
1744
+ <xsl:call-template name="getVariable"><xsl:with-param name="variable">color_term_admitted</xsl:with-param></xsl:call-template>
1745
+ </xsl:variable>
1689
1746
  <xsl:attribute name="background-color">
1690
1747
  <xsl:choose>
1691
1748
  <!-- <xsl:when test="$kind = 'PreferredLabel' or $label = 'PREFERRED'">rgb(249, 235, 187)</xsl:when>
@@ -1738,7 +1795,7 @@
1738
1795
 
1739
1796
  <xsl:template name="insertHeaderFooter">
1740
1797
  <xsl:param name="num"/>
1741
- <xsl:param name="color" select="$color_text_title"/>
1798
+ <xsl:param name="color"/>
1742
1799
  <xsl:call-template name="insertHeader"/>
1743
1800
  <xsl:call-template name="insertFooter">
1744
1801
  <xsl:with-param name="num" select="$num"/>
@@ -1751,9 +1808,15 @@
1751
1808
 
1752
1809
  <xsl:template name="insertFooter">
1753
1810
  <xsl:param name="num"/>
1754
- <xsl:param name="color" select="$color_text_title"/>
1811
+ <xsl:param name="color"/>
1755
1812
  <fo:static-content flow-name="footer" role="artifact">
1756
1813
  <fo:block-container font-size="8pt" color="{$color}" padding-top="6mm">
1814
+ <xsl:if test="normalize-space($color) = ''">
1815
+ <xsl:variable name="color_text_title">
1816
+ <xsl:call-template name="getVariable"><xsl:with-param name="variable">color_text_title</xsl:with-param></xsl:call-template>
1817
+ </xsl:variable>
1818
+ <xsl:attribute name="color"><xsl:value-of select="$color_text_title"/></xsl:attribute>
1819
+ </xsl:if>
1757
1820
  <fo:table table-layout="fixed" width="100%">
1758
1821
  <fo:table-column column-width="90%"/>
1759
1822
  <fo:table-column column-width="10%"/>
@@ -1878,6 +1941,10 @@
1878
1941
  </xsl:choose>
1879
1942
  </xsl:variable>
1880
1943
 
1944
+ <xsl:variable name="color_design">
1945
+ <xsl:call-template name="getVariable"><xsl:with-param name="variable">color_design</xsl:with-param></xsl:call-template>
1946
+ </xsl:variable>
1947
+
1881
1948
  <!-- orange circle 14mm -->
1882
1949
  <fo:block>
1883
1950
  <fo:instream-foreign-object content-height="14mm" content-width="14mm" fox:alt-text="Circle">
@@ -1898,9 +1965,12 @@
1898
1965
  <!-- background color -->
1899
1966
  <fo:block-container absolute-position="fixed" left="0" top="0" font-size="0">
1900
1967
  <fo:block>
1968
+ <xsl:variable name="color_background_page">
1969
+ <xsl:call-template name="getVariable"><xsl:with-param name="variable">color_background_page</xsl:with-param></xsl:call-template>
1970
+ </xsl:variable>
1901
1971
  <fo:instream-foreign-object content-height="{$pageHeight}mm" fox:alt-text="Background color">
1902
1972
  <svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="{$pageWidth}mm" height="{$pageHeight}mm">
1903
- <rect width="{$pageWidth}mm" height="{$pageHeight}mm" style="fill:{$color-background-page};stroke-width:0;fill-opacity:{$opacity}"/>
1973
+ <rect width="{$pageWidth}mm" height="{$pageHeight}mm" style="fill:{$color_background_page};stroke-width:0;fill-opacity:{$opacity}"/>
1904
1974
  </svg>
1905
1975
  </fo:instream-foreign-object>
1906
1976
  </fo:block>
@@ -1908,6 +1978,9 @@
1908
1978
  </xsl:template>
1909
1979
 
1910
1980
  <xsl:template name="insertCrossingLines">
1981
+ <xsl:variable name="color_design">
1982
+ <xsl:call-template name="getVariable"><xsl:with-param name="variable">color_design</xsl:with-param></xsl:call-template>
1983
+ </xsl:variable>
1911
1984
  <fo:block-container absolute-position="fixed" width="{$pageWidth}mm" height="{$pageHeight}mm" font-size="0">
1912
1985
  <fo:block>
1913
1986
  <fo:instream-foreign-object content-height="{$pageHeight}mm" content-width="{$pageWidth}mm" fox:alt-text="Crossing lines">
@@ -1961,7 +2034,13 @@
1961
2034
  <xsl:param name="title"/>
1962
2035
  <xsl:param name="level">1</xsl:param>
1963
2036
  <fo:block>
1964
- <xsl:variable name="title_styles"><styles xsl:use-attribute-sets="title-style"/></xsl:variable>
2037
+ <xsl:variable name="title_styles">
2038
+ <styles xsl:use-attribute-sets="title-style">
2039
+ <xsl:variable name="color_text_title">
2040
+ <xsl:call-template name="getVariable"><xsl:with-param name="variable">color_text_title</xsl:with-param></xsl:call-template>
2041
+ </xsl:variable>
2042
+ <xsl:attribute name="color"><xsl:value-of select="$color_text_title"/></xsl:attribute>
2043
+ </styles></xsl:variable>
1965
2044
  <fo:block line-height="150%">
1966
2045
  <xsl:copy-of select="xalan:nodeset($title_styles)/styles/@*[local-name() = 'font-size' or local-name() = 'color' or local-name() = 'keep-with-next']"/>
1967
2046
  <xsl:if test="$section != ''">
@@ -2063,18 +2142,27 @@
2063
2142
  </xsl:template>
2064
2143
 
2065
2144
  <xsl:template name="insertShortHorizontalLine">
2145
+ <xsl:variable name="color_design">
2146
+ <xsl:call-template name="getVariable"><xsl:with-param name="variable">color_design</xsl:with-param></xsl:call-template>
2147
+ </xsl:variable>
2066
2148
  <fo:block-container width="12.7mm" border-top="1pt solid {$color_design}" margin-top="3mm" role="SKIP">
2067
2149
  <fo:block font-size="1pt" role="SKIP"><fo:wrapper role="artifact"> </fo:wrapper></fo:block>
2068
2150
  </fo:block-container>
2069
2151
  </xsl:template>
2070
2152
 
2071
2153
  <xsl:template name="insertBigHorizontalLine">
2154
+ <xsl:variable name="color_design">
2155
+ <xsl:call-template name="getVariable"><xsl:with-param name="variable">color_design</xsl:with-param></xsl:call-template>
2156
+ </xsl:variable>
2072
2157
  <fo:block-container width="22.5mm" border-bottom="2pt solid {$color_design}" role="SKIP">
2073
2158
  <fo:block margin-top="4pt" role="SKIP"><fo:wrapper role="artifact"> </fo:wrapper></fo:block>
2074
2159
  </fo:block-container>
2075
2160
  </xsl:template>
2076
2161
 
2077
2162
  <xsl:template name="insertFootnoteSeparator">
2163
+ <xsl:variable name="color_design">
2164
+ <xsl:call-template name="getVariable"><xsl:with-param name="variable">color_design</xsl:with-param></xsl:call-template>
2165
+ </xsl:variable>
2078
2166
  <fo:static-content flow-name="xsl-footnote-separator" role="artifact">
2079
2167
  <fo:block>
2080
2168
  <fo:leader leader-pattern="rule" leader-length="20%" color="{$color_design}"/>
@@ -2226,45 +2314,59 @@
2226
2314
 
2227
2315
  <xsl:variable name="ace_tag">ace-tag_</xsl:variable>
2228
2316
 
2229
- <xsl:variable name="title-list-tables">
2230
- <xsl:variable name="toc_table_title" select="//mn:metanorma/mn:metanorma-extension/mn:toc[@type='table']/mn:title"/>
2231
- <xsl:value-of select="$toc_table_title"/>
2232
- <xsl:if test="normalize-space($toc_table_title) = ''">
2233
- <xsl:call-template name="getLocalizedString">
2234
- <xsl:with-param name="key">toc_tables</xsl:with-param>
2235
- </xsl:call-template>
2236
- </xsl:if>
2237
- </xsl:variable>
2317
+ <xsl:variable name="toc_title_lists_">
2318
+ <xsl:for-each select="//mn:metanorma">
2319
+ <xsl:variable name="num"><xsl:number level="any" count="mn:metanorma"/></xsl:variable>
2320
+ <xsl:variable name="docid"><xsl:call-template name="getDocumentId"/></xsl:variable>
2321
+ <xsl:variable name="current_document">
2322
+ <xsl:copy-of select="."/>
2323
+ </xsl:variable>
2324
+ <xsl:for-each select="xalan:nodeset($current_document)">
2325
+ <mnx:doc id="{$docid}" num="{$num}">
2326
+ <mnx:title-list-tables>
2327
+ <xsl:variable name="toc_table_title" select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='table']/mn:title"/>
2328
+ <xsl:value-of select="$toc_table_title"/>
2329
+ <xsl:if test="normalize-space($toc_table_title) = ''">
2330
+ <xsl:call-template name="getLocalizedString">
2331
+ <xsl:with-param name="key">toc_tables</xsl:with-param>
2332
+ </xsl:call-template>
2333
+ </xsl:if>
2334
+ </mnx:title-list-tables>
2238
2335
 
2239
- <xsl:variable name="title-list-figures">
2240
- <xsl:variable name="toc_figure_title" select="//mn:metanorma/mn:metanorma-extension/mn:toc[@type='figure']/mn:title"/>
2241
- <xsl:value-of select="$toc_figure_title"/>
2242
- <xsl:if test="normalize-space($toc_figure_title) = ''">
2243
- <xsl:call-template name="getLocalizedString">
2244
- <xsl:with-param name="key">toc_figures</xsl:with-param>
2245
- </xsl:call-template>
2246
- </xsl:if>
2247
- </xsl:variable>
2336
+ <mnx:title-list-figures>
2337
+ <xsl:variable name="toc_figure_title" select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='figure']/mn:title"/>
2338
+ <xsl:value-of select="$toc_figure_title"/>
2339
+ <xsl:if test="normalize-space($toc_figure_title) = ''">
2340
+ <xsl:call-template name="getLocalizedString">
2341
+ <xsl:with-param name="key">toc_figures</xsl:with-param>
2342
+ </xsl:call-template>
2343
+ </xsl:if>
2344
+ </mnx:title-list-figures>
2248
2345
 
2249
- <xsl:variable name="title-list-examples">
2250
- <xsl:variable name="toc_example_title" select="//mn:metanorma/mn:metanorma-extension/mn:toc[@type='example']/mn:title"/>
2251
- <xsl:value-of select="$toc_example_title"/>
2252
- <xsl:if test="normalize-space($toc_example_title) = ''">
2253
- <xsl:call-template name="getLocalizedString">
2254
- <xsl:with-param name="key">toc_examples</xsl:with-param>
2255
- </xsl:call-template>
2256
- </xsl:if>
2257
- </xsl:variable>
2346
+ <mnx:title-list-examples>
2347
+ <xsl:variable name="toc_example_title" select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='example']/mn:title"/>
2348
+ <xsl:value-of select="$toc_example_title"/>
2349
+ <xsl:if test="normalize-space($toc_example_title) = ''">
2350
+ <xsl:call-template name="getLocalizedString">
2351
+ <xsl:with-param name="key">toc_examples</xsl:with-param>
2352
+ </xsl:call-template>
2353
+ </xsl:if>
2354
+ </mnx:title-list-examples>
2258
2355
 
2259
- <xsl:variable name="title-list-recommendations">
2260
- <xsl:variable name="toc_requirement_title" select="//mn:metanorma/mn:metanorma-extension/mn:toc[@type='requirement']/mn:title"/>
2261
- <xsl:value-of select="$toc_requirement_title"/>
2262
- <xsl:if test="normalize-space($toc_requirement_title) = ''">
2263
- <xsl:call-template name="getLocalizedString">
2264
- <xsl:with-param name="key">toc_recommendations</xsl:with-param>
2265
- </xsl:call-template>
2266
- </xsl:if>
2356
+ <mnx:title-list-recommendations>
2357
+ <xsl:variable name="toc_requirement_title" select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='requirement']/mn:title"/>
2358
+ <xsl:value-of select="$toc_requirement_title"/>
2359
+ <xsl:if test="normalize-space($toc_requirement_title) = ''">
2360
+ <xsl:call-template name="getLocalizedString">
2361
+ <xsl:with-param name="key">toc_recommendations</xsl:with-param>
2362
+ </xsl:call-template>
2363
+ </xsl:if>
2364
+ </mnx:title-list-recommendations>
2365
+ </mnx:doc>
2366
+ </xsl:for-each>
2367
+ </xsl:for-each>
2267
2368
  </xsl:variable>
2369
+ <xsl:variable name="toc_title_lists" select="xalan:nodeset($toc_title_lists_)"/>
2268
2370
 
2269
2371
  <xsl:variable name="bibdata">
2270
2372
  <xsl:copy-of select="//mn:metanorma/mn:bibdata"/>
@@ -2374,6 +2476,10 @@
2374
2476
  <xsl:param name="doctype"/>
2375
2477
  <xsl:param name="num"/>
2376
2478
  <xsl:param name="skip_force_page_count">false</xsl:param>
2479
+ <xsl:variable name="color_main">
2480
+ <xsl:call-template name="getVariable"><xsl:with-param name="variable">color_main</xsl:with-param></xsl:call-template>
2481
+ </xsl:variable>
2482
+ <xsl:attribute name="color"><xsl:value-of select="$color_main"/></xsl:attribute>
2377
2483
  </xsl:template> <!-- refine_page-sequence-preface -->
2378
2484
 
2379
2485
  <xsl:attribute-set name="page-sequence-main">
@@ -2389,6 +2495,10 @@
2389
2495
  <xsl:text>document</xsl:text>
2390
2496
  <xsl:call-template name="getPageSequenceOrientation"/>
2391
2497
  </xsl:attribute>
2498
+ <xsl:variable name="color_main">
2499
+ <xsl:call-template name="getVariable"><xsl:with-param name="variable">color_main</xsl:with-param></xsl:call-template>
2500
+ </xsl:variable>
2501
+ <xsl:attribute name="color"><xsl:value-of select="$color_main"/></xsl:attribute>
2392
2502
  </xsl:template> <!-- refine_page-sequence-main -->
2393
2503
 
2394
2504
  <xsl:variable name="font_noto_sans">Noto Sans, Noto Sans HK, Noto Sans JP, Noto Sans KR, Noto Sans SC, Noto Sans TC</xsl:variable>
@@ -2398,7 +2508,6 @@
2398
2508
  <xsl:attribute name="font-family">Lato, STIX Two Math, <xsl:value-of select="$font_noto_sans"/></xsl:attribute>
2399
2509
  <xsl:attribute name="font-family-generic">Sans</xsl:attribute>
2400
2510
  <xsl:attribute name="font-size">11pt</xsl:attribute>
2401
- <xsl:attribute name="color"><xsl:value-of select="$color_main"/></xsl:attribute>
2402
2511
  </xsl:attribute-set> <!-- root-style -->
2403
2512
 
2404
2513
  <xsl:template name="insertRootStyle">
@@ -3049,7 +3158,7 @@
3049
3158
  <xsl:apply-templates mode="update_xml_step1"/>
3050
3159
  </xsl:template>
3051
3160
 
3052
- <xsl:template match="mn:semx" mode="update_xml_step1">
3161
+ <xsl:template match="mn:semx[not(@element = 'name')]" mode="update_xml_step1">
3053
3162
  <xsl:apply-templates mode="update_xml_step1"/>
3054
3163
  </xsl:template>
3055
3164
 
@@ -3332,7 +3441,7 @@
3332
3441
  <xsl:variable name="non_white_space">[^\s\u3000-\u9FFF]</xsl:variable>
3333
3442
  <xsl:variable name="regex_dots_units">((\b((<xsl:value-of select="$non_white_space"/>{1,3}\.<xsl:value-of select="$non_white_space"/>+)|(<xsl:value-of select="$non_white_space"/>+\.<xsl:value-of select="$non_white_space"/>{1,3}))\b)|(\.<xsl:value-of select="$non_white_space"/>{1,3})\b)</xsl:variable>
3334
3443
 
3335
- <xsl:template match="text()[not(ancestor::mn:bibdata or ancestor::mn:fmt-link[not(contains(normalize-space(),' '))] or ancestor::mn:sourcecode or (ancestor::mn:tt and ancestor::mn:table and string-length() &gt; 20) or ancestor::*[local-name() = 'math'] or ancestor::*[local-name() = 'svg'] or ancestor::mn:name or ancestor::mn:fmt-name or starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.') or normalize-space() = '' )]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
3444
+ <xsl:template match="text()[not( (ancestor::mn:bibdata and not(ancestor::mn:title)) or ancestor::mn:fmt-link[not(contains(normalize-space(),' '))] or ancestor::mn:sourcecode or (ancestor::mn:tt and ancestor::mn:table and string-length() &gt; 20) or ancestor::*[local-name() = 'math'] or ancestor::*[local-name() = 'svg'] or ancestor::mn:name or (ancestor::mn:fmt-name and not(ancestor::mn:semx[@element = 'name'])) or starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.') or normalize-space() = '' )]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
3336
3445
 
3337
3446
  <xsl:variable name="parent" select="local-name(..)"/>
3338
3447
 
@@ -3377,7 +3486,7 @@
3377
3486
  <xsl:variable name="text">
3378
3487
  <xsl:element name="text" namespace="{$namespace_full}">
3379
3488
  <xsl:choose>
3380
- <xsl:when test="ancestor::mn:table"><xsl:value-of select="."/></xsl:when> <!-- no need enclose standard's number into tag 'keep-together_within-line' in table cells -->
3489
+ <xsl:when test="ancestor::mn:table and not(ancestor::mn:fmt-name)"><xsl:value-of select="."/></xsl:when> <!-- no need enclose standard's number into tag 'keep-together_within-line' in table cells -->
3381
3490
  <xsl:otherwise>
3382
3491
  <xsl:variable name="text_" select="java:replaceAll(java:java.lang.String.new(.), $regex_standard_reference, concat($tag_keep-together_within-line_open,'$1',$tag_keep-together_within-line_close))"/>
3383
3492
  <!-- <xsl:value-of select="$text__"/> -->
@@ -3455,6 +3564,10 @@
3455
3564
  <xsl:copy-of select="."/>
3456
3565
  </xsl:template>
3457
3566
 
3567
+ <xsl:template match="mn:semx" mode="update_xml_enclose_keep-together_within-line">
3568
+ <xsl:apply-templates mode="update_xml_enclose_keep-together_within-line"/>
3569
+ </xsl:template>
3570
+
3458
3571
  <xsl:template name="replace_text_tags">
3459
3572
  <xsl:param name="tag_open"/>
3460
3573
  <xsl:param name="tag_close"/>
@@ -3754,11 +3867,14 @@
3754
3867
 
3755
3868
  <xsl:attribute-set name="copyright-statement-title-style">
3756
3869
  <xsl:attribute name="font-weight">bold</xsl:attribute>
3757
- <xsl:attribute name="color"><xsl:value-of select="$color_text_title"/></xsl:attribute>
3758
3870
  <xsl:attribute name="margin-top">24pt</xsl:attribute>
3759
3871
  </xsl:attribute-set> <!-- copyright-statement-title-style -->
3760
3872
 
3761
3873
  <xsl:template name="refine_copyright-statement-title-style">
3874
+ <xsl:variable name="color_text_title">
3875
+ <xsl:call-template name="getVariable"><xsl:with-param name="variable">color_text_title</xsl:with-param></xsl:call-template>
3876
+ </xsl:variable>
3877
+ <xsl:attribute name="color"><xsl:value-of select="$color_text_title"/></xsl:attribute>
3762
3878
  </xsl:template>
3763
3879
 
3764
3880
  <xsl:attribute-set name="copyright-statement-p-style">
@@ -3780,10 +3896,13 @@
3780
3896
  <xsl:attribute-set name="license-statement-title-style">
3781
3897
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
3782
3898
  <xsl:attribute name="font-weight">bold</xsl:attribute>
3783
- <xsl:attribute name="color"><xsl:value-of select="$color_text_title"/></xsl:attribute>
3784
3899
  </xsl:attribute-set> <!-- license-statement-title-style -->
3785
3900
 
3786
3901
  <xsl:template name="refine_license-statement-title-style">
3902
+ <xsl:variable name="color_text_title">
3903
+ <xsl:call-template name="getVariable"><xsl:with-param name="variable">color_text_title</xsl:with-param></xsl:call-template>
3904
+ </xsl:variable>
3905
+ <xsl:attribute name="color"><xsl:value-of select="$color_text_title"/></xsl:attribute>
3787
3906
  </xsl:template>
3788
3907
 
3789
3908
  <xsl:attribute-set name="license-statement-p-style">
@@ -3864,6 +3983,7 @@
3864
3983
  <xsl:call-template name="getLevel"/>
3865
3984
  </xsl:variable>
3866
3985
  <fo:block role="H{$level}" xsl:use-attribute-sets="copyright-statement-title-style">
3986
+ <xsl:call-template name="refine_copyright-statement-title-style"/>
3867
3987
  <xsl:apply-templates/>
3868
3988
  </fo:block>
3869
3989
 
@@ -5663,6 +5783,9 @@
5663
5783
  <xsl:attribute name="font-weight">bold</xsl:attribute>
5664
5784
  <xsl:attribute name="font-weight">normal</xsl:attribute>
5665
5785
  <xsl:if test="parent::*[local-name()='thead']"> <!-- and not(ancestor::mn:table[@class = 'recommendation' or @class='requirement' or @class='permission']) -->
5786
+ <xsl:variable name="color_table_header_row">
5787
+ <xsl:call-template name="getVariable"><xsl:with-param name="variable">color_table_header_row</xsl:with-param></xsl:call-template>
5788
+ </xsl:variable>
5666
5789
  <xsl:attribute name="background-color"><xsl:value-of select="$color_table_header_row"/></xsl:attribute>
5667
5790
  </xsl:if>
5668
5791
  <xsl:if test="starts-with(*[local-name()='td'][1], 'Requirement ')">
@@ -6410,7 +6533,6 @@
6410
6533
  <xsl:attribute name="text-align">left</xsl:attribute>
6411
6534
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
6412
6535
  <xsl:attribute name="font-weight">normal</xsl:attribute>
6413
- <xsl:attribute name="color"><xsl:value-of select="$color_text_title"/></xsl:attribute>
6414
6536
  <xsl:attribute name="font-size">11pt</xsl:attribute>
6415
6537
  </xsl:attribute-set> <!-- table-name-style -->
6416
6538
 
@@ -6419,6 +6541,10 @@
6419
6541
  <xsl:if test="$continued = 'true'">
6420
6542
  <xsl:attribute name="role">SKIP</xsl:attribute>
6421
6543
  </xsl:if>
6544
+ <xsl:variable name="color_text_title">
6545
+ <xsl:call-template name="getVariable"><xsl:with-param name="variable">color_text_title</xsl:with-param></xsl:call-template>
6546
+ </xsl:variable>
6547
+ <xsl:attribute name="color"><xsl:value-of select="$color_text_title"/></xsl:attribute>
6422
6548
  </xsl:template> <!-- refine_table-name-style -->
6423
6549
 
6424
6550
  <xsl:attribute-set name="table-row-style">
@@ -6428,13 +6554,16 @@
6428
6554
 
6429
6555
  <xsl:attribute-set name="table-header-row-style" use-attribute-sets="table-row-style">
6430
6556
  <xsl:attribute name="font-weight">bold</xsl:attribute>
6431
- <xsl:attribute name="background-color"><xsl:value-of select="$color_table_header_row"/></xsl:attribute>
6432
6557
  <xsl:attribute name="color">white</xsl:attribute>
6433
6558
  </xsl:attribute-set>
6434
6559
 
6435
6560
  <xsl:template name="refine_table-header-row-style">
6436
6561
 
6437
6562
  <xsl:call-template name="setBordersTableArray"/>
6563
+ <xsl:variable name="color_table_header_row">
6564
+ <xsl:call-template name="getVariable"><xsl:with-param name="variable">color_table_header_row</xsl:with-param></xsl:call-template>
6565
+ </xsl:variable>
6566
+ <xsl:attribute name="background-color"><xsl:value-of select="$color_table_header_row"/></xsl:attribute>
6438
6567
 
6439
6568
  <xsl:call-template name="setNoBordersForTableList"/>
6440
6569
  </xsl:template> <!-- refine_table-header-row-style -->
@@ -6455,6 +6584,12 @@
6455
6584
 
6456
6585
  <xsl:call-template name="setBordersTableArray"/>
6457
6586
  <xsl:variable name="number"><xsl:number/></xsl:variable>
6587
+ <xsl:variable name="color_table_row_even">
6588
+ <xsl:call-template name="getVariable"><xsl:with-param name="variable">color_table_row_even</xsl:with-param></xsl:call-template>
6589
+ </xsl:variable>
6590
+ <xsl:variable name="color_table_row_odd">
6591
+ <xsl:call-template name="getVariable"><xsl:with-param name="variable">color_table_row_odd</xsl:with-param></xsl:call-template>
6592
+ </xsl:variable>
6458
6593
  <xsl:attribute name="background-color">
6459
6594
  <xsl:choose>
6460
6595
  <xsl:when test="$number mod 2 = 0"><xsl:value-of select="$color_table_row_even"/></xsl:when>
@@ -7763,6 +7898,12 @@
7763
7898
  <style name="{$key}-left"><xsl:value-of select="$value"/></style>
7764
7899
  <style name="{$key}-bottom"><xsl:value-of select="$value"/></style>
7765
7900
  </xsl:if>
7901
+ <xsl:if test="$key = 'page-break-inside' and $value = 'avoid'">
7902
+ <style name="keep-together.within-page">always</style>
7903
+ </xsl:if>
7904
+ <xsl:if test="$key = 'page-break-after' and $value = 'always'">
7905
+ <style name="break-after">page</style>
7906
+ </xsl:if>
7766
7907
  </xsl:for-each>
7767
7908
  </xsl:variable>
7768
7909
  <xsl:variable name="styles" select="xalan:nodeset($styles_)"/>
@@ -7806,6 +7947,11 @@
7806
7947
 
7807
7948
  <fo:block role="SKIP">
7808
7949
 
7950
+ <xsl:variable name="styles">
7951
+ <styles><xsl:call-template name="setTableStyles"/></styles>
7952
+ </xsl:variable>
7953
+ <xsl:copy-of select="xalan:nodeset($styles)/styles/@break-after"/>
7954
+
7809
7955
  <xsl:if test="$isGenerateTableIF = 'true'">
7810
7956
  <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
7811
7957
  </xsl:if>
@@ -8799,6 +8945,9 @@
8799
8945
  <xsl:template name="refine_dt-cell-style">
8800
8946
  <xsl:if test="not(ancestor::mn:sourcecode)">
8801
8947
  <!-- <xsl:attribute name="border-left">1pt solid <xsl:value-of select="$color_design"/></xsl:attribute> -->
8948
+ <xsl:variable name="color_dl_dt">
8949
+ <xsl:call-template name="getVariable"><xsl:with-param name="variable">color_dl_dt</xsl:with-param></xsl:call-template>
8950
+ </xsl:variable>
8802
8951
  <xsl:attribute name="background-color"><xsl:value-of select="$color_dl_dt"/></xsl:attribute>
8803
8952
  </xsl:if>
8804
8953
  </xsl:template> <!-- refine_dt-cell-style -->
@@ -8821,10 +8970,13 @@
8821
8970
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
8822
8971
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
8823
8972
  <xsl:attribute name="font-weight">normal</xsl:attribute>
8824
- <xsl:attribute name="color"><xsl:value-of select="$color_text_title"/></xsl:attribute>
8825
8973
  </xsl:attribute-set> <!-- dl-name-style -->
8826
8974
 
8827
8975
  <xsl:template name="refine_dl-name-style">
8976
+ <xsl:variable name="color_text_title">
8977
+ <xsl:call-template name="getVariable"><xsl:with-param name="variable">color_text_title</xsl:with-param></xsl:call-template>
8978
+ </xsl:variable>
8979
+ <xsl:attribute name="color"><xsl:value-of select="$color_text_title"/></xsl:attribute>
8828
8980
  </xsl:template>
8829
8981
 
8830
8982
  <xsl:attribute-set name="dd-cell-style">
@@ -8834,6 +8986,9 @@
8834
8986
 
8835
8987
  <xsl:template name="refine_dd-cell-style">
8836
8988
  <xsl:if test="not(ancestor::mn:sourcecode)">
8989
+ <xsl:variable name="color_dl_dd">
8990
+ <xsl:call-template name="getVariable"><xsl:with-param name="variable">color_dl_dd</xsl:with-param></xsl:call-template>
8991
+ </xsl:variable>
8837
8992
  <xsl:attribute name="background-color"><xsl:value-of select="$color_dl_dd"/></xsl:attribute>
8838
8993
  </xsl:if>
8839
8994
  </xsl:template> <!-- refine_dd-cell-style -->
@@ -9976,11 +10131,27 @@
9976
10131
  <!-- ====== -->
9977
10132
  <!-- ====== -->
9978
10133
 
9979
- <xsl:attribute-set name="quote-style">
10134
+ <xsl:attribute-set name="quote-container-style">
9980
10135
  <xsl:attribute name="margin-left">12mm</xsl:attribute>
9981
10136
  <xsl:attribute name="margin-right">12mm</xsl:attribute>
9982
- <xsl:attribute name="margin-top">12pt</xsl:attribute>
10137
+ <xsl:attribute name="role">SKIP</xsl:attribute>
10138
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
9983
10139
  <xsl:attribute name="margin-left">13mm</xsl:attribute>
10140
+ </xsl:attribute-set>
10141
+
10142
+ <xsl:template name="refine_quote-container-style">
10143
+ <xsl:if test="parent::mn:note">
10144
+ <xsl:if test="not(ancestor::mn:table)">
10145
+ <xsl:attribute name="margin-left">5mm</xsl:attribute>
10146
+ </xsl:if>
10147
+ </xsl:if>
10148
+ </xsl:template>
10149
+
10150
+ <xsl:attribute-set name="quote-style">
10151
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
10152
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
10153
+ <xsl:attribute name="margin-top">12pt</xsl:attribute>
10154
+
9984
10155
  </xsl:attribute-set> <!-- quote-style -->
9985
10156
 
9986
10157
  <xsl:template name="refine_quote-style">
@@ -9988,7 +10159,8 @@
9988
10159
 
9989
10160
  <xsl:attribute-set name="quote-source-style">
9990
10161
  <xsl:attribute name="text-align">right</xsl:attribute>
9991
- <xsl:attribute name="margin-right">25mm</xsl:attribute>
10162
+ <xsl:attribute name="margin-right">-12mm</xsl:attribute>
10163
+ <xsl:attribute name="margin-right">13mm</xsl:attribute>
9992
10164
  </xsl:attribute-set> <!-- quote-source-style -->
9993
10165
 
9994
10166
  <xsl:template name="refine_quote-source-style">
@@ -10011,12 +10183,9 @@
10011
10183
 
10012
10184
  <xsl:call-template name="setBlockSpanAll"/>
10013
10185
 
10014
- <xsl:if test="parent::mn:note">
10015
- <xsl:if test="not(ancestor::mn:table)">
10016
- <xsl:attribute name="margin-left">5mm</xsl:attribute>
10017
- </xsl:if>
10018
- </xsl:if>
10019
- <fo:block-container margin-left="0mm" role="SKIP">
10186
+ <fo:block-container xsl:use-attribute-sets="quote-container-style">
10187
+ <xsl:call-template name="refine_quote-container-style"/>
10188
+
10020
10189
  <fo:block-container xsl:use-attribute-sets="quote-style" role="SKIP">
10021
10190
 
10022
10191
  <xsl:call-template name="refine_quote-style"/>
@@ -10028,14 +10197,16 @@
10028
10197
  </fo:block-container>
10029
10198
  </fo:block-container>
10030
10199
  <xsl:if test="mn:author or mn:fmt-source or mn:attribution">
10031
- <fo:block xsl:use-attribute-sets="quote-source-style">
10032
- <xsl:call-template name="refine_quote-source-style"/>
10033
- <!-- — ISO, ISO 7301:2011, Clause 1 -->
10034
- <xsl:apply-templates select="mn:author"/>
10035
- <xsl:apply-templates select="mn:fmt-source"/>
10036
- <!-- added for https://github.com/metanorma/isodoc/issues/607 -->
10037
- <xsl:apply-templates select="mn:attribution/mn:p/node()"/>
10038
- </fo:block>
10200
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
10201
+ <fo:block xsl:use-attribute-sets="quote-source-style">
10202
+ <xsl:call-template name="refine_quote-source-style"/>
10203
+ <!-- — ISO, ISO 7301:2011, Clause 1 -->
10204
+ <xsl:apply-templates select="mn:author"/>
10205
+ <xsl:apply-templates select="mn:fmt-source"/>
10206
+ <!-- added for https://github.com/metanorma/isodoc/issues/607 -->
10207
+ <xsl:apply-templates select="mn:attribution/mn:p/node()"/>
10208
+ </fo:block>
10209
+ </fo:block-container>
10039
10210
  </xsl:if>
10040
10211
 
10041
10212
  </fo:block-container>
@@ -10105,7 +10276,6 @@
10105
10276
 
10106
10277
  <xsl:attribute-set name="figure-name-style">
10107
10278
  <xsl:attribute name="role">Caption</xsl:attribute>
10108
- <xsl:attribute name="color"><xsl:value-of select="$color_text_title"/></xsl:attribute>
10109
10279
  <!-- <xsl:attribute name="margin-top">12pt</xsl:attribute> -->
10110
10280
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
10111
10281
  <xsl:attribute name="space-after">12pt</xsl:attribute>
@@ -10115,6 +10285,10 @@
10115
10285
  </xsl:attribute-set> <!-- figure-name-style -->
10116
10286
 
10117
10287
  <xsl:template name="refine_figure-name-style">
10288
+ <xsl:variable name="color_text_title">
10289
+ <xsl:call-template name="getVariable"><xsl:with-param name="variable">color_text_title</xsl:with-param></xsl:call-template>
10290
+ </xsl:variable>
10291
+ <xsl:attribute name="color"><xsl:value-of select="$color_text_title"/></xsl:attribute>
10118
10292
  </xsl:template> <!-- refine_figure-name-style -->
10119
10293
 
10120
10294
  <xsl:attribute-set name="image-style">
@@ -10831,6 +11005,7 @@
10831
11005
  <xsl:variable name="svg_content">
10832
11006
  <xsl:apply-templates select="." mode="svg_update"/>
10833
11007
  </xsl:variable>
11008
+ <!-- <svg_content><xsl:copy-of select="$svg_content"/></svg_content> -->
10834
11009
 
10835
11010
  <xsl:variable name="alt-text">
10836
11011
  <xsl:choose>
@@ -11045,7 +11220,7 @@
11045
11220
  </xsl:copy>
11046
11221
  </xsl:template>
11047
11222
 
11048
- <xsl:template match="mn:image/@href" mode="svg_update">
11223
+ <xsl:template match="*[local-name() = 'image']/@href" mode="svg_update">
11049
11224
  <xsl:attribute name="href" namespace="http://www.w3.org/1999/xlink">
11050
11225
  <xsl:value-of select="."/>
11051
11226
  </xsl:attribute>
@@ -11829,10 +12004,13 @@
11829
12004
  <xsl:attribute-set name="list-name-style">
11830
12005
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
11831
12006
  <xsl:attribute name="font-weight">normal</xsl:attribute>
11832
- <xsl:attribute name="color"><xsl:value-of select="$color_text_title"/></xsl:attribute>
11833
12007
  </xsl:attribute-set> <!-- list-name-style -->
11834
12008
 
11835
12009
  <xsl:template name="refine_list-name-style">
12010
+ <xsl:variable name="color_text_title">
12011
+ <xsl:call-template name="getVariable"><xsl:with-param name="variable">color_text_title</xsl:with-param></xsl:call-template>
12012
+ </xsl:variable>
12013
+ <xsl:attribute name="color"><xsl:value-of select="$color_text_title"/></xsl:attribute>
11836
12014
  </xsl:template>
11837
12015
 
11838
12016
  <xsl:attribute-set name="list-item-style">
@@ -11865,7 +12043,7 @@
11865
12043
  <!-- Lists processing -->
11866
12044
  <!-- ===================================== -->
11867
12045
  <xsl:variable name="ul_labels_">
11868
- <label color="{$color_design}">•</label>
12046
+ <label>•</label> <!-- color="{$color_design}" -->
11869
12047
 
11870
12048
  </xsl:variable>
11871
12049
  <xsl:variable name="ul_labels" select="xalan:nodeset($ul_labels_)"/>
@@ -11902,6 +12080,10 @@
11902
12080
  </xsl:template>
11903
12081
  <xsl:template match="label" mode="ul_labels">
11904
12082
  <xsl:copy-of select="@*[not(local-name() = 'level')]"/>
12083
+ <xsl:variable name="color_design">
12084
+ <xsl:call-template name="getVariable"><xsl:with-param name="variable">color_design</xsl:with-param></xsl:call-template>
12085
+ </xsl:variable>
12086
+ <xsl:attribute name="color"><xsl:value-of select="$color_design"/></xsl:attribute>
11905
12087
  <xsl:value-of select="."/>
11906
12088
  </xsl:template>
11907
12089
 
@@ -12259,12 +12441,15 @@
12259
12441
  <xsl:attribute name="start-indent">0</xsl:attribute>
12260
12442
  <xsl:attribute name="font-size">10pt</xsl:attribute>
12261
12443
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
12262
- <xsl:attribute name="color"><xsl:value-of select="$color_main"/></xsl:attribute>
12263
12444
  <xsl:attribute name="line-height">124%</xsl:attribute>
12264
12445
  <xsl:attribute name="text-align">justify</xsl:attribute>
12265
12446
  </xsl:attribute-set> <!-- fn-body-style" -->
12266
12447
 
12267
12448
  <xsl:template name="refine_fn-body-style">
12449
+ <xsl:variable name="color_main">
12450
+ <xsl:call-template name="getVariable"><xsl:with-param name="variable">color_main</xsl:with-param></xsl:call-template>
12451
+ </xsl:variable>
12452
+ <xsl:attribute name="color"><xsl:value-of select="$color_main"/></xsl:attribute>
12268
12453
  </xsl:template> <!-- refine_fn-body-style -->
12269
12454
 
12270
12455
  <xsl:attribute-set name="fn-body-num-style">
@@ -13026,10 +13211,13 @@
13026
13211
  <xsl:attribute name="margin-bottom">24pt</xsl:attribute>
13027
13212
  <xsl:attribute name="font-size">18pt</xsl:attribute>
13028
13213
  <xsl:attribute name="font-weight">normal</xsl:attribute>
13029
- <xsl:attribute name="color"><xsl:value-of select="$color_text_title"/></xsl:attribute>
13030
13214
  </xsl:attribute-set> <!-- indexsect-title-style -->
13031
13215
 
13032
13216
  <xsl:template name="refine_indexsect-title-style">
13217
+ <xsl:variable name="color_text_title">
13218
+ <xsl:call-template name="getVariable"><xsl:with-param name="variable">color_text_title</xsl:with-param></xsl:call-template>
13219
+ </xsl:variable>
13220
+ <xsl:attribute name="color"><xsl:value-of select="$color_text_title"/></xsl:attribute>
13033
13221
  </xsl:template>
13034
13222
 
13035
13223
  <xsl:attribute-set name="indexsect-clause-title-style">
@@ -13653,13 +13841,13 @@
13653
13841
 
13654
13842
  <xsl:template name="processTablesFigures_Contents">
13655
13843
  <xsl:param name="always"/>
13656
- <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:toc[@type='table']/mn:title) or normalize-space($always) = 'true'">
13844
+ <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='table']/mn:title) or normalize-space($always) = 'true'">
13657
13845
  <xsl:call-template name="processTables_Contents"/>
13658
13846
  </xsl:if>
13659
- <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:toc[@type='figure']/mn:title) or normalize-space($always) = 'true'">
13847
+ <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='figure']/mn:title) or normalize-space($always) = 'true'">
13660
13848
  <xsl:call-template name="processFigures_Contents"/>
13661
13849
  </xsl:if>
13662
- <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:toc[@type='example']/mn:title)">
13850
+ <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='example']/mn:title)">
13663
13851
  <xsl:call-template name="processExamples_Contents"/>
13664
13852
  </xsl:if>
13665
13853
  </xsl:template>
@@ -13710,22 +13898,22 @@
13710
13898
 
13711
13899
  <xsl:template name="processExamples_Contents">
13712
13900
  <mnx:examples>
13713
- <xsl:for-each select="//mn:example[@id and mn:fmt-name and not(@unnumbered = 'true') and normalize-space(@id) != '']">
13714
- <xsl:choose>
13715
- <xsl:when test="mn:fmt-name">
13716
- <xsl:variable name="fmt_name">
13717
- <xsl:apply-templates select="mn:fmt-name" mode="update_xml_step1"/>
13718
- </xsl:variable>
13719
- <mnx:example id="{@id}" alt-text="{normalize-space($fmt_name)}">
13720
- <xsl:copy-of select="$fmt_name"/>
13721
- </mnx:example>
13722
- </xsl:when>
13723
- <xsl:otherwise>
13724
- <mnx:example id="{@id}" alt-text="{mn:name}">
13725
- <xsl:copy-of select="mn:name"/>
13726
- </mnx:example>
13727
- </xsl:otherwise>
13728
- </xsl:choose>
13901
+ <xsl:for-each select="//mn:example[@id and mn:fmt-name and normalize-space(@id) != '']">
13902
+ <!-- https://github.com/metanorma/metanorma-pdfa/issues/32#issuecomment-4929133938:
13903
+ //example/fmt-xref-label[@container] + //example/fmt-name/span[@class = 'fmt-caption-delim'] + //example/name,
13904
+ with the last two elements dropped if //example/name does not exist. -->
13905
+ <xsl:variable name="example_name">
13906
+ <xsl:apply-templates select="mn:name/node()" mode="update_xml_step1"/>
13907
+ </xsl:variable>
13908
+ <mnx:example id="{@id}" alt-text="{normalize-space($example_name)}">
13909
+ <xsl:element name="fmt-name" namespace="{$namespace_full}">
13910
+ <xsl:value-of select="mn:fmt-xref-label[@container]"/>
13911
+ <xsl:if test="normalize-space($example_name) != ''">
13912
+ <xsl:value-of select="mn:fmt-name/mn:span[@class = 'fmt-caption-delim']"/>
13913
+ <xsl:copy-of select="$example_name"/>
13914
+ </xsl:if>
13915
+ </xsl:element>
13916
+ </mnx:example>
13729
13917
  </xsl:for-each>
13730
13918
  </mnx:examples>
13731
13919
  </xsl:template>
@@ -13998,15 +14186,18 @@
13998
14186
 
13999
14187
  <xsl:call-template name="insertFigureBookmarks">
14000
14188
  <xsl:with-param name="contents" select="mnx:contents"/>
14189
+ <xsl:with-param name="num" select="@num"/>
14001
14190
  </xsl:call-template>
14002
14191
 
14003
14192
  <xsl:call-template name="insertTableBookmarks">
14004
14193
  <xsl:with-param name="contents" select="mnx:contents"/>
14194
+ <xsl:with-param name="num" select="@num"/>
14005
14195
  <xsl:with-param name="lang" select="@lang"/>
14006
14196
  </xsl:call-template>
14007
14197
 
14008
14198
  <xsl:call-template name="insertExampleBookmarks">
14009
14199
  <xsl:with-param name="contents" select="mnx:contents"/>
14200
+ <xsl:with-param name="num" select="@num"/>
14010
14201
  <xsl:with-param name="lang" select="@lang"/>
14011
14202
  </xsl:call-template>
14012
14203
 
@@ -14021,15 +14212,18 @@
14021
14212
 
14022
14213
  <xsl:call-template name="insertFigureBookmarks">
14023
14214
  <xsl:with-param name="contents" select="mnx:contents"/>
14215
+ <xsl:with-param name="num" select="@num"/>
14024
14216
  </xsl:call-template>
14025
14217
 
14026
14218
  <xsl:call-template name="insertTableBookmarks">
14027
14219
  <xsl:with-param name="contents" select="mnx:contents"/>
14220
+ <xsl:with-param name="num" select="@num"/>
14028
14221
  <xsl:with-param name="lang" select="@lang"/>
14029
14222
  </xsl:call-template>
14030
14223
 
14031
14224
  <xsl:call-template name="insertExampleBookmarks">
14032
14225
  <xsl:with-param name="contents" select="mnx:contents"/>
14226
+ <xsl:with-param name="num" select="@num"/>
14033
14227
  <xsl:with-param name="lang" select="@lang"/>
14034
14228
  </xsl:call-template>
14035
14229
 
@@ -14042,15 +14236,18 @@
14042
14236
 
14043
14237
  <xsl:call-template name="insertFigureBookmarks">
14044
14238
  <xsl:with-param name="contents" select="$contents_nodes/mnx:contents"/>
14239
+ <xsl:with-param name="num" select="@num"/>
14045
14240
  </xsl:call-template>
14046
14241
 
14047
14242
  <xsl:call-template name="insertTableBookmarks">
14048
14243
  <xsl:with-param name="contents" select="$contents_nodes/mnx:contents"/>
14244
+ <xsl:with-param name="num" select="@num"/>
14049
14245
  <xsl:with-param name="lang" select="@lang"/>
14050
14246
  </xsl:call-template>
14051
14247
 
14052
14248
  <xsl:call-template name="insertExampleBookmarks">
14053
14249
  <xsl:with-param name="contents" select="$contents_nodes/mnx:contents"/>
14250
+ <xsl:with-param name="num" select="@num"/>
14054
14251
  <xsl:with-param name="lang" select="@lang"/>
14055
14252
  </xsl:call-template>
14056
14253
 
@@ -14066,6 +14263,7 @@
14066
14263
 
14067
14264
  <xsl:template name="insertFigureBookmarks">
14068
14265
  <xsl:param name="contents"/>
14266
+ <xsl:param name="num"/>
14069
14267
  <xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
14070
14268
  <xsl:if test="$contents_nodes/mnx:figure">
14071
14269
  <fo:bookmark internal-destination="{$contents_nodes/mnx:figure[1]/@id}" starting-state="hide">
@@ -14083,6 +14281,7 @@
14083
14281
 
14084
14282
  <xsl:template name="insertTableBookmarks">
14085
14283
  <xsl:param name="contents"/>
14284
+ <xsl:param name="num"/>
14086
14285
  <xsl:param name="lang"/>
14087
14286
  <xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
14088
14287
  <xsl:if test="$contents_nodes/mnx:table">
@@ -14104,8 +14303,9 @@
14104
14303
  </xsl:if><!-- see template addBookmarks -->
14105
14304
  </xsl:template> <!-- insertTableBookmarks -->
14106
14305
 
14107
- <xsl:template name="insertExampleBookmarks">
14306
+ <xsl:template name="insertExampleBookmarks">
14108
14307
  <xsl:param name="contents"/>
14308
+ <xsl:param name="num"/>
14109
14309
  <xsl:param name="lang"/>
14110
14310
  <xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
14111
14311
  <xsl:if test="$contents_nodes/mnx:example">
@@ -14273,6 +14473,18 @@
14273
14473
  </xsl:copy>
14274
14474
  </xsl:template>
14275
14475
 
14476
+ <xsl:template match="mn:tt" mode="contents_item">
14477
+ <xsl:copy>
14478
+ <xsl:apply-templates mode="contents_item"/>
14479
+ </xsl:copy>
14480
+ </xsl:template>
14481
+
14482
+ <xsl:template match="*[local-name() = 'keep-together_within-line']" mode="contents_item">
14483
+ <xsl:copy>
14484
+ <xsl:apply-templates mode="contents_item"/>
14485
+ </xsl:copy>
14486
+ </xsl:template>
14487
+
14276
14488
  <xsl:template match="mn:stem" mode="contents_item"/>
14277
14489
  <xsl:template match="mn:fmt-stem" mode="contents_item">
14278
14490
  <xsl:copy-of select="."/>
@@ -14866,7 +15078,6 @@
14866
15078
  <xsl:attribute name="font-size">18pt</xsl:attribute>
14867
15079
  <xsl:attribute name="font-weight">normal</xsl:attribute>
14868
15080
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
14869
- <xsl:attribute name="color"><xsl:value-of select="$color_text_title"/></xsl:attribute>
14870
15081
  </xsl:attribute-set> <!-- title-style -->
14871
15082
 
14872
15083
  <xsl:template name="refine_title-style">
@@ -14875,6 +15086,11 @@
14875
15086
  <xsl:call-template name="getLevel"/>
14876
15087
  </xsl:variable>
14877
15088
 
15089
+ <xsl:variable name="color_text_title">
15090
+ <xsl:call-template name="getVariable"><xsl:with-param name="variable">color_text_title</xsl:with-param></xsl:call-template>
15091
+ </xsl:variable>
15092
+ <xsl:attribute name="color"><xsl:value-of select="$color_text_title"/></xsl:attribute>
15093
+
14878
15094
  <xsl:if test="$level = 1">
14879
15095
  <xsl:attribute name="space-before">36pt</xsl:attribute>
14880
15096
  <xsl:attribute name="margin-bottom">10pt</xsl:attribute>
@@ -15130,6 +15346,10 @@
15130
15346
  <fo:block break-after="page"/>
15131
15347
  </xsl:template>
15132
15348
 
15349
+ <xsl:template match="mn:pagebreak[ancestor::mn:table]" priority="2">
15350
+ <fo:block break-after="page"/>
15351
+ </xsl:template>
15352
+
15133
15353
  <xsl:variable name="font_main_root_style">
15134
15354
  <root-style xsl:use-attribute-sets="root-style">
15135
15355
  </root-style>