metanorma-plateau 1.0.9 → 1.1.1

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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  <xsl:output method="xml" encoding="UTF-8" indent="no"/>
4
4
 
5
- <xsl:key name="kfn" match="mn:fn[not(ancestor::*[self::mn:table or self::mn:figure or self::mn:localized-strings] and not(ancestor::mn:name))]" use="@reference"/>
5
+ <xsl:key name="kfn" match="mn:fn[not(ancestor::*[self::mn:table or self::mn:figure or self::mn:localized-strings] and not(ancestor::mn:fmt-name))]" use="@reference"/>
6
6
 
7
7
  <xsl:variable name="debug">false</xsl:variable>
8
8
 
@@ -62,6 +62,108 @@
62
62
  </xsl:for-each>
63
63
  </xsl:variable>
64
64
 
65
+ <xsl:template name="layout-master-set">
66
+ <fo:layout-master-set>
67
+
68
+ <!-- Cover page -->
69
+ <xsl:variable name="cover_page_margin_bottom">
70
+ <xsl:choose>
71
+ <xsl:when test="$doctype = 'technical-report'">48</xsl:when>
72
+ <xsl:otherwise>45</xsl:otherwise>
73
+ </xsl:choose>
74
+ </xsl:variable>
75
+ <fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
76
+ <fo:region-body margin-top="15mm" margin-bottom="{$cover_page_margin_bottom}mm" margin-left="36mm" margin-right="8.5mm"/>
77
+ <fo:region-before region-name="header" extent="15mm"/>
78
+ <fo:region-after region-name="footer" extent="{$cover_page_margin_bottom}mm"/>
79
+ <fo:region-start region-name="left-region" extent="36mm"/>
80
+ <fo:region-end region-name="right-region" extent="8.5mm"/>
81
+ </fo:simple-page-master>
82
+
83
+ <fo:simple-page-master master-name="preface" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
84
+ <xsl:if test="$vertical_layout = 'true'">
85
+ <xsl:attribute name="page-width"><xsl:value-of select="$pageHeight"/>mm</xsl:attribute>
86
+ <xsl:attribute name="page-height"><xsl:value-of select="$pageWidth"/>mm</xsl:attribute>
87
+ </xsl:if>
88
+ <fo:region-body margin-top="50mm" margin-bottom="35mm" margin-left="26mm" margin-right="34mm">
89
+ <xsl:if test="$vertical_layout = 'true'">
90
+ <xsl:attribute name="writing-mode">tb-rl</xsl:attribute>
91
+ </xsl:if>
92
+ </fo:region-body>
93
+ <fo:region-before region-name="header" extent="50mm"/>
94
+ <fo:region-after region-name="footer" extent="35mm"/>
95
+ <fo:region-start region-name="left-region" extent="26mm"/>
96
+ <fo:region-end region-name="right-region" extent="34mm"/>
97
+ </fo:simple-page-master>
98
+
99
+ <!-- preface landscape -->
100
+ <fo:simple-page-master master-name="preface-landscape" page-width="{$pageHeight}mm" page-height="{$pageWidth}mm">
101
+ <fo:region-body margin-top="15mm" margin-bottom="{$cover_page_margin_bottom}mm" margin-left="36mm" margin-right="8.5mm"/>
102
+ <fo:region-before region-name="header" extent="15mm"/>
103
+ <fo:region-after region-name="footer" extent="{$cover_page_margin_bottom}mm"/>
104
+ <fo:region-start region-name="left-region-landscape" extent="36mm"/>
105
+ <fo:region-end region-name="right-region-landscape" extent="8.5mm"/>
106
+ </fo:simple-page-master>
107
+
108
+ <fo:simple-page-master master-name="toc" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
109
+ <xsl:if test="$vertical_layout = 'true'">
110
+ <xsl:attribute name="page-width"><xsl:value-of select="$pageHeight"/>mm</xsl:attribute>
111
+ <xsl:attribute name="page-height"><xsl:value-of select="$pageWidth"/>mm</xsl:attribute>
112
+ </xsl:if>
113
+ <fo:region-body margin-top="16.5mm" margin-bottom="22mm" margin-left="14.5mm" margin-right="22.3mm">
114
+ <xsl:if test="$vertical_layout = 'true'">
115
+ <xsl:attribute name="writing-mode">tb-rl</xsl:attribute>
116
+ </xsl:if>
117
+ </fo:region-body>
118
+ <fo:region-before region-name="header" extent="16.5mm"/>
119
+ <fo:region-after region-name="footer" extent="22mm"/>
120
+ <fo:region-start region-name="left-region" extent="14.5mm"/>
121
+ <fo:region-end region-name="right-region" extent="22.3mm"/>
122
+ </fo:simple-page-master>
123
+
124
+ <fo:simple-page-master master-name="document" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
125
+ <xsl:if test="$vertical_layout = 'true'">
126
+ <xsl:attribute name="page-width"><xsl:value-of select="$pageHeight"/>mm</xsl:attribute>
127
+ <xsl:attribute name="page-height"><xsl:value-of select="$pageWidth"/>mm</xsl:attribute>
128
+ </xsl:if>
129
+ <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm">
130
+ <xsl:if test="$vertical_layout = 'true'">
131
+ <xsl:attribute name="writing-mode">tb-rl</xsl:attribute>
132
+ </xsl:if>
133
+ </fo:region-body>
134
+ <fo:region-before region-name="header" extent="{$marginTop}mm"/>
135
+ <fo:region-after region-name="footer" extent="{$marginBottom}mm"/>
136
+ <fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
137
+ <fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
138
+ </fo:simple-page-master>
139
+
140
+ <!-- landscape -->
141
+ <fo:simple-page-master master-name="document-landscape" page-width="{$pageHeight}mm" page-height="{$pageWidth}mm">
142
+ <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
143
+ <fo:region-before region-name="header" extent="{$marginTop}mm" precedence="true"/>
144
+ <fo:region-after region-name="footer" extent="{$marginBottom}mm" precedence="true"/>
145
+ <fo:region-start region-name="left-region-landscape" extent="{$marginLeftRight1}mm"/>
146
+ <fo:region-end region-name="right-region-landscape" extent="{$marginLeftRight2}mm"/>
147
+ </fo:simple-page-master>
148
+
149
+ <fo:simple-page-master master-name="back-page" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
150
+ <fo:region-body margin-top="179.5mm" margin-bottom="30mm" margin-left="15mm" margin-right="22.7mm"/>
151
+ <fo:region-before region-name="header" extent="179.5mm"/>
152
+ <fo:region-after region-name="footer" extent="30mm"/>
153
+ <fo:region-start region-name="left-region" extent="15mm"/>
154
+ <fo:region-end region-name="right-region" extent="22.7mm"/>
155
+ </fo:simple-page-master>
156
+
157
+ <fo:simple-page-master master-name="back-page_technical-report" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
158
+ <fo:region-body margin-top="191mm" margin-bottom="41mm" margin-left="26mm" margin-right="26mm"/>
159
+ <fo:region-before region-name="header" extent="{$marginTop}mm"/>
160
+ <fo:region-after region-name="footer" extent="{$marginBottom}mm"/>
161
+ <fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
162
+ <fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
163
+ </fo:simple-page-master>
164
+ </fo:layout-master-set>
165
+ </xsl:template> <!-- END: layout-master-set -->
166
+
65
167
  <xsl:template match="/">
66
168
 
67
169
  <fo:root xml:lang="{$lang}">
@@ -76,96 +178,7 @@
76
178
  <xsl:attribute name="font-size">10pt</xsl:attribute>
77
179
  </xsl:if>
78
180
 
79
- <fo:layout-master-set>
80
-
81
- <!-- Cover page -->
82
- <xsl:variable name="cover_page_margin_bottom">
83
- <xsl:choose>
84
- <xsl:when test="$doctype = 'technical-report'">48</xsl:when>
85
- <xsl:otherwise>45</xsl:otherwise>
86
- </xsl:choose>
87
- </xsl:variable>
88
- <fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
89
- <fo:region-body margin-top="15mm" margin-bottom="{$cover_page_margin_bottom}mm" margin-left="36mm" margin-right="8.5mm"/>
90
- <fo:region-before region-name="header" extent="15mm"/>
91
- <fo:region-after region-name="footer" extent="{$cover_page_margin_bottom}mm"/>
92
- <fo:region-start region-name="left-region" extent="36mm"/>
93
- <fo:region-end region-name="right-region" extent="8.5mm"/>
94
- </fo:simple-page-master>
95
-
96
- <fo:simple-page-master master-name="document_preface" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
97
- <xsl:if test="$vertical_layout = 'true'">
98
- <xsl:attribute name="page-width"><xsl:value-of select="$pageHeight"/>mm</xsl:attribute>
99
- <xsl:attribute name="page-height"><xsl:value-of select="$pageWidth"/>mm</xsl:attribute>
100
- </xsl:if>
101
- <fo:region-body margin-top="50mm" margin-bottom="35mm" margin-left="26mm" margin-right="34mm">
102
- <xsl:if test="$vertical_layout = 'true'">
103
- <xsl:attribute name="writing-mode">tb-rl</xsl:attribute>
104
- </xsl:if>
105
- </fo:region-body>
106
- <fo:region-before region-name="header" extent="50mm"/>
107
- <fo:region-after region-name="footer" extent="35mm"/>
108
- <fo:region-start region-name="left-region" extent="26mm"/>
109
- <fo:region-end region-name="right-region" extent="34mm"/>
110
- </fo:simple-page-master>
111
-
112
- <fo:simple-page-master master-name="document_toc" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
113
- <xsl:if test="$vertical_layout = 'true'">
114
- <xsl:attribute name="page-width"><xsl:value-of select="$pageHeight"/>mm</xsl:attribute>
115
- <xsl:attribute name="page-height"><xsl:value-of select="$pageWidth"/>mm</xsl:attribute>
116
- </xsl:if>
117
- <fo:region-body margin-top="16.5mm" margin-bottom="22mm" margin-left="14.5mm" margin-right="22.3mm">
118
- <xsl:if test="$vertical_layout = 'true'">
119
- <xsl:attribute name="writing-mode">tb-rl</xsl:attribute>
120
- </xsl:if>
121
- </fo:region-body>
122
- <fo:region-before region-name="header" extent="16.5mm"/>
123
- <fo:region-after region-name="footer" extent="22mm"/>
124
- <fo:region-start region-name="left-region" extent="14.5mm"/>
125
- <fo:region-end region-name="right-region" extent="22.3mm"/>
126
- </fo:simple-page-master>
127
-
128
- <fo:simple-page-master master-name="document" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
129
- <xsl:if test="$vertical_layout = 'true'">
130
- <xsl:attribute name="page-width"><xsl:value-of select="$pageHeight"/>mm</xsl:attribute>
131
- <xsl:attribute name="page-height"><xsl:value-of select="$pageWidth"/>mm</xsl:attribute>
132
- </xsl:if>
133
- <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm">
134
- <xsl:if test="$vertical_layout = 'true'">
135
- <xsl:attribute name="writing-mode">tb-rl</xsl:attribute>
136
- </xsl:if>
137
- </fo:region-body>
138
- <fo:region-before region-name="header" extent="{$marginTop}mm"/>
139
- <fo:region-after region-name="footer" extent="{$marginBottom}mm"/>
140
- <fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
141
- <fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
142
- </fo:simple-page-master>
143
-
144
- <!-- landscape -->
145
- <fo:simple-page-master master-name="document-landscape" page-width="{$pageHeight}mm" page-height="{$pageWidth}mm">
146
- <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
147
- <fo:region-before region-name="header" extent="{$marginTop}mm" precedence="true"/>
148
- <fo:region-after region-name="footer" extent="{$marginBottom}mm" precedence="true"/>
149
- <fo:region-start region-name="left-region-landscape" extent="{$marginLeftRight1}mm"/>
150
- <fo:region-end region-name="right-region-landscape" extent="{$marginLeftRight2}mm"/>
151
- </fo:simple-page-master>
152
-
153
- <fo:simple-page-master master-name="last-page" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
154
- <fo:region-body margin-top="179.5mm" margin-bottom="30mm" margin-left="15mm" margin-right="22.7mm"/>
155
- <fo:region-before region-name="header" extent="179.5mm"/>
156
- <fo:region-after region-name="footer" extent="30mm"/>
157
- <fo:region-start region-name="left-region" extent="15mm"/>
158
- <fo:region-end region-name="right-region" extent="22.7mm"/>
159
- </fo:simple-page-master>
160
-
161
- <fo:simple-page-master master-name="last-page_technical-report" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
162
- <fo:region-body margin-top="191mm" margin-bottom="41mm" margin-left="26mm" margin-right="26mm"/>
163
- <fo:region-before region-name="header" extent="{$marginTop}mm"/>
164
- <fo:region-after region-name="footer" extent="{$marginBottom}mm"/>
165
- <fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
166
- <fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
167
- </fo:simple-page-master>
168
- </fo:layout-master-set>
181
+ <xsl:call-template name="layout-master-set"/>
169
182
 
170
183
  <fo:declarations>
171
184
  <xsl:call-template name="addPDFUAmeta"/>
@@ -175,13 +188,13 @@
175
188
  <xsl:with-param name="contents" select="$contents"/>
176
189
  </xsl:call-template>
177
190
 
178
- <!-- <xsl:if test="$debug = 'true'">
191
+ <xsl:if test="$debug = 'true'">
179
192
  <xsl:message>start contents redirect</xsl:message>
180
193
  <redirect:write file="contents.xml">
181
194
  <xsl:copy-of select="$contents"/>
182
195
  </redirect:write>
183
196
  <xsl:message>end contents redirect</xsl:message>
184
- </xsl:if> -->
197
+ </xsl:if>
185
198
 
186
199
  <xsl:variable name="updated_xml_pres">
187
200
  <xsl:apply-templates mode="update_xml_pres"/>
@@ -235,7 +248,7 @@
235
248
  <!-- <xsl:for-each select="xalan:nodeset($current_document)"> -->
236
249
  <xsl:for-each select="xalan:nodeset($updated_xml_with_pages)">
237
250
 
238
- <xsl:call-template name="insertCoverPage">
251
+ <xsl:call-template name="cover-page">
239
252
  <xsl:with-param name="num" select="$num"/>
240
253
  </xsl:call-template>
241
254
 
@@ -248,7 +261,7 @@
248
261
 
249
262
  <xsl:choose>
250
263
  <xsl:when test="mn:clause[@type = 'toc']">
251
- <fo:page-sequence master-reference="document_toc" initial-page-number="1" force-page-count="no-force">
264
+ <fo:page-sequence master-reference="toc" initial-page-number="1" force-page-count="no-force">
252
265
  <xsl:if test="$doctype = 'technical-report'">
253
266
  <xsl:attribute name="master-reference">document</xsl:attribute>
254
267
  </xsl:if>
@@ -271,12 +284,9 @@
271
284
  </xsl:when>
272
285
  <xsl:otherwise>
273
286
 
274
- <fo:page-sequence master-reference="document_preface" force-page-count="no-force" font-family="Noto Sans JP" font-size="10pt">
287
+ <xsl:variable name="page_orientation"><xsl:call-template name="getPageSequenceOrientation"/></xsl:variable>
275
288
 
276
- <xsl:attribute name="master-reference">
277
- <xsl:text>document_preface</xsl:text>
278
- <xsl:call-template name="getPageSequenceOrientation"/>
279
- </xsl:attribute>
289
+ <fo:page-sequence master-reference="preface{$page_orientation}" force-page-count="no-force" font-family="Noto Sans JP" font-size="10pt">
280
290
 
281
291
  <fo:static-content flow-name="header" role="artifact" id="__internal_layout__preface_header_{generate-id()}">
282
292
  <!-- grey background -->
@@ -313,12 +323,9 @@
313
323
  <!-- ========================== -->
314
324
 
315
325
  <xsl:for-each select=".//mn:page_sequence[not(parent::mn:preface)][normalize-space() != '' or .//mn:image or .//*[local-name() = 'svg']]">
316
- <fo:page-sequence master-reference="document" force-page-count="no-force">
326
+ <xsl:variable name="page_orientation"><xsl:call-template name="getPageSequenceOrientation"/></xsl:variable>
317
327
 
318
- <xsl:attribute name="master-reference">
319
- <xsl:text>document</xsl:text>
320
- <xsl:call-template name="getPageSequenceOrientation"/>
321
- </xsl:attribute>
328
+ <fo:page-sequence master-reference="document{$page_orientation}" force-page-count="no-force">
322
329
 
323
330
  <xsl:if test="position() = 1">
324
331
  <xsl:attribute name="initial-page-number">1</xsl:attribute>
@@ -337,46 +344,7 @@
337
344
  </fo:page-sequence>
338
345
  </xsl:for-each>
339
346
 
340
- <xsl:choose>
341
- <xsl:when test="$doctype = 'technical-report'">
342
- <fo:page-sequence master-reference="last-page_technical-report" force-page-count="no-force">
343
- <xsl:call-template name="insertHeaderFooter"/>
344
- <fo:flow flow-name="xsl-region-body">
345
- <fo:block-container width="100%" height="64mm" border="0.75pt solid black" font-size="14pt" text-align="center" display-align="center" line-height="1.7">
346
- <fo:block>
347
- <xsl:value-of select="/*/mn:bibdata/mn:title[@language = 'ja' and @type = 'title-main']"/>
348
- </fo:block>
349
- <fo:block>
350
- <xsl:value-of select="$i18n_doctype_dict_technical_report"/>
351
- </fo:block>
352
- <fo:block font-size="12pt" margin-top="18pt">
353
- <fo:block><xsl:value-of select="/*/mn:bibdata/mn:date[@type = 'published']"/><xsl:text> 発行</xsl:text></fo:block>
354
- <!-- 委託者 (Contractor) -->
355
- <fo:block>委託者:<xsl:value-of select="/*/mn:bibdata/mn:contributor[mn:role/@type = 'author']/mn:organization/mn:name"/></fo:block>
356
- <!-- 受託者 (Trustees) -->
357
- <fo:block>受託者:<xsl:value-of select="/*/mn:bibdata/mn:contributor[mn:role/@type = 'enabler']/mn:organization/mn:name"/></fo:block>
358
- </fo:block>
359
- </fo:block-container>
360
- </fo:flow>
361
- </fo:page-sequence>
362
- </xsl:when>
363
- <xsl:otherwise> <!-- handbook -->
364
- <fo:page-sequence master-reference="last-page" force-page-count="no-force">
365
- <fo:flow flow-name="xsl-region-body">
366
- <fo:block-container width="100%" border="0.75pt solid black" font-size="10pt" line-height="1.7">
367
- <fo:block margin-left="4.5mm" margin-top="1mm">
368
- <xsl:value-of select="/*/mn:bibdata/mn:title[@language = 'ja' and @type = 'title-main']"/>
369
- <fo:inline padding-left="4mm"><xsl:value-of select="/*/mn:bibdata/mn:edition[@language = 'ja']"/></fo:inline>
370
- </fo:block>
371
- <fo:block margin-left="7.7mm"><xsl:value-of select="/*/mn:bibdata/mn:date[@type = 'published']"/><xsl:text> 発行</xsl:text></fo:block>
372
- <!-- MLIT Department -->
373
- <fo:block margin-left="7.7mm"><xsl:value-of select="/*/mn:bibdata/mn:contributor[mn:role/@type = 'author']/mn:organization/mn:name"/></fo:block>
374
- <fo:block margin-left="9mm"><xsl:value-of select="/*/mn:bibdata/mn:contributor[mn:role/@type = 'enabler']/mn:organization/mn:name"/></fo:block>
375
- </fo:block-container>
376
- </fo:flow>
377
- </fo:page-sequence>
378
- </xsl:otherwise>
379
- </xsl:choose>
347
+ <xsl:call-template name="back-page"/>
380
348
 
381
349
  </xsl:for-each>
382
350
 
@@ -419,7 +387,7 @@
419
387
  <xsl:element name="sections" namespace="{$namespace_full}"> <!-- save context element -->
420
388
 
421
389
  <!-- determine clause 2 element number -->
422
- <xsl:variable name="clause_2_num_" select="count(/*/mn:sections/*[normalize-space(mn:title/mn:tab/preceding-sibling::*) = '2']/preceding-sibling::*)"/>
390
+ <xsl:variable name="clause_2_num_" select="count(/*/mn:sections/*[normalize-space(mn:fmt-title/mn:tab/preceding-sibling::*) = '2']/preceding-sibling::*)"/>
423
391
  <xsl:variable name="clause_2_num__">
424
392
  <xsl:choose>
425
393
  <xsl:when test="$clause_2_num_ = 0">2</xsl:when>
@@ -496,7 +464,7 @@
496
464
  <fo:block><fo:leader leader-pattern="rule" rule-style="double" rule-thickness="1.5pt" leader-length="100%"/></fo:block>
497
465
  </xsl:if>
498
466
  <xsl:apply-templates/>
499
- <xsl:if test="count(*) = 1 and mn:title"> <!-- if there isn't user ToC -->
467
+ <xsl:if test="count(*) = 1 and mn:fmt-title"> <!-- if there isn't user ToC -->
500
468
  <!-- fill ToC -->
501
469
  <fo:block role="TOC" font-weight="bold">
502
470
  <xsl:if test="$doctype = 'technical-report'">
@@ -592,7 +560,7 @@
592
560
  </xsl:if>
593
561
  </xsl:template>
594
562
 
595
- <xsl:template match="mn:clause[@type = 'toc']/mn:title" priority="3"/>
563
+ <xsl:template match="mn:clause[@type = 'toc']/mn:fmt-title" priority="3"/>
596
564
 
597
565
  <xsl:template name="insertTocItem">
598
566
  <xsl:param name="printSection">false</xsl:param>
@@ -615,7 +583,7 @@
615
583
  </fo:block>
616
584
  </xsl:template>
617
585
 
618
- <xsl:template name="insertCoverPage">
586
+ <xsl:template name="cover-page">
619
587
  <xsl:param name="num"/>
620
588
  <fo:page-sequence master-reference="cover-page" force-page-count="no-force" font-family="Noto Sans Condensed">
621
589
 
@@ -754,7 +722,7 @@
754
722
  <fo:block id="firstpage_id_{$num}"> </fo:block>
755
723
  </fo:flow>
756
724
  </fo:page-sequence>
757
- </xsl:template> <!-- insertCoverPage -->
725
+ </xsl:template> <!-- cover-page -->
758
726
 
759
727
  <xsl:template match="mn:p[@class = 'JapaneseIndustrialStandard']" priority="4"/>
760
728
  <xsl:template match="mn:p[@class = 'StandardNumber']" priority="4"/>
@@ -895,7 +863,7 @@
895
863
  <xsl:choose>
896
864
  <xsl:when test="self::mn:p and count(node()) = count(processing-instruction())"><!-- skip --></xsl:when> <!-- empty paragraph with processing-instruction -->
897
865
  <xsl:when test="@hidden = 'true'"><!-- skip --></xsl:when>
898
- <xsl:when test="self::mn:title or self::mn:term">
866
+ <xsl:when test="self::mn:fmt-title or self::mn:term">
899
867
  <xsl:apply-templates select="."/>
900
868
  </xsl:when>
901
869
  <xsl:when test="@mainsection = 'true'">
@@ -922,7 +890,7 @@
922
890
  </xsl:choose>
923
891
  </xsl:template>
924
892
 
925
- <xsl:template match="mn:title" priority="2" name="title">
893
+ <xsl:template match="mn:fmt-title" priority="2" name="title">
926
894
 
927
895
  <xsl:variable name="level">
928
896
  <xsl:call-template name="getLevel"/>
@@ -968,8 +936,8 @@
968
936
  <xsl:when test="ancestor::mn:foreword and $level = 2">0mm</xsl:when>
969
937
  <!-- <xsl:when test="ancestor::mn:annex and $level = 2">4.5mm</xsl:when> -->
970
938
  <xsl:when test="ancestor::mn:bibliography and $level = 2">0mm</xsl:when>
971
- <xsl:when test="$doctype = 'technical-report' and $level = 2 and preceding-sibling::*[2][self::mn:title]">0mm</xsl:when>
972
- <xsl:when test="$doctype = 'technical-report' and $level = 3 and preceding-sibling::*[2][self::mn:title]">0mm</xsl:when>
939
+ <xsl:when test="$doctype = 'technical-report' and $level = 2 and preceding-sibling::*[2][self::mn:fmt-title]">0mm</xsl:when>
940
+ <xsl:when test="$doctype = 'technical-report' and $level = 3 and preceding-sibling::*[2][self::mn:fmt-title]">0mm</xsl:when>
973
941
  <xsl:when test="$level = 2">2mm</xsl:when>
974
942
  <xsl:when test="$level &gt;= 3">2mm</xsl:when>
975
943
  <xsl:otherwise>0mm</xsl:otherwise>
@@ -1106,15 +1074,15 @@
1106
1074
  </xsl:template>
1107
1075
 
1108
1076
  <!-- indent for clause level 4 and more -->
1109
- <xsl:template match="mn:sections/mn:page_sequence//mn:clause[mn:title[@depth &gt;= 4]]" priority="20">
1077
+ <xsl:template match="mn:sections/mn:page_sequence//mn:clause[mn:fmt-title[@depth &gt;= 4]]" priority="20">
1110
1078
  <fo:block keep-with-next="always">
1111
1079
  <fo:block id="{@id}"/>
1112
1080
  </fo:block>
1113
- <xsl:apply-templates select="mn:title"/>
1081
+ <xsl:apply-templates select="mn:fmt-title"/>
1114
1082
  <fo:block-container margin-left="6mm">
1115
1083
  <fo:block-container margin-left="0">
1116
1084
  <fo:block>
1117
- <xsl:apply-templates select="*[not(self::mn:title)]"/>
1085
+ <xsl:apply-templates select="*[not(self::mn:fmt-title)]"/>
1118
1086
  </fo:block>
1119
1087
  </fo:block-container>
1120
1088
  </fo:block-container>
@@ -1143,7 +1111,7 @@
1143
1111
 
1144
1112
  <xsl:choose>
1145
1113
 
1146
- <xsl:when test="preceding-sibling::*[1][self::mn:title]/@inline-header = 'true' and $inline-header = 'false'"/> <!-- paragraph displayed in title template -->
1114
+ <xsl:when test="preceding-sibling::*[1][self::mn:fmt-title]/@inline-header = 'true' and $inline-header = 'false'"/> <!-- paragraph displayed in title template -->
1147
1115
 
1148
1116
  <xsl:otherwise>
1149
1117
 
@@ -1187,7 +1155,7 @@
1187
1155
  <xsl:attribute name="margin-bottom">2pt</xsl:attribute>
1188
1156
  </xsl:if>
1189
1157
 
1190
- <xsl:if test="parent::mn:definition">
1158
+ <xsl:if test="parent::mn:fmt-definition">
1191
1159
  <xsl:attribute name="margin-bottom">2pt</xsl:attribute>
1192
1160
  </xsl:if>
1193
1161
 
@@ -1274,10 +1242,10 @@
1274
1242
  <fo:table-row>
1275
1243
  <fo:table-cell padding="2mm">
1276
1244
  <fo:block keep-with-next="always" margin-bottom="10pt" role="SKIP">
1277
- <xsl:apply-templates select="mn:name"/>
1245
+ <xsl:apply-templates select="mn:fmt-name"/>
1278
1246
  </fo:block>
1279
1247
  <fo:block>
1280
- <xsl:apply-templates select="node()[not(self::mn:name)]"/>
1248
+ <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
1281
1249
  </fo:block>
1282
1250
  </fo:table-cell>
1283
1251
  </fo:table-row>
@@ -1299,12 +1267,12 @@
1299
1267
  <fo:list-item>
1300
1268
  <fo:list-item-label start-indent="{$text_indent}mm" end-indent="label-end()">
1301
1269
  <fo:block xsl:use-attribute-sets="note-name-style">
1302
- <xsl:apply-templates select="mn:name"/>
1270
+ <xsl:apply-templates select="mn:fmt-name"/>
1303
1271
  </fo:block>
1304
1272
  </fo:list-item-label>
1305
1273
  <fo:list-item-body start-indent="body-start()">
1306
1274
  <fo:block>
1307
- <xsl:apply-templates select="node()[not(self::mn:name)]"/>
1275
+ <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
1308
1276
  </fo:block>
1309
1277
  </fo:list-item-body>
1310
1278
  </fo:list-item>
@@ -1590,7 +1558,7 @@
1590
1558
  <xsl:variable name="tag_font_en_bold_open">###<xsl:value-of select="$element_name_font_en_bold"/>###</xsl:variable>
1591
1559
  <xsl:variable name="tag_font_en_bold_close">###/<xsl:value-of select="$element_name_font_en_bold"/>###</xsl:variable>
1592
1560
 
1593
- <xsl:template match="mn:p//text()[not(ancestor::mn:strong) and not(ancestor::mn:stem)] | mn:dt/text() | mn:td/text() | mn:th/text()" mode="update_xml_step1">
1561
+ <xsl:template match="mn:p//text()[not(ancestor::mn:strong) and not(ancestor::mn:fmt-stem)] | mn:dt/text() | mn:td/text() | mn:th/text()" mode="update_xml_step1">
1594
1562
  <!-- add hairspace after 'IDEOGRAPHIC SPACE' (U+3000) -->
1595
1563
  <xsl:variable name="text" select="java:replaceAll(java:java.lang.String.new(.), '(\u3000)', concat('$1',$hair_space))"/>
1596
1564
  <xsl:variable name="text_en__">
@@ -1617,8 +1585,6 @@
1617
1585
  <xsl:copy-of select="xalan:nodeset($text_en)/*[local-name() = 'text']/node()"/>
1618
1586
  </xsl:template>
1619
1587
 
1620
- <!-- mn:term/mn:preferred2//text() | -->
1621
-
1622
1588
  <!-- <name>注記 1</name> to <name>注記<font_en> 1</font_en></name> -->
1623
1589
  <xsl:template match="mn:title/text() | mn:fmt-title/text() | mn:note/mn:name/text() | mn:note/mn:fmt-name/text() | mn:termnote/mn:name/text() | mn:termnote/mn:fmt-name/text() | mn:table/mn:name/text() | mn:table/mn:fmt-name/text() | mn:figure/mn:name/text() | mn:figure/mn:fmt-name/text() | mn:termexample/mn:name/text() | mn:termexample/mn:fmt-name/text() | mn:xref//text() | mn:fmt-xref//text() | mn:origin/text() | mn:fmt-origin/text()" mode="update_xml_step1">
1624
1590
  <xsl:variable name="text_en_" select="java:replaceAll(java:java.lang.String.new(.), $regex_en, concat($tag_font_en_bold_open,'$1',$tag_font_en_bold_close))"/>
@@ -1675,12 +1641,14 @@
1675
1641
  </xsl:copy>
1676
1642
  </xsl:template>
1677
1643
  <xsl:template match="mn:example/mn:fmt-name[contains(mn:span/text(), ' — ')]" mode="update_xml_step1" priority="2">
1678
- <xsl:element name="name" namespace="{$namespace_full}">
1644
+ <!-- <xsl:element name="name" namespace="{$namespace_full}"> -->
1645
+ <xsl:copy>
1679
1646
  <xsl:copy-of select="@*"/>
1680
1647
  <xsl:apply-templates select="*[1]" mode="update_xml_step1"/>
1681
- </xsl:element>
1648
+ </xsl:copy>
1649
+ <!-- </xsl:element> -->
1682
1650
  </xsl:template>
1683
- <xsl:template match="mn:example/mn:name/text()" mode="update_xml_step1">
1651
+ <xsl:template match="mn:example/mn:fmt-name/text()" mode="update_xml_step1">
1684
1652
  <xsl:variable name="example_name" select="."/>
1685
1653
  <!--
1686
1654
  <xsl:choose>
@@ -1701,7 +1669,7 @@
1701
1669
  <xsl:copy-of select="xalan:nodeset($text_en)/*[local-name() = 'text']/node()"/>
1702
1670
  </xsl:template>
1703
1671
 
1704
- <xsl:template match="mn:eref//text()" mode="update_xml_step1">
1672
+ <xsl:template match="mn:fmt-eref//text()" mode="update_xml_step1">
1705
1673
  <!-- Example: JIS Z 8301:2011 to <font_en_bold>JIS Z 8301</font_en_bold><font_en>:2011</font_en> -->
1706
1674
  <xsl:variable name="parts">
1707
1675
  <xsl:choose>
@@ -1751,6 +1719,11 @@
1751
1719
  <!-- Key title after the table -->
1752
1720
  <!-- <xsl:template match="mn:table/mn:p[@class = 'ListTitle']" priority="2" mode="update_xml_step1"/> -->
1753
1721
 
1722
+ <!-- prevent nested <font_en><font_en>...</font_en></font_en> in the auto-layout table width XSL-FO -->
1723
+ <xsl:template match="*[local-name() = 'font_en'] | *[local-name() = 'font_en_bold']" mode="update_xml_step1">
1724
+ <xsl:copy-of select="."/>
1725
+ </xsl:template>
1726
+
1754
1727
  <xsl:template match="*[local-name() = 'font_en_bold'][normalize-space() != '']">
1755
1728
  <xsl:if test="ancestor::*[local-name() = 'td' or local-name() = 'th']">
1756
1729
  <xsl:choose>
@@ -1759,17 +1732,15 @@
1759
1732
  </xsl:choose>
1760
1733
  </xsl:if>
1761
1734
  <fo:inline font-family="Noto Sans Condensed" font-weight="300"> <!-- font-weight="bold" -->
1762
- <!-- <xsl:if test="ancestor::mn:preferred">
1763
- <xsl:attribute name="font-weight">normal</xsl:attribute>
1764
- </xsl:if> -->
1765
- <xsl:if test="(ancestor::mn:figure or ancestor::mn:table) and parent::mn:name">
1735
+
1736
+ <xsl:if test="(ancestor::mn:figure or ancestor::mn:table) and parent::mn:fmt-name">
1766
1737
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1767
1738
  <xsl:if test="$doctype = 'technical-report'">
1768
1739
  <xsl:attribute name="font-weight">normal</xsl:attribute>
1769
1740
  </xsl:if>
1770
1741
  </xsl:if>
1771
1742
 
1772
- <xsl:if test="ancestor::mn:annex and ancestor::mn:title and not(ancestor::mn:clause)">
1743
+ <xsl:if test="ancestor::mn:annex and ancestor::mn:fmt-title and not(ancestor::mn:clause)">
1773
1744
  <xsl:attribute name="font-family">inherit</xsl:attribute>
1774
1745
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1775
1746
  </xsl:if>
@@ -1785,6 +1756,7 @@
1785
1756
  </xsl:template>
1786
1757
 
1787
1758
  <xsl:template match="*[local-name() = 'font_en'][normalize-space() != '']">
1759
+ <!-- <debug><xsl:copy-of select="ancestor::mn:td"/></debug> -->
1788
1760
  <xsl:if test="ancestor::*[local-name() = 'td' or local-name() = 'th']">
1789
1761
  <xsl:choose>
1790
1762
  <xsl:when test="$isGenerateTableIF = 'false'"><fo:inline font-size="0.1pt"><xsl:text> </xsl:text></fo:inline></xsl:when>
@@ -1796,7 +1768,7 @@
1796
1768
  <xsl:attribute name="font-family">Noto Sans Condensed</xsl:attribute>
1797
1769
  <xsl:attribute name="font-weight">300</xsl:attribute>
1798
1770
  </xsl:if>
1799
- <xsl:if test="ancestor::mn:preferred">
1771
+ <xsl:if test="ancestor::mn:fmt-preferred">
1800
1772
  <xsl:attribute name="font-weight">normal</xsl:attribute>
1801
1773
  </xsl:if>
1802
1774
  <xsl:apply-templates/>
@@ -1854,7 +1826,7 @@
1854
1826
  </fo:block>
1855
1827
  </xsl:template>
1856
1828
 
1857
- <xsl:template match="mn:xref[@pagenumber = 'true']" priority="2">
1829
+ <xsl:template match="mn:xref[@pagenumber = 'true'] | mn:fmt-xref[@pagenumber = 'true']" priority="2">
1858
1830
  <xsl:call-template name="insert_basic_link">
1859
1831
  <xsl:with-param name="element">
1860
1832
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
@@ -1914,6 +1886,49 @@
1914
1886
  </xsl:if>
1915
1887
  </xsl:template>
1916
1888
 
1889
+ <xsl:template name="back-page">
1890
+ <xsl:choose>
1891
+ <xsl:when test="$doctype = 'technical-report'">
1892
+ <fo:page-sequence master-reference="back-page_technical-report" force-page-count="no-force">
1893
+ <xsl:call-template name="insertHeaderFooter"/>
1894
+ <fo:flow flow-name="xsl-region-body">
1895
+ <fo:block-container width="100%" height="64mm" border="0.75pt solid black" font-size="14pt" text-align="center" display-align="center" line-height="1.7">
1896
+ <fo:block>
1897
+ <xsl:value-of select="/*/mn:bibdata/mn:title[@language = 'ja' and @type = 'title-main']"/>
1898
+ </fo:block>
1899
+ <fo:block>
1900
+ <xsl:value-of select="$i18n_doctype_dict_technical_report"/>
1901
+ </fo:block>
1902
+ <fo:block font-size="12pt" margin-top="18pt">
1903
+ <fo:block><xsl:value-of select="/*/mn:bibdata/mn:date[@type = 'published']"/><xsl:text> 発行</xsl:text></fo:block>
1904
+ <!-- 委託者 (Contractor) -->
1905
+ <fo:block>委託者:<xsl:value-of select="/*/mn:bibdata/mn:contributor[mn:role/@type = 'author']/mn:organization/mn:name"/></fo:block>
1906
+ <!-- 受託者 (Trustees) -->
1907
+ <fo:block>受託者:<xsl:value-of select="/*/mn:bibdata/mn:contributor[mn:role/@type = 'enabler']/mn:organization/mn:name"/></fo:block>
1908
+ </fo:block>
1909
+ </fo:block-container>
1910
+ </fo:flow>
1911
+ </fo:page-sequence>
1912
+ </xsl:when>
1913
+ <xsl:otherwise> <!-- handbook -->
1914
+ <fo:page-sequence master-reference="back-page" force-page-count="no-force">
1915
+ <fo:flow flow-name="xsl-region-body">
1916
+ <fo:block-container width="100%" border="0.75pt solid black" font-size="10pt" line-height="1.7">
1917
+ <fo:block margin-left="4.5mm" margin-top="1mm">
1918
+ <xsl:value-of select="/*/mn:bibdata/mn:title[@language = 'ja' and @type = 'title-main']"/>
1919
+ <fo:inline padding-left="4mm"><xsl:value-of select="/*/mn:bibdata/mn:edition[@language = 'ja']"/></fo:inline>
1920
+ </fo:block>
1921
+ <fo:block margin-left="7.7mm"><xsl:value-of select="/*/mn:bibdata/mn:date[@type = 'published']"/><xsl:text> 発行</xsl:text></fo:block>
1922
+ <!-- MLIT Department -->
1923
+ <fo:block margin-left="7.7mm"><xsl:value-of select="/*/mn:bibdata/mn:contributor[mn:role/@type = 'author']/mn:organization/mn:name"/></fo:block>
1924
+ <fo:block margin-left="9mm"><xsl:value-of select="/*/mn:bibdata/mn:contributor[mn:role/@type = 'enabler']/mn:organization/mn:name"/></fo:block>
1925
+ </fo:block-container>
1926
+ </fo:flow>
1927
+ </fo:page-sequence>
1928
+ </xsl:otherwise>
1929
+ </xsl:choose>
1930
+ </xsl:template> <!-- END: back-page -->
1931
+
1917
1932
  <xsl:variable name="PLATEAU-Logo">
1918
1933
  <svg xmlns="http://www.w3.org/2000/svg" id="Layer_1" data-name="Layer 1" viewBox="0 0 141.72 172.64">
1919
1934
  <defs>
@@ -2159,10 +2174,6 @@
2159
2174
  <title-part lang="ru">
2160
2175
  </title-part>
2161
2176
  <title-part lang="zh">第 # 部分:</title-part>
2162
-
2163
- <title-subpart lang="en">Sub-part #</title-subpart>
2164
- <title-subpart lang="fr">Partie de sub #</title-subpart>
2165
-
2166
2177
  </xsl:variable>
2167
2178
  <xsl:variable name="titles" select="xalan:nodeset($titles_)"/>
2168
2179
 
@@ -2636,7 +2647,8 @@
2636
2647
  <xsl:template match="mn:stem" mode="update_xml_step1"/>
2637
2648
 
2638
2649
  <xsl:template match="mn:fmt-stem" mode="update_xml_step1">
2639
- <xsl:element name="stem" namespace="{$namespace_full}">
2650
+ <!-- <xsl:element name="stem" namespace="{$namespace_full}"> -->
2651
+ <xsl:copy>
2640
2652
  <xsl:copy-of select="@*"/>
2641
2653
  <xsl:choose>
2642
2654
  <xsl:when test="mn:semx and count(node()) = 1">
@@ -2660,7 +2672,8 @@
2660
2672
  </xsl:choose>
2661
2673
  </xsl:otherwise>
2662
2674
  </xsl:choose>
2663
- </xsl:element>
2675
+ </xsl:copy>
2676
+ <!-- </xsl:element> -->
2664
2677
  </xsl:template>
2665
2678
 
2666
2679
  <xsl:template match="mn:image[not(.//mn:passthrough)] | mn:bibdata[not(.//mn:passthrough)] | mn:localized-strings" mode="update_xml_step1">
@@ -2822,12 +2835,14 @@
2822
2835
  </xsl:template>
2823
2836
 
2824
2837
  <xsl:template match="mn:fmt-title" mode="update_xml_step1">
2825
- <xsl:element name="title" namespace="{$namespace_full}">
2838
+ <!-- <xsl:element name="title" namespace="{$namespace_full}"> -->
2839
+ <xsl:copy>
2826
2840
  <xsl:copy-of select="@*"/>
2827
2841
  <xsl:call-template name="addNamedDestinationAttribute"/>
2828
2842
 
2829
2843
  <xsl:apply-templates mode="update_xml_step1"/>
2830
- </xsl:element>
2844
+ </xsl:copy>
2845
+ <!-- </xsl:element> -->
2831
2846
  </xsl:template>
2832
2847
 
2833
2848
  <xsl:template name="addNamedDestinationAttribute">
@@ -2839,12 +2854,14 @@
2839
2854
  <xsl:apply-templates mode="update_xml_step1"/>
2840
2855
  </xsl:when>
2841
2856
  <xsl:otherwise>
2842
- <xsl:element name="name" namespace="{$namespace_full}">
2857
+ <!-- <xsl:element name="name" namespace="{$namespace_full}"> -->
2858
+ <xsl:copy>
2843
2859
  <xsl:copy-of select="@*"/>
2844
2860
  <xsl:call-template name="addNamedDestinationAttribute"/>
2845
2861
 
2846
2862
  <xsl:apply-templates mode="update_xml_step1"/>
2847
- </xsl:element>
2863
+ </xsl:copy>
2864
+ <!-- </xsl:element> -->
2848
2865
  </xsl:otherwise>
2849
2866
  </xsl:choose>
2850
2867
  </xsl:template>
@@ -2859,7 +2876,7 @@
2859
2876
  <xsl:apply-templates mode="update_xml_step1"/>
2860
2877
  </xsl:template>
2861
2878
  <xsl:template match="mn:fmt-preferred[not(mn:p)] | mn:fmt-preferred/mn:p" mode="update_xml_step1">
2862
- <xsl:element name="preferred" namespace="{$namespace_full}">
2879
+ <xsl:element name="fmt-preferred" namespace="{$namespace_full}">
2863
2880
  <xsl:copy-of select="@*"/>
2864
2881
  <xsl:apply-templates mode="update_xml_step1"/>
2865
2882
  </xsl:element>
@@ -2869,7 +2886,7 @@
2869
2886
  <xsl:apply-templates mode="update_xml_step1"/>
2870
2887
  </xsl:template>
2871
2888
  <xsl:template match="mn:fmt-admitted[not(mn:p)] | mn:fmt-admitted/mn:p" mode="update_xml_step1">
2872
- <xsl:element name="admitted" namespace="{$namespace_full}">
2889
+ <xsl:element name="fmt-admitted" namespace="{$namespace_full}">
2873
2890
  <xsl:copy-of select="@*"/>
2874
2891
  <xsl:apply-templates mode="update_xml_step1"/>
2875
2892
  </xsl:element>
@@ -2879,32 +2896,32 @@
2879
2896
  <xsl:apply-templates mode="update_xml_step1"/>
2880
2897
  </xsl:template>
2881
2898
  <xsl:template match="mn:fmt-deprecates[not(mn:p)] | mn:fmt-deprecates/mn:p" mode="update_xml_step1">
2882
- <xsl:element name="deprecates" namespace="{$namespace_full}">
2899
+ <xsl:element name="fmt-deprecates" namespace="{$namespace_full}">
2883
2900
  <xsl:copy-of select="@*"/>
2884
2901
  <xsl:apply-templates mode="update_xml_step1"/>
2885
2902
  </xsl:element>
2886
2903
  </xsl:template>
2887
2904
 
2888
- <xsl:template match="mn:fmt-definition" mode="update_xml_step1">
2905
+ <!-- <xsl:template match="mn:fmt-definition" mode="update_xml_step1">
2889
2906
  <xsl:element name="definition" namespace="{$namespace_full}">
2890
2907
  <xsl:copy-of select="@*"/>
2891
2908
  <xsl:apply-templates mode="update_xml_step1"/>
2892
2909
  </xsl:element>
2893
2910
  </xsl:template>
2894
-
2911
+
2895
2912
  <xsl:template match="mn:fmt-termsource" mode="update_xml_step1">
2896
2913
  <xsl:element name="termsource" namespace="{$namespace_full}">
2897
2914
  <xsl:copy-of select="@*"/>
2898
2915
  <xsl:apply-templates mode="update_xml_step1"/>
2899
2916
  </xsl:element>
2900
2917
  </xsl:template>
2901
-
2918
+
2902
2919
  <xsl:template match="mn:fmt-source" mode="update_xml_step1">
2903
2920
  <xsl:element name="source" namespace="{$namespace_full}">
2904
2921
  <xsl:copy-of select="@*"/>
2905
2922
  <xsl:apply-templates mode="update_xml_step1"/>
2906
2923
  </xsl:element>
2907
- </xsl:template>
2924
+ </xsl:template> -->
2908
2925
 
2909
2926
  <xsl:template match="mn:span[ @class = 'fmt-caption-label' or @class = 'fmt-element-name' or @class = 'fmt-caption-delim' or @class = 'fmt-autonum-delim']" mode="update_xml_step1" priority="3">
2910
2927
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -2927,12 +2944,12 @@
2927
2944
  </xsl:template>
2928
2945
 
2929
2946
  <xsl:template match="mn:identifier" mode="update_xml_step1"/>
2930
- <xsl:template match="mn:fmt-identifier" mode="update_xml_step1">
2947
+ <!-- <xsl:template match="mn:fmt-identifier" mode="update_xml_step1">
2931
2948
  <xsl:element name="identifier" namespace="{$namespace_full}">
2932
2949
  <xsl:copy-of select="@*"/>
2933
2950
  <xsl:apply-templates mode="update_xml_step1"/>
2934
2951
  </xsl:element>
2935
- </xsl:template>
2952
+ </xsl:template> -->
2936
2953
 
2937
2954
  <xsl:template match="mn:concept" mode="update_xml_step1"/>
2938
2955
 
@@ -2942,51 +2959,53 @@
2942
2959
 
2943
2960
  <xsl:template match="mn:eref" mode="update_xml_step1"/>
2944
2961
 
2945
- <xsl:template match="mn:fmt-eref" mode="update_xml_step1">
2962
+ <!-- <xsl:template match="mn:fmt-eref" mode="update_xml_step1">
2946
2963
  <xsl:element name="eref" namespace="{$namespace_full}">
2947
2964
  <xsl:copy-of select="@*"/>
2948
2965
  <xsl:apply-templates mode="update_xml_step1"/>
2949
2966
  </xsl:element>
2950
- </xsl:template>
2967
+ </xsl:template> -->
2951
2968
 
2952
2969
  <xsl:template match="mn:xref" mode="update_xml_step1"/>
2953
2970
 
2954
- <xsl:template match="mn:fmt-xref" mode="update_xml_step1">
2971
+ <!-- <xsl:template match="mn:fmt-xref" mode="update_xml_step1">
2955
2972
  <xsl:element name="xref" namespace="{$namespace_full}">
2956
2973
  <xsl:copy-of select="@*"/>
2957
2974
  <xsl:apply-templates mode="update_xml_step1"/>
2958
2975
  </xsl:element>
2959
- </xsl:template>
2976
+ </xsl:template> -->
2960
2977
 
2961
2978
  <xsl:template match="mn:link" mode="update_xml_step1"/>
2962
2979
 
2963
- <xsl:template match="mn:fmt-link" mode="update_xml_step1">
2980
+ <!-- <xsl:template match="mn:fmt-link" mode="update_xml_step1">
2964
2981
  <xsl:element name="link" namespace="{$namespace_full}">
2965
2982
  <xsl:copy-of select="@*"/>
2966
2983
  <xsl:apply-templates mode="update_xml_step1"/>
2967
2984
  </xsl:element>
2968
- </xsl:template>
2985
+ </xsl:template> -->
2969
2986
 
2970
2987
  <xsl:template match="mn:origin" mode="update_xml_step1"/>
2971
2988
 
2972
- <xsl:template match="mn:fmt-origin" mode="update_xml_step1">
2989
+ <!-- <xsl:template match="mn:fmt-origin" mode="update_xml_step1">
2973
2990
  <xsl:element name="origin" namespace="{$namespace_full}">
2974
2991
  <xsl:copy-of select="@*"/>
2975
2992
  <xsl:apply-templates mode="update_xml_step1"/>
2976
2993
  </xsl:element>
2977
- </xsl:template>
2994
+ </xsl:template> -->
2978
2995
 
2979
2996
  <xsl:template match="mn:erefstack" mode="update_xml_step1"/>
2980
2997
 
2981
2998
  <xsl:template match="mn:svgmap" mode="update_xml_step1"/>
2982
2999
 
2983
- <xsl:template match="mn:review-container" mode="update_xml_step1"/>
3000
+ <xsl:template match="mn:annotation-container" mode="update_xml_step1"/>
2984
3001
 
2985
- <xsl:template match="mn:fmt-identifier[not(ancestor::*[local-name() = 'bibdata'])]//text()" mode="update_xml_step1">
2986
- <xsl:element name="{$element_name_keep-together_within-line}" namespace="{$namespace_full}">
2987
- <xsl:value-of select="."/>
2988
- </xsl:element>
2989
- </xsl:template>
3002
+ <xsl:template match="mn:fmt-identifier[not(ancestor::*[local-name() = 'bibdata'])]//text()" mode="update_xml_step1">
3003
+ <xsl:element name="{$element_name_keep-together_within-line}" namespace="{$namespace_full}">
3004
+ <xsl:value-of select="."/>
3005
+ </xsl:element>
3006
+ </xsl:template>
3007
+
3008
+ <xsl:template match="@semx-id | @anchor" mode="update_xml_step1"/>
2990
3009
 
2991
3010
  <!-- END: update new Presentation XML -->
2992
3011
 
@@ -3179,7 +3198,7 @@
3179
3198
  </xsl:variable>
3180
3199
 
3181
3200
  <!-- add 'fn' after eref and origin, to reference bibitem with note = 'Withdrawn.' or 'Cancelled and replaced...' -->
3182
- <xsl:template match="mn:eref | mn:origin" mode="update_xml_step2">
3201
+ <xsl:template match="mn:fmt-eref | mn:fmt-origin" mode="update_xml_step2">
3183
3202
  <xsl:copy-of select="."/>
3184
3203
 
3185
3204
  <xsl:variable name="bibitemid" select="@bibitemid"/>
@@ -3248,7 +3267,7 @@
3248
3267
  </xsl:call-template>
3249
3268
  </xsl:template>
3250
3269
 
3251
- <xsl:template match="mn:stem | mn:image" mode="update_xml_step2">
3270
+ <xsl:template match="mn:fmt-stem | mn:image" mode="update_xml_step2">
3252
3271
  <xsl:copy-of select="."/>
3253
3272
  </xsl:template>
3254
3273
 
@@ -3285,7 +3304,7 @@
3285
3304
  <xsl:variable name="non_white_space">[^\s\u3000-\u9FFF]</xsl:variable>
3286
3305
  <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>
3287
3306
 
3288
- <xsl:template match="text()[not(ancestor::mn:bibdata or ancestor::mn:link[not(contains(.,' '))] or ancestor::mn:sourcecode or ancestor::*[local-name() = 'math'] or ancestor::*[local-name() = 'svg'] or ancestor::mn: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">
3307
+ <xsl:template match="text()[not(ancestor::mn:bibdata or ancestor::mn:fmt-link[not(contains(normalize-space(),' '))] or ancestor::mn:sourcecode 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">
3289
3308
 
3290
3309
  <xsl:variable name="parent" select="local-name(..)"/>
3291
3310
 
@@ -3404,7 +3423,7 @@
3404
3423
  </xsl:if>
3405
3424
  </xsl:template>
3406
3425
 
3407
- <xsl:template match="mn:stem | mn:image" mode="update_xml_enclose_keep-together_within-line">
3426
+ <xsl:template match="mn:fmt-stem | mn:image" mode="update_xml_enclose_keep-together_within-line">
3408
3427
  <xsl:copy-of select="."/>
3409
3428
  </xsl:template>
3410
3429
 
@@ -3731,7 +3750,7 @@
3731
3750
  </fo:block>
3732
3751
  </xsl:template> <!-- copyright-statement -->
3733
3752
 
3734
- <xsl:template match="mn:copyright-statement//mn:title">
3753
+ <xsl:template match="mn:copyright-statement//mn:fmt-title">
3735
3754
  <!-- process in the template 'title' -->
3736
3755
  <xsl:call-template name="title"/>
3737
3756
  </xsl:template> <!-- copyright-statement//title -->
@@ -3747,7 +3766,7 @@
3747
3766
  </fo:block>
3748
3767
  </xsl:template> <!-- license-statement -->
3749
3768
 
3750
- <xsl:template match="mn:license-statement//mn:title">
3769
+ <xsl:template match="mn:license-statement//mn:fmt-title">
3751
3770
  <!-- process in the template 'title' -->
3752
3771
  <xsl:call-template name="title"/>
3753
3772
  </xsl:template> <!-- license-statement/title -->
@@ -3764,7 +3783,7 @@
3764
3783
  </fo:block>
3765
3784
  </xsl:template> <!-- legal-statement -->
3766
3785
 
3767
- <xsl:template match="mn:legal-statement//mn:title">
3786
+ <xsl:template match="mn:legal-statement//mn:fmt-title">
3768
3787
  <!-- process in the template 'title' -->
3769
3788
  <xsl:call-template name="title"/>
3770
3789
 
@@ -3784,7 +3803,7 @@
3784
3803
  </fo:block>
3785
3804
  </xsl:template> <!-- feedback-statement -->
3786
3805
 
3787
- <xsl:template match="mn:feedback-statement//mn:title">
3806
+ <xsl:template match="mn:feedback-statement//mn:fmt-title">
3788
3807
  <!-- process in the template 'title' -->
3789
3808
  <xsl:call-template name="title"/>
3790
3809
  </xsl:template>
@@ -3807,7 +3826,7 @@
3807
3826
  <xsl:template name="refine_link-style">
3808
3827
  </xsl:template> <!-- refine_link-style -->
3809
3828
 
3810
- <xsl:template match="mn:link" name="link">
3829
+ <xsl:template match="mn:fmt-link" name="link">
3811
3830
  <xsl:variable name="target_normalized" select="translate(@target, '\', '/')"/>
3812
3831
  <xsl:variable name="target_attachment_name" select="substring-after($target_normalized, '_attachments/')"/>
3813
3832
  <xsl:variable name="isLinkToEmbeddedFile" select="normalize-space(@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target])"/>
@@ -4025,7 +4044,7 @@
4025
4044
  <xsl:value-of select="."/>
4026
4045
  </xsl:attribute>
4027
4046
  </xsl:for-each>
4028
- <xsl:apply-templates select="node()[not(self::mn:name)]"/>
4047
+ <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
4029
4048
  </xsl:when>
4030
4049
 
4031
4050
  <xsl:otherwise>
@@ -4067,11 +4086,11 @@
4067
4086
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
4068
4087
  </xsl:if>
4069
4088
 
4070
- <xsl:apply-templates select="node()[not(self::mn:name or self::mn:dl)]"/>
4089
+ <xsl:apply-templates select="node()[not(self::mn:fmt-name or self::mn:dl)]"/>
4071
4090
  </fo:block>
4072
4091
 
4073
4092
  <xsl:apply-templates select="mn:dl"/> <!-- Key table -->
4074
- <xsl:apply-templates select="mn:name"/> <!-- show sourcecode's name AFTER content -->
4093
+ <xsl:apply-templates select="mn:fmt-name"/> <!-- show sourcecode's name AFTER content -->
4075
4094
 
4076
4095
  </fo:block-container>
4077
4096
  </fo:block-container>
@@ -4372,7 +4391,7 @@
4372
4391
 
4373
4392
  <!-- end mode="syntax_highlight" -->
4374
4393
 
4375
- <xsl:template match="mn:sourcecode/mn:name">
4394
+ <xsl:template match="mn:sourcecode/mn:fmt-name">
4376
4395
  <xsl:if test="normalize-space() != ''">
4377
4396
  <fo:block xsl:use-attribute-sets="sourcecode-name-style">
4378
4397
  <xsl:apply-templates/>
@@ -4390,7 +4409,7 @@
4390
4409
  </xsl:choose>
4391
4410
  </xsl:template>
4392
4411
 
4393
- <xsl:template match="mn:annotation">
4412
+ <xsl:template match="mn:callout-annotation">
4394
4413
  <xsl:variable name="annotation-id" select="@id"/>
4395
4414
  <xsl:variable name="callout" select="//*[@target = $annotation-id]/text()"/>
4396
4415
  <fo:block id="{$annotation-id}" white-space="nowrap">
@@ -4402,7 +4421,7 @@
4402
4421
  </fo:block>
4403
4422
  </xsl:template>
4404
4423
 
4405
- <xsl:template match="mn:annotation/mn:p">
4424
+ <xsl:template match="mn:callout-annotation/mn:p">
4406
4425
  <xsl:param name="callout"/>
4407
4426
  <fo:inline id="{@id}">
4408
4427
  <xsl:call-template name="setNamedDestination"/>
@@ -4552,7 +4571,7 @@
4552
4571
  <xsl:when test="starts-with(., $ace_tag) or self::mn:change-open-tag or self::mn:change-close-tag"> <!-- examples: ace-tag_A1_start, ace-tag_A2_end, C1_start, AC_start, or
4553
4572
  <change-open-tag>A<sub>1</sub></change-open-tag>, <change-close-tag>A<sub>1</sub></change-close-tag> -->
4554
4573
  <xsl:choose>
4555
- <xsl:when test="$skip = 'true' and ((local-name(../..) = 'note' and not(preceding-sibling::node())) or (local-name(..) = 'title' and preceding-sibling::node()[1][self::mn:tab]) or local-name(..) = 'formattedref' and not(preceding-sibling::node())) and ../node()[last()][self::mn:add][starts-with(text(), $ace_tag)]"><!-- start tag displayed in template name="note" and title --></xsl:when>
4574
+ <xsl:when test="$skip = 'true' and ((local-name(../..) = 'note' and not(preceding-sibling::node())) or (parent::mn:fmt-title and preceding-sibling::node()[1][self::mn:tab]) or local-name(..) = 'formattedref' and not(preceding-sibling::node())) and ../node()[last()][self::mn:add][starts-with(text(), $ace_tag)]"><!-- start tag displayed in template name="note" and title --></xsl:when>
4556
4575
  <xsl:otherwise>
4557
4576
  <xsl:variable name="tag">
4558
4577
  <xsl:call-template name="insertTag">
@@ -4953,12 +4972,12 @@
4953
4972
  <xsl:template match="mn:permission">
4954
4973
  <xsl:call-template name="setNamedDestination"/>
4955
4974
  <fo:block id="{@id}" xsl:use-attribute-sets="permission-style">
4956
- <xsl:apply-templates select="mn:name"/>
4957
- <xsl:apply-templates select="node()[not(self::mn:name)]"/>
4975
+ <xsl:apply-templates select="mn:fmt-name"/>
4976
+ <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
4958
4977
  </fo:block>
4959
4978
  </xsl:template>
4960
4979
 
4961
- <xsl:template match="mn:permission/mn:name">
4980
+ <xsl:template match="mn:permission/mn:fmt-name">
4962
4981
  <xsl:if test="normalize-space() != ''">
4963
4982
  <fo:block xsl:use-attribute-sets="permission-name-style">
4964
4983
  <xsl:apply-templates/>
@@ -4980,15 +4999,15 @@
4980
4999
  <xsl:template match="mn:requirement">
4981
5000
  <xsl:call-template name="setNamedDestination"/>
4982
5001
  <fo:block id="{@id}" xsl:use-attribute-sets="requirement-style">
4983
- <xsl:apply-templates select="mn:name"/>
5002
+ <xsl:apply-templates select="mn:fmt-name"/>
4984
5003
  <xsl:apply-templates select="mn:label"/>
4985
5004
  <xsl:apply-templates select="@obligation"/>
4986
5005
  <xsl:apply-templates select="mn:subject"/>
4987
- <xsl:apply-templates select="node()[not(self::mn:name) and not(self::mn:label) and not(self::mn:subject)]"/>
5006
+ <xsl:apply-templates select="node()[not(self::mn:fmt-name) and not(self::mn:label) and not(self::mn:subject)]"/>
4988
5007
  </fo:block>
4989
5008
  </xsl:template>
4990
5009
 
4991
- <xsl:template match="mn:requirement/mn:name">
5010
+ <xsl:template match="mn:requirement/mn:fmt-name">
4992
5011
  <xsl:if test="normalize-space() != ''">
4993
5012
 
4994
5013
  <fo:block xsl:use-attribute-sets="requirement-name-style">
@@ -5024,12 +5043,12 @@
5024
5043
  <xsl:template match="mn:recommendation">
5025
5044
  <xsl:call-template name="setNamedDestination"/>
5026
5045
  <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
5027
- <xsl:apply-templates select="mn:name"/>
5028
- <xsl:apply-templates select="node()[not(self::mn:name)]"/>
5046
+ <xsl:apply-templates select="mn:fmt-name"/>
5047
+ <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
5029
5048
  </fo:block>
5030
5049
  </xsl:template>
5031
5050
 
5032
- <xsl:template match="mn:recommendation/mn:name">
5051
+ <xsl:template match="mn:recommendation/mn:fmt-name">
5033
5052
  <xsl:if test="normalize-space() != ''">
5034
5053
 
5035
5054
  <fo:block xsl:use-attribute-sets="recommendation-name-style">
@@ -5287,11 +5306,11 @@
5287
5306
 
5288
5307
  <xsl:if test="parent::mn:term and not(preceding-sibling::mn:term)">
5289
5308
  </xsl:if>
5290
- <xsl:apply-templates select="node()[not(self::mn:name)]"/>
5309
+ <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
5291
5310
  </fo:block>
5292
5311
  </xsl:template>
5293
5312
 
5294
- <xsl:template match="mn:term/mn:name">
5313
+ <xsl:template match="mn:term/mn:fmt-name">
5295
5314
  <xsl:if test="normalize-space() != ''">
5296
5315
  <!-- <xsl:variable name="level">
5297
5316
  <xsl:call-template name="getLevelTermName"/>
@@ -5310,7 +5329,7 @@
5310
5329
  <!-- origin -->
5311
5330
  <!-- modification -->
5312
5331
  <!-- ====== -->
5313
- <xsl:template match="mn:termsource" name="termsource">
5332
+ <xsl:template match="mn:fmt-termsource" name="termsource">
5314
5333
  <fo:block xsl:use-attribute-sets="termsource-style">
5315
5334
 
5316
5335
  <xsl:call-template name="refine_termsource-style"/>
@@ -5349,24 +5368,24 @@
5349
5368
  </fo:block>
5350
5369
  </xsl:template>
5351
5370
 
5352
- <xsl:template match="mn:termsource/text()[starts-with(., '[SOURCE: Adapted from: ') or starts-with(., '[SOURCE: Quoted from: ') or starts-with(., '[SOURCE: Modified from: ')]" priority="2">
5371
+ <xsl:template match="mn:fmt-termsource/text()[starts-with(., '[SOURCE: Adapted from: ') or starts-with(., '[SOURCE: Quoted from: ') or starts-with(., '[SOURCE: Modified from: ')]" priority="2">
5353
5372
  <xsl:text>[</xsl:text><xsl:value-of select="substring-after(., '[SOURCE: ')"/>
5354
5373
  </xsl:template>
5355
5374
 
5356
- <xsl:template match="mn:termsource/text()">
5375
+ <xsl:template match="mn:fmt-termsource/text()">
5357
5376
  <xsl:if test="normalize-space() != ''">
5358
5377
  <xsl:value-of select="."/>
5359
5378
  </xsl:if>
5360
5379
  </xsl:template>
5361
5380
 
5362
5381
  <!-- text SOURCE: -->
5363
- <xsl:template match="mn:termsource/mn:strong[1][following-sibling::*[1][self::mn:origin]]/text()">
5382
+ <xsl:template match="mn:fmt-termsource/mn:strong[1][following-sibling::*[1][self::mn:fmt-origin]]/text()">
5364
5383
  <fo:inline xsl:use-attribute-sets="termsource-text-style">
5365
5384
  <xsl:value-of select="."/>
5366
5385
  </fo:inline>
5367
5386
  </xsl:template>
5368
5387
 
5369
- <xsl:template match="mn:origin">
5388
+ <xsl:template match="mn:fmt-origin">
5370
5389
  <xsl:call-template name="insert_basic_link">
5371
5390
  <xsl:with-param name="element">
5372
5391
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
@@ -5412,7 +5431,7 @@
5412
5431
  <!-- ====== -->
5413
5432
 
5414
5433
  <!-- Preferred, admitted, deprecated -->
5415
- <xsl:template match="mn:preferred">
5434
+ <xsl:template match="mn:fmt-preferred">
5416
5435
  <xsl:variable name="level">
5417
5436
  <xsl:call-template name="getLevel"/>
5418
5437
  </xsl:variable>
@@ -5423,15 +5442,15 @@
5423
5442
  </xsl:variable>
5424
5443
  <fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="preferred-block-style">
5425
5444
 
5426
- <xsl:if test="parent::mn:term and not(preceding-sibling::mn:preferred)"> <!-- if first preffered in term, then display term's name -->
5445
+ <xsl:if test="parent::mn:term and not(preceding-sibling::mn:fmt-preferred)"> <!-- if first preffered in term, then display term's name -->
5427
5446
 
5428
5447
  <fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
5429
5448
 
5430
- <xsl:for-each select="ancestor::mn:term[1]/mn:name"><!-- change context -->
5449
+ <xsl:for-each select="ancestor::mn:term[1]/mn:fmt-name"><!-- change context -->
5431
5450
  <xsl:call-template name="setIDforNamedDestination"/>
5432
5451
  </xsl:for-each>
5433
5452
 
5434
- <xsl:apply-templates select="ancestor::mn:term[1]/mn:name"/>
5453
+ <xsl:apply-templates select="ancestor::mn:term[1]/mn:fmt-name"/>
5435
5454
  </fo:block>
5436
5455
  </xsl:if>
5437
5456
 
@@ -5455,13 +5474,13 @@
5455
5474
  <!-- https://github.com/metanorma/isodoc/issues/632#issuecomment-2567163931 -->
5456
5475
  <xsl:template match="mn:domain"/>
5457
5476
 
5458
- <xsl:template match="mn:admitted">
5477
+ <xsl:template match="mn:fmt-admitted">
5459
5478
  <fo:block xsl:use-attribute-sets="admitted-style">
5460
5479
  <xsl:apply-templates/>
5461
5480
  </fo:block>
5462
5481
  </xsl:template>
5463
5482
 
5464
- <xsl:template match="mn:deprecates">
5483
+ <xsl:template match="mn:fmt-deprecates">
5465
5484
  <fo:block xsl:use-attribute-sets="deprecates-style">
5466
5485
  <xsl:apply-templates/>
5467
5486
  </fo:block>
@@ -5475,7 +5494,7 @@
5475
5494
 
5476
5495
  <!-- regarding ISO 10241-1:2011, If there is more than one preferred term, each preferred term follows the previous one on a new line. -->
5477
5496
  <!-- in metanorma xml preferred terms delimited by semicolons -->
5478
- <xsl:template match="mn:preferred/text()[contains(., ';')] | mn:preferred/mn:strong/text()[contains(., ';')]">
5497
+ <xsl:template match="mn:fmt-preferred/text()[contains(., ';')] | mn:fmt-preferred/mn:strong/text()[contains(., ';')]">
5479
5498
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.), ';', $linebreak)"/>
5480
5499
  </xsl:template>
5481
5500
  <!-- End Preferred, admitted, deprecated -->
@@ -5494,16 +5513,16 @@
5494
5513
  <!-- ========== -->
5495
5514
  <!-- definition -->
5496
5515
  <!-- ========== -->
5497
- <xsl:template match="mn:definition">
5516
+ <xsl:template match="mn:fmt-definition">
5498
5517
  <fo:block xsl:use-attribute-sets="definition-style" role="SKIP">
5499
5518
  <xsl:apply-templates/>
5500
5519
  </fo:block>
5501
5520
  </xsl:template>
5502
5521
 
5503
- <xsl:template match="mn:definition[preceding-sibling::mn:domain]">
5522
+ <xsl:template match="mn:fmt-definition[preceding-sibling::mn:domain]">
5504
5523
  <xsl:apply-templates/>
5505
5524
  </xsl:template>
5506
- <xsl:template match="mn:definition[preceding-sibling::mn:domain]/mn:p[1]">
5525
+ <xsl:template match="mn:fmt-definition[preceding-sibling::mn:domain]/mn:p[1]">
5507
5526
  <fo:inline> <xsl:apply-templates/></fo:inline>
5508
5527
  <fo:block/>
5509
5528
  </xsl:template>
@@ -5569,12 +5588,12 @@
5569
5588
  <xsl:call-template name="refine_termexample-style"/>
5570
5589
  <xsl:call-template name="setBlockSpanAll"/>
5571
5590
 
5572
- <xsl:apply-templates select="mn:name"/>
5573
- <xsl:apply-templates select="node()[not(self::mn:name)]"/>
5591
+ <xsl:apply-templates select="mn:fmt-name"/>
5592
+ <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
5574
5593
  </fo:block>
5575
5594
  </xsl:template>
5576
5595
 
5577
- <xsl:template match="mn:termexample/mn:name">
5596
+ <xsl:template match="mn:termexample/mn:fmt-name">
5578
5597
  <xsl:if test="normalize-space() != ''">
5579
5598
  <fo:inline xsl:use-attribute-sets="termexample-name-style">
5580
5599
  <xsl:call-template name="refine_termexample-name-style"/>
@@ -5625,7 +5644,7 @@
5625
5644
  <xsl:call-template name="refine_example-style"/>
5626
5645
 
5627
5646
  <xsl:variable name="fo_element">
5628
- <xsl:if test=".//mn:table or .//mn:dl or *[not(self::mn:name)][1][self::mn:sourcecode]">block</xsl:if>block
5647
+ <xsl:if test=".//mn:table or .//mn:dl or *[not(self::mn:fmt-name)][1][self::mn:sourcecode]">block</xsl:if>block
5629
5648
  </xsl:variable>
5630
5649
 
5631
5650
  <fo:block-container margin-left="0mm" role="SKIP">
@@ -5636,7 +5655,7 @@
5636
5655
 
5637
5656
  <!-- display name 'EXAMPLE' in a separate block -->
5638
5657
  <fo:block>
5639
- <xsl:apply-templates select="mn:name">
5658
+ <xsl:apply-templates select="mn:fmt-name">
5640
5659
  <xsl:with-param name="fo_element" select="$fo_element"/>
5641
5660
  </xsl:apply-templates>
5642
5661
  </fo:block>
@@ -5644,7 +5663,7 @@
5644
5663
  <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
5645
5664
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
5646
5665
  <xsl:variable name="example_body">
5647
- <xsl:apply-templates select="node()[not(self::mn:name)]">
5666
+ <xsl:apply-templates select="node()[not(self::mn:fmt-name)]">
5648
5667
  <xsl:with-param name="fo_element" select="$fo_element"/>
5649
5668
  </xsl:apply-templates>
5650
5669
  </xsl:variable>
@@ -5671,14 +5690,14 @@
5671
5690
  <fo:list-item>
5672
5691
  <fo:list-item-label start-indent="{$indent}mm" end-indent="label-end()">
5673
5692
  <fo:block>
5674
- <xsl:apply-templates select="mn:name">
5693
+ <xsl:apply-templates select="mn:fmt-name">
5675
5694
  <xsl:with-param name="fo_element">block</xsl:with-param>
5676
5695
  </xsl:apply-templates>
5677
5696
  </fo:block>
5678
5697
  </fo:list-item-label>
5679
5698
  <fo:list-item-body start-indent="body-start()">
5680
5699
  <fo:block>
5681
- <xsl:apply-templates select="node()[not(self::mn:name)]">
5700
+ <xsl:apply-templates select="node()[not(self::mn:fmt-name)]">
5682
5701
  <xsl:with-param name="fo_element" select="$fo_element"/>
5683
5702
  </xsl:apply-templates>
5684
5703
  </fo:block>
@@ -5691,21 +5710,21 @@
5691
5710
 
5692
5711
  <!-- display 'EXAMPLE' and first element in the same line -->
5693
5712
  <fo:block>
5694
- <xsl:apply-templates select="mn:name">
5713
+ <xsl:apply-templates select="mn:fmt-name">
5695
5714
  <xsl:with-param name="fo_element" select="$fo_element"/>
5696
5715
  </xsl:apply-templates>
5697
5716
  <fo:inline>
5698
- <xsl:apply-templates select="*[not(self::mn:name)][1]">
5717
+ <xsl:apply-templates select="*[not(self::mn:fmt-name)][1]">
5699
5718
  <xsl:with-param name="fo_element" select="$fo_element"/>
5700
5719
  </xsl:apply-templates>
5701
5720
  </fo:inline>
5702
5721
  </fo:block>
5703
5722
 
5704
- <xsl:if test="*[not(self::mn:name)][position() &gt; 1]">
5723
+ <xsl:if test="*[not(self::mn:fmt-name)][position() &gt; 1]">
5705
5724
  <!-- display further elements in blocks -->
5706
5725
  <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
5707
5726
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
5708
- <xsl:apply-templates select="*[not(self::mn:name)][position() &gt; 1]">
5727
+ <xsl:apply-templates select="*[not(self::mn:fmt-name)][position() &gt; 1]">
5709
5728
  <xsl:with-param name="fo_element" select="'block'"/>
5710
5729
  </xsl:apply-templates>
5711
5730
  </fo:block-container>
@@ -5719,7 +5738,7 @@
5719
5738
  </xsl:template>
5720
5739
 
5721
5740
  <!-- example/name -->
5722
- <xsl:template match="mn:example/mn:name">
5741
+ <xsl:template match="mn:example/mn:fmt-name">
5723
5742
  <xsl:param name="fo_element">block</xsl:param>
5724
5743
 
5725
5744
  <xsl:choose>
@@ -5744,7 +5763,7 @@
5744
5763
  </xsl:template>
5745
5764
 
5746
5765
  <!-- table/example/name, table/tfoot//example/name -->
5747
- <xsl:template match="mn:table/mn:example/mn:name | mn:table/mn:tfoot//mn:example/mn:name">
5766
+ <xsl:template match="mn:table/mn:example/mn:fmt-name | mn:table/mn:tfoot//mn:example/mn:fmt-name">
5748
5767
  <fo:inline xsl:use-attribute-sets="example-name-style">
5749
5768
  <xsl:attribute name="font-weight">bold</xsl:attribute>
5750
5769
  <xsl:apply-templates/>
@@ -6036,7 +6055,7 @@
6036
6055
 
6037
6056
  <!-- Display table's name before table as standalone block -->
6038
6057
  <!-- $namespace = 'iso' or -->
6039
- <xsl:apply-templates select="mn:name"/> <!-- table's title rendered before table -->
6058
+ <xsl:apply-templates select="mn:fmt-name"/> <!-- table's title rendered before table -->
6040
6059
  <xsl:call-template name="table_name_fn_display"/>
6041
6060
 
6042
6061
  <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)/*/mn:tr[1]/mn:td)"/>
@@ -6078,7 +6097,7 @@
6078
6097
 
6079
6098
  <fo:block-container xsl:use-attribute-sets="table-container-style" role="SKIP">
6080
6099
 
6081
- <xsl:for-each select="mn:name">
6100
+ <xsl:for-each select="mn:fmt-name">
6082
6101
  <xsl:call-template name="setIDforNamedDestination"/>
6083
6102
  </xsl:for-each>
6084
6103
 
@@ -6108,6 +6127,10 @@
6108
6127
  <xsl:with-param name="margin-side" select="$margin-side"/>
6109
6128
  </xsl:call-template>
6110
6129
 
6130
+ <xsl:call-template name="setTableStyles">
6131
+ <xsl:with-param name="scope">table</xsl:with-param>
6132
+ </xsl:call-template>
6133
+
6111
6134
  </xsl:element>
6112
6135
  </xsl:variable>
6113
6136
 
@@ -6128,7 +6151,7 @@
6128
6151
  </xsl:attribute>
6129
6152
  </xsl:for-each>
6130
6153
 
6131
- <xsl:variable name="isNoteOrFnExist" select="./mn:note[not(@type = 'units')] or ./mn:example or .//mn:fn[local-name(..) != 'name'] or ./mn:source"/>
6154
+ <xsl:variable name="isNoteOrFnExist" select="./mn:note[not(@type = 'units')] or ./mn:example or .//mn:fn[not(parent::mn:fmt-name)] or ./mn:fmt-source"/>
6132
6155
  <xsl:if test="$isNoteOrFnExist = 'true'">
6133
6156
  <!-- <xsl:choose>
6134
6157
  <xsl:when test="$namespace = 'plateau'"></xsl:when>
@@ -6184,7 +6207,7 @@
6184
6207
  <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
6185
6208
  </xsl:when>
6186
6209
  <xsl:otherwise>
6187
- <xsl:apply-templates select="node()[not(self::mn:name) and not(self::mn:note) and not(self::mn:example) and not(self::mn:dl) and not(self::mn:source) and not(self::mn:p) and not(self::mn:thead) and not(self::mn:tfoot) and not(self::mn:fmt-footnote-container)]"/> <!-- process all table' elements, except name, header, footer, note, source and dl which render separaterely -->
6210
+ <xsl:apply-templates select="node()[not(self::mn:fmt-name) and not(self::mn:note) and not(self::mn:example) and not(self::mn:dl) and not(self::mn:fmt-source) and not(self::mn:p) and not(self::mn:thead) and not(self::mn:tfoot) and not(self::mn:fmt-footnote-container)]"/> <!-- process all table' elements, except name, header, footer, note, source and dl which render separaterely -->
6188
6211
  </xsl:otherwise>
6189
6212
  </xsl:choose>
6190
6213
 
@@ -6281,7 +6304,7 @@
6281
6304
  </xsl:template>
6282
6305
 
6283
6306
  <!-- table/name-->
6284
- <xsl:template match="*[local-name()='table']/mn:name">
6307
+ <xsl:template match="*[local-name()='table']/mn:fmt-name">
6285
6308
  <xsl:param name="continued"/>
6286
6309
  <xsl:param name="cols-count"/>
6287
6310
  <xsl:if test="normalize-space() != ''">
@@ -6346,7 +6369,7 @@
6346
6369
  </xsl:template>
6347
6370
 
6348
6371
  <!-- SOURCE: ... -->
6349
- <xsl:template match="*[local-name()='table']/mn:source" priority="2">
6372
+ <xsl:template match="*[local-name()='table']/mn:fmt-source" priority="2">
6350
6373
  <xsl:call-template name="termsource"/>
6351
6374
  </xsl:template>
6352
6375
 
@@ -6511,11 +6534,11 @@
6511
6534
  <xsl:value-of select="translate(., $zero_width_space, ' ')"/><xsl:text> </xsl:text>
6512
6535
  </xsl:template>
6513
6536
 
6514
- <xsl:template match="mn:termsource" mode="td_text">
6515
- <xsl:value-of select="*[local-name()='origin']/@citeas"/>
6537
+ <xsl:template match="mn:fmt-termsource" mode="td_text">
6538
+ <xsl:value-of select="mn:fmt-origin/@citeas"/>
6516
6539
  </xsl:template>
6517
6540
 
6518
- <xsl:template match="mn:link" mode="td_text">
6541
+ <xsl:template match="mn:fmt-link" mode="td_text">
6519
6542
  <xsl:value-of select="@target"/>
6520
6543
  </xsl:template>
6521
6544
 
@@ -6717,12 +6740,12 @@
6717
6740
 
6718
6741
  <xsl:call-template name="refine_table-header-title-style"/>
6719
6742
 
6720
- <xsl:apply-templates select="ancestor::mn:table/mn:name">
6743
+ <xsl:apply-templates select="ancestor::mn:table/mn:fmt-name">
6721
6744
  <xsl:with-param name="continued">true</xsl:with-param>
6722
6745
  <xsl:with-param name="cols-count" select="$cols-count"/>
6723
6746
  </xsl:apply-templates>
6724
6747
 
6725
- <xsl:if test="not(ancestor::mn:table/mn:name)"> <!-- to prevent empty fo:table-cell in case of missing table's name -->
6748
+ <xsl:if test="not(ancestor::mn:table/mn:fmt-name)"> <!-- to prevent empty fo:table-cell in case of missing table's name -->
6726
6749
  <fo:block role="SKIP"/>
6727
6750
  </xsl:if>
6728
6751
 
@@ -6757,7 +6780,7 @@
6757
6780
  <xsl:param name="colwidths"/>
6758
6781
  <xsl:param name="colgroup"/>
6759
6782
 
6760
- <xsl:variable name="isNoteOrFnExist" select="../mn:note[not(@type = 'units')] or ../mn:example or ../mn:dl or ..//mn:fn[local-name(..) != 'name'] or ../mn:source or ../mn:p"/>
6783
+ <xsl:variable name="isNoteOrFnExist" select="../mn:note[not(@type = 'units')] or ../mn:example or ../mn:dl or ..//mn:fn[not(parent::mn:fmt-name)] or ../mn:fmt-source or ../mn:p"/>
6761
6784
 
6762
6785
  <xsl:variable name="isNoteOrFnExistShowAfterTable">
6763
6786
  </xsl:variable>
@@ -6798,6 +6821,12 @@
6798
6821
  </xsl:choose>
6799
6822
  </xsl:for-each>
6800
6823
 
6824
+ <xsl:for-each select="ancestor::mn:table[1]">
6825
+ <xsl:call-template name="setTableStyles">
6826
+ <xsl:with-param name="scope">table</xsl:with-param>
6827
+ </xsl:call-template>
6828
+ </xsl:for-each>
6829
+
6801
6830
  <xsl:choose>
6802
6831
  <xsl:when test="xalan:nodeset($colgroup)//mn:col">
6803
6832
  <xsl:for-each select="xalan:nodeset($colgroup)//mn:col">
@@ -6814,10 +6843,22 @@
6814
6843
 
6815
6844
  <fo:table-body role="SKIP">
6816
6845
  <fo:table-row role="SKIP">
6846
+ <xsl:for-each select="ancestor::mn:table[1]">
6847
+ <xsl:call-template name="setTableStyles">
6848
+ <xsl:with-param name="scope">ancestor_table</xsl:with-param>
6849
+ </xsl:call-template>
6850
+ </xsl:for-each>
6851
+
6817
6852
  <fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}" role="SKIP">
6818
6853
 
6819
6854
  <xsl:call-template name="refine_table-footer-cell-style"/>
6820
6855
 
6856
+ <xsl:for-each select="ancestor::mn:table[1]">
6857
+ <xsl:call-template name="setTableStyles">
6858
+ <xsl:with-param name="scope">ancestor_table_borders_only</xsl:with-param>
6859
+ </xsl:call-template>
6860
+ </xsl:for-each>
6861
+
6821
6862
  <xsl:call-template name="setBordersTableArray"/>
6822
6863
 
6823
6864
  <!-- fn will be processed inside 'note' processing -->
@@ -6825,7 +6866,7 @@
6825
6866
  <xsl:apply-templates select="../mn:dl"/>
6826
6867
  <xsl:apply-templates select="../mn:note[not(@type = 'units')]"/>
6827
6868
  <xsl:apply-templates select="../mn:example"/>
6828
- <xsl:apply-templates select="../mn:source"/>
6869
+ <xsl:apply-templates select="../mn:fmt-source"/>
6829
6870
 
6830
6871
  <xsl:variable name="isDisplayRowSeparator">
6831
6872
  </xsl:variable>
@@ -7012,7 +7053,12 @@
7012
7053
 
7013
7054
  <xsl:template name="setTableRowAttributes">
7014
7055
 
7015
- <xsl:call-template name="setColors"/>
7056
+ <xsl:for-each select="ancestor::mn:table[1]">
7057
+ <xsl:call-template name="setTableStyles">
7058
+ <xsl:with-param name="scope">ancestor_table</xsl:with-param>
7059
+ </xsl:call-template>
7060
+ </xsl:for-each>
7061
+ <xsl:call-template name="setTableStyles"/>
7016
7062
 
7017
7063
  </xsl:template> <!-- setTableRowAttributes -->
7018
7064
  <!-- ===================== -->
@@ -7065,7 +7111,13 @@
7065
7111
  </xsl:attribute>
7066
7112
  </xsl:if>
7067
7113
  <xsl:call-template name="display-align"/>
7068
- <xsl:call-template name="setColors"/>
7114
+
7115
+ <xsl:for-each select="ancestor::mn:table[1]">
7116
+ <xsl:call-template name="setTableStyles">
7117
+ <xsl:with-param name="scope">ancestor_table_borders_only</xsl:with-param>
7118
+ </xsl:call-template>
7119
+ </xsl:for-each>
7120
+ <xsl:call-template name="setTableStyles"/>
7069
7121
  </xsl:template>
7070
7122
 
7071
7123
  <xsl:template name="display-align">
@@ -7081,7 +7133,8 @@
7081
7133
  </xsl:if>
7082
7134
  </xsl:template>
7083
7135
 
7084
- <xsl:template name="setColors">
7136
+ <xsl:template name="setTableStyles">
7137
+ <xsl:param name="scope">cell</xsl:param>
7085
7138
  <xsl:variable name="styles__">
7086
7139
  <xsl:call-template name="split">
7087
7140
  <xsl:with-param name="pText" select="concat(@style,';')"/>
@@ -7090,19 +7143,35 @@
7090
7143
  </xsl:variable>
7091
7144
  <xsl:variable name="quot">"</xsl:variable>
7092
7145
  <xsl:variable name="styles_">
7146
+ <!-- PDF: Borderless tables https://github.com/metanorma/metanorma-jis/issues/344 -->
7147
+ <xsl:if test="@plain = 'true' or ancestor::mn:table/@plain = 'true'">
7148
+ <style name="border-top">none</style>
7149
+ <style name="border-right">none</style>
7150
+ <style name="border-left">none</style>
7151
+ <style name="border-bottom">none</style>
7152
+ <style name="color">inherit</style>
7153
+ <style name="background-color">transparent</style>
7154
+ </xsl:if>
7155
+
7093
7156
  <xsl:for-each select="xalan:nodeset($styles__)/mnx:item">
7094
7157
  <xsl:variable name="key" select="normalize-space(substring-before(., ':'))"/>
7095
7158
  <xsl:variable name="value" select="normalize-space(substring-after(translate(.,$quot,''), ':'))"/>
7096
- <xsl:if test="$key = 'color' or $key = 'background-color' or $key = 'border' or $key = 'border-top' or $key = 'border-right' or $key = 'border-left' or $key = 'border-bottom' or $key = 'border-style' or $key = 'border-width' or $key = 'border-color' or $key = 'border-top-style' or $key = 'border-top-width' or $key = 'border-top-color' or $key = 'border-right-style' or $key = 'border-right-width' or $key = 'border-right-color' or $key = 'border-left-style' or $key = 'border-left-width' or $key = 'border-left-color' or $key = 'border-bottom-style' or $key = 'border-bottom-width' or $key = 'border-bottom-color'">
7159
+ <xsl:if test="($key = 'color' and ($scope = 'cell' or $scope = 'table')) or ($key = 'background-color' and ($scope = 'cell' or $scope = 'ancestor_table')) or $key = 'border' or $key = 'border-top' or $key = 'border-right' or $key = 'border-left' or $key = 'border-bottom' or $key = 'border-style' or $key = 'border-width' or $key = 'border-color' or $key = 'border-top-style' or $key = 'border-top-width' or $key = 'border-top-color' or $key = 'border-right-style' or $key = 'border-right-width' or $key = 'border-right-color' or $key = 'border-left-style' or $key = 'border-left-width' or $key = 'border-left-color' or $key = 'border-bottom-style' or $key = 'border-bottom-width' or $key = 'border-bottom-color'">
7097
7160
  <style name="{$key}"><xsl:value-of select="java:replaceAll(java:java.lang.String.new($value), 'currentColor', 'inherit')"/></style>
7098
7161
  </xsl:if>
7162
+ <xsl:if test="$key = 'border' and ($scope = 'table' or $scope = 'ancestor_table' or $scope = 'ancestor_table_borders_only')">
7163
+ <style name="{$key}-top"><xsl:value-of select="$value"/></style>
7164
+ <style name="{$key}-right"><xsl:value-of select="$value"/></style>
7165
+ <style name="{$key}-left"><xsl:value-of select="$value"/></style>
7166
+ <style name="{$key}-bottom"><xsl:value-of select="$value"/></style>
7167
+ </xsl:if>
7099
7168
  </xsl:for-each>
7100
7169
  </xsl:variable>
7101
7170
  <xsl:variable name="styles" select="xalan:nodeset($styles_)"/>
7102
7171
  <xsl:for-each select="$styles/style">
7103
7172
  <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
7104
7173
  </xsl:for-each>
7105
- </xsl:template> <!-- setColors -->
7174
+ </xsl:template> <!-- setTableStyles -->
7106
7175
 
7107
7176
  <!-- cell in table body, footer -->
7108
7177
  <xsl:template match="*[local-name()='td']" name="td">
@@ -7166,11 +7235,11 @@
7166
7235
 
7167
7236
  <xsl:call-template name="refine_table-note-name-style"/>
7168
7237
 
7169
- <xsl:apply-templates select="mn:name"/>
7238
+ <xsl:apply-templates select="mn:fmt-name"/>
7170
7239
 
7171
7240
  </fo:inline>
7172
7241
 
7173
- <xsl:apply-templates select="node()[not(self::mn:name)]"/>
7242
+ <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
7174
7243
  </fo:block>
7175
7244
  </xsl:template> <!-- table/note -->
7176
7245
 
@@ -7310,7 +7379,7 @@
7310
7379
 
7311
7380
  <!-- footnotes for table's name rendering -->
7312
7381
  <xsl:template name="table_name_fn_display">
7313
- <xsl:for-each select="mn:name//mn:fn">
7382
+ <xsl:for-each select="mn:fmt-name//mn:fn">
7314
7383
  <xsl:variable name="reference" select="@reference"/>
7315
7384
  <fo:block id="{@reference}_{ancestor::*[@id][1]/@id}"><xsl:value-of select="@reference"/></fo:block>
7316
7385
  <fo:block margin-bottom="12pt">
@@ -7967,7 +8036,7 @@
7967
8036
  </xsl:if> -->
7968
8037
 
7969
8038
  <xsl:variable name="words">
7970
- <xsl:for-each select=".//*[local-name() = 'image' or local-name() = 'stem']">
8039
+ <xsl:for-each select=".//*[local-name() = 'image' or local-name() = 'fmt-stem']">
7971
8040
  <word>
7972
8041
  <xsl:copy-of select="."/>
7973
8042
  </word>
@@ -8026,7 +8095,7 @@
8026
8095
  </xsl:copy>
8027
8096
  </xsl:template>
8028
8097
 
8029
- <xsl:template match="*[local-name() = 'stem' or local-name() = 'image']" mode="td_text_with_formatting"/>
8098
+ <xsl:template match="*[local-name() = 'fmt-stem' or local-name() = 'image']" mode="td_text_with_formatting"/>
8030
8099
 
8031
8100
  <xsl:template match="*[local-name() = 'keep-together_within-line']/text()" mode="td_text_with_formatting">
8032
8101
  <xsl:variable name="formatting_tags">
@@ -8061,7 +8130,7 @@
8061
8130
  </xsl:call-template>
8062
8131
  </xsl:template>
8063
8132
 
8064
- <xsl:template match="mn:link[normalize-space() = '']" mode="td_text_with_formatting">
8133
+ <xsl:template match="mn:fmt-link[normalize-space() = '']" mode="td_text_with_formatting">
8065
8134
  <xsl:variable name="link">
8066
8135
  <link_updated>
8067
8136
  <xsl:variable name="target_text">
@@ -8279,7 +8348,7 @@
8279
8348
 
8280
8349
  <xsl:call-template name="refine_multicomponent_block_style"/>
8281
8350
 
8282
- <xsl:apply-templates select="mn:name">
8351
+ <xsl:apply-templates select="mn:fmt-name">
8283
8352
  <xsl:with-param name="process">true</xsl:with-param>
8284
8353
  </xsl:apply-templates>
8285
8354
 
@@ -8491,7 +8560,7 @@
8491
8560
  </xsl:template> <!-- refine_multicomponent_block_style -->
8492
8561
 
8493
8562
  <!-- dl/name -->
8494
- <xsl:template match="mn:dl/mn:name">
8563
+ <xsl:template match="mn:dl/mn:fmt-name">
8495
8564
  <xsl:param name="process">false</xsl:param>
8496
8565
  <xsl:if test="$process = 'true'">
8497
8566
  <fo:block xsl:use-attribute-sets="dl-name-style">
@@ -8907,12 +8976,12 @@
8907
8976
  <xsl:template match="mn:appendix">
8908
8977
  <xsl:call-template name="setNamedDestination"/>
8909
8978
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
8910
- <xsl:apply-templates select="mn:title"/>
8979
+ <xsl:apply-templates select="mn:fmt-title"/>
8911
8980
  </fo:block>
8912
- <xsl:apply-templates select="node()[not(local-name()='title')]"/>
8981
+ <xsl:apply-templates select="node()[not(self::mn:fmt-title)]"/>
8913
8982
  </xsl:template>
8914
8983
 
8915
- <xsl:template match="mn:appendix/mn:title" priority="2">
8984
+ <xsl:template match="mn:appendix/mn:fmt-title" priority="2">
8916
8985
  <xsl:variable name="level">
8917
8986
  <xsl:call-template name="getLevel"/>
8918
8987
  </xsl:variable>
@@ -8925,15 +8994,15 @@
8925
8994
  <xsl:template match="mn:appendix//mn:example" priority="2">
8926
8995
  <xsl:call-template name="setNamedDestination"/>
8927
8996
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
8928
- <xsl:apply-templates select="mn:name"/>
8997
+ <xsl:apply-templates select="mn:fmt-name"/>
8929
8998
  </fo:block>
8930
- <xsl:apply-templates select="node()[not(local-name()='name')]"/>
8999
+ <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
8931
9000
  </xsl:template>
8932
9001
 
8933
9002
  <xsl:attribute-set name="xref-style">
8934
9003
  </xsl:attribute-set>
8935
9004
 
8936
- <xsl:template match="mn:xref">
9005
+ <xsl:template match="mn:fmt-xref">
8937
9006
  <xsl:call-template name="insert_basic_link">
8938
9007
  <xsl:with-param name="element">
8939
9008
  <xsl:variable name="alt_text">
@@ -8953,7 +9022,7 @@
8953
9022
  </xsl:template> <!-- xref -->
8954
9023
 
8955
9024
  <!-- command between two xref points to non-standard bibitem -->
8956
- <xsl:template match="text()[. = ','][preceding-sibling::node()[1][self::mn:sup][mn:xref[@type = 'footnote']] and following-sibling::node()[1][self::mn:sup][mn:xref[@type = 'footnote']]]"><xsl:value-of select="."/>
9025
+ <xsl:template match="text()[. = ','][preceding-sibling::node()[1][self::mn:sup][mn:fmt-xref[@type = 'footnote']] and following-sibling::node()[1][self::mn:sup][mn:fmt-xref[@type = 'footnote']]]"><xsl:value-of select="."/>
8957
9026
  </xsl:template>
8958
9027
 
8959
9028
  <xsl:attribute-set name="eref-style">
@@ -8984,7 +9053,7 @@
8984
9053
  <!-- ====== -->
8985
9054
  <!-- eref -->
8986
9055
  <!-- ====== -->
8987
- <xsl:template match="mn:eref" name="eref">
9056
+ <xsl:template match="mn:fmt-eref" name="eref">
8988
9057
  <xsl:variable name="current_bibitemid" select="@bibitemid"/>
8989
9058
  <!-- <xsl:variable name="external-destination" select="normalize-space(key('bibitems', $current_bibitemid)/mn:uri[@type = 'citation'])"/> -->
8990
9059
  <xsl:variable name="external-destination" select="normalize-space($bibitems/mn:bibitem[@id = $current_bibitemid]/mn:uri[@type = 'citation'])"/>
@@ -9109,7 +9178,10 @@
9109
9178
 
9110
9179
  <xsl:call-template name="setNamedDestination"/>
9111
9180
 
9112
- <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
9181
+ <fo:block-container xsl:use-attribute-sets="note-style" role="SKIP">
9182
+ <xsl:if test="not(parent::mn:references)">
9183
+ <xsl:copy-of select="@id"/>
9184
+ </xsl:if>
9113
9185
 
9114
9186
  <xsl:call-template name="setBlockSpanAll"/>
9115
9187
 
@@ -9122,28 +9194,28 @@
9122
9194
 
9123
9195
  <fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
9124
9196
 
9125
- <xsl:apply-templates select="mn:name/mn:tab" mode="tab"/>
9197
+ <xsl:apply-templates select="mn:fmt-name/mn:tab" mode="tab"/>
9126
9198
 
9127
9199
  <xsl:call-template name="refine_note-name-style"/>
9128
9200
 
9129
9201
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
9130
9202
  <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
9131
- <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and mn:add]">
9203
+ <xsl:if test="*[not(self::mn:fmt-name)][1][count(node()[normalize-space() != '']) = 1 and mn:add]">
9132
9204
  <xsl:call-template name="append_add-style"/>
9133
9205
  </xsl:if>
9134
9206
 
9135
9207
  <!-- if note contains only one element and first and last childs are `add` ace-tag, then move start ace-tag before NOTE's name-->
9136
- <xsl:if test="count(*[not(self::mn:name)]) = 1 and *[not(self::mn:name)]/node()[last()][self::mn:add][starts-with(text(), $ace_tag)]">
9137
- <xsl:apply-templates select="*[not(self::mn:name)]/node()[1][self::mn:add][starts-with(text(), $ace_tag)]">
9208
+ <xsl:if test="count(*[not(self::mn:fmt-name)]) = 1 and *[not(self::mn:fmt-name)]/node()[last()][self::mn:add][starts-with(text(), $ace_tag)]">
9209
+ <xsl:apply-templates select="*[not(self::mn:fmt-name)]/node()[1][self::mn:add][starts-with(text(), $ace_tag)]">
9138
9210
  <xsl:with-param name="skip">false</xsl:with-param>
9139
9211
  </xsl:apply-templates>
9140
9212
  </xsl:if>
9141
9213
 
9142
- <xsl:apply-templates select="mn:name"/>
9214
+ <xsl:apply-templates select="mn:fmt-name"/>
9143
9215
 
9144
9216
  </fo:inline>
9145
9217
 
9146
- <xsl:apply-templates select="node()[not(self::mn:name)]"/>
9218
+ <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
9147
9219
  </fo:block>
9148
9220
  </fo:block-container>
9149
9221
  </fo:block-container>
@@ -9185,19 +9257,19 @@
9185
9257
 
9186
9258
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
9187
9259
  <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
9188
- <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and mn:add]">
9260
+ <xsl:if test="*[not(self::mn:fmt-name)][1][count(node()[normalize-space() != '']) = 1 and mn:add]">
9189
9261
  <xsl:call-template name="append_add-style"/>
9190
9262
  </xsl:if>
9191
9263
 
9192
- <xsl:apply-templates select="mn:name"/>
9264
+ <xsl:apply-templates select="mn:fmt-name"/>
9193
9265
 
9194
9266
  </fo:inline>
9195
9267
 
9196
- <xsl:apply-templates select="node()[not(self::mn:name)]"/>
9268
+ <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
9197
9269
  </fo:block>
9198
9270
  </xsl:template>
9199
9271
 
9200
- <xsl:template match="mn:note/mn:name">
9272
+ <xsl:template match="mn:note/mn:fmt-name">
9201
9273
  <xsl:param name="sfx"/>
9202
9274
  <xsl:variable name="suffix">
9203
9275
  <xsl:choose>
@@ -9224,7 +9296,7 @@
9224
9296
  </xsl:if>
9225
9297
  </xsl:template>
9226
9298
 
9227
- <xsl:template match="mn:termnote/mn:name">
9299
+ <xsl:template match="mn:termnote/mn:fmt-name">
9228
9300
  <xsl:param name="sfx"/>
9229
9301
  <xsl:variable name="suffix">
9230
9302
  <xsl:choose>
@@ -9306,15 +9378,15 @@
9306
9378
 
9307
9379
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
9308
9380
  <fo:block role="BlockQuote">
9309
- <xsl:apply-templates select="./node()[not(self::mn:author) and not(self::mn:source) and not(self::mn:attribution)]"/> <!-- process all nested nodes, except author and source -->
9381
+ <xsl:apply-templates select="./node()[not(self::mn:author) and not(self::mn:fmt-source) and not(self::mn:attribution)]"/> <!-- process all nested nodes, except author and source -->
9310
9382
  </fo:block>
9311
9383
  </fo:block-container>
9312
9384
  </fo:block-container>
9313
- <xsl:if test="mn:author or mn:source or mn:attribution">
9385
+ <xsl:if test="mn:author or mn:fmt-source or mn:attribution">
9314
9386
  <fo:block xsl:use-attribute-sets="quote-source-style">
9315
9387
  <!-- — ISO, ISO 7301:2011, Clause 1 -->
9316
9388
  <xsl:apply-templates select="mn:author"/>
9317
- <xsl:apply-templates select="mn:source"/>
9389
+ <xsl:apply-templates select="mn:fmt-source"/>
9318
9390
  <!-- added for https://github.com/metanorma/isodoc/issues/607 -->
9319
9391
  <xsl:apply-templates select="mn:attribution/mn:p/node()"/>
9320
9392
  </fo:block>
@@ -9324,17 +9396,32 @@
9324
9396
  </fo:block-container>
9325
9397
  </xsl:template>
9326
9398
 
9327
- <xsl:template match="mn:source">
9399
+ <xsl:template match="mn:fmt-source">
9328
9400
  <xsl:if test="../mn:author">
9329
9401
  <xsl:text>, </xsl:text>
9330
9402
  </xsl:if>
9331
- <xsl:call-template name="insert_basic_link">
9332
- <xsl:with-param name="element">
9333
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
9334
- <xsl:apply-templates/>
9335
- </fo:basic-link>
9336
- </xsl:with-param>
9337
- </xsl:call-template>
9403
+ <xsl:choose>
9404
+ <xsl:when test="not(parent::quote)">
9405
+ <fo:block>
9406
+ <xsl:call-template name="insert_basic_link">
9407
+ <xsl:with-param name="element">
9408
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
9409
+ <xsl:apply-templates/>
9410
+ </fo:basic-link>
9411
+ </xsl:with-param>
9412
+ </xsl:call-template>
9413
+ </fo:block>
9414
+ </xsl:when>
9415
+ <xsl:otherwise>
9416
+ <xsl:call-template name="insert_basic_link">
9417
+ <xsl:with-param name="element">
9418
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
9419
+ <xsl:apply-templates/>
9420
+ </fo:basic-link>
9421
+ </xsl:with-param>
9422
+ </xsl:call-template>
9423
+ </xsl:otherwise>
9424
+ </xsl:choose>
9338
9425
  </xsl:template>
9339
9426
 
9340
9427
  <xsl:template match="mn:author">
@@ -9412,7 +9499,7 @@
9412
9499
  <ancestor><xsl:copy-of select="ancestor::mn:figure[.//mn:name[.//mn:fn]]"/></ancestor> -->
9413
9500
  <xsl:choose>
9414
9501
  <!-- skip figure/name/fn -->
9415
- <xsl:when test="ancestor::mn:figure[.//mn:name[.//mn:fn[@target = $curr_id]]]"><!-- skip --></xsl:when>
9502
+ <xsl:when test="ancestor::mn:figure[.//mn:fmt-name[.//mn:fn[@target = $curr_id]]]"><!-- skip --></xsl:when>
9416
9503
  <xsl:otherwise>
9417
9504
  <xsl:element name="figure" namespace="{$namespace_full}">
9418
9505
  <xsl:element name="fmt-footnote-container" namespace="{$namespace_full}">
@@ -9613,17 +9700,17 @@
9613
9700
 
9614
9701
  <fo:block xsl:use-attribute-sets="figure-style" role="SKIP">
9615
9702
 
9616
- <xsl:for-each select="mn:name"> <!-- set context -->
9703
+ <xsl:for-each select="mn:fmt-name"> <!-- set context -->
9617
9704
  <xsl:call-template name="setIDforNamedDestination"/>
9618
9705
  </xsl:for-each>
9619
9706
 
9620
- <xsl:apply-templates select="node()[not(self::mn:name) and not(self::mn:note and @type = 'units')]"/>
9707
+ <xsl:apply-templates select="node()[not(self::mn:fmt-name) and not(self::mn:note and @type = 'units')]"/>
9621
9708
  </fo:block>
9622
9709
 
9623
9710
  <xsl:if test="normalize-space($show_figure_key_in_block_container) = 'true'">
9624
9711
  <xsl:call-template name="showFigureKey"/>
9625
9712
  </xsl:if>
9626
- <xsl:apply-templates select="mn:name"/> <!-- show figure's name AFTER image -->
9713
+ <xsl:apply-templates select="mn:fmt-name"/> <!-- show figure's name AFTER image -->
9627
9714
 
9628
9715
  </fo:block-container>
9629
9716
  </xsl:template>
@@ -9649,9 +9736,9 @@
9649
9736
  <xsl:template match="mn:figure[@class = 'pseudocode']">
9650
9737
  <xsl:call-template name="setNamedDestination"/>
9651
9738
  <fo:block id="{@id}">
9652
- <xsl:apply-templates select="node()[not(self::mn:name)]"/>
9739
+ <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
9653
9740
  </fo:block>
9654
- <xsl:apply-templates select="mn:name"/>
9741
+ <xsl:apply-templates select="mn:fmt-name"/>
9655
9742
  </xsl:template>
9656
9743
 
9657
9744
  <xsl:template match="mn:figure[@class = 'pseudocode']//mn:p">
@@ -9662,7 +9749,7 @@
9662
9749
 
9663
9750
  <!-- SOURCE: ... -->
9664
9751
  <!-- figure/source -->
9665
- <xsl:template match="mn:figure/mn:source" priority="2">
9752
+ <xsl:template match="mn:figure/mn:fmt-source" priority="2">
9666
9753
  <xsl:call-template name="termsource"/>
9667
9754
  </xsl:template>
9668
9755
 
@@ -9672,7 +9759,7 @@
9672
9759
  <xsl:variable name="isAdded" select="../@added"/>
9673
9760
  <xsl:variable name="isDeleted" select="../@deleted"/>
9674
9761
  <xsl:choose>
9675
- <xsl:when test="ancestor::mn:title or not(parent::mn:figure) or parent::mn:p"> <!-- inline image ( 'image:path' in adoc, with one colon after image) -->
9762
+ <xsl:when test="ancestor::mn:fmt-title or not(parent::mn:figure) or parent::mn:p"> <!-- inline image ( 'image:path' in adoc, with one colon after image) -->
9676
9763
  <fo:inline padding-left="1mm" padding-right="1mm">
9677
9764
  <xsl:if test="not(parent::mn:figure) or parent::mn:p">
9678
9765
  <xsl:attribute name="padding-left">0mm</xsl:attribute>
@@ -9693,13 +9780,26 @@
9693
9780
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" vertical-align="middle">
9694
9781
 
9695
9782
  <xsl:if test="parent::mn:logo"> <!-- publisher's logo -->
9696
- <xsl:attribute name="width">100%</xsl:attribute>
9783
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
9784
+ <xsl:choose>
9785
+ <xsl:when test="@width and not(@height)">
9786
+ <xsl:attribute name="width">100%</xsl:attribute>
9787
+ <xsl:attribute name="content-height">100%</xsl:attribute>
9788
+ </xsl:when>
9789
+ <xsl:when test="@height and not(@width)">
9790
+ <xsl:attribute name="height">100%</xsl:attribute>
9791
+ <xsl:attribute name="content-height"><xsl:value-of select="@height"/></xsl:attribute>
9792
+ </xsl:when>
9793
+ <xsl:when test="not(@width) and not(@height)">
9794
+ <xsl:attribute name="content-height">100%</xsl:attribute>
9795
+ </xsl:when>
9796
+ </xsl:choose>
9797
+
9697
9798
  <xsl:if test="normalize-space($logo_width) != ''">
9698
9799
  <xsl:attribute name="width"><xsl:value-of select="$logo_width"/></xsl:attribute>
9699
9800
  </xsl:if>
9700
- <xsl:attribute name="content-height">100%</xsl:attribute>
9701
9801
  <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
9702
- <xsl:attribute name="scaling">uniform</xsl:attribute>
9802
+ <xsl:attribute name="vertical-align">top</xsl:attribute>
9703
9803
  </xsl:if>
9704
9804
 
9705
9805
  <xsl:variable name="width">
@@ -9988,7 +10088,7 @@
9988
10088
  <xsl:variable name="width_effective_px" select="$width_effective div 25.4 * $image_dpi"/>
9989
10089
  <xsl:variable name="height_effective_px" select="$height_effective div 25.4 * $image_dpi"/>
9990
10090
 
9991
- <xsl:template match="mn:figure[not(mn:image) and *[local-name() = 'svg']]/mn:name/mn:bookmark" priority="2"/>
10091
+ <xsl:template match="mn:figure[not(mn:image) and *[local-name() = 'svg']]/mn:fmt-name/mn:bookmark" priority="2"/>
9992
10092
  <xsl:template match="mn:figure[not(mn:image)]/*[local-name() = 'svg']" priority="2" name="image_svg">
9993
10093
  <xsl:param name="name"/>
9994
10094
 
@@ -9998,8 +10098,8 @@
9998
10098
 
9999
10099
  <xsl:variable name="alt-text">
10000
10100
  <xsl:choose>
10001
- <xsl:when test="normalize-space(../mn:name) != ''">
10002
- <xsl:value-of select="../mn:name"/>
10101
+ <xsl:when test="normalize-space(../mn:fmt-name) != ''">
10102
+ <xsl:value-of select="../mn:fmt-name"/>
10003
10103
  </xsl:when>
10004
10104
  <xsl:when test="normalize-space($name) != ''">
10005
10105
  <xsl:value-of select="$name"/>
@@ -10008,7 +10108,7 @@
10008
10108
  </xsl:choose>
10009
10109
  </xsl:variable>
10010
10110
 
10011
- <xsl:variable name="isPrecedingTitle" select="normalize-space(ancestor::mn:figure/preceding-sibling::*[1][self::mn:title] and 1 = 1)"/>
10111
+ <xsl:variable name="isPrecedingTitle" select="normalize-space(ancestor::mn:figure/preceding-sibling::*[1][self::mn:fmt-title] and 1 = 1)"/>
10012
10112
 
10013
10113
  <xsl:choose>
10014
10114
  <xsl:when test=".//*[local-name() = 'a'][*[local-name() = 'rect'] or *[local-name() = 'polygon'] or *[local-name() = 'circle'] or *[local-name() = 'ellipse']]">
@@ -10057,9 +10157,9 @@
10057
10157
  <fo:table-cell column-number="2">
10058
10158
  <fo:block>
10059
10159
  <fo:block-container width="{$width_scale}px" height="{$height_scale}px">
10060
- <xsl:if test="../mn:name/mn:bookmark">
10160
+ <xsl:if test="../mn:fmt-name/mn:bookmark">
10061
10161
  <fo:block line-height="0" font-size="0">
10062
- <xsl:for-each select="../mn:name/mn:bookmark">
10162
+ <xsl:for-each select="../mn:fmt-name/mn:bookmark">
10063
10163
  <xsl:call-template name="bookmark"/>
10064
10164
  </xsl:for-each>
10065
10165
  </fo:block>
@@ -10299,7 +10399,7 @@
10299
10399
 
10300
10400
  <!-- image with svg and emf -->
10301
10401
  <xsl:template match="mn:figure/mn:image[*[local-name() = 'svg']]" priority="3">
10302
- <xsl:variable name="name" select="ancestor::mn:figure/mn:name"/>
10402
+ <xsl:variable name="name" select="ancestor::mn:figure/mn:fmt-name"/>
10303
10403
  <xsl:for-each select="*[local-name() = 'svg']">
10304
10404
  <xsl:call-template name="image_svg">
10305
10405
  <xsl:with-param name="name" select="$name"/>
@@ -10316,7 +10416,7 @@
10316
10416
 
10317
10417
  <xsl:template match="mn:figure/mn:image[@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
10318
10418
  <xsl:variable name="svg_content" select="document(@src)"/>
10319
- <xsl:variable name="name" select="ancestor::mn:figure/mn:name"/>
10419
+ <xsl:variable name="name" select="ancestor::mn:figure/mn:fmt-name"/>
10320
10420
  <xsl:for-each select="xalan:nodeset($svg_content)/node()">
10321
10421
  <xsl:call-template name="image_svg">
10322
10422
  <xsl:with-param name="name" select="$name"/>
@@ -10439,7 +10539,7 @@
10439
10539
  <xsl:template match="mn:emf"/>
10440
10540
 
10441
10541
  <!-- figure/name -->
10442
- <xsl:template match="mn:figure/mn:name | mn:image/mn:name">
10542
+ <xsl:template match="mn:figure/mn:fmt-name | mn:image/mn:fmt-name">
10443
10543
  <xsl:if test="normalize-space() != ''">
10444
10544
  <fo:block xsl:use-attribute-sets="figure-name-style">
10445
10545
 
@@ -10509,25 +10609,25 @@
10509
10609
  <fo:block-container margin-left="0mm" role="SKIP">
10510
10610
  <xsl:call-template name="setNamedDestination"/>
10511
10611
  <fo:block id="{@id}">
10512
- <xsl:apply-templates select="node()[not(self::mn:name)]"/> <!-- formula's number will be process in 'stem' template -->
10612
+ <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/> <!-- formula's number will be process in 'stem' template -->
10513
10613
  </fo:block>
10514
10614
  </fo:block-container>
10515
10615
  </fo:block-container>
10516
10616
  </xsl:template>
10517
10617
 
10518
- <xsl:template match="mn:formula/mn:dt/mn:stem">
10618
+ <xsl:template match="mn:formula/mn:dt/mn:fmt-stem">
10519
10619
  <fo:inline>
10520
10620
  <xsl:apply-templates/>
10521
10621
  </fo:inline>
10522
10622
  </xsl:template>
10523
10623
 
10524
- <xsl:template match="mn:admitted/mn:stem">
10624
+ <xsl:template match="mn:fmt-admitted/mn:fmt-stem">
10525
10625
  <fo:inline>
10526
10626
  <xsl:apply-templates/>
10527
10627
  </fo:inline>
10528
10628
  </xsl:template>
10529
10629
 
10530
- <xsl:template match="mn:formula/mn:name"> <!-- show in 'stem' template -->
10630
+ <xsl:template match="mn:formula/mn:fmt-name"> <!-- show in 'stem' template -->
10531
10631
  <!-- https://github.com/metanorma/isodoc/issues/607
10532
10632
  <xsl:if test="normalize-space() != ''">
10533
10633
  <xsl:text>(</xsl:text><xsl:apply-templates /><xsl:text>)</xsl:text>
@@ -10536,7 +10636,7 @@
10536
10636
  </xsl:template>
10537
10637
 
10538
10638
  <!-- stem inside formula with name (with formula's number) -->
10539
- <xsl:template match="mn:formula[mn:name]/mn:stem">
10639
+ <xsl:template match="mn:formula[mn:fmt-name]/mn:fmt-stem">
10540
10640
  <fo:block xsl:use-attribute-sets="formula-style">
10541
10641
 
10542
10642
  <fo:table table-layout="fixed" width="100%">
@@ -10556,13 +10656,13 @@
10556
10656
 
10557
10657
  <fo:block xsl:use-attribute-sets="formula-stem-number-style" role="SKIP">
10558
10658
 
10559
- <xsl:for-each select="../mn:name">
10659
+ <xsl:for-each select="../mn:fmt-name">
10560
10660
  <xsl:call-template name="setIDforNamedDestination"/>
10561
10661
  </xsl:for-each>
10562
10662
 
10563
10663
  <xsl:call-template name="refine_formula-stem-number-style"/>
10564
10664
 
10565
- <xsl:apply-templates select="../mn:name"/>
10665
+ <xsl:apply-templates select="../mn:fmt-name"/>
10566
10666
  </fo:block>
10567
10667
  </fo:table-cell>
10568
10668
  </fo:table-row>
@@ -10572,7 +10672,7 @@
10572
10672
  </xsl:template>
10573
10673
 
10574
10674
  <!-- stem inside formula without name (without formula's number) -->
10575
- <xsl:template match="mn:formula[not(mn:name)]/mn:stem">
10675
+ <xsl:template match="mn:formula[not(mn:fmt-name)]/mn:fmt-stem">
10576
10676
  <fo:block xsl:use-attribute-sets="formula-style">
10577
10677
  <fo:block xsl:use-attribute-sets="formula-stem-block-style">
10578
10678
  <xsl:apply-templates/>
@@ -10926,7 +11026,7 @@
10926
11026
  <stem type="AsciiMath"><asciimath>x = 1</asciimath></stem>
10927
11027
  <stem type="AsciiMath"><asciimath>x = 1</asciimath><latexmath>x = 1</latexmath></stem>
10928
11028
  -->
10929
- <xsl:template match="mn:stem[@type = 'AsciiMath'][count(*) = 0]/text() | mn:stem[@type = 'AsciiMath'][mn:asciimath]" priority="3">
11029
+ <xsl:template match="mn:fmt-stem[@type = 'AsciiMath'][count(*) = 0]/text() | mn:fmt-stem[@type = 'AsciiMath'][mn:asciimath]" priority="3">
10930
11030
  <fo:inline xsl:use-attribute-sets="mathml-style">
10931
11031
 
10932
11032
  <xsl:call-template name="refine_mathml-style"/>
@@ -11202,7 +11302,7 @@
11202
11302
 
11203
11303
  <xsl:template match="mn:ul | mn:ol" mode="list" name="list">
11204
11304
 
11205
- <xsl:apply-templates select="mn:name">
11305
+ <xsl:apply-templates select="mn:fmt-name">
11206
11306
  <xsl:with-param name="process">true</xsl:with-param>
11207
11307
  </xsl:apply-templates>
11208
11308
 
@@ -11248,7 +11348,7 @@
11248
11348
 
11249
11349
  <xsl:call-template name="refine_list-style"/>
11250
11350
 
11251
- <xsl:if test="mn:name">
11351
+ <xsl:if test="mn:fmt-name">
11252
11352
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
11253
11353
  </xsl:if>
11254
11354
 
@@ -11263,7 +11363,7 @@
11263
11363
  <xsl:template name="refine_list-style_provisional-distance-between-starts">
11264
11364
  </xsl:template> <!-- refine_list-style_provisional-distance-between-starts -->
11265
11365
 
11266
- <xsl:template match="*[self::mn:ol or self::mn:ul]/mn:name">
11366
+ <xsl:template match="*[self::mn:ol or self::mn:ul]/mn:fmt-name">
11267
11367
  <xsl:param name="process">false</xsl:param>
11268
11368
  <xsl:if test="$process = 'true'">
11269
11369
  <fo:block xsl:use-attribute-sets="list-name-style">
@@ -11390,7 +11490,7 @@
11390
11490
  -->
11391
11491
  <!-- footnotes in text (title, bibliography, main body), not for tables, figures and names --> <!-- table's, figure's names -->
11392
11492
  <!-- fn in text -->
11393
- <xsl:template match="mn:fn[not(ancestor::*[(self::mn:table or self::mn:figure)] and not(ancestor::mn:name))]" priority="2" name="fn">
11493
+ <xsl:template match="mn:fn[not(ancestor::*[(self::mn:table or self::mn:figure)] and not(ancestor::mn:fmt-name))]" priority="2" name="fn">
11394
11494
  <xsl:param name="footnote_body_from_table">false</xsl:param>
11395
11495
 
11396
11496
  <!-- list of unique footnotes -->
@@ -11515,7 +11615,7 @@
11515
11615
  <!-- commented:
11516
11616
  .//mn:bibitem[ancestor::mn:references]/mn:note |
11517
11617
  because 'fn' there is in biblio-tag -->
11518
- <xsl:for-each select=".//mn:fn[not(ancestor::*[(self::mn:table or self::mn:figure)] and not(ancestor::mn:name))][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
11618
+ <xsl:for-each select=".//mn:fn[not(ancestor::*[(self::mn:table or self::mn:figure)] and not(ancestor::mn:fmt-name))][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
11519
11619
  <!-- copy unique fn -->
11520
11620
  <fn gen_id="{generate-id(.)}">
11521
11621
  <xsl:copy-of select="@*"/>
@@ -11580,7 +11680,7 @@
11580
11680
  <fo:block-container xsl:use-attribute-sets="admonition-container-style" role="SKIP">
11581
11681
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
11582
11682
  <fo:block>
11583
- <xsl:apply-templates select="node()[not(self::mn:name)]"/>
11683
+ <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
11584
11684
  </fo:block>
11585
11685
  </fo:block-container>
11586
11686
  </fo:block-container>
@@ -11606,7 +11706,7 @@
11606
11706
  </xsl:otherwise>
11607
11707
  </xsl:choose> -->
11608
11708
  <xsl:variable name="name">
11609
- <xsl:apply-templates select="mn:name"/>
11709
+ <xsl:apply-templates select="mn:fmt-name"/>
11610
11710
  </xsl:variable>
11611
11711
  <xsl:copy-of select="$name"/>
11612
11712
  <xsl:if test="normalize-space($name) != ''">
@@ -11614,7 +11714,7 @@
11614
11714
  </xsl:if>
11615
11715
  </xsl:template>
11616
11716
 
11617
- <xsl:template match="mn:admonition/mn:name">
11717
+ <xsl:template match="mn:admonition/mn:fmt-name">
11618
11718
  <xsl:apply-templates/>
11619
11719
  </xsl:template>
11620
11720
 
@@ -11739,10 +11839,10 @@
11739
11839
  <xsl:call-template name="setNamedDestination"/>
11740
11840
  <fo:block id="{@id}"/>
11741
11841
 
11742
- <xsl:apply-templates select="mn:title[@columns = 1]"/>
11842
+ <xsl:apply-templates select="mn:fmt-title[@columns = 1]"/>
11743
11843
 
11744
11844
  <fo:block xsl:use-attribute-sets="references-non-normative-style">
11745
- <xsl:apply-templates select="node()[not(self::mn:title and @columns = 1)]"/>
11845
+ <xsl:apply-templates select="node()[not(self::mn:fmt-title and @columns = 1)]"/>
11746
11846
  </fo:block>
11747
11847
  </xsl:template> <!-- references -->
11748
11848
 
@@ -11761,8 +11861,8 @@
11761
11861
  </xsl:template> <!-- bibitem -->
11762
11862
 
11763
11863
  <!-- Bibliography (non-normative references) -->
11764
- <xsl:template match="mn:references[not(@normative='true')]/mn:bibitem" name="bibitem_non_normative" priority="2">
11765
- <xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][self::mn:bibitem] and 1 = 1)"/> <!-- current bibiitem is non-first --> <!-- $namespace = 'csd' or $namespace = 'gb' or $namespace = 'iec' or $namespace = 'ieee' or $namespace = 'iso' or $namespace = 'jcgm' or $namespace = 'm3d' or
11864
+ <xsl:template match="mn:references[not(@normative='true')]/mn:bibitem | mn:references[not(@normative='true')]/mn:note" name="bibitem_non_normative" priority="2">
11865
+ <xsl:param name="skip" select="normalize-space(preceding-sibling::*[not(self::mn:note)][1][self::mn:bibitem] and 1 = 1)"/> <!-- current bibiitem is non-first --> <!-- $namespace = 'csd' or $namespace = 'gb' or $namespace = 'iec' or $namespace = 'ieee' or $namespace = 'iso' or $namespace = 'jcgm' or $namespace = 'm3d' or
11766
11866
  $namespace = 'mpfd' or $namespace = 'ogc' or $namespace = 'ogc-white-paper' -->
11767
11867
  <!-- Example: [1] ISO 9:1995, Information and documentation – Transliteration of Cyrillic characters into Latin characters – Slavic and non-Slavic languages -->
11768
11868
  <xsl:call-template name="setNamedDestination"/>
@@ -11814,7 +11914,7 @@
11814
11914
  </fo:list-item>
11815
11915
  </xsl:otherwise>
11816
11916
  </xsl:choose>
11817
- <xsl:apply-templates select="following-sibling::*[1][self::mn:bibitem]">
11917
+ <xsl:apply-templates select="following-sibling::*[1]"> <!-- [self::mn:bibitem] -->
11818
11918
  <xsl:with-param name="skip">false</xsl:with-param>
11819
11919
  </xsl:apply-templates>
11820
11920
  </xsl:template>
@@ -11831,8 +11931,26 @@
11831
11931
  </xsl:apply-templates>
11832
11932
  <xsl:apply-templates select="mn:formattedref"/>
11833
11933
  <!-- end bibitem processing -->
11934
+
11935
+ <xsl:call-template name="processBibliographyNote"/>
11834
11936
  </xsl:template> <!-- processBibitem (bibitem) -->
11835
11937
 
11938
+ <xsl:template name="processBibliographyNote">
11939
+ <xsl:if test="self::mn:note">
11940
+ <xsl:variable name="note_node">
11941
+ <xsl:element name="{local-name(..)}" namespace="{$namespace_full}"> <!-- save parent context node for determining styles -->
11942
+ <xsl:copy> <!-- skip @id -->
11943
+ <xsl:copy-of select="node()"/>
11944
+ </xsl:copy>
11945
+ </xsl:element>
11946
+ </xsl:variable>
11947
+ <!-- <xsl:for-each select="xalan:nodeset($note_node)//mn:note">
11948
+ <xsl:call-template name="note"/>
11949
+ </xsl:for-each> -->
11950
+ <xsl:call-template name="note"/>
11951
+ </xsl:if>
11952
+ </xsl:template>
11953
+
11836
11954
  <xsl:template match="mn:title" mode="title">
11837
11955
  <fo:inline><xsl:apply-templates/></fo:inline>
11838
11956
  </xsl:template>
@@ -12061,7 +12179,8 @@
12061
12179
  </xsl:copy>
12062
12180
  </xsl:template>
12063
12181
 
12064
- <xsl:template match="mn:xref" mode="index_add_id">
12182
+ <xsl:template match="mn:xref" mode="index_add_id"/>
12183
+ <xsl:template match="mn:fmt-xref" mode="index_add_id">
12065
12184
  <xsl:param name="docid"/>
12066
12185
  <xsl:variable name="id">
12067
12186
  <xsl:call-template name="generateIndexXrefId">
@@ -12103,7 +12222,7 @@
12103
12222
  <xsl:template match="mn:indexsect//mn:li" mode="index_update">
12104
12223
  <xsl:copy>
12105
12224
  <xsl:apply-templates select="@*" mode="index_update"/>
12106
- <xsl:apply-templates select="node()[1]" mode="process_li_element"/>
12225
+ <xsl:apply-templates select="node()[not(self::mn:fmt-name)][1]" mode="process_li_element"/>
12107
12226
  </xsl:copy>
12108
12227
  </xsl:template>
12109
12228
 
@@ -12124,11 +12243,11 @@
12124
12243
  <xsl:value-of select="."/>
12125
12244
  <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
12126
12245
  </xsl:when>
12127
- <xsl:when test="self::* and local-name(.) = 'xref'">
12246
+ <xsl:when test="self::* and local-name(.) = 'fmt-xref'">
12128
12247
  <xsl:variable name="id" select="@id"/>
12129
12248
 
12130
- <xsl:variable name="id_next" select="following-sibling::mn:xref[1]/@id"/>
12131
- <xsl:variable name="id_prev" select="preceding-sibling::mn:xref[1]/@id"/>
12249
+ <xsl:variable name="id_next" select="following-sibling::mn:fmt-xref[1]/@id"/>
12250
+ <xsl:variable name="id_prev" select="preceding-sibling::mn:fmt-xref[1]/@id"/>
12132
12251
 
12133
12252
  <xsl:variable name="pages_">
12134
12253
  <xsl:for-each select="$index/index/item[@id = $id or @id = $id_next or @id = $id_prev]">
@@ -12224,18 +12343,18 @@
12224
12343
  <xsl:variable name="item_number">
12225
12344
  <xsl:number count="mn:li[ancestor::mn:indexsect]" level="any"/>
12226
12345
  </xsl:variable>
12227
- <xsl:variable name="xref_number"><xsl:number count="mn:xref"/></xsl:variable>
12346
+ <xsl:variable name="xref_number"><xsl:number count="mn:fmt-xref"/></xsl:variable>
12228
12347
  <xsl:value-of select="concat($docid_curr, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
12229
12348
  </xsl:template>
12230
12349
 
12231
- <xsl:template match="mn:indexsect/mn:title" priority="4">
12350
+ <xsl:template match="mn:indexsect/mn:fmt-title | mn:indexsect/mn:title" priority="4">
12232
12351
  <fo:block xsl:use-attribute-sets="indexsect-title-style">
12233
12352
  <!-- Index -->
12234
12353
  <xsl:apply-templates/>
12235
12354
  </fo:block>
12236
12355
  </xsl:template>
12237
12356
 
12238
- <xsl:template match="mn:indexsect/mn:clause/mn:title" priority="4">
12357
+ <xsl:template match="mn:indexsect/mn:clause/mn:fmt-title | mn:indexsect/mn:clause/mn:title" priority="4">
12239
12358
  <!-- Letter A, B, C, ... -->
12240
12359
  <fo:block xsl:use-attribute-sets="indexsect-clause-title-style">
12241
12360
  <xsl:apply-templates/>
@@ -12277,12 +12396,12 @@
12277
12396
  <fmt-review-start id="_7ef81cf7-3f6c-4ed4-9c1f-1ba092052bbd" source="_dda23915-8574-ef1e-29a1-822d465a5b97" target="_ecfb2210-3b1b-46a2-b63a-8b8505be6686" end="_dda23915-8574-ef1e-29a1-822d465a5b97" author="" date="2025-03-24T00:00:00Z"/>
12278
12397
  <bookmark id="_dda23915-8574-ef1e-29a1-822d465a5b97"/>
12279
12398
  <fmt-review-end id="_f336a8d0-08a8-4b7f-a1aa-b04688ed40c1" source="_dda23915-8574-ef1e-29a1-822d465a5b97" target="_ecfb2210-3b1b-46a2-b63a-8b8505be6686" start="_dda23915-8574-ef1e-29a1-822d465a5b97" author="" date="2025-03-24T00:00:00Z"/> -->
12280
- <xsl:when test="1 = 2 and preceding-sibling::node()[self::mn:fmt-review-start][@source = $bookmark_id] and following-sibling::node()[self::mn:fmt-review-end][@source = $bookmark_id]">
12399
+ <xsl:when test="1 = 2 and preceding-sibling::node()[self::mn:fmt-annotation-start][@source = $bookmark_id] and following-sibling::node()[self::mn:fmt-annotation-end][@source = $bookmark_id]">
12281
12400
  <!-- skip here, see the template 'fmt-review-start' -->
12282
12401
  </xsl:when>
12283
12402
  <xsl:otherwise>
12284
12403
  <!-- <fo:inline id="{@id}" font-size="1pt"/> -->
12285
- <fo:inline id="{@id}" font-size="1pt"><xsl:if test="preceding-sibling::node()[self::mn:fmt-review-start][@source = $bookmark_id] and following-sibling::node()[self::mn:fmt-review-end][@source = $bookmark_id]"><xsl:attribute name="line-height">0.1</xsl:attribute></xsl:if><xsl:value-of select="$hair_space"/></fo:inline>
12404
+ <fo:inline id="{@id}" font-size="1pt"><xsl:if test="preceding-sibling::node()[self::mn:fmt-annotation-start][@source = $bookmark_id] and following-sibling::node()[self::mn:fmt-annotation-end][@source = $bookmark_id]"><xsl:attribute name="line-height">0.1</xsl:attribute></xsl:if><xsl:value-of select="$hair_space"/></fo:inline>
12286
12405
  <!-- we need to add zero-width space, otherwise this fo:inline is missing in IF xml -->
12287
12406
  <xsl:if test="not(following-sibling::node()[normalize-space() != ''])"><fo:inline font-size="1pt"> </fo:inline></xsl:if>
12288
12407
  </xsl:otherwise>
@@ -12381,6 +12500,48 @@
12381
12500
  <!-- End Form's elements processing -->
12382
12501
  <!-- =================== -->
12383
12502
 
12503
+ <xsl:attribute-set name="toc-style">
12504
+ </xsl:attribute-set>
12505
+
12506
+ <xsl:template name="refine_toc-style">
12507
+ </xsl:template>
12508
+
12509
+ <xsl:attribute-set name="toc-title-style">
12510
+ </xsl:attribute-set>
12511
+
12512
+ <xsl:attribute-set name="toc-title-page-style">
12513
+ </xsl:attribute-set> <!-- toc-title-page-style -->
12514
+
12515
+ <xsl:attribute-set name="toc-item-block-style">
12516
+ </xsl:attribute-set>
12517
+
12518
+ <xsl:template name="refine_toc-item-block-style">
12519
+ </xsl:template>
12520
+
12521
+ <xsl:attribute-set name="toc-item-style">
12522
+ <xsl:attribute name="role">TOCI</xsl:attribute>
12523
+ </xsl:attribute-set> <!-- END: toc-item-style -->
12524
+
12525
+ <xsl:template name="refine_toc-item-style">
12526
+ </xsl:template> <!-- END: refine_toc-item-style -->
12527
+
12528
+ <xsl:attribute-set name="toc-leader-style">
12529
+ </xsl:attribute-set> <!-- END: toc-leader-style -->
12530
+
12531
+ <xsl:attribute-set name="toc-pagenumber-style">
12532
+ </xsl:attribute-set>
12533
+
12534
+ <!-- List of Figures, Tables -->
12535
+ <xsl:attribute-set name="toc-listof-title-style">
12536
+ </xsl:attribute-set>
12537
+
12538
+ <xsl:attribute-set name="toc-listof-item-block-style">
12539
+ </xsl:attribute-set>
12540
+
12541
+ <xsl:attribute-set name="toc-listof-item-style">
12542
+ <xsl:attribute name="role">TOCI</xsl:attribute>
12543
+ </xsl:attribute-set>
12544
+
12384
12545
  <xsl:template name="processPrefaceSectionsDefault_Contents">
12385
12546
  <xsl:variable name="nodes_preface_">
12386
12547
  <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition or @type = 'toc')]">
@@ -12446,7 +12607,7 @@
12446
12607
 
12447
12608
  <xsl:template name="processTables_Contents">
12448
12609
  <mnx:tables>
12449
- <xsl:for-each select="//mn:table[not(ancestor::mn:metanorma-extension)][@id and mn:name and normalize-space(@id) != '']">
12610
+ <xsl:for-each select="//mn:table[not(ancestor::mn:metanorma-extension)][@id and mn:fmt-name and normalize-space(@id) != '']">
12450
12611
  <xsl:choose>
12451
12612
  <xsl:when test="mn:fmt-name">
12452
12613
  <xsl:variable name="fmt_name">
@@ -12468,7 +12629,7 @@
12468
12629
 
12469
12630
  <xsl:template name="processFigures_Contents">
12470
12631
  <mnx:figures>
12471
- <xsl:for-each select="//mn:figure[@id and mn:name and not(@unnumbered = 'true') and normalize-space(@id) != ''] | //*[@id and starts-with(mn:name, 'Figure ') and normalize-space(@id) != '']">
12632
+ <xsl:for-each select="//mn:figure[@id and mn:fmt-name and not(@unnumbered = 'true') and normalize-space(@id) != ''] | //*[@id and starts-with(mn:name, 'Figure ') and normalize-space(@id) != '']">
12472
12633
  <xsl:choose>
12473
12634
  <xsl:when test="mn:fmt-name">
12474
12635
  <xsl:variable name="fmt_name">
@@ -12497,7 +12658,7 @@
12497
12658
 
12498
12659
  <xsl:template match="mn:title[following-sibling::*[1][self::mn:fmt-title]]" mode="contents"/>
12499
12660
 
12500
- <xsl:template match="mn:figure/mn:fmt-name | mn:table/mn:fmt-name | mn:permission/mn:fmt-name | mn:recommendation/mn:fmt-name | mn:requirement/mn:fmt-name" mode="contents">
12661
+ <xsl:template match="mn:figure/mn:fmt-name | mnx:figure/mn:fmt-name | mn:table/mn:fmt-name | mnx:table/mn:fmt-name | mn:permission/mn:fmt-name | mnx:permission/mn:fmt-name | mn:recommendation/mn:fmt-name | mnx:recommendation/mn:fmt-name | mn:requirement/mn:fmt-name | mnx:requirement/mn:fmt-name" mode="contents">
12501
12662
  <xsl:apply-templates mode="contents"/>
12502
12663
  <xsl:text> </xsl:text>
12503
12664
  </xsl:template>
@@ -12509,7 +12670,7 @@
12509
12670
  </xsl:if>
12510
12671
  </xsl:template>
12511
12672
 
12512
- <xsl:template match="mn:figure/mn:fmt-name | mn:table/mn:fmt-name | mn:permission/mn:fmt-name | mn:recommendation/mn:fmt-name | mn:requirement/mn:fmt-name | mn:sourcecode/mn:fmt-name" mode="bookmarks">
12673
+ <xsl:template match="mn:figure/mn:fmt-name | mnx:figure/mn:fmt-name | mn:table/mn:fmt-name | mnx:table/mn:fmt-name | mn:permission/mn:fmt-name | mnx:permission/mn:fmt-name | mn:recommendation/mn:fmt-name | mnx:recommendation/mn:fmt-name | mn:requirement/mn:fmt-name | mnx:requirement/mn:fmt-name | mn:sourcecode/mn:fmt-name | mnx:sourcecode/mn:fmt-name" mode="bookmarks">
12513
12674
  <xsl:apply-templates mode="bookmarks"/>
12514
12675
  <xsl:text> </xsl:text>
12515
12676
  </xsl:template>
@@ -12520,7 +12681,7 @@
12520
12681
  </xsl:if>
12521
12682
  </xsl:template>
12522
12683
 
12523
- <xsl:template match="*[self::mn:figure or self::mn:table or self::mn:permission or self::mn:recommendation or self::mn:requirement]/mn:fmt-name/text()" mode="contents" priority="2">
12684
+ <xsl:template match="*[self::mn:figure or self::mn:table or self::mn:permission or self::mn:recommendation or self::mn:requirement]/mn:fmt-name/text() | *[self::mnx:figure or self::mnx:table or self::mnx:permission or self::mnx:recommendation or self::mnx:requirement]/mn:fmt-name/text()" mode="contents" priority="2">
12524
12685
  <xsl:value-of select="."/>
12525
12686
  </xsl:template>
12526
12687
 
@@ -12530,7 +12691,7 @@
12530
12691
  </xsl:if>
12531
12692
  </xsl:template>
12532
12693
 
12533
- <xsl:template match="*[self::mn:figure or self::mn:table or self::mn:permission or self::mn:recommendation or self::mn:requirement or self::mn:sourcecode]/mn:fmt-name//text()" mode="bookmarks" priority="2">
12694
+ <xsl:template match="*[self::mn:figure or self::mn:table or self::mn:permission or self::mn:recommendation or self::mn:requirement or self::mn:sourcecode]/mn:fmt-name//text() | *[self::mnx:figure or self::mnx:table or self::mnx:permission or self::mnx:recommendation or self::mnx:requirement or self::mnx:sourcecode]/mn:fmt-name//text()" mode="bookmarks" priority="2">
12534
12695
  <xsl:value-of select="."/>
12535
12696
  </xsl:template>
12536
12697
 
@@ -12991,7 +13152,7 @@
12991
13152
  <xsl:value-of select="."/>
12992
13153
  </xsl:template>
12993
13154
 
12994
- <xsl:template match="mn:review" mode="contents_item"/>
13155
+ <xsl:template match="mn:annotation" mode="contents_item"/>
12995
13156
 
12996
13157
  <xsl:template match="mn:tab" mode="contents_item">
12997
13158
  <xsl:text> </xsl:text>
@@ -13146,7 +13307,7 @@
13146
13307
  <xsl:apply-templates/>
13147
13308
  </xsl:template>
13148
13309
 
13149
- <xsl:template match="mn:toc//mn:xref" priority="3">
13310
+ <xsl:template match="mn:toc//mn:xref | mn:toc//mn:fmt-xref" priority="3">
13150
13311
  <!-- <xref target="cgpm9th1948r6">1.6.3<tab/>&#8220;9th CGPM, 1948:<tab/>decision to establish the SI&#8221;</xref> -->
13151
13312
  <!-- New format: one tab <xref target="cgpm9th1948r6">&#8220;9th CGPM, 1948:<tab/>decision to establish the SI&#8221;</xref> -->
13152
13313
  <!-- <test><xsl:copy-of select="."/></test> -->
@@ -13214,8 +13375,8 @@
13214
13375
  <xsl:apply-templates mode="toc_table_width"/>
13215
13376
  </xsl:template>
13216
13377
 
13217
- <xsl:template match="mn:clause[@type = 'toc']/mn:title" mode="toc_table_width"/>
13218
- <xsl:template match="mn:clause[not(@type = 'toc')]/mn:title" mode="toc_table_width"/>
13378
+ <xsl:template match="mn:clause[@type = 'toc']/mn:fmt-title" mode="toc_table_width"/>
13379
+ <xsl:template match="mn:clause[not(@type = 'toc')]/mn:fmt-title" mode="toc_table_width"/>
13219
13380
 
13220
13381
  <xsl:template match="mn:li" mode="toc_table_width">
13221
13382
  <mn:tr>
@@ -13223,7 +13384,7 @@
13223
13384
  </mn:tr>
13224
13385
  </xsl:template>
13225
13386
 
13226
- <xsl:template match="mn:xref" mode="toc_table_width">
13387
+ <xsl:template match="mn:fmt-xref" mode="toc_table_width">
13227
13388
  <!-- <xref target="cgpm9th1948r6">1.6.3<tab/>&#8220;9th CGPM, 1948:<tab/>decision to establish the SI&#8221;</xref> -->
13228
13389
  <!-- New format - one tab <xref target="cgpm9th1948r6">&#8220;9th CGPM, 1948:<tab/>decision to establish the SI&#8221;</xref> -->
13229
13390
  <xsl:for-each select="mn:tab">
@@ -13297,10 +13458,10 @@
13297
13458
 
13298
13459
  </xsl:template> <!-- tab -->
13299
13460
 
13300
- <xsl:template match="mn:note/mn:name/mn:tab" priority="2"/>
13301
- <xsl:template match="mn:termnote/mn:name/mn:tab" priority="2"/>
13461
+ <xsl:template match="mn:note/mn:fmt-name/mn:tab" priority="2"/>
13462
+ <xsl:template match="mn:termnote/mn:fmt-name/mn:tab" priority="2"/>
13302
13463
 
13303
- <xsl:template match="mn:note/mn:name/mn:tab" mode="tab">
13464
+ <xsl:template match="mn:note/mn:fmt-name/mn:tab" mode="tab">
13304
13465
  </xsl:template>
13305
13466
 
13306
13467
  <xsl:template name="insertNonBreakSpaces">
@@ -13314,13 +13475,13 @@
13314
13475
  </xsl:template>
13315
13476
 
13316
13477
  <xsl:variable name="reviews_">
13317
- <xsl:for-each select="//mn:review[not(parent::mn:review-container)][@from]">
13478
+ <xsl:for-each select="//mn:annotation[not(parent::mn:annotation-container)][@from]">
13318
13479
  <xsl:copy>
13319
13480
  <xsl:copy-of select="@from"/>
13320
13481
  <xsl:copy-of select="@id"/>
13321
13482
  </xsl:copy>
13322
13483
  </xsl:for-each>
13323
- <xsl:for-each select="//mn:fmt-review-start[@source]">
13484
+ <xsl:for-each select="//mn:fmt-annotation-start[@source]">
13324
13485
  <xsl:copy>
13325
13486
  <xsl:copy-of select="@source"/>
13326
13487
  <xsl:copy-of select="@id"/>
@@ -13334,7 +13495,7 @@
13334
13495
  <!-- if there is review with from="...", then add small helper block for Annot tag adding, see 'review' template -->
13335
13496
  <xsl:variable name="curr_id" select="@id"/>
13336
13497
  <!-- <xsl:variable name="review_id" select="normalize-space(/@id)"/> -->
13337
- <xsl:for-each select="$reviews//mn:review[@from = $curr_id]"> <!-- $reviews//mn:fmt-review-start[@source = $curr_id] -->
13498
+ <xsl:for-each select="$reviews//mn:annotation[@from = $curr_id]"> <!-- $reviews//mn:fmt-review-start[@source = $curr_id] -->
13338
13499
  <xsl:variable name="review_id" select="normalize-space(@id)"/>
13339
13500
  <xsl:if test="$review_id != ''"> <!-- i.e. if review found -->
13340
13501
  <fo:block keep-with-next="always" line-height="0.1" id="{$review_id}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{$review_id}" fox:alt-text="Annot___{$review_id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
@@ -13349,7 +13510,7 @@
13349
13510
 
13350
13511
  <!-- document text (not figures, or tables) footnotes -->
13351
13512
  <xsl:variable name="reviews_container_">
13352
- <xsl:for-each select="//mn:review-container/mn:fmt-review-body">
13513
+ <xsl:for-each select="//mn:annotation-container/mn:fmt-annotation-body">
13353
13514
  <xsl:variable name="update_xml_step1">
13354
13515
  <xsl:apply-templates select="." mode="update_xml_step1"/>
13355
13516
  </xsl:variable>
@@ -13358,10 +13519,10 @@
13358
13519
  </xsl:variable>
13359
13520
  <xsl:variable name="reviews_container" select="xalan:nodeset($reviews_container_)"/>
13360
13521
 
13361
- <xsl:template match="mn:review-container"/>
13522
+ <xsl:template match="mn:annotation-container"/>
13362
13523
 
13363
13524
  <!-- for old Presentation XML (before https://github.com/metanorma/isodoc/issues/670) -->
13364
- <xsl:template match="mn:review[not(parent::mn:review-container)]"> <!-- 'review' will be processed in mn2pdf/review.xsl -->
13525
+ <xsl:template match="mn:annotation[not(parent::mn:annotation-container)]"> <!-- 'review' will be processed in mn2pdf/review.xsl -->
13365
13526
  <xsl:variable name="id_from" select="normalize-space(current()/@from)"/>
13366
13527
  <xsl:if test="$isGenerateTableIF = 'false'">
13367
13528
  <xsl:choose>
@@ -13381,7 +13542,7 @@
13381
13542
  </xsl:template>
13382
13543
 
13383
13544
  <!-- for new Presentation XML (https://github.com/metanorma/isodoc/issues/670) -->
13384
- <xsl:template match="mn:fmt-review-start" name="fmt-review-start"> <!-- 'review' will be processed in mn2pdf/review.xsl -->
13545
+ <xsl:template match="mn:fmt-annotation-start" name="fmt-annotation-start"> <!-- 'review' will be processed in mn2pdf/review.xsl -->
13385
13546
  <!-- comment 2019-11-29 -->
13386
13547
  <!-- <fo:block font-weight="bold">Review:</fo:block>
13387
13548
  <xsl:apply-templates /> -->
@@ -13437,7 +13598,7 @@
13437
13598
  </xsl:template>
13438
13599
 
13439
13600
  <!-- https://github.com/metanorma/mn-samples-bsi/issues/312 -->
13440
- <xsl:template match="mn:review[@type = 'other']"/>
13601
+ <xsl:template match="mn:annotation[@type = 'other']"/>
13441
13602
 
13442
13603
  <!-- ============ -->
13443
13604
  <!-- errata -->
@@ -13830,9 +13991,12 @@
13830
13991
  <xsl:choose>
13831
13992
  <xsl:when test="mn:fmt-title">
13832
13993
  <xsl:variable name="fmt_title_section">
13833
- <xsl:copy-of select="mn:fmt-title//mn:span[@class = 'fmt-caption-delim'][mn:tab][1]/preceding-sibling::node()[not(self::mn:review)]"/>
13994
+ <xsl:copy-of select="mn:fmt-title//mn:span[@class = 'fmt-caption-delim'][mn:tab][1]/preceding-sibling::node()[not(self::mn:annotation)]"/>
13834
13995
  </xsl:variable>
13835
13996
  <xsl:value-of select="normalize-space($fmt_title_section)"/>
13997
+ <xsl:if test="normalize-space($fmt_title_section) = ''">
13998
+ <xsl:value-of select="mn:fmt-title/mn:tab[1]/preceding-sibling::node()"/>
13999
+ </xsl:if>
13836
14000
  </xsl:when>
13837
14001
  <xsl:otherwise>
13838
14002
  <xsl:value-of select="mn:title/mn:tab[1]/preceding-sibling::node()"/>
@@ -13845,6 +14009,9 @@
13845
14009
  <xsl:when test="mn:fmt-title//mn:span[@class = 'fmt-caption-delim'][mn:tab]">
13846
14010
  <xsl:copy-of select="mn:fmt-title//mn:span[@class = 'fmt-caption-delim'][mn:tab][1]/following-sibling::node()"/>
13847
14011
  </xsl:when>
14012
+ <xsl:when test="mn:fmt-title/mn:tab">
14013
+ <xsl:copy-of select="mn:fmt-title/mn:tab[1]/following-sibling::node()"/>
14014
+ </xsl:when>
13848
14015
  <xsl:when test="mn:fmt-title">
13849
14016
  <xsl:copy-of select="mn:fmt-title/node()"/>
13850
14017
  </xsl:when>
@@ -13982,10 +14149,10 @@
13982
14149
 
13983
14150
  </fo:block>
13984
14151
 
13985
- <xsl:apply-templates select="mn:title[@columns = 1]"/>
14152
+ <xsl:apply-templates select="mn:fmt-title[@columns = 1]"/>
13986
14153
 
13987
14154
  <fo:block>
13988
- <xsl:apply-templates select="node()[not(self::mn:title and @columns = 1)]"/>
14155
+ <xsl:apply-templates select="node()[not(self::mn:fmt-title and @columns = 1)]"/>
13989
14156
  </fo:block>
13990
14157
  </xsl:otherwise>
13991
14158
  </xsl:choose>
@@ -13994,7 +14161,7 @@
13994
14161
  <xsl:template name="refine_annex_style">
13995
14162
  </xsl:template>
13996
14163
 
13997
- <xsl:template match="mn:name/text()">
14164
+ <xsl:template match="mn:name/text() | mn:fmt-name/text()">
13998
14165
  <!-- 0xA0 to space replacement -->
13999
14166
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
14000
14167
  </xsl:template>
@@ -14050,28 +14217,28 @@
14050
14217
  <xsl:template match="mn:amend"/>
14051
14218
 
14052
14219
  <!-- fmt-title renamed to title in update_xml_step1 -->
14053
- <xsl:template match="mn:fmt-title"/>
14220
+ <!-- <xsl:template match="mn:fmt-title" /> -->
14054
14221
 
14055
14222
  <!-- fmt-name renamed to name in update_xml_step1 -->
14056
- <xsl:template match="mn:fmt-name"/>
14223
+ <!-- <xsl:template match="mn:fmt-name" /> -->
14057
14224
 
14058
14225
  <!-- fmt-preferred renamed to preferred in update_xml_step1 -->
14059
- <xsl:template match="mn:fmt-preferred"/>
14226
+ <!-- <xsl:template match="mn:fmt-preferred" /> -->
14060
14227
 
14061
14228
  <!-- fmt-admitted renamed to admitted in update_xml_step1 -->
14062
- <xsl:template match="mn:fmt-admitted"/>
14229
+ <!-- <xsl:template match="mn:fmt-admitted" /> -->
14063
14230
 
14064
14231
  <!-- fmt-deprecates renamed to deprecates in update_xml_step1 -->
14065
- <xsl:template match="mn:fmt-deprecates"/>
14232
+ <!-- <xsl:template match="mn:fmt-deprecates" /> -->
14066
14233
 
14067
14234
  <!-- fmt-definition renamed to definition in update_xml_step1 -->
14068
- <xsl:template match="mn:fmt-definition"/>
14235
+ <!-- <xsl:template match="mn:fmt-definition" /> -->
14069
14236
 
14070
14237
  <!-- fmt-termsource renamed to termsource in update_xml_step1 -->
14071
- <xsl:template match="mn:fmt-termsource"/>
14238
+ <!-- <xsl:template match="mn:fmt-termsource" /> -->
14072
14239
 
14073
14240
  <!-- fmt-source renamed to source in update_xml_step1 -->
14074
- <xsl:template match="mn:fmt-source"/>
14241
+ <!-- <xsl:template match="mn:fmt-source" /> -->
14075
14242
 
14076
14243
  <xsl:template match="mn:semx">
14077
14244
  <xsl:apply-templates/>
@@ -14540,12 +14707,12 @@
14540
14707
  <xsl:when test="ancestor::mn:preface">
14541
14708
  <xsl:value-of select="$level_total - 2"/>
14542
14709
  </xsl:when>
14543
- <xsl:when test="ancestor::mn:sections and self::mn:title">
14710
+ <xsl:when test="ancestor::mn:sections and self::mn:fmt-title">
14544
14711
  <!-- determine 'depth' depends on upper clause with title/@depth -->
14545
14712
  <!-- <xsl:message>title=<xsl:value-of select="."/></xsl:message> -->
14546
- <xsl:variable name="clause_with_depth_depth" select="ancestor::mn:clause[mn:title/@depth][1]/mn:title/@depth"/>
14713
+ <xsl:variable name="clause_with_depth_depth" select="ancestor::mn:clause[mn:fmt-title/@depth][1]/mn:fmt-title/@depth"/>
14547
14714
  <!-- <xsl:message>clause_with_depth_depth=<xsl:value-of select="$clause_with_depth_depth"/></xsl:message> -->
14548
- <xsl:variable name="clause_with_depth_level" select="count(ancestor::mn:clause[mn:title/@depth][1]/ancestor::*)"/>
14715
+ <xsl:variable name="clause_with_depth_level" select="count(ancestor::mn:clause[mn:fmt-title/@depth][1]/ancestor::*)"/>
14549
14716
  <!-- <xsl:message>clause_with_depth_level=<xsl:value-of select="$clause_with_depth_level"/></xsl:message> -->
14550
14717
  <xsl:variable name="curr_level" select="count(ancestor::*) - 1"/>
14551
14718
  <!-- <xsl:message>curr_level=<xsl:value-of select="$curr_level"/></xsl:message> -->
@@ -14561,8 +14728,8 @@
14561
14728
  </xsl:otherwise>
14562
14729
  </xsl:choose>
14563
14730
  </xsl:when>
14564
- <xsl:when test="ancestor::mn:sections and self::mn:name and parent::mn:term">
14565
- <xsl:variable name="upper_terms_depth" select="normalize-space(ancestor::mn:terms[1]/mn:title/@depth)"/>
14731
+ <xsl:when test="ancestor::mn:sections and self::mn:fmt-name and parent::mn:term">
14732
+ <xsl:variable name="upper_terms_depth" select="normalize-space(ancestor::mn:terms[1]/mn:fmt-title/@depth)"/>
14566
14733
  <xsl:choose>
14567
14734
  <xsl:when test="string(number($upper_terms_depth)) != 'NaN'">
14568
14735
  <xsl:value-of select="number($upper_terms_depth + 1)"/>
@@ -14573,7 +14740,7 @@
14573
14740
  </xsl:choose>
14574
14741
  </xsl:when>
14575
14742
  <xsl:when test="ancestor::mn:sections">
14576
- <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[self::mn:clause or self::mn:terms][1]/mn:title/@depth)"/>
14743
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[self::mn:clause or self::mn:terms][1]/mn:fmt-title/@depth)"/>
14577
14744
  <xsl:choose>
14578
14745
  <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
14579
14746
  <xsl:value-of select="number($upper_clause_depth + 1)"/>
@@ -14589,8 +14756,8 @@
14589
14756
  <xsl:when test="parent::mn:annex">
14590
14757
  <xsl:value-of select="$level_total - 1"/>
14591
14758
  </xsl:when>
14592
- <xsl:when test="ancestor::mn:annex and self::mn:title">
14593
- <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::mn:clause[2]/mn:title/@depth)"/>
14759
+ <xsl:when test="ancestor::mn:annex and self::mn:fmt-title">
14760
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::mn:clause[2]/mn:fmt-title/@depth)"/>
14594
14761
  <xsl:choose>
14595
14762
  <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
14596
14763
  <xsl:value-of select="number($upper_clause_depth + 1)"/>
@@ -14623,7 +14790,7 @@
14623
14790
  </xsl:when>
14624
14791
  <xsl:otherwise>
14625
14792
  <xsl:variable name="title_level_">
14626
- <xsl:for-each select="../preceding-sibling::mn:title[1]">
14793
+ <xsl:for-each select="../preceding-sibling::mn:fmt-title[1]">
14627
14794
  <xsl:call-template name="getLevel"/>
14628
14795
  </xsl:for-each>
14629
14796
  </xsl:variable>
@@ -14700,15 +14867,17 @@
14700
14867
  </xsl:template>
14701
14868
 
14702
14869
  <xsl:template name="setNamedDestination">
14703
- <!-- skip GUID, e.g. _33eac3cb-9663-4291-ae26-1d4b6f4635fc -->
14704
- <xsl:if test="@id and normalize-space(java:matches(java:java.lang.String.new(@id), '_[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}')) = 'false'">
14705
- <fox:destination internal-destination="{@id}"/>
14706
- </xsl:if>
14707
- <xsl:for-each select=". | mn:title | mn:name">
14708
- <xsl:if test="@named_dest">
14709
- <fox:destination internal-destination="{@named_dest}"/>
14870
+ <xsl:if test="$isGenerateTableIF = 'false'">
14871
+ <!-- skip GUID, e.g. _33eac3cb-9663-4291-ae26-1d4b6f4635fc -->
14872
+ <xsl:if test="@id and normalize-space(java:matches(java:java.lang.String.new(@id), '_[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}')) = 'false'">
14873
+ <fox:destination internal-destination="{@id}"/>
14710
14874
  </xsl:if>
14711
- </xsl:for-each>
14875
+ <xsl:for-each select=". | mn:fmt-title | mn:fmt-name">
14876
+ <xsl:if test="@named_dest">
14877
+ <fox:destination internal-destination="{@named_dest}"/>
14878
+ </xsl:if>
14879
+ </xsl:for-each>
14880
+ </xsl:if>
14712
14881
  </xsl:template>
14713
14882
 
14714
14883
  <xsl:template name="add-letter-spacing">
@@ -15056,7 +15225,7 @@
15056
15225
  </xsl:when>
15057
15226
  <xsl:otherwise>
15058
15227
  <!-- namespace-uri(ancestor::mn:title) != '' to skip title from $contents -->
15059
- <xsl:if test="namespace-uri(ancestor::mn:title) != '' and ($char_prev = '' and ../preceding-sibling::node())">
15228
+ <xsl:if test="namespace-uri(ancestor::mn:fmt-title) != '' and ($char_prev = '' and ../preceding-sibling::node())">
15060
15229
  <fo:inline padding-left="1mm"><xsl:value-of select="$zero_width_space"/></fo:inline>
15061
15230
  </xsl:if>
15062
15231
  <fo:inline-container text-align="center" alignment-baseline="central" width="1em" margin="0" padding="0" text-indent="0mm" last-line-end-indent="0mm" start-indent="0mm" end-indent="0mm" role="SKIP" text-align-last="center">
@@ -15090,7 +15259,7 @@
15090
15259
  </fo:block>
15091
15260
  </fo:block-container>
15092
15261
  </fo:inline-container>
15093
- <xsl:if test="namespace-uri(ancestor::mn:title) != '' and ($char_next != '' or ../following-sibling::node())">
15262
+ <xsl:if test="namespace-uri(ancestor::mn:fmt-title) != '' and ($char_next != '' or ../following-sibling::node())">
15094
15263
  <fo:inline padding-left="1mm"><xsl:value-of select="$zero_width_space"/></fo:inline>
15095
15264
  </xsl:if>
15096
15265
  </xsl:otherwise>