metanorma-iho 1.1.9 → 1.2.0

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,14 +2,27 @@
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
 
9
- <xsl:variable name="title-en">
10
- <xsl:apply-templates select="/mn:metanorma/mn:bibdata/mn:title[@language = 'en']/node()"/>
9
+ <xsl:variable name="title-en"><xsl:apply-templates select="/mn:metanorma/mn:bibdata/mn:title[@language = 'en']/node()"/></xsl:variable>
10
+ <xsl:variable name="title-main_"><xsl:apply-templates select="/mn:metanorma/mn:bibdata/mn:title[@type = 'main']/node()"/></xsl:variable>
11
+ <xsl:variable name="title-main"><xsl:apply-templates select="/mn:metanorma/mn:bibdata/mn:title[@type = 'title-main']/node()"/></xsl:variable>
12
+ <xsl:variable name="title-appendix"><xsl:apply-templates select="/mn:metanorma/mn:bibdata/mn:title[@type = 'title-appendix']/node()"/></xsl:variable>
13
+ <xsl:variable name="title-annex"><xsl:apply-templates select="/mn:metanorma/mn:bibdata/mn:title[@type = 'title-annex']/node()"/></xsl:variable>
14
+ <xsl:variable name="title-part"><xsl:apply-templates select="/mn:metanorma/mn:bibdata/mn:title[@type = 'title-part']/node()"/></xsl:variable>
15
+ <xsl:variable name="title-supplement"><xsl:apply-templates select="/mn:metanorma/mn:bibdata/mn:title[@type = 'title-supplement']/node()"/></xsl:variable>
16
+ <xsl:variable name="title_header">
17
+ <xsl:copy-of select="$title-main_"/>
18
+ <xsl:if test="normalize-space($title-main_) = ''"><xsl:copy-of select="$title-en"/></xsl:if>
11
19
  </xsl:variable>
12
- <xsl:variable name="docidentifier" select="/mn:metanorma/mn:bibdata/mn:docidentifier[@type = 'IHO']"/>
20
+
21
+ <xsl:variable name="docidentifier_parent" select="normalize-space(/mn:metanorma/mn:bibdata/mn:docidentifier[@type = 'IHO-parent-document'])"/>
22
+ <xsl:variable name="docidentifier">
23
+ <xsl:value-of select="$docidentifier_parent"/>
24
+ <xsl:if test="$docidentifier_parent = ''"><xsl:value-of select="/mn:metanorma/mn:bibdata/mn:docidentifier[@type = 'IHO']"/></xsl:if>
25
+ </xsl:variable>
13
26
  <xsl:variable name="copyrightText" select="concat('© International Hydrographic Association ', /mn:metanorma/mn:bibdata/mn:copyright/mn:from ,' – All rights reserved')"/>
14
27
  <xsl:variable name="edition">
15
28
  <xsl:apply-templates select="/mn:metanorma/mn:bibdata/mn:edition[normalize-space(@language) = '']"/>
@@ -32,6 +45,96 @@
32
45
  </xsl:variable>
33
46
  <xsl:variable name="contents" select="xalan:nodeset($contents_)"/>
34
47
 
48
+ <xsl:template name="layout-master-set">
49
+ <fo:layout-master-set>
50
+ <!-- cover page -->
51
+ <fo:simple-page-master master-name="cover" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
52
+ <fo:region-body margin-top="0mm" margin-bottom="5mm" margin-left="0mm" margin-right="5mm"/>
53
+ </fo:simple-page-master>
54
+
55
+ <fo:simple-page-master master-name="first" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
56
+ <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
57
+ <fo:region-before region-name="header" extent="{$marginTop}mm"/>
58
+ <fo:region-after region-name="footer" extent="{$marginBottom}mm"/>
59
+ <fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
60
+ <fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
61
+ </fo:simple-page-master>
62
+ <fo:simple-page-master master-name="odd" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
63
+ <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
64
+ <fo:region-before region-name="header-odd" extent="{$marginTop}mm"/>
65
+ <fo:region-after region-name="footer" extent="{$marginBottom}mm"/>
66
+ <fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
67
+ <fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
68
+ </fo:simple-page-master>
69
+ <fo:simple-page-master master-name="odd-landscape" page-width="{$pageHeight}mm" page-height="{$pageWidth}mm">
70
+ <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
71
+ <fo:region-before region-name="header-odd" extent="{$marginTop}mm"/>
72
+ <fo:region-after region-name="footer" extent="{$marginBottom}mm"/>
73
+ <fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
74
+ <fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
75
+ </fo:simple-page-master>
76
+ <fo:simple-page-master master-name="even" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
77
+ <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight2}mm" margin-right="{$marginLeftRight1}mm"/>
78
+ <fo:region-before region-name="header-even" extent="{$marginTop}mm"/>
79
+ <fo:region-after region-name="footer" extent="{$marginBottom}mm"/>
80
+ <fo:region-start region-name="left-region" extent="{$marginLeftRight2}mm"/>
81
+ <fo:region-end region-name="right-region" extent="{$marginLeftRight1}mm"/>
82
+ </fo:simple-page-master>
83
+ <fo:simple-page-master master-name="even-landscape" page-width="{$pageHeight}mm" page-height="{$pageWidth}mm">
84
+ <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight2}mm" margin-right="{$marginLeftRight1}mm"/>
85
+ <fo:region-before region-name="header-even" extent="{$marginTop}mm"/>
86
+ <fo:region-after region-name="footer" extent="{$marginBottom}mm"/>
87
+ <fo:region-start region-name="left-region" extent="{$marginLeftRight2}mm"/>
88
+ <fo:region-end region-name="right-region" extent="{$marginLeftRight1}mm"/>
89
+ </fo:simple-page-master>
90
+ <fo:simple-page-master master-name="blankpage" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
91
+ <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight2}mm" margin-right="{$marginLeftRight1}mm"/>
92
+ <fo:region-before region-name="header-blank" extent="{$marginTop}mm"/>
93
+ <fo:region-after region-name="footer" extent="{$marginBottom}mm"/>
94
+ <fo:region-start region-name="left-region" extent="{$marginLeftRight2}mm"/>
95
+ <fo:region-end region-name="right-region" extent="{$marginLeftRight1}mm"/>
96
+ </fo:simple-page-master>
97
+ <!-- Preface pages -->
98
+ <fo:page-sequence-master master-name="preface">
99
+ <fo:repeatable-page-master-alternatives>
100
+ <!-- <fo:conditional-page-master-reference master-reference="first" page-position="first"/> -->
101
+ <fo:conditional-page-master-reference master-reference="blankpage" blank-or-not-blank="blank"/>
102
+ <fo:conditional-page-master-reference odd-or-even="even" master-reference="even"/>
103
+ <fo:conditional-page-master-reference odd-or-even="odd" master-reference="odd"/>
104
+ </fo:repeatable-page-master-alternatives>
105
+ </fo:page-sequence-master>
106
+ <fo:page-sequence-master master-name="preface-landscape">
107
+ <fo:repeatable-page-master-alternatives>
108
+ <fo:conditional-page-master-reference master-reference="blankpage" blank-or-not-blank="blank"/>
109
+ <fo:conditional-page-master-reference odd-or-even="even" master-reference="even-landscape"/>
110
+ <fo:conditional-page-master-reference odd-or-even="odd" master-reference="odd-landscape"/>
111
+ </fo:repeatable-page-master-alternatives>
112
+ </fo:page-sequence-master>
113
+ <!-- Document pages -->
114
+ <fo:page-sequence-master master-name="document">
115
+ <fo:repeatable-page-master-alternatives>
116
+ <fo:conditional-page-master-reference master-reference="blankpage" blank-or-not-blank="blank"/>
117
+ <fo:conditional-page-master-reference odd-or-even="even" master-reference="even"/>
118
+ <fo:conditional-page-master-reference odd-or-even="odd" master-reference="odd"/>
119
+ </fo:repeatable-page-master-alternatives>
120
+ </fo:page-sequence-master>
121
+ <fo:page-sequence-master master-name="document-portrait">
122
+ <fo:repeatable-page-master-alternatives>
123
+ <fo:conditional-page-master-reference master-reference="blankpage" blank-or-not-blank="blank"/>
124
+ <fo:conditional-page-master-reference odd-or-even="even" master-reference="even"/>
125
+ <fo:conditional-page-master-reference odd-or-even="odd" master-reference="odd"/>
126
+ </fo:repeatable-page-master-alternatives>
127
+ </fo:page-sequence-master>
128
+ <fo:page-sequence-master master-name="document-landscape">
129
+ <fo:repeatable-page-master-alternatives>
130
+ <fo:conditional-page-master-reference master-reference="blankpage" blank-or-not-blank="blank"/>
131
+ <fo:conditional-page-master-reference odd-or-even="even" master-reference="even-landscape"/>
132
+ <fo:conditional-page-master-reference odd-or-even="odd" master-reference="odd-landscape"/>
133
+ </fo:repeatable-page-master-alternatives>
134
+ </fo:page-sequence-master>
135
+ </fo:layout-master-set>
136
+ </xsl:template> <!-- END: layout-master-set -->
137
+
35
138
  <xsl:template match="/">
36
139
 
37
140
  <fo:root xml:lang="{$lang}">
@@ -41,93 +144,8 @@
41
144
  <xsl:call-template name="insertRootStyle">
42
145
  <xsl:with-param name="root-style" select="$root-style"/>
43
146
  </xsl:call-template>
44
- <fo:layout-master-set>
45
- <!-- cover page -->
46
- <fo:simple-page-master master-name="cover" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
47
- <fo:region-body margin-top="0mm" margin-bottom="5mm" margin-left="0mm" margin-right="5mm"/>
48
- </fo:simple-page-master>
49
-
50
- <fo:simple-page-master master-name="first" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
51
- <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
52
- <fo:region-before region-name="header" extent="{$marginTop}mm"/>
53
- <fo:region-after region-name="footer" extent="{$marginBottom}mm"/>
54
- <fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
55
- <fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
56
- </fo:simple-page-master>
57
- <fo:simple-page-master master-name="odd" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
58
- <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
59
- <fo:region-before region-name="header-odd" extent="{$marginTop}mm"/>
60
- <fo:region-after region-name="footer" extent="{$marginBottom}mm"/>
61
- <fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
62
- <fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
63
- </fo:simple-page-master>
64
- <fo:simple-page-master master-name="odd-landscape" page-width="{$pageHeight}mm" page-height="{$pageWidth}mm">
65
- <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
66
- <fo:region-before region-name="header-odd" extent="{$marginTop}mm"/>
67
- <fo:region-after region-name="footer" extent="{$marginBottom}mm"/>
68
- <fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
69
- <fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
70
- </fo:simple-page-master>
71
- <fo:simple-page-master master-name="even" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
72
- <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight2}mm" margin-right="{$marginLeftRight1}mm"/>
73
- <fo:region-before region-name="header-even" extent="{$marginTop}mm"/>
74
- <fo:region-after region-name="footer" extent="{$marginBottom}mm"/>
75
- <fo:region-start region-name="left-region" extent="{$marginLeftRight2}mm"/>
76
- <fo:region-end region-name="right-region" extent="{$marginLeftRight1}mm"/>
77
- </fo:simple-page-master>
78
- <fo:simple-page-master master-name="even-landscape" page-width="{$pageHeight}mm" page-height="{$pageWidth}mm">
79
- <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight2}mm" margin-right="{$marginLeftRight1}mm"/>
80
- <fo:region-before region-name="header-even" extent="{$marginTop}mm"/>
81
- <fo:region-after region-name="footer" extent="{$marginBottom}mm"/>
82
- <fo:region-start region-name="left-region" extent="{$marginLeftRight2}mm"/>
83
- <fo:region-end region-name="right-region" extent="{$marginLeftRight1}mm"/>
84
- </fo:simple-page-master>
85
- <fo:simple-page-master master-name="blankpage" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
86
- <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight2}mm" margin-right="{$marginLeftRight1}mm"/>
87
- <fo:region-before region-name="header-blank" extent="{$marginTop}mm"/>
88
- <fo:region-after region-name="footer" extent="{$marginBottom}mm"/>
89
- <fo:region-start region-name="left-region" extent="{$marginLeftRight2}mm"/>
90
- <fo:region-end region-name="right-region" extent="{$marginLeftRight1}mm"/>
91
- </fo:simple-page-master>
92
- <!-- Preface pages -->
93
- <fo:page-sequence-master master-name="preface">
94
- <fo:repeatable-page-master-alternatives>
95
- <!-- <fo:conditional-page-master-reference master-reference="first" page-position="first"/> -->
96
- <fo:conditional-page-master-reference master-reference="blankpage" blank-or-not-blank="blank"/>
97
- <fo:conditional-page-master-reference odd-or-even="even" master-reference="even"/>
98
- <fo:conditional-page-master-reference odd-or-even="odd" master-reference="odd"/>
99
- </fo:repeatable-page-master-alternatives>
100
- </fo:page-sequence-master>
101
- <fo:page-sequence-master master-name="preface-landscape">
102
- <fo:repeatable-page-master-alternatives>
103
- <fo:conditional-page-master-reference master-reference="blankpage" blank-or-not-blank="blank"/>
104
- <fo:conditional-page-master-reference odd-or-even="even" master-reference="even-landscape"/>
105
- <fo:conditional-page-master-reference odd-or-even="odd" master-reference="odd-landscape"/>
106
- </fo:repeatable-page-master-alternatives>
107
- </fo:page-sequence-master>
108
- <!-- Document pages -->
109
- <fo:page-sequence-master master-name="document">
110
- <fo:repeatable-page-master-alternatives>
111
- <fo:conditional-page-master-reference master-reference="blankpage" blank-or-not-blank="blank"/>
112
- <fo:conditional-page-master-reference odd-or-even="even" master-reference="even"/>
113
- <fo:conditional-page-master-reference odd-or-even="odd" master-reference="odd"/>
114
- </fo:repeatable-page-master-alternatives>
115
- </fo:page-sequence-master>
116
- <fo:page-sequence-master master-name="document-portrait">
117
- <fo:repeatable-page-master-alternatives>
118
- <fo:conditional-page-master-reference master-reference="blankpage" blank-or-not-blank="blank"/>
119
- <fo:conditional-page-master-reference odd-or-even="even" master-reference="even"/>
120
- <fo:conditional-page-master-reference odd-or-even="odd" master-reference="odd"/>
121
- </fo:repeatable-page-master-alternatives>
122
- </fo:page-sequence-master>
123
- <fo:page-sequence-master master-name="document-landscape">
124
- <fo:repeatable-page-master-alternatives>
125
- <fo:conditional-page-master-reference master-reference="blankpage" blank-or-not-blank="blank"/>
126
- <fo:conditional-page-master-reference odd-or-even="even" master-reference="even-landscape"/>
127
- <fo:conditional-page-master-reference odd-or-even="odd" master-reference="odd-landscape"/>
128
- </fo:repeatable-page-master-alternatives>
129
- </fo:page-sequence-master>
130
- </fo:layout-master-set>
147
+
148
+ <xsl:call-template name="layout-master-set"/>
131
149
 
132
150
  <fo:declarations>
133
151
  <xsl:call-template name="addPDFUAmeta"/>
@@ -149,160 +167,7 @@
149
167
 
150
168
  <xsl:for-each select="xalan:nodeset($updated_xml)/*">
151
169
 
152
- <!-- =========================== -->
153
- <!-- Cover Page -->
154
- <fo:page-sequence master-reference="cover">
155
- <fo:flow flow-name="xsl-region-body">
156
-
157
- <xsl:variable name="isCoverPageImage" select="normalize-space(/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata[mn:name = 'coverpage-image']/mn:value/mn:image and 1 = 1)"/>
158
-
159
- <xsl:variable name="document_scheme" select="normalize-space(/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata[mn:name = 'document-scheme']/mn:value)"/>
160
-
161
- <xsl:choose>
162
- <xsl:when test="$document_scheme != '' and $document_scheme != '2019' and $isCoverPageImage = 'true'">
163
- <xsl:call-template name="insertBackgroundPageImage"/>
164
- </xsl:when>
165
- <xsl:otherwise>
166
-
167
- <fo:block-container position="absolute" left="14.25mm" top="12mm" id="__internal_layout__coverpage_{generate-id()}">
168
- <fo:table table-layout="fixed" width="181.1mm">
169
- <fo:table-column column-width="26mm"/>
170
- <fo:table-column column-width="19.4mm"/>
171
- <fo:table-column column-width="135.7mm"/>
172
- <fo:table-body>
173
- <fo:table-row>
174
- <fo:table-cell><fo:block> </fo:block></fo:table-cell>
175
- <fo:table-cell>
176
- <fo:block-container width="19.4mm" height="21mm" background-color="rgb(241, 234, 202)" border-bottom="0.05pt solid rgb(0, 21, 50)" text-align="center" display-align="center" font-size="10pt" font-weight="bold">
177
- <xsl:if test="$isCoverPageImage = 'true'">
178
- <xsl:attribute name="width">42.5mm</xsl:attribute>
179
- </xsl:if>
180
- <fo:block>
181
- <xsl:value-of select="$docidentifier"/>
182
- <xsl:if test="$isCoverPageImage = 'true'">
183
- <xsl:text> </xsl:text><xsl:value-of select="$edition"/>
184
- </xsl:if>
185
- </fo:block>
186
- </fo:block-container>
187
- </fo:table-cell>
188
- <fo:table-cell><fo:block> </fo:block></fo:table-cell>
189
- </fo:table-row>
190
- <fo:table-row>
191
- <fo:table-cell display-align="after" text-align="right">
192
- <fo:block font-size="1">
193
- <fo:instream-foreign-object content-width="25.9mm" fox:alt-text="Image IHO">
194
- <xsl:copy-of select="$Image-IHO-SVG"/>
195
- </fo:instream-foreign-object>
196
- </fo:block>
197
- </fo:table-cell>
198
-
199
- <!-- https://github.com/metanorma/metanorma-iho/issues/288 -->
200
- <xsl:choose>
201
- <xsl:when test="$isCoverPageImage = 'true'">
202
- <fo:table-cell number-columns-spanned="2">
203
- <fo:block-container font-size="0"> <!-- height="168mm" width="115mm" -->
204
- <fo:block>
205
- <xsl:for-each select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata[mn:name = 'coverpage-image'][1]/mn:value/mn:image[1]">
206
- <xsl:choose>
207
- <xsl:when test="*[local-name() = 'svg'] or java:endsWith(java:java.lang.String.new(@src), '.svg')">
208
- <fo:instream-foreign-object fox:alt-text="Image Front">
209
- <xsl:attribute name="content-height"><xsl:value-of select="$pageHeight"/>mm</xsl:attribute>
210
- <xsl:call-template name="getSVG"/>
211
- </fo:instream-foreign-object>
212
- </xsl:when>
213
- <xsl:when test="starts-with(@src, 'data:application/pdf;base64')">
214
- <fo:external-graphic src="{@src}" fox:alt-text="Image Front"/>
215
- </xsl:when>
216
- <xsl:otherwise> <!-- bitmap image -->
217
- <xsl:variable name="coverimage_src" select="normalize-space(@src)"/>
218
- <xsl:if test="$coverimage_src != ''">
219
- <xsl:variable name="coverpage">
220
- <xsl:call-template name="getImageURL">
221
- <xsl:with-param name="src" select="$coverimage_src"/>
222
- </xsl:call-template>
223
- </xsl:variable>
224
- <fo:external-graphic src="{$coverpage}" width="155.5mm" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Front"/>
225
- </xsl:if>
226
- </xsl:otherwise>
227
- </xsl:choose>
228
- </xsl:for-each>
229
- </fo:block>
230
- </fo:block-container>
231
- </fo:table-cell>
232
- </xsl:when>
233
- <xsl:otherwise>
234
- <fo:table-cell number-columns-spanned="2" border="0.5pt solid rgb(0, 21, 50)" font-weight="bold" color="rgb(0, 0, 76)" padding-top="3mm">
235
- <fo:block-container height="165mm" width="115mm">
236
- <fo:block-container margin-left="10mm">
237
- <fo:block-container margin-left="0mm">
238
- <fo:block-container display-align="center" height="90mm">
239
- <fo:block font-size="28pt" role="H1" line-height="115%">
240
- <xsl:copy-of select="$title-en"/>
241
- </fo:block>
242
- </fo:block-container>
243
- <fo:block font-size="14pt">
244
- <xsl:value-of select="$edition"/>
245
- <xsl:if test="normalize-space($month_year) != ''">
246
- <xsl:text> – </xsl:text>
247
- <xsl:value-of select="$month_year"/>
248
- </xsl:if>
249
- </fo:block>
250
- </fo:block-container>
251
- </fo:block-container>
252
- </fo:block-container>
253
- </fo:table-cell>
254
- </xsl:otherwise>
255
- </xsl:choose>
256
- </fo:table-row>
257
- <fo:table-row>
258
- <fo:table-cell>
259
- <fo:block font-size="1">
260
- <fo:instream-foreign-object content-width="25.9mm" fox:alt-text="Image Logo IHO">
261
- <xsl:copy-of select="$Image-Logo-IHO-SVG"/>
262
- </fo:instream-foreign-object>
263
- </fo:block>
264
- </fo:table-cell>
265
- <fo:table-cell>
266
- <fo:block font-size="1">
267
- <fo:instream-foreign-object content-width="25.8mm" fox:alt-text="Image Logo IHO">
268
- <xsl:copy-of select="$Image-Text-IHO-SVG"/>
269
- </fo:instream-foreign-object>
270
- </fo:block>
271
- </fo:table-cell>
272
- <fo:table-cell number-rows-spanned="2">
273
- <fo:block-container width="79mm" height="72mm" margin-left="56.8mm" background-color="rgb(0, 172, 158)" text-align="right" display-align="after">
274
- <fo:block-container margin-left="0mm">
275
- <fo:block font-size="8pt" color="white" margin-right="5mm" margin-bottom="5mm" line-height-shift-adjustment="disregard-shifts">
276
- <xsl:apply-templates select="/mn:metanorma/mn:boilerplate/mn:feedback-statement"/>
277
- </fo:block>
278
- </fo:block-container>
279
- </fo:block-container>
280
- </fo:table-cell>
281
- </fo:table-row>
282
- <fo:table-row>
283
- <fo:table-cell number-columns-spanned="2" padding-top="2mm">
284
- <fo:block-container width="51.5mm">
285
- <fo:block>
286
- <xsl:for-each select="/mn:metanorma/mn:bibdata/mn:contributor[mn:role/@type = 'publisher']/mn:organization[not(mn:abbreviation = 'IHO')]">
287
- <xsl:apply-templates select="mn:logo/mn:image">
288
- <xsl:with-param name="logo_width">25.8mm</xsl:with-param>
289
- </xsl:apply-templates>
290
- <xsl:if test="position() != last()"><fo:inline> </fo:inline></xsl:if>
291
- </xsl:for-each>
292
- </fo:block>
293
- </fo:block-container>
294
- </fo:table-cell>
295
- </fo:table-row>
296
- </fo:table-body>
297
- </fo:table>
298
- </fo:block-container>
299
- </xsl:otherwise>
300
- </xsl:choose>
301
- </fo:flow>
302
- </fo:page-sequence>
303
- <!-- End Cover Page -->
304
- <!-- =========================== -->
305
- <!-- =========================== -->
170
+ <xsl:call-template name="cover-page"/>
306
171
 
307
172
  <xsl:choose>
308
173
  <xsl:when test="/mn:metanorma/mn:boilerplate/*[not(self::mn:feedback-statement)]">
@@ -496,6 +361,190 @@
496
361
  </fo:root>
497
362
  </xsl:template>
498
363
 
364
+ <xsl:template name="cover-page">
365
+ <!-- =========================== -->
366
+ <!-- Cover Page -->
367
+ <fo:page-sequence master-reference="cover">
368
+ <fo:flow flow-name="xsl-region-body">
369
+
370
+ <xsl:variable name="isCoverPageImage" select="normalize-space(/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata[mn:name = 'coverpage-image']/mn:value/mn:image and 1 = 1)"/>
371
+
372
+ <xsl:variable name="document_scheme" select="normalize-space(/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata[mn:name = 'document-scheme']/mn:value)"/>
373
+
374
+ <xsl:choose>
375
+ <xsl:when test="$document_scheme != '' and $document_scheme != '2019' and $isCoverPageImage = 'true'">
376
+ <xsl:call-template name="insertBackgroundPageImage"/>
377
+ </xsl:when>
378
+ <xsl:otherwise>
379
+
380
+ <fo:block-container position="absolute" left="14.25mm" top="12mm" id="__internal_layout__coverpage_{generate-id()}">
381
+ <fo:table table-layout="fixed" width="181.1mm">
382
+ <fo:table-column column-width="26mm"/>
383
+ <fo:table-column column-width="19.4mm"/>
384
+ <fo:table-column column-width="135.7mm"/>
385
+ <fo:table-body>
386
+ <fo:table-row>
387
+ <fo:table-cell><fo:block> </fo:block></fo:table-cell>
388
+ <fo:table-cell>
389
+ <fo:block-container width="19.4mm" height="21mm" background-color="rgb(241, 234, 202)" border-bottom="0.05pt solid rgb(0, 21, 50)" text-align="center" display-align="center" font-size="10pt" font-weight="bold">
390
+ <xsl:if test="$isCoverPageImage = 'true'">
391
+ <xsl:attribute name="width">42.5mm</xsl:attribute>
392
+ </xsl:if>
393
+ <fo:block>
394
+ <xsl:value-of select="$docidentifier"/>
395
+ <xsl:if test="$isCoverPageImage = 'true'">
396
+ <xsl:text> </xsl:text><xsl:value-of select="$edition"/>
397
+ </xsl:if>
398
+ </fo:block>
399
+ </fo:block-container>
400
+ </fo:table-cell>
401
+ <fo:table-cell><fo:block> </fo:block></fo:table-cell>
402
+ </fo:table-row>
403
+ <fo:table-row>
404
+ <fo:table-cell display-align="after" text-align="right">
405
+ <fo:block font-size="1">
406
+ <fo:instream-foreign-object content-width="25.9mm" fox:alt-text="Image IHO">
407
+ <xsl:copy-of select="$Image-IHO-SVG"/>
408
+ </fo:instream-foreign-object>
409
+ </fo:block>
410
+ </fo:table-cell>
411
+
412
+ <!-- https://github.com/metanorma/metanorma-iho/issues/288 -->
413
+ <xsl:choose>
414
+ <xsl:when test="$isCoverPageImage = 'true'">
415
+ <fo:table-cell number-columns-spanned="2">
416
+ <fo:block-container font-size="0"> <!-- height="168mm" width="115mm" -->
417
+ <fo:block>
418
+ <xsl:for-each select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata[mn:name = 'coverpage-image'][1]/mn:value/mn:image[1]">
419
+ <xsl:choose>
420
+ <xsl:when test="*[local-name() = 'svg'] or java:endsWith(java:java.lang.String.new(@src), '.svg')">
421
+ <fo:instream-foreign-object fox:alt-text="Image Front">
422
+ <xsl:attribute name="content-height"><xsl:value-of select="$pageHeight"/>mm</xsl:attribute>
423
+ <xsl:call-template name="getSVG"/>
424
+ </fo:instream-foreign-object>
425
+ </xsl:when>
426
+ <xsl:when test="starts-with(@src, 'data:application/pdf;base64')">
427
+ <fo:external-graphic src="{@src}" fox:alt-text="Image Front"/>
428
+ </xsl:when>
429
+ <xsl:otherwise> <!-- bitmap image -->
430
+ <xsl:variable name="coverimage_src" select="normalize-space(@src)"/>
431
+ <xsl:if test="$coverimage_src != ''">
432
+ <xsl:variable name="coverpage">
433
+ <xsl:call-template name="getImageURL">
434
+ <xsl:with-param name="src" select="$coverimage_src"/>
435
+ </xsl:call-template>
436
+ </xsl:variable>
437
+ <fo:external-graphic src="{$coverpage}" width="155.5mm" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Front"/>
438
+ </xsl:if>
439
+ </xsl:otherwise>
440
+ </xsl:choose>
441
+ </xsl:for-each>
442
+ </fo:block>
443
+ </fo:block-container>
444
+ </fo:table-cell>
445
+ </xsl:when>
446
+ <xsl:otherwise>
447
+ <fo:table-cell number-columns-spanned="2" border="0.5pt solid rgb(0, 21, 50)" font-weight="bold" color="rgb(0, 0, 76)" padding-top="3mm">
448
+ <fo:block-container height="165mm" width="115mm">
449
+ <fo:block-container margin-left="10mm">
450
+ <fo:block-container margin-left="0mm">
451
+
452
+ <!-- <fo:block-container display-align="center" height="90mm"> -->
453
+ <fo:table table-layout="fixed" width="100%">
454
+ <fo:table-body>
455
+ <fo:table-row min-height="90mm"> <!-- for debug: border="1pt solid blue" -->
456
+ <fo:table-cell display-align="center">
457
+ <xsl:if test="normalize-space($title-annex) != '' or normalize-space($title-appendix) != '' or normalize-space($title-supplement) != ''">
458
+ <fo:block font-size="14pt" role="H1" line-height="115%" margin-top="35mm">
459
+ <fo:block><xsl:copy-of select="$title-annex"/></fo:block>
460
+ <fo:block><xsl:copy-of select="$title-appendix"/></fo:block>
461
+ <fo:block><xsl:copy-of select="$title-supplement"/></fo:block>
462
+ </fo:block>
463
+ <fo:block font-size="28pt" role="SKIP" line-height="115%"> </fo:block>
464
+ </xsl:if>
465
+ <fo:block font-size="28pt" role="H1" line-height="115%">
466
+ <xsl:copy-of select="$title-main"/>
467
+ <xsl:if test="normalize-space($title-main) = ''">
468
+ <xsl:copy-of select="$title-en"/>
469
+ </xsl:if>
470
+ </fo:block>
471
+ <xsl:if test="normalize-space($title-part) != ''">
472
+ <fo:block font-size="28pt" role="SKIP" line-height="115%"> </fo:block>
473
+ <fo:block font-size="18pt" role="H2" line-height="115%" margin-bottom="10mm">
474
+ <xsl:copy-of select="$title-part"/>
475
+ </fo:block>
476
+ </xsl:if>
477
+ </fo:table-cell>
478
+ </fo:table-row>
479
+ </fo:table-body>
480
+ </fo:table>
481
+ <!-- </fo:block-container> -->
482
+
483
+ <fo:block font-size="14pt">
484
+ <xsl:value-of select="$edition"/>
485
+ <xsl:if test="normalize-space($month_year) != ''">
486
+ <xsl:text> – </xsl:text>
487
+ <xsl:value-of select="$month_year"/>
488
+ </xsl:if>
489
+ </fo:block>
490
+ </fo:block-container>
491
+ </fo:block-container>
492
+ </fo:block-container>
493
+ </fo:table-cell>
494
+ </xsl:otherwise>
495
+ </xsl:choose>
496
+ </fo:table-row>
497
+ <fo:table-row>
498
+ <fo:table-cell>
499
+ <fo:block font-size="1">
500
+ <fo:instream-foreign-object content-width="25.9mm" fox:alt-text="Image Logo IHO">
501
+ <xsl:copy-of select="$Image-Logo-IHO-SVG"/>
502
+ </fo:instream-foreign-object>
503
+ </fo:block>
504
+ </fo:table-cell>
505
+ <fo:table-cell>
506
+ <fo:block font-size="1">
507
+ <fo:instream-foreign-object content-width="25.8mm" fox:alt-text="Image Logo IHO">
508
+ <xsl:copy-of select="$Image-Text-IHO-SVG"/>
509
+ </fo:instream-foreign-object>
510
+ </fo:block>
511
+ </fo:table-cell>
512
+ <fo:table-cell number-rows-spanned="2">
513
+ <fo:block-container width="79mm" height="72mm" margin-left="56.8mm" background-color="rgb(0, 172, 158)" text-align="right" display-align="after">
514
+ <fo:block-container margin-left="0mm">
515
+ <fo:block font-size="8pt" color="white" margin-right="5mm" margin-bottom="5mm" line-height-shift-adjustment="disregard-shifts">
516
+ <xsl:apply-templates select="/mn:metanorma/mn:boilerplate/mn:feedback-statement"/>
517
+ </fo:block>
518
+ </fo:block-container>
519
+ </fo:block-container>
520
+ </fo:table-cell>
521
+ </fo:table-row>
522
+ <fo:table-row>
523
+ <fo:table-cell number-columns-spanned="2" padding-top="2mm">
524
+ <fo:block-container width="51.5mm">
525
+ <fo:block>
526
+ <xsl:for-each select="/mn:metanorma/mn:bibdata/mn:contributor[mn:role/@type = 'publisher']/mn:organization[not(mn:abbreviation = 'IHO')]">
527
+ <xsl:apply-templates select="mn:logo/mn:image">
528
+ <xsl:with-param name="logo_width">25.8mm</xsl:with-param>
529
+ </xsl:apply-templates>
530
+ <xsl:if test="position() != last()"><fo:inline> </fo:inline></xsl:if>
531
+ </xsl:for-each>
532
+ </fo:block>
533
+ </fo:block-container>
534
+ </fo:table-cell>
535
+ </fo:table-row>
536
+ </fo:table-body>
537
+ </fo:table>
538
+ </fo:block-container>
539
+ </xsl:otherwise>
540
+ </xsl:choose>
541
+ </fo:flow>
542
+ </fo:page-sequence>
543
+ <!-- End Cover Page -->
544
+ <!-- =========================== -->
545
+ <!-- =========================== -->
546
+ </xsl:template>
547
+
499
548
  <xsl:template name="insertListOf_Title">
500
549
  <xsl:param name="title"/>
501
550
  <fo:block role="TOCI" font-weight="bold" margin-top="6pt" keep-with-next="always">
@@ -566,7 +615,7 @@
566
615
  </redirect:write>
567
616
  </xsl:if>
568
617
 
569
- <xsl:if test="count(*) = 1 and mn:title"> <!-- if there isn't user ToC -->
618
+ <xsl:if test="count(*) = 1 and mn:fmt-title"> <!-- if there isn't user ToC -->
570
619
 
571
620
  <fo:block line-height="115%" role="TOC">
572
621
 
@@ -635,7 +684,7 @@
635
684
  </fo:block>
636
685
  </xsl:template>
637
686
 
638
- <xsl:template match="mn:preface//mn:clause[@type = 'toc']/mn:title" priority="3">
687
+ <xsl:template match="mn:preface//mn:clause[@type = 'toc']/mn:fmt-title" priority="3">
639
688
  <fo:block font-weight="bold" margin-bottom="7.5pt" font-size="12pt" margin-top="4pt" role="SKIP">
640
689
  <fo:block-container width="18.3mm" border-bottom="1.25pt solid black" role="SKIP">
641
690
  <fo:block line-height="75%">
@@ -782,14 +831,14 @@
782
831
  <!-- title -->
783
832
  <!-- ====== -->
784
833
 
785
- <xsl:template match="mn:annex/mn:title">
834
+ <xsl:template match="mn:annex/mn:fmt-title">
786
835
  <fo:block font-size="12pt" font-weight="bold" text-align="center" margin-bottom="12pt" keep-with-next="always" role="H1">
787
836
  <xsl:apply-templates/>
788
837
  <xsl:apply-templates select="following-sibling::*[1][mn:variant-title][@type = 'sub']" mode="subtitle"/>
789
838
  </fo:block>
790
839
  </xsl:template>
791
840
 
792
- <xsl:template match="mn:bibliography/mn:references[not(@normative='true')]/mn:title">
841
+ <xsl:template match="mn:bibliography/mn:references[not(@normative='true')]/mn:fmt-title">
793
842
  <fo:block font-size="16pt" font-weight="bold" text-align="center" margin-top="6pt" margin-bottom="36pt" keep-with-next="always" role="H1">
794
843
  <xsl:apply-templates/>
795
844
  </fo:block>
@@ -800,7 +849,7 @@
800
849
  <fo:block break-after="page"/>
801
850
  </xsl:if>
802
851
  <xsl:choose>
803
- <xsl:when test="mn:title">
852
+ <xsl:when test="mn:fmt-title">
804
853
  <xsl:apply-templates/>
805
854
  </xsl:when>
806
855
  <xsl:otherwise>
@@ -813,7 +862,7 @@
813
862
  </xsl:choose>
814
863
  </xsl:template>
815
864
 
816
- <xsl:template match="mn:title" name="title">
865
+ <xsl:template match="mn:fmt-title" name="title">
817
866
 
818
867
  <xsl:variable name="level">
819
868
  <xsl:call-template name="getLevel"/>
@@ -844,7 +893,7 @@
844
893
  <xsl:attribute name="space-before">
845
894
  <xsl:choose>
846
895
  <xsl:when test="$level = 1">24pt</xsl:when>
847
- <xsl:when test="$level = 2 and ../preceding-sibling::*[1][self::mn:title]">10pt</xsl:when>
896
+ <xsl:when test="$level = 2 and ../preceding-sibling::*[1][self::mn:fmt-title]">10pt</xsl:when>
848
897
  <xsl:when test="$level = 2">24pt</xsl:when>
849
898
  <xsl:when test="$level &gt;= 3">6pt</xsl:when>
850
899
  <xsl:when test="ancestor::mn:preface">8pt</xsl:when>
@@ -889,7 +938,7 @@
889
938
  <xsl:variable name="element-name">
890
939
  <xsl:choose>
891
940
  <xsl:when test="$inline = 'true'">fo:inline</xsl:when>
892
- <xsl:when test="../@inline-header = 'true' and $previous-element = 'title'">fo:inline</xsl:when> <!-- first paragraph after inline title -->
941
+ <xsl:when test="../@inline-header = 'true' and $previous-element = 'fmt-title'">fo:inline</xsl:when> <!-- first paragraph after inline title -->
893
942
  <xsl:when test="parent::mn:admonition">fo:inline</xsl:when>
894
943
  <xsl:when test="ancestor::*[self::mn:recommendation or self::mn:requirement or self::mn:permission] and not(preceding-sibling::mn:p)">fo:inline</xsl:when>
895
944
  <xsl:otherwise>fo:block</xsl:otherwise>
@@ -1005,7 +1054,7 @@
1005
1054
  <fo:table-body>
1006
1055
  <fo:table-row>
1007
1056
  <fo:table-cell><fo:block> </fo:block></fo:table-cell>
1008
- <fo:table-cell text-align="center"><fo:block><xsl:copy-of select="$title-en"/></fo:block></fo:table-cell>
1057
+ <fo:table-cell text-align="center"><fo:block><xsl:copy-of select="$title_header"/></fo:block></fo:table-cell>
1009
1058
  <fo:table-cell text-align="right"><fo:block><fo:page-number/></fo:block></fo:table-cell>
1010
1059
  </fo:table-row>
1011
1060
  </fo:table-body>
@@ -1023,7 +1072,7 @@
1023
1072
  <fo:table-body>
1024
1073
  <fo:table-row>
1025
1074
  <fo:table-cell><fo:block><fo:page-number/></fo:block></fo:table-cell>
1026
- <fo:table-cell text-align="center"><fo:block><xsl:copy-of select="$title-en"/></fo:block></fo:table-cell>
1075
+ <fo:table-cell text-align="center"><fo:block><xsl:copy-of select="$title_header"/></fo:block></fo:table-cell>
1027
1076
  <fo:table-cell><fo:block> </fo:block></fo:table-cell>
1028
1077
  </fo:table-row>
1029
1078
  </fo:table-body>
@@ -1045,7 +1094,7 @@
1045
1094
  <fo:table-body>
1046
1095
  <fo:table-row>
1047
1096
  <fo:table-cell><fo:block><fo:page-number/></fo:block></fo:table-cell>
1048
- <fo:table-cell text-align="center"><fo:block><xsl:copy-of select="$title-en"/></fo:block></fo:table-cell>
1097
+ <fo:table-cell text-align="center"><fo:block><xsl:copy-of select="$title_header"/></fo:block></fo:table-cell>
1049
1098
  <fo:table-cell><fo:block> </fo:block></fo:table-cell>
1050
1099
  </fo:table-row>
1051
1100
  </fo:table-body>
@@ -1317,10 +1366,6 @@
1317
1366
  <title-part lang="ru">
1318
1367
  </title-part>
1319
1368
  <title-part lang="zh">第 # 部分:</title-part>
1320
-
1321
- <title-subpart lang="en">Sub-part #</title-subpart>
1322
- <title-subpart lang="fr">Partie de sub #</title-subpart>
1323
-
1324
1369
  </xsl:variable>
1325
1370
  <xsl:variable name="titles" select="xalan:nodeset($titles_)"/>
1326
1371
 
@@ -1773,7 +1818,8 @@
1773
1818
  <xsl:template match="mn:stem" mode="update_xml_step1"/>
1774
1819
 
1775
1820
  <xsl:template match="mn:fmt-stem" mode="update_xml_step1">
1776
- <xsl:element name="stem" namespace="{$namespace_full}">
1821
+ <!-- <xsl:element name="stem" namespace="{$namespace_full}"> -->
1822
+ <xsl:copy>
1777
1823
  <xsl:copy-of select="@*"/>
1778
1824
  <xsl:choose>
1779
1825
  <xsl:when test="mn:semx and count(node()) = 1">
@@ -1797,7 +1843,8 @@
1797
1843
  </xsl:choose>
1798
1844
  </xsl:otherwise>
1799
1845
  </xsl:choose>
1800
- </xsl:element>
1846
+ </xsl:copy>
1847
+ <!-- </xsl:element> -->
1801
1848
  </xsl:template>
1802
1849
 
1803
1850
  <xsl:template match="mn:image[not(.//mn:passthrough)] | mn:bibdata[not(.//mn:passthrough)] | mn:localized-strings" mode="update_xml_step1">
@@ -1959,12 +2006,14 @@
1959
2006
  </xsl:template>
1960
2007
 
1961
2008
  <xsl:template match="mn:fmt-title" mode="update_xml_step1">
1962
- <xsl:element name="title" namespace="{$namespace_full}">
2009
+ <!-- <xsl:element name="title" namespace="{$namespace_full}"> -->
2010
+ <xsl:copy>
1963
2011
  <xsl:copy-of select="@*"/>
1964
2012
  <xsl:call-template name="addNamedDestinationAttribute"/>
1965
2013
 
1966
2014
  <xsl:apply-templates mode="update_xml_step1"/>
1967
- </xsl:element>
2015
+ </xsl:copy>
2016
+ <!-- </xsl:element> -->
1968
2017
  </xsl:template>
1969
2018
 
1970
2019
  <xsl:template name="addNamedDestinationAttribute">
@@ -1976,12 +2025,14 @@
1976
2025
  <xsl:apply-templates mode="update_xml_step1"/>
1977
2026
  </xsl:when>
1978
2027
  <xsl:otherwise>
1979
- <xsl:element name="name" namespace="{$namespace_full}">
2028
+ <!-- <xsl:element name="name" namespace="{$namespace_full}"> -->
2029
+ <xsl:copy>
1980
2030
  <xsl:copy-of select="@*"/>
1981
2031
  <xsl:call-template name="addNamedDestinationAttribute"/>
1982
2032
 
1983
2033
  <xsl:apply-templates mode="update_xml_step1"/>
1984
- </xsl:element>
2034
+ </xsl:copy>
2035
+ <!-- </xsl:element> -->
1985
2036
  </xsl:otherwise>
1986
2037
  </xsl:choose>
1987
2038
  </xsl:template>
@@ -1996,7 +2047,7 @@
1996
2047
  <xsl:apply-templates mode="update_xml_step1"/>
1997
2048
  </xsl:template>
1998
2049
  <xsl:template match="mn:fmt-preferred[not(mn:p)] | mn:fmt-preferred/mn:p" mode="update_xml_step1">
1999
- <xsl:element name="preferred" namespace="{$namespace_full}">
2050
+ <xsl:element name="fmt-preferred" namespace="{$namespace_full}">
2000
2051
  <xsl:copy-of select="@*"/>
2001
2052
  <xsl:apply-templates mode="update_xml_step1"/>
2002
2053
  </xsl:element>
@@ -2006,7 +2057,7 @@
2006
2057
  <xsl:apply-templates mode="update_xml_step1"/>
2007
2058
  </xsl:template>
2008
2059
  <xsl:template match="mn:fmt-admitted[not(mn:p)] | mn:fmt-admitted/mn:p" mode="update_xml_step1">
2009
- <xsl:element name="admitted" namespace="{$namespace_full}">
2060
+ <xsl:element name="fmt-admitted" namespace="{$namespace_full}">
2010
2061
  <xsl:copy-of select="@*"/>
2011
2062
  <xsl:apply-templates mode="update_xml_step1"/>
2012
2063
  </xsl:element>
@@ -2016,32 +2067,32 @@
2016
2067
  <xsl:apply-templates mode="update_xml_step1"/>
2017
2068
  </xsl:template>
2018
2069
  <xsl:template match="mn:fmt-deprecates[not(mn:p)] | mn:fmt-deprecates/mn:p" mode="update_xml_step1">
2019
- <xsl:element name="deprecates" namespace="{$namespace_full}">
2070
+ <xsl:element name="fmt-deprecates" namespace="{$namespace_full}">
2020
2071
  <xsl:copy-of select="@*"/>
2021
2072
  <xsl:apply-templates mode="update_xml_step1"/>
2022
2073
  </xsl:element>
2023
2074
  </xsl:template>
2024
2075
 
2025
- <xsl:template match="mn:fmt-definition" mode="update_xml_step1">
2076
+ <!-- <xsl:template match="mn:fmt-definition" mode="update_xml_step1">
2026
2077
  <xsl:element name="definition" namespace="{$namespace_full}">
2027
2078
  <xsl:copy-of select="@*"/>
2028
2079
  <xsl:apply-templates mode="update_xml_step1"/>
2029
2080
  </xsl:element>
2030
2081
  </xsl:template>
2031
-
2082
+
2032
2083
  <xsl:template match="mn:fmt-termsource" mode="update_xml_step1">
2033
2084
  <xsl:element name="termsource" namespace="{$namespace_full}">
2034
2085
  <xsl:copy-of select="@*"/>
2035
2086
  <xsl:apply-templates mode="update_xml_step1"/>
2036
2087
  </xsl:element>
2037
2088
  </xsl:template>
2038
-
2089
+
2039
2090
  <xsl:template match="mn:fmt-source" mode="update_xml_step1">
2040
2091
  <xsl:element name="source" namespace="{$namespace_full}">
2041
2092
  <xsl:copy-of select="@*"/>
2042
2093
  <xsl:apply-templates mode="update_xml_step1"/>
2043
2094
  </xsl:element>
2044
- </xsl:template>
2095
+ </xsl:template> -->
2045
2096
 
2046
2097
  <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">
2047
2098
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -2064,12 +2115,12 @@
2064
2115
  </xsl:template>
2065
2116
 
2066
2117
  <xsl:template match="mn:identifier" mode="update_xml_step1"/>
2067
- <xsl:template match="mn:fmt-identifier" mode="update_xml_step1">
2118
+ <!-- <xsl:template match="mn:fmt-identifier" mode="update_xml_step1">
2068
2119
  <xsl:element name="identifier" namespace="{$namespace_full}">
2069
2120
  <xsl:copy-of select="@*"/>
2070
2121
  <xsl:apply-templates mode="update_xml_step1"/>
2071
2122
  </xsl:element>
2072
- </xsl:template>
2123
+ </xsl:template> -->
2073
2124
 
2074
2125
  <xsl:template match="mn:concept" mode="update_xml_step1"/>
2075
2126
 
@@ -2079,51 +2130,53 @@
2079
2130
 
2080
2131
  <xsl:template match="mn:eref" mode="update_xml_step1"/>
2081
2132
 
2082
- <xsl:template match="mn:fmt-eref" mode="update_xml_step1">
2133
+ <!-- <xsl:template match="mn:fmt-eref" mode="update_xml_step1">
2083
2134
  <xsl:element name="eref" namespace="{$namespace_full}">
2084
2135
  <xsl:copy-of select="@*"/>
2085
2136
  <xsl:apply-templates mode="update_xml_step1"/>
2086
2137
  </xsl:element>
2087
- </xsl:template>
2138
+ </xsl:template> -->
2088
2139
 
2089
2140
  <xsl:template match="mn:xref" mode="update_xml_step1"/>
2090
2141
 
2091
- <xsl:template match="mn:fmt-xref" mode="update_xml_step1">
2142
+ <!-- <xsl:template match="mn:fmt-xref" mode="update_xml_step1">
2092
2143
  <xsl:element name="xref" namespace="{$namespace_full}">
2093
2144
  <xsl:copy-of select="@*"/>
2094
2145
  <xsl:apply-templates mode="update_xml_step1"/>
2095
2146
  </xsl:element>
2096
- </xsl:template>
2147
+ </xsl:template> -->
2097
2148
 
2098
2149
  <xsl:template match="mn:link" mode="update_xml_step1"/>
2099
2150
 
2100
- <xsl:template match="mn:fmt-link" mode="update_xml_step1">
2151
+ <!-- <xsl:template match="mn:fmt-link" mode="update_xml_step1">
2101
2152
  <xsl:element name="link" namespace="{$namespace_full}">
2102
2153
  <xsl:copy-of select="@*"/>
2103
2154
  <xsl:apply-templates mode="update_xml_step1"/>
2104
2155
  </xsl:element>
2105
- </xsl:template>
2156
+ </xsl:template> -->
2106
2157
 
2107
2158
  <xsl:template match="mn:origin" mode="update_xml_step1"/>
2108
2159
 
2109
- <xsl:template match="mn:fmt-origin" mode="update_xml_step1">
2160
+ <!-- <xsl:template match="mn:fmt-origin" mode="update_xml_step1">
2110
2161
  <xsl:element name="origin" namespace="{$namespace_full}">
2111
2162
  <xsl:copy-of select="@*"/>
2112
2163
  <xsl:apply-templates mode="update_xml_step1"/>
2113
2164
  </xsl:element>
2114
- </xsl:template>
2165
+ </xsl:template> -->
2115
2166
 
2116
2167
  <xsl:template match="mn:erefstack" mode="update_xml_step1"/>
2117
2168
 
2118
2169
  <xsl:template match="mn:svgmap" mode="update_xml_step1"/>
2119
2170
 
2120
- <xsl:template match="mn:review-container" mode="update_xml_step1"/>
2171
+ <xsl:template match="mn:annotation-container" mode="update_xml_step1"/>
2121
2172
 
2122
- <xsl:template match="mn:fmt-identifier[not(ancestor::*[local-name() = 'bibdata'])]//text()" mode="update_xml_step1">
2123
- <xsl:element name="{$element_name_keep-together_within-line}" namespace="{$namespace_full}">
2124
- <xsl:value-of select="."/>
2125
- </xsl:element>
2126
- </xsl:template>
2173
+ <xsl:template match="mn:fmt-identifier[not(ancestor::*[local-name() = 'bibdata'])]//text()" mode="update_xml_step1">
2174
+ <xsl:element name="{$element_name_keep-together_within-line}" namespace="{$namespace_full}">
2175
+ <xsl:value-of select="."/>
2176
+ </xsl:element>
2177
+ </xsl:template>
2178
+
2179
+ <xsl:template match="@semx-id | @anchor" mode="update_xml_step1"/>
2127
2180
 
2128
2181
  <!-- END: update new Presentation XML -->
2129
2182
 
@@ -2319,7 +2372,7 @@
2319
2372
  <xsl:variable name="non_white_space">[^\s\u3000-\u9FFF]</xsl:variable>
2320
2373
  <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>
2321
2374
 
2322
- <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">
2375
+ <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">
2323
2376
 
2324
2377
  <xsl:variable name="parent" select="local-name(..)"/>
2325
2378
 
@@ -2438,7 +2491,7 @@
2438
2491
  </xsl:if>
2439
2492
  </xsl:template>
2440
2493
 
2441
- <xsl:template match="mn:stem | mn:image" mode="update_xml_enclose_keep-together_within-line">
2494
+ <xsl:template match="mn:fmt-stem | mn:image" mode="update_xml_enclose_keep-together_within-line">
2442
2495
  <xsl:copy-of select="."/>
2443
2496
  </xsl:template>
2444
2497
 
@@ -2765,7 +2818,7 @@
2765
2818
  </fo:block>
2766
2819
  </xsl:template> <!-- copyright-statement -->
2767
2820
 
2768
- <xsl:template match="mn:copyright-statement//mn:title">
2821
+ <xsl:template match="mn:copyright-statement//mn:fmt-title">
2769
2822
  <!-- process in the template 'title' -->
2770
2823
  <xsl:call-template name="title"/>
2771
2824
  </xsl:template> <!-- copyright-statement//title -->
@@ -2781,7 +2834,7 @@
2781
2834
  </fo:block>
2782
2835
  </xsl:template> <!-- license-statement -->
2783
2836
 
2784
- <xsl:template match="mn:license-statement//mn:title">
2837
+ <xsl:template match="mn:license-statement//mn:fmt-title">
2785
2838
  <!-- process in the template 'title' -->
2786
2839
  <xsl:call-template name="title"/>
2787
2840
  </xsl:template> <!-- license-statement/title -->
@@ -2798,7 +2851,7 @@
2798
2851
  </fo:block>
2799
2852
  </xsl:template> <!-- legal-statement -->
2800
2853
 
2801
- <xsl:template match="mn:legal-statement//mn:title">
2854
+ <xsl:template match="mn:legal-statement//mn:fmt-title">
2802
2855
  <!-- process in the template 'title' -->
2803
2856
  <xsl:call-template name="title"/>
2804
2857
 
@@ -2818,7 +2871,7 @@
2818
2871
  </fo:block>
2819
2872
  </xsl:template> <!-- feedback-statement -->
2820
2873
 
2821
- <xsl:template match="mn:feedback-statement//mn:title">
2874
+ <xsl:template match="mn:feedback-statement//mn:fmt-title">
2822
2875
  <!-- process in the template 'title' -->
2823
2876
  <xsl:call-template name="title"/>
2824
2877
  </xsl:template>
@@ -2843,7 +2896,7 @@
2843
2896
  <xsl:template name="refine_link-style">
2844
2897
  </xsl:template> <!-- refine_link-style -->
2845
2898
 
2846
- <xsl:template match="mn:link" name="link">
2899
+ <xsl:template match="mn:fmt-link" name="link">
2847
2900
  <xsl:variable name="target_normalized" select="translate(@target, '\', '/')"/>
2848
2901
  <xsl:variable name="target_attachment_name" select="substring-after($target_normalized, '_attachments/')"/>
2849
2902
  <xsl:variable name="isLinkToEmbeddedFile" select="normalize-space(@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target])"/>
@@ -3065,7 +3118,7 @@
3065
3118
  <xsl:value-of select="."/>
3066
3119
  </xsl:attribute>
3067
3120
  </xsl:for-each>
3068
- <xsl:apply-templates select="node()[not(self::mn:name)]"/>
3121
+ <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
3069
3122
  </xsl:when>
3070
3123
 
3071
3124
  <xsl:otherwise>
@@ -3107,11 +3160,11 @@
3107
3160
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
3108
3161
  </xsl:if>
3109
3162
 
3110
- <xsl:apply-templates select="node()[not(self::mn:name or self::mn:dl)]"/>
3163
+ <xsl:apply-templates select="node()[not(self::mn:fmt-name or self::mn:dl)]"/>
3111
3164
  </fo:block>
3112
3165
 
3113
3166
  <xsl:apply-templates select="mn:dl"/> <!-- Key table -->
3114
- <xsl:apply-templates select="mn:name"/> <!-- show sourcecode's name AFTER content -->
3167
+ <xsl:apply-templates select="mn:fmt-name"/> <!-- show sourcecode's name AFTER content -->
3115
3168
 
3116
3169
  </fo:block-container>
3117
3170
  </fo:block-container>
@@ -3412,7 +3465,7 @@
3412
3465
 
3413
3466
  <!-- end mode="syntax_highlight" -->
3414
3467
 
3415
- <xsl:template match="mn:sourcecode/mn:name">
3468
+ <xsl:template match="mn:sourcecode/mn:fmt-name">
3416
3469
  <xsl:if test="normalize-space() != ''">
3417
3470
  <fo:block xsl:use-attribute-sets="sourcecode-name-style">
3418
3471
  <xsl:apply-templates/>
@@ -3430,7 +3483,7 @@
3430
3483
  </xsl:choose>
3431
3484
  </xsl:template>
3432
3485
 
3433
- <xsl:template match="mn:annotation">
3486
+ <xsl:template match="mn:callout-annotation">
3434
3487
  <xsl:variable name="annotation-id" select="@id"/>
3435
3488
  <xsl:variable name="callout" select="//*[@target = $annotation-id]/text()"/>
3436
3489
  <fo:block id="{$annotation-id}" white-space="nowrap">
@@ -3442,7 +3495,7 @@
3442
3495
  </fo:block>
3443
3496
  </xsl:template>
3444
3497
 
3445
- <xsl:template match="mn:annotation/mn:p">
3498
+ <xsl:template match="mn:callout-annotation/mn:p">
3446
3499
  <xsl:param name="callout"/>
3447
3500
  <fo:inline id="{@id}">
3448
3501
  <xsl:call-template name="setNamedDestination"/>
@@ -3595,7 +3648,7 @@
3595
3648
  <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
3596
3649
  <change-open-tag>A<sub>1</sub></change-open-tag>, <change-close-tag>A<sub>1</sub></change-close-tag> -->
3597
3650
  <xsl:choose>
3598
- <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>
3651
+ <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>
3599
3652
  <xsl:otherwise>
3600
3653
  <xsl:variable name="tag">
3601
3654
  <xsl:call-template name="insertTag">
@@ -4000,12 +4053,12 @@
4000
4053
  <xsl:template match="mn:permission">
4001
4054
  <xsl:call-template name="setNamedDestination"/>
4002
4055
  <fo:block id="{@id}" xsl:use-attribute-sets="permission-style">
4003
- <xsl:apply-templates select="mn:name"/>
4004
- <xsl:apply-templates select="node()[not(self::mn:name)]"/>
4056
+ <xsl:apply-templates select="mn:fmt-name"/>
4057
+ <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
4005
4058
  </fo:block>
4006
4059
  </xsl:template>
4007
4060
 
4008
- <xsl:template match="mn:permission/mn:name">
4061
+ <xsl:template match="mn:permission/mn:fmt-name">
4009
4062
  <xsl:if test="normalize-space() != ''">
4010
4063
  <fo:inline xsl:use-attribute-sets="permission-name-style">
4011
4064
  <xsl:apply-templates/><xsl:text>:</xsl:text>
@@ -4028,15 +4081,15 @@
4028
4081
  <xsl:template match="mn:requirement">
4029
4082
  <xsl:call-template name="setNamedDestination"/>
4030
4083
  <fo:block id="{@id}" xsl:use-attribute-sets="requirement-style">
4031
- <xsl:apply-templates select="mn:name"/>
4084
+ <xsl:apply-templates select="mn:fmt-name"/>
4032
4085
  <xsl:apply-templates select="mn:label"/>
4033
4086
  <xsl:apply-templates select="@obligation"/>
4034
4087
  <xsl:apply-templates select="mn:subject"/>
4035
- <xsl:apply-templates select="node()[not(self::mn:name) and not(self::mn:label) and not(self::mn:subject)]"/>
4088
+ <xsl:apply-templates select="node()[not(self::mn:fmt-name) and not(self::mn:label) and not(self::mn:subject)]"/>
4036
4089
  </fo:block>
4037
4090
  </xsl:template>
4038
4091
 
4039
- <xsl:template match="mn:requirement/mn:name">
4092
+ <xsl:template match="mn:requirement/mn:fmt-name">
4040
4093
  <xsl:if test="normalize-space() != ''">
4041
4094
  <fo:inline xsl:use-attribute-sets="requirement-name-style">
4042
4095
  <xsl:apply-templates/><xsl:text>:</xsl:text>
@@ -4072,12 +4125,12 @@
4072
4125
  <xsl:template match="mn:recommendation">
4073
4126
  <xsl:call-template name="setNamedDestination"/>
4074
4127
  <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
4075
- <xsl:apply-templates select="mn:name"/>
4076
- <xsl:apply-templates select="node()[not(self::mn:name)]"/>
4128
+ <xsl:apply-templates select="mn:fmt-name"/>
4129
+ <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
4077
4130
  </fo:block>
4078
4131
  </xsl:template>
4079
4132
 
4080
- <xsl:template match="mn:recommendation/mn:name">
4133
+ <xsl:template match="mn:recommendation/mn:fmt-name">
4081
4134
  <xsl:if test="normalize-space() != ''">
4082
4135
  <fo:inline xsl:use-attribute-sets="recommendation-name-style">
4083
4136
  <xsl:apply-templates/><xsl:text>:</xsl:text>
@@ -4332,11 +4385,11 @@
4332
4385
 
4333
4386
  <xsl:if test="parent::mn:term and not(preceding-sibling::mn:term)">
4334
4387
  </xsl:if>
4335
- <xsl:apply-templates select="node()[not(self::mn:name)]"/>
4388
+ <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
4336
4389
  </fo:block>
4337
4390
  </xsl:template>
4338
4391
 
4339
- <xsl:template match="mn:term/mn:name">
4392
+ <xsl:template match="mn:term/mn:fmt-name">
4340
4393
  <xsl:if test="normalize-space() != ''">
4341
4394
  <!-- <xsl:variable name="level">
4342
4395
  <xsl:call-template name="getLevelTermName"/>
@@ -4355,7 +4408,7 @@
4355
4408
  <!-- origin -->
4356
4409
  <!-- modification -->
4357
4410
  <!-- ====== -->
4358
- <xsl:template match="mn:termsource" name="termsource">
4411
+ <xsl:template match="mn:fmt-termsource" name="termsource">
4359
4412
  <fo:block xsl:use-attribute-sets="termsource-style">
4360
4413
 
4361
4414
  <xsl:call-template name="refine_termsource-style"/>
@@ -4394,24 +4447,24 @@
4394
4447
  </fo:block>
4395
4448
  </xsl:template>
4396
4449
 
4397
- <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">
4450
+ <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">
4398
4451
  <xsl:text>[</xsl:text><xsl:value-of select="substring-after(., '[SOURCE: ')"/>
4399
4452
  </xsl:template>
4400
4453
 
4401
- <xsl:template match="mn:termsource/text()">
4454
+ <xsl:template match="mn:fmt-termsource/text()">
4402
4455
  <xsl:if test="normalize-space() != ''">
4403
4456
  <xsl:value-of select="."/>
4404
4457
  </xsl:if>
4405
4458
  </xsl:template>
4406
4459
 
4407
4460
  <!-- text SOURCE: -->
4408
- <xsl:template match="mn:termsource/mn:strong[1][following-sibling::*[1][self::mn:origin]]/text()">
4461
+ <xsl:template match="mn:fmt-termsource/mn:strong[1][following-sibling::*[1][self::mn:fmt-origin]]/text()">
4409
4462
  <fo:inline xsl:use-attribute-sets="termsource-text-style">
4410
4463
  <xsl:value-of select="."/>
4411
4464
  </fo:inline>
4412
4465
  </xsl:template>
4413
4466
 
4414
- <xsl:template match="mn:origin">
4467
+ <xsl:template match="mn:fmt-origin">
4415
4468
  <xsl:call-template name="insert_basic_link">
4416
4469
  <xsl:with-param name="element">
4417
4470
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
@@ -4457,7 +4510,7 @@
4457
4510
  <!-- ====== -->
4458
4511
 
4459
4512
  <!-- Preferred, admitted, deprecated -->
4460
- <xsl:template match="mn:preferred">
4513
+ <xsl:template match="mn:fmt-preferred">
4461
4514
  <xsl:variable name="level">
4462
4515
  <xsl:call-template name="getLevel"/>
4463
4516
  </xsl:variable>
@@ -4468,15 +4521,15 @@
4468
4521
  </xsl:variable>
4469
4522
  <fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="preferred-block-style">
4470
4523
 
4471
- <xsl:if test="parent::mn:term and not(preceding-sibling::mn:preferred)"> <!-- if first preffered in term, then display term's name -->
4524
+ <xsl:if test="parent::mn:term and not(preceding-sibling::mn:fmt-preferred)"> <!-- if first preffered in term, then display term's name -->
4472
4525
 
4473
4526
  <fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
4474
4527
 
4475
- <xsl:for-each select="ancestor::mn:term[1]/mn:name"><!-- change context -->
4528
+ <xsl:for-each select="ancestor::mn:term[1]/mn:fmt-name"><!-- change context -->
4476
4529
  <xsl:call-template name="setIDforNamedDestination"/>
4477
4530
  </xsl:for-each>
4478
4531
 
4479
- <xsl:apply-templates select="ancestor::mn:term[1]/mn:name"/>
4532
+ <xsl:apply-templates select="ancestor::mn:term[1]/mn:fmt-name"/>
4480
4533
  </fo:block>
4481
4534
  </xsl:if>
4482
4535
 
@@ -4500,13 +4553,13 @@
4500
4553
  <!-- https://github.com/metanorma/isodoc/issues/632#issuecomment-2567163931 -->
4501
4554
  <xsl:template match="mn:domain"/>
4502
4555
 
4503
- <xsl:template match="mn:admitted">
4556
+ <xsl:template match="mn:fmt-admitted">
4504
4557
  <fo:block xsl:use-attribute-sets="admitted-style">
4505
4558
  <xsl:apply-templates/>
4506
4559
  </fo:block>
4507
4560
  </xsl:template>
4508
4561
 
4509
- <xsl:template match="mn:deprecates">
4562
+ <xsl:template match="mn:fmt-deprecates">
4510
4563
  <fo:block xsl:use-attribute-sets="deprecates-style">
4511
4564
  <xsl:apply-templates/>
4512
4565
  </fo:block>
@@ -4520,7 +4573,7 @@
4520
4573
 
4521
4574
  <!-- regarding ISO 10241-1:2011, If there is more than one preferred term, each preferred term follows the previous one on a new line. -->
4522
4575
  <!-- in metanorma xml preferred terms delimited by semicolons -->
4523
- <xsl:template match="mn:preferred/text()[contains(., ';')] | mn:preferred/mn:strong/text()[contains(., ';')]">
4576
+ <xsl:template match="mn:fmt-preferred/text()[contains(., ';')] | mn:fmt-preferred/mn:strong/text()[contains(., ';')]">
4524
4577
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.), ';', $linebreak)"/>
4525
4578
  </xsl:template>
4526
4579
  <!-- End Preferred, admitted, deprecated -->
@@ -4539,16 +4592,16 @@
4539
4592
  <!-- ========== -->
4540
4593
  <!-- definition -->
4541
4594
  <!-- ========== -->
4542
- <xsl:template match="mn:definition">
4595
+ <xsl:template match="mn:fmt-definition">
4543
4596
  <fo:block xsl:use-attribute-sets="definition-style" role="SKIP">
4544
4597
  <xsl:apply-templates/>
4545
4598
  </fo:block>
4546
4599
  </xsl:template>
4547
4600
 
4548
- <xsl:template match="mn:definition[preceding-sibling::mn:domain]">
4601
+ <xsl:template match="mn:fmt-definition[preceding-sibling::mn:domain]">
4549
4602
  <xsl:apply-templates/>
4550
4603
  </xsl:template>
4551
- <xsl:template match="mn:definition[preceding-sibling::mn:domain]/mn:p[1]">
4604
+ <xsl:template match="mn:fmt-definition[preceding-sibling::mn:domain]/mn:p[1]">
4552
4605
  <fo:inline> <xsl:apply-templates/></fo:inline>
4553
4606
  <fo:block/>
4554
4607
  </xsl:template>
@@ -4621,12 +4674,12 @@
4621
4674
  <xsl:call-template name="refine_termexample-style"/>
4622
4675
  <xsl:call-template name="setBlockSpanAll"/>
4623
4676
 
4624
- <xsl:apply-templates select="mn:name"/>
4625
- <xsl:apply-templates select="node()[not(self::mn:name)]"/>
4677
+ <xsl:apply-templates select="mn:fmt-name"/>
4678
+ <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
4626
4679
  </fo:block>
4627
4680
  </xsl:template>
4628
4681
 
4629
- <xsl:template match="mn:termexample/mn:name">
4682
+ <xsl:template match="mn:termexample/mn:fmt-name">
4630
4683
  <xsl:if test="normalize-space() != ''">
4631
4684
  <fo:inline xsl:use-attribute-sets="termexample-name-style">
4632
4685
  <xsl:call-template name="refine_termexample-name-style"/>
@@ -4677,7 +4730,7 @@
4677
4730
  <xsl:call-template name="refine_example-style"/>
4678
4731
 
4679
4732
  <xsl:variable name="fo_element">
4680
- <xsl:if test=".//mn:table or .//mn:dl or *[not(self::mn:name)][1][self::mn:sourcecode]">block</xsl:if>inline
4733
+ <xsl:if test=".//mn:table or .//mn:dl or *[not(self::mn:fmt-name)][1][self::mn:sourcecode]">block</xsl:if>inline
4681
4734
  </xsl:variable>
4682
4735
 
4683
4736
  <fo:block-container margin-left="0mm" role="SKIP">
@@ -4688,7 +4741,7 @@
4688
4741
 
4689
4742
  <!-- display name 'EXAMPLE' in a separate block -->
4690
4743
  <fo:block>
4691
- <xsl:apply-templates select="mn:name">
4744
+ <xsl:apply-templates select="mn:fmt-name">
4692
4745
  <xsl:with-param name="fo_element" select="$fo_element"/>
4693
4746
  </xsl:apply-templates>
4694
4747
  </fo:block>
@@ -4696,7 +4749,7 @@
4696
4749
  <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
4697
4750
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
4698
4751
  <xsl:variable name="example_body">
4699
- <xsl:apply-templates select="node()[not(self::mn:name)]">
4752
+ <xsl:apply-templates select="node()[not(self::mn:fmt-name)]">
4700
4753
  <xsl:with-param name="fo_element" select="$fo_element"/>
4701
4754
  </xsl:apply-templates>
4702
4755
  </xsl:variable>
@@ -4723,14 +4776,14 @@
4723
4776
  <fo:list-item>
4724
4777
  <fo:list-item-label start-indent="{$indent}mm" end-indent="label-end()">
4725
4778
  <fo:block>
4726
- <xsl:apply-templates select="mn:name">
4779
+ <xsl:apply-templates select="mn:fmt-name">
4727
4780
  <xsl:with-param name="fo_element">block</xsl:with-param>
4728
4781
  </xsl:apply-templates>
4729
4782
  </fo:block>
4730
4783
  </fo:list-item-label>
4731
4784
  <fo:list-item-body start-indent="body-start()">
4732
4785
  <fo:block>
4733
- <xsl:apply-templates select="node()[not(self::mn:name)]">
4786
+ <xsl:apply-templates select="node()[not(self::mn:fmt-name)]">
4734
4787
  <xsl:with-param name="fo_element" select="$fo_element"/>
4735
4788
  </xsl:apply-templates>
4736
4789
  </fo:block>
@@ -4743,21 +4796,21 @@
4743
4796
 
4744
4797
  <!-- display 'EXAMPLE' and first element in the same line -->
4745
4798
  <fo:block>
4746
- <xsl:apply-templates select="mn:name">
4799
+ <xsl:apply-templates select="mn:fmt-name">
4747
4800
  <xsl:with-param name="fo_element" select="$fo_element"/>
4748
4801
  </xsl:apply-templates>
4749
4802
  <fo:inline>
4750
- <xsl:apply-templates select="*[not(self::mn:name)][1]">
4803
+ <xsl:apply-templates select="*[not(self::mn:fmt-name)][1]">
4751
4804
  <xsl:with-param name="fo_element" select="$fo_element"/>
4752
4805
  </xsl:apply-templates>
4753
4806
  </fo:inline>
4754
4807
  </fo:block>
4755
4808
 
4756
- <xsl:if test="*[not(self::mn:name)][position() &gt; 1]">
4809
+ <xsl:if test="*[not(self::mn:fmt-name)][position() &gt; 1]">
4757
4810
  <!-- display further elements in blocks -->
4758
4811
  <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
4759
4812
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
4760
- <xsl:apply-templates select="*[not(self::mn:name)][position() &gt; 1]">
4813
+ <xsl:apply-templates select="*[not(self::mn:fmt-name)][position() &gt; 1]">
4761
4814
  <xsl:with-param name="fo_element" select="'block'"/>
4762
4815
  </xsl:apply-templates>
4763
4816
  </fo:block-container>
@@ -4771,7 +4824,7 @@
4771
4824
  </xsl:template>
4772
4825
 
4773
4826
  <!-- example/name -->
4774
- <xsl:template match="mn:example/mn:name">
4827
+ <xsl:template match="mn:example/mn:fmt-name">
4775
4828
  <xsl:param name="fo_element">block</xsl:param>
4776
4829
 
4777
4830
  <xsl:choose>
@@ -4796,7 +4849,7 @@
4796
4849
  </xsl:template>
4797
4850
 
4798
4851
  <!-- table/example/name, table/tfoot//example/name -->
4799
- <xsl:template match="mn:table/mn:example/mn:name | mn:table/mn:tfoot//mn:example/mn:name">
4852
+ <xsl:template match="mn:table/mn:example/mn:fmt-name | mn:table/mn:tfoot//mn:example/mn:fmt-name">
4800
4853
  <fo:inline xsl:use-attribute-sets="example-name-style">
4801
4854
  <xsl:apply-templates/>
4802
4855
  </fo:inline>
@@ -5076,7 +5129,7 @@
5076
5129
 
5077
5130
  <!-- Display table's name before table as standalone block -->
5078
5131
  <!-- $namespace = 'iso' or -->
5079
- <xsl:apply-templates select="mn:name"/> <!-- table's title rendered before table -->
5132
+ <xsl:apply-templates select="mn:fmt-name"/> <!-- table's title rendered before table -->
5080
5133
  <xsl:call-template name="table_name_fn_display"/>
5081
5134
 
5082
5135
  <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)/*/mn:tr[1]/mn:td)"/>
@@ -5118,7 +5171,7 @@
5118
5171
 
5119
5172
  <fo:block-container xsl:use-attribute-sets="table-container-style" role="SKIP">
5120
5173
 
5121
- <xsl:for-each select="mn:name">
5174
+ <xsl:for-each select="mn:fmt-name">
5122
5175
  <xsl:call-template name="setIDforNamedDestination"/>
5123
5176
  </xsl:for-each>
5124
5177
 
@@ -5148,6 +5201,10 @@
5148
5201
  <xsl:with-param name="margin-side" select="$margin-side"/>
5149
5202
  </xsl:call-template>
5150
5203
 
5204
+ <xsl:call-template name="setTableStyles">
5205
+ <xsl:with-param name="scope">table</xsl:with-param>
5206
+ </xsl:call-template>
5207
+
5151
5208
  </xsl:element>
5152
5209
  </xsl:variable>
5153
5210
 
@@ -5168,7 +5225,7 @@
5168
5225
  </xsl:attribute>
5169
5226
  </xsl:for-each>
5170
5227
 
5171
- <xsl:variable name="isNoteOrFnExist" select="./mn:note[not(@type = 'units')] or ./mn:example or .//mn:fn[local-name(..) != 'name'] or ./mn:source"/>
5228
+ <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"/>
5172
5229
  <xsl:if test="$isNoteOrFnExist = 'true'">
5173
5230
  <!-- <xsl:choose>
5174
5231
  <xsl:when test="$namespace = 'plateau'"></xsl:when>
@@ -5224,7 +5281,7 @@
5224
5281
  <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
5225
5282
  </xsl:when>
5226
5283
  <xsl:otherwise>
5227
- <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 -->
5284
+ <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 -->
5228
5285
  </xsl:otherwise>
5229
5286
  </xsl:choose>
5230
5287
 
@@ -5321,7 +5378,7 @@
5321
5378
  </xsl:template>
5322
5379
 
5323
5380
  <!-- table/name-->
5324
- <xsl:template match="*[local-name()='table']/mn:name">
5381
+ <xsl:template match="*[local-name()='table']/mn:fmt-name">
5325
5382
  <xsl:param name="continued"/>
5326
5383
  <xsl:param name="cols-count"/>
5327
5384
  <xsl:if test="normalize-space() != ''">
@@ -5386,7 +5443,7 @@
5386
5443
  </xsl:template>
5387
5444
 
5388
5445
  <!-- SOURCE: ... -->
5389
- <xsl:template match="*[local-name()='table']/mn:source" priority="2">
5446
+ <xsl:template match="*[local-name()='table']/mn:fmt-source" priority="2">
5390
5447
  <xsl:call-template name="termsource"/>
5391
5448
  </xsl:template>
5392
5449
 
@@ -5551,11 +5608,11 @@
5551
5608
  <xsl:value-of select="translate(., $zero_width_space, ' ')"/><xsl:text> </xsl:text>
5552
5609
  </xsl:template>
5553
5610
 
5554
- <xsl:template match="mn:termsource" mode="td_text">
5555
- <xsl:value-of select="*[local-name()='origin']/@citeas"/>
5611
+ <xsl:template match="mn:fmt-termsource" mode="td_text">
5612
+ <xsl:value-of select="mn:fmt-origin/@citeas"/>
5556
5613
  </xsl:template>
5557
5614
 
5558
- <xsl:template match="mn:link" mode="td_text">
5615
+ <xsl:template match="mn:fmt-link" mode="td_text">
5559
5616
  <xsl:value-of select="@target"/>
5560
5617
  </xsl:template>
5561
5618
 
@@ -5757,12 +5814,12 @@
5757
5814
 
5758
5815
  <xsl:call-template name="refine_table-header-title-style"/>
5759
5816
 
5760
- <xsl:apply-templates select="ancestor::mn:table/mn:name">
5817
+ <xsl:apply-templates select="ancestor::mn:table/mn:fmt-name">
5761
5818
  <xsl:with-param name="continued">true</xsl:with-param>
5762
5819
  <xsl:with-param name="cols-count" select="$cols-count"/>
5763
5820
  </xsl:apply-templates>
5764
5821
 
5765
- <xsl:if test="not(ancestor::mn:table/mn:name)"> <!-- to prevent empty fo:table-cell in case of missing table's name -->
5822
+ <xsl:if test="not(ancestor::mn:table/mn:fmt-name)"> <!-- to prevent empty fo:table-cell in case of missing table's name -->
5766
5823
  <fo:block role="SKIP"/>
5767
5824
  </xsl:if>
5768
5825
 
@@ -5797,7 +5854,7 @@
5797
5854
  <xsl:param name="colwidths"/>
5798
5855
  <xsl:param name="colgroup"/>
5799
5856
 
5800
- <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"/>
5857
+ <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"/>
5801
5858
 
5802
5859
  <xsl:variable name="isNoteOrFnExistShowAfterTable">
5803
5860
  </xsl:variable>
@@ -5838,6 +5895,12 @@
5838
5895
  </xsl:choose>
5839
5896
  </xsl:for-each>
5840
5897
 
5898
+ <xsl:for-each select="ancestor::mn:table[1]">
5899
+ <xsl:call-template name="setTableStyles">
5900
+ <xsl:with-param name="scope">table</xsl:with-param>
5901
+ </xsl:call-template>
5902
+ </xsl:for-each>
5903
+
5841
5904
  <xsl:choose>
5842
5905
  <xsl:when test="xalan:nodeset($colgroup)//mn:col">
5843
5906
  <xsl:for-each select="xalan:nodeset($colgroup)//mn:col">
@@ -5854,10 +5917,22 @@
5854
5917
 
5855
5918
  <fo:table-body role="SKIP">
5856
5919
  <fo:table-row role="SKIP">
5920
+ <xsl:for-each select="ancestor::mn:table[1]">
5921
+ <xsl:call-template name="setTableStyles">
5922
+ <xsl:with-param name="scope">ancestor_table</xsl:with-param>
5923
+ </xsl:call-template>
5924
+ </xsl:for-each>
5925
+
5857
5926
  <fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}" role="SKIP">
5858
5927
 
5859
5928
  <xsl:call-template name="refine_table-footer-cell-style"/>
5860
5929
 
5930
+ <xsl:for-each select="ancestor::mn:table[1]">
5931
+ <xsl:call-template name="setTableStyles">
5932
+ <xsl:with-param name="scope">ancestor_table_borders_only</xsl:with-param>
5933
+ </xsl:call-template>
5934
+ </xsl:for-each>
5935
+
5861
5936
  <xsl:call-template name="setBordersTableArray"/>
5862
5937
 
5863
5938
  <!-- fn will be processed inside 'note' processing -->
@@ -5865,7 +5940,7 @@
5865
5940
  <xsl:apply-templates select="../mn:dl"/>
5866
5941
  <xsl:apply-templates select="../mn:note[not(@type = 'units')]"/>
5867
5942
  <xsl:apply-templates select="../mn:example"/>
5868
- <xsl:apply-templates select="../mn:source"/>
5943
+ <xsl:apply-templates select="../mn:fmt-source"/>
5869
5944
 
5870
5945
  <xsl:variable name="isDisplayRowSeparator">
5871
5946
  </xsl:variable>
@@ -6054,7 +6129,12 @@
6054
6129
 
6055
6130
  <xsl:template name="setTableRowAttributes">
6056
6131
 
6057
- <xsl:call-template name="setColors"/>
6132
+ <xsl:for-each select="ancestor::mn:table[1]">
6133
+ <xsl:call-template name="setTableStyles">
6134
+ <xsl:with-param name="scope">ancestor_table</xsl:with-param>
6135
+ </xsl:call-template>
6136
+ </xsl:for-each>
6137
+ <xsl:call-template name="setTableStyles"/>
6058
6138
 
6059
6139
  </xsl:template> <!-- setTableRowAttributes -->
6060
6140
  <!-- ===================== -->
@@ -6107,7 +6187,13 @@
6107
6187
  </xsl:attribute>
6108
6188
  </xsl:if>
6109
6189
  <xsl:call-template name="display-align"/>
6110
- <xsl:call-template name="setColors"/>
6190
+
6191
+ <xsl:for-each select="ancestor::mn:table[1]">
6192
+ <xsl:call-template name="setTableStyles">
6193
+ <xsl:with-param name="scope">ancestor_table_borders_only</xsl:with-param>
6194
+ </xsl:call-template>
6195
+ </xsl:for-each>
6196
+ <xsl:call-template name="setTableStyles"/>
6111
6197
  </xsl:template>
6112
6198
 
6113
6199
  <xsl:template name="display-align">
@@ -6123,7 +6209,8 @@
6123
6209
  </xsl:if>
6124
6210
  </xsl:template>
6125
6211
 
6126
- <xsl:template name="setColors">
6212
+ <xsl:template name="setTableStyles">
6213
+ <xsl:param name="scope">cell</xsl:param>
6127
6214
  <xsl:variable name="styles__">
6128
6215
  <xsl:call-template name="split">
6129
6216
  <xsl:with-param name="pText" select="concat(@style,';')"/>
@@ -6135,16 +6222,22 @@
6135
6222
  <xsl:for-each select="xalan:nodeset($styles__)/mnx:item">
6136
6223
  <xsl:variable name="key" select="normalize-space(substring-before(., ':'))"/>
6137
6224
  <xsl:variable name="value" select="normalize-space(substring-after(translate(.,$quot,''), ':'))"/>
6138
- <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'">
6225
+ <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'">
6139
6226
  <style name="{$key}"><xsl:value-of select="java:replaceAll(java:java.lang.String.new($value), 'currentColor', 'inherit')"/></style>
6140
6227
  </xsl:if>
6228
+ <xsl:if test="$key = 'border' and ($scope = 'table' or $scope = 'ancestor_table' or $scope = 'ancestor_table_borders_only')">
6229
+ <style name="{$key}-top"><xsl:value-of select="$value"/></style>
6230
+ <style name="{$key}-right"><xsl:value-of select="$value"/></style>
6231
+ <style name="{$key}-left"><xsl:value-of select="$value"/></style>
6232
+ <style name="{$key}-bottom"><xsl:value-of select="$value"/></style>
6233
+ </xsl:if>
6141
6234
  </xsl:for-each>
6142
6235
  </xsl:variable>
6143
6236
  <xsl:variable name="styles" select="xalan:nodeset($styles_)"/>
6144
6237
  <xsl:for-each select="$styles/style">
6145
6238
  <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
6146
6239
  </xsl:for-each>
6147
- </xsl:template> <!-- setColors -->
6240
+ </xsl:template> <!-- setTableStyles -->
6148
6241
 
6149
6242
  <!-- cell in table body, footer -->
6150
6243
  <xsl:template match="*[local-name()='td']" name="td">
@@ -6208,11 +6301,11 @@
6208
6301
 
6209
6302
  <xsl:call-template name="refine_table-note-name-style"/>
6210
6303
 
6211
- <xsl:apply-templates select="mn:name"/>
6304
+ <xsl:apply-templates select="mn:fmt-name"/>
6212
6305
 
6213
6306
  </fo:inline>
6214
6307
 
6215
- <xsl:apply-templates select="node()[not(self::mn:name)]"/>
6308
+ <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
6216
6309
  </fo:block>
6217
6310
  </xsl:template> <!-- table/note -->
6218
6311
 
@@ -6351,7 +6444,7 @@
6351
6444
 
6352
6445
  <!-- footnotes for table's name rendering -->
6353
6446
  <xsl:template name="table_name_fn_display">
6354
- <xsl:for-each select="mn:name//mn:fn">
6447
+ <xsl:for-each select="mn:fmt-name//mn:fn">
6355
6448
  <xsl:variable name="reference" select="@reference"/>
6356
6449
  <fo:block id="{@reference}_{ancestor::*[@id][1]/@id}"><xsl:value-of select="@reference"/></fo:block>
6357
6450
  <fo:block margin-bottom="12pt">
@@ -7008,7 +7101,7 @@
7008
7101
  </xsl:if> -->
7009
7102
 
7010
7103
  <xsl:variable name="words">
7011
- <xsl:for-each select=".//*[local-name() = 'image' or local-name() = 'stem']">
7104
+ <xsl:for-each select=".//*[local-name() = 'image' or local-name() = 'fmt-stem']">
7012
7105
  <word>
7013
7106
  <xsl:copy-of select="."/>
7014
7107
  </word>
@@ -7067,7 +7160,7 @@
7067
7160
  </xsl:copy>
7068
7161
  </xsl:template>
7069
7162
 
7070
- <xsl:template match="*[local-name() = 'stem' or local-name() = 'image']" mode="td_text_with_formatting"/>
7163
+ <xsl:template match="*[local-name() = 'fmt-stem' or local-name() = 'image']" mode="td_text_with_formatting"/>
7071
7164
 
7072
7165
  <xsl:template match="*[local-name() = 'keep-together_within-line']/text()" mode="td_text_with_formatting">
7073
7166
  <xsl:variable name="formatting_tags">
@@ -7102,7 +7195,7 @@
7102
7195
  </xsl:call-template>
7103
7196
  </xsl:template>
7104
7197
 
7105
- <xsl:template match="mn:link[normalize-space() = '']" mode="td_text_with_formatting">
7198
+ <xsl:template match="mn:fmt-link[normalize-space() = '']" mode="td_text_with_formatting">
7106
7199
  <xsl:variable name="link">
7107
7200
  <link_updated>
7108
7201
  <xsl:variable name="target_text">
@@ -7317,7 +7410,7 @@
7317
7410
 
7318
7411
  <xsl:call-template name="refine_multicomponent_block_style"/>
7319
7412
 
7320
- <xsl:apply-templates select="mn:name">
7413
+ <xsl:apply-templates select="mn:fmt-name">
7321
7414
  <xsl:with-param name="process">true</xsl:with-param>
7322
7415
  </xsl:apply-templates>
7323
7416
 
@@ -7503,7 +7596,7 @@
7503
7596
  </xsl:template> <!-- refine_multicomponent_block_style -->
7504
7597
 
7505
7598
  <!-- dl/name -->
7506
- <xsl:template match="mn:dl/mn:name">
7599
+ <xsl:template match="mn:dl/mn:fmt-name">
7507
7600
  <xsl:param name="process">false</xsl:param>
7508
7601
  <xsl:if test="$process = 'true'">
7509
7602
  <fo:block xsl:use-attribute-sets="dl-name-style">
@@ -7914,12 +8007,12 @@
7914
8007
  <xsl:template match="mn:appendix">
7915
8008
  <xsl:call-template name="setNamedDestination"/>
7916
8009
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
7917
- <xsl:apply-templates select="mn:title"/>
8010
+ <xsl:apply-templates select="mn:fmt-title"/>
7918
8011
  </fo:block>
7919
- <xsl:apply-templates select="node()[not(local-name()='title')]"/>
8012
+ <xsl:apply-templates select="node()[not(self::mn:fmt-title)]"/>
7920
8013
  </xsl:template>
7921
8014
 
7922
- <xsl:template match="mn:appendix/mn:title" priority="2">
8015
+ <xsl:template match="mn:appendix/mn:fmt-title" priority="2">
7923
8016
  <xsl:variable name="level">
7924
8017
  <xsl:call-template name="getLevel"/>
7925
8018
  </xsl:variable>
@@ -7932,9 +8025,9 @@
7932
8025
  <xsl:template match="mn:appendix//mn:example" priority="2">
7933
8026
  <xsl:call-template name="setNamedDestination"/>
7934
8027
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
7935
- <xsl:apply-templates select="mn:name"/>
8028
+ <xsl:apply-templates select="mn:fmt-name"/>
7936
8029
  </fo:block>
7937
- <xsl:apply-templates select="node()[not(local-name()='name')]"/>
8030
+ <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
7938
8031
  </xsl:template>
7939
8032
 
7940
8033
  <xsl:attribute-set name="xref-style">
@@ -7942,7 +8035,7 @@
7942
8035
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
7943
8036
  </xsl:attribute-set>
7944
8037
 
7945
- <xsl:template match="mn:xref">
8038
+ <xsl:template match="mn:fmt-xref">
7946
8039
  <xsl:call-template name="insert_basic_link">
7947
8040
  <xsl:with-param name="element">
7948
8041
  <xsl:variable name="alt_text">
@@ -7962,7 +8055,7 @@
7962
8055
  </xsl:template> <!-- xref -->
7963
8056
 
7964
8057
  <!-- command between two xref points to non-standard bibitem -->
7965
- <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="."/>
8058
+ <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="."/>
7966
8059
  </xsl:template>
7967
8060
 
7968
8061
  <xsl:attribute-set name="eref-style">
@@ -7993,7 +8086,7 @@
7993
8086
  <!-- ====== -->
7994
8087
  <!-- eref -->
7995
8088
  <!-- ====== -->
7996
- <xsl:template match="mn:eref" name="eref">
8089
+ <xsl:template match="mn:fmt-eref" name="eref">
7997
8090
  <xsl:variable name="current_bibitemid" select="@bibitemid"/>
7998
8091
  <!-- <xsl:variable name="external-destination" select="normalize-space(key('bibitems', $current_bibitemid)/mn:uri[@type = 'citation'])"/> -->
7999
8092
  <xsl:variable name="external-destination" select="normalize-space($bibitems/mn:bibitem[@id = $current_bibitemid]/mn:uri[@type = 'citation'])"/>
@@ -8137,28 +8230,28 @@
8137
8230
 
8138
8231
  <fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
8139
8232
 
8140
- <xsl:apply-templates select="mn:name/mn:tab" mode="tab"/>
8233
+ <xsl:apply-templates select="mn:fmt-name/mn:tab" mode="tab"/>
8141
8234
 
8142
8235
  <xsl:call-template name="refine_note-name-style"/>
8143
8236
 
8144
8237
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
8145
8238
  <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
8146
- <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and mn:add]">
8239
+ <xsl:if test="*[not(self::mn:fmt-name)][1][count(node()[normalize-space() != '']) = 1 and mn:add]">
8147
8240
  <xsl:call-template name="append_add-style"/>
8148
8241
  </xsl:if>
8149
8242
 
8150
8243
  <!-- if note contains only one element and first and last childs are `add` ace-tag, then move start ace-tag before NOTE's name-->
8151
- <xsl:if test="count(*[not(self::mn:name)]) = 1 and *[not(self::mn:name)]/node()[last()][self::mn:add][starts-with(text(), $ace_tag)]">
8152
- <xsl:apply-templates select="*[not(self::mn:name)]/node()[1][self::mn:add][starts-with(text(), $ace_tag)]">
8244
+ <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)]">
8245
+ <xsl:apply-templates select="*[not(self::mn:fmt-name)]/node()[1][self::mn:add][starts-with(text(), $ace_tag)]">
8153
8246
  <xsl:with-param name="skip">false</xsl:with-param>
8154
8247
  </xsl:apply-templates>
8155
8248
  </xsl:if>
8156
8249
 
8157
- <xsl:apply-templates select="mn:name"/>
8250
+ <xsl:apply-templates select="mn:fmt-name"/>
8158
8251
 
8159
8252
  </fo:inline>
8160
8253
 
8161
- <xsl:apply-templates select="node()[not(self::mn:name)]"/>
8254
+ <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
8162
8255
  </fo:block>
8163
8256
  </fo:block-container>
8164
8257
  </fo:block-container>
@@ -8197,19 +8290,19 @@
8197
8290
 
8198
8291
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
8199
8292
  <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
8200
- <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and mn:add]">
8293
+ <xsl:if test="*[not(self::mn:fmt-name)][1][count(node()[normalize-space() != '']) = 1 and mn:add]">
8201
8294
  <xsl:call-template name="append_add-style"/>
8202
8295
  </xsl:if>
8203
8296
 
8204
- <xsl:apply-templates select="mn:name"/>
8297
+ <xsl:apply-templates select="mn:fmt-name"/>
8205
8298
 
8206
8299
  </fo:inline>
8207
8300
 
8208
- <xsl:apply-templates select="node()[not(self::mn:name)]"/>
8301
+ <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
8209
8302
  </fo:block>
8210
8303
  </xsl:template>
8211
8304
 
8212
- <xsl:template match="mn:note/mn:name">
8305
+ <xsl:template match="mn:note/mn:fmt-name">
8213
8306
  <xsl:param name="sfx"/>
8214
8307
  <xsl:variable name="suffix">
8215
8308
  <xsl:choose>
@@ -8236,7 +8329,7 @@
8236
8329
  </xsl:if>
8237
8330
  </xsl:template>
8238
8331
 
8239
- <xsl:template match="mn:termnote/mn:name">
8332
+ <xsl:template match="mn:termnote/mn:fmt-name">
8240
8333
  <xsl:param name="sfx"/>
8241
8334
  <xsl:variable name="suffix">
8242
8335
  <xsl:choose>
@@ -8319,15 +8412,15 @@
8319
8412
 
8320
8413
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
8321
8414
  <fo:block role="BlockQuote">
8322
- <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 -->
8415
+ <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 -->
8323
8416
  </fo:block>
8324
8417
  </fo:block-container>
8325
8418
  </fo:block-container>
8326
- <xsl:if test="mn:author or mn:source or mn:attribution">
8419
+ <xsl:if test="mn:author or mn:fmt-source or mn:attribution">
8327
8420
  <fo:block xsl:use-attribute-sets="quote-source-style">
8328
8421
  <!-- — ISO, ISO 7301:2011, Clause 1 -->
8329
8422
  <xsl:apply-templates select="mn:author"/>
8330
- <xsl:apply-templates select="mn:source"/>
8423
+ <xsl:apply-templates select="mn:fmt-source"/>
8331
8424
  <!-- added for https://github.com/metanorma/isodoc/issues/607 -->
8332
8425
  <xsl:apply-templates select="mn:attribution/mn:p/node()"/>
8333
8426
  </fo:block>
@@ -8337,17 +8430,32 @@
8337
8430
  </fo:block-container>
8338
8431
  </xsl:template>
8339
8432
 
8340
- <xsl:template match="mn:source">
8433
+ <xsl:template match="mn:fmt-source">
8341
8434
  <xsl:if test="../mn:author">
8342
8435
  <xsl:text>, </xsl:text>
8343
8436
  </xsl:if>
8344
- <xsl:call-template name="insert_basic_link">
8345
- <xsl:with-param name="element">
8346
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
8347
- <xsl:apply-templates/>
8348
- </fo:basic-link>
8349
- </xsl:with-param>
8350
- </xsl:call-template>
8437
+ <xsl:choose>
8438
+ <xsl:when test="not(parent::quote)">
8439
+ <fo:block>
8440
+ <xsl:call-template name="insert_basic_link">
8441
+ <xsl:with-param name="element">
8442
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
8443
+ <xsl:apply-templates/>
8444
+ </fo:basic-link>
8445
+ </xsl:with-param>
8446
+ </xsl:call-template>
8447
+ </fo:block>
8448
+ </xsl:when>
8449
+ <xsl:otherwise>
8450
+ <xsl:call-template name="insert_basic_link">
8451
+ <xsl:with-param name="element">
8452
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
8453
+ <xsl:apply-templates/>
8454
+ </fo:basic-link>
8455
+ </xsl:with-param>
8456
+ </xsl:call-template>
8457
+ </xsl:otherwise>
8458
+ </xsl:choose>
8351
8459
  </xsl:template>
8352
8460
 
8353
8461
  <xsl:template match="mn:author">
@@ -8424,7 +8532,7 @@
8424
8532
  <ancestor><xsl:copy-of select="ancestor::mn:figure[.//mn:name[.//mn:fn]]"/></ancestor> -->
8425
8533
  <xsl:choose>
8426
8534
  <!-- skip figure/name/fn -->
8427
- <xsl:when test="ancestor::mn:figure[.//mn:name[.//mn:fn[@target = $curr_id]]]"><!-- skip --></xsl:when>
8535
+ <xsl:when test="ancestor::mn:figure[.//mn:fmt-name[.//mn:fn[@target = $curr_id]]]"><!-- skip --></xsl:when>
8428
8536
  <xsl:otherwise>
8429
8537
  <xsl:element name="figure" namespace="{$namespace_full}">
8430
8538
  <xsl:element name="fmt-footnote-container" namespace="{$namespace_full}">
@@ -8620,17 +8728,17 @@
8620
8728
 
8621
8729
  <fo:block xsl:use-attribute-sets="figure-style" role="SKIP">
8622
8730
 
8623
- <xsl:for-each select="mn:name"> <!-- set context -->
8731
+ <xsl:for-each select="mn:fmt-name"> <!-- set context -->
8624
8732
  <xsl:call-template name="setIDforNamedDestination"/>
8625
8733
  </xsl:for-each>
8626
8734
 
8627
- <xsl:apply-templates select="node()[not(self::mn:name) and not(self::mn:note and @type = 'units')]"/>
8735
+ <xsl:apply-templates select="node()[not(self::mn:fmt-name) and not(self::mn:note and @type = 'units')]"/>
8628
8736
  </fo:block>
8629
8737
 
8630
8738
  <xsl:if test="normalize-space($show_figure_key_in_block_container) = 'true'">
8631
8739
  <xsl:call-template name="showFigureKey"/>
8632
8740
  </xsl:if>
8633
- <xsl:apply-templates select="mn:name"/> <!-- show figure's name AFTER image -->
8741
+ <xsl:apply-templates select="mn:fmt-name"/> <!-- show figure's name AFTER image -->
8634
8742
 
8635
8743
  </fo:block-container>
8636
8744
  </xsl:template>
@@ -8656,9 +8764,9 @@
8656
8764
  <xsl:template match="mn:figure[@class = 'pseudocode']">
8657
8765
  <xsl:call-template name="setNamedDestination"/>
8658
8766
  <fo:block id="{@id}">
8659
- <xsl:apply-templates select="node()[not(self::mn:name)]"/>
8767
+ <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
8660
8768
  </fo:block>
8661
- <xsl:apply-templates select="mn:name"/>
8769
+ <xsl:apply-templates select="mn:fmt-name"/>
8662
8770
  </xsl:template>
8663
8771
 
8664
8772
  <xsl:template match="mn:figure[@class = 'pseudocode']//mn:p">
@@ -8669,7 +8777,7 @@
8669
8777
 
8670
8778
  <!-- SOURCE: ... -->
8671
8779
  <!-- figure/source -->
8672
- <xsl:template match="mn:figure/mn:source" priority="2">
8780
+ <xsl:template match="mn:figure/mn:fmt-source" priority="2">
8673
8781
  <xsl:call-template name="termsource"/>
8674
8782
  </xsl:template>
8675
8783
 
@@ -8679,7 +8787,7 @@
8679
8787
  <xsl:variable name="isAdded" select="../@added"/>
8680
8788
  <xsl:variable name="isDeleted" select="../@deleted"/>
8681
8789
  <xsl:choose>
8682
- <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) -->
8790
+ <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) -->
8683
8791
  <fo:inline padding-left="1mm" padding-right="1mm">
8684
8792
  <xsl:if test="not(parent::mn:figure) or parent::mn:p">
8685
8793
  <xsl:attribute name="padding-left">0mm</xsl:attribute>
@@ -8700,13 +8808,26 @@
8700
8808
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" vertical-align="middle">
8701
8809
 
8702
8810
  <xsl:if test="parent::mn:logo"> <!-- publisher's logo -->
8703
- <xsl:attribute name="width">100%</xsl:attribute>
8811
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
8812
+ <xsl:choose>
8813
+ <xsl:when test="@width and not(@height)">
8814
+ <xsl:attribute name="width">100%</xsl:attribute>
8815
+ <xsl:attribute name="content-height">100%</xsl:attribute>
8816
+ </xsl:when>
8817
+ <xsl:when test="@height and not(@width)">
8818
+ <xsl:attribute name="height">100%</xsl:attribute>
8819
+ <xsl:attribute name="content-height"><xsl:value-of select="@height"/></xsl:attribute>
8820
+ </xsl:when>
8821
+ <xsl:when test="not(@width) and not(@height)">
8822
+ <xsl:attribute name="content-height">100%</xsl:attribute>
8823
+ </xsl:when>
8824
+ </xsl:choose>
8825
+
8704
8826
  <xsl:if test="normalize-space($logo_width) != ''">
8705
8827
  <xsl:attribute name="width"><xsl:value-of select="$logo_width"/></xsl:attribute>
8706
8828
  </xsl:if>
8707
- <xsl:attribute name="content-height">100%</xsl:attribute>
8708
8829
  <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
8709
- <xsl:attribute name="scaling">uniform</xsl:attribute>
8830
+ <xsl:attribute name="vertical-align">top</xsl:attribute>
8710
8831
  </xsl:if>
8711
8832
 
8712
8833
  <xsl:variable name="width">
@@ -8995,7 +9116,7 @@
8995
9116
  <xsl:variable name="width_effective_px" select="$width_effective div 25.4 * $image_dpi"/>
8996
9117
  <xsl:variable name="height_effective_px" select="$height_effective div 25.4 * $image_dpi"/>
8997
9118
 
8998
- <xsl:template match="mn:figure[not(mn:image) and *[local-name() = 'svg']]/mn:name/mn:bookmark" priority="2"/>
9119
+ <xsl:template match="mn:figure[not(mn:image) and *[local-name() = 'svg']]/mn:fmt-name/mn:bookmark" priority="2"/>
8999
9120
  <xsl:template match="mn:figure[not(mn:image)]/*[local-name() = 'svg']" priority="2" name="image_svg">
9000
9121
  <xsl:param name="name"/>
9001
9122
 
@@ -9005,8 +9126,8 @@
9005
9126
 
9006
9127
  <xsl:variable name="alt-text">
9007
9128
  <xsl:choose>
9008
- <xsl:when test="normalize-space(../mn:name) != ''">
9009
- <xsl:value-of select="../mn:name"/>
9129
+ <xsl:when test="normalize-space(../mn:fmt-name) != ''">
9130
+ <xsl:value-of select="../mn:fmt-name"/>
9010
9131
  </xsl:when>
9011
9132
  <xsl:when test="normalize-space($name) != ''">
9012
9133
  <xsl:value-of select="$name"/>
@@ -9015,7 +9136,7 @@
9015
9136
  </xsl:choose>
9016
9137
  </xsl:variable>
9017
9138
 
9018
- <xsl:variable name="isPrecedingTitle" select="normalize-space(ancestor::mn:figure/preceding-sibling::*[1][self::mn:title] and 1 = 1)"/>
9139
+ <xsl:variable name="isPrecedingTitle" select="normalize-space(ancestor::mn:figure/preceding-sibling::*[1][self::mn:fmt-title] and 1 = 1)"/>
9019
9140
 
9020
9141
  <xsl:choose>
9021
9142
  <xsl:when test=".//*[local-name() = 'a'][*[local-name() = 'rect'] or *[local-name() = 'polygon'] or *[local-name() = 'circle'] or *[local-name() = 'ellipse']]">
@@ -9064,9 +9185,9 @@
9064
9185
  <fo:table-cell column-number="2">
9065
9186
  <fo:block>
9066
9187
  <fo:block-container width="{$width_scale}px" height="{$height_scale}px">
9067
- <xsl:if test="../mn:name/mn:bookmark">
9188
+ <xsl:if test="../mn:fmt-name/mn:bookmark">
9068
9189
  <fo:block line-height="0" font-size="0">
9069
- <xsl:for-each select="../mn:name/mn:bookmark">
9190
+ <xsl:for-each select="../mn:fmt-name/mn:bookmark">
9070
9191
  <xsl:call-template name="bookmark"/>
9071
9192
  </xsl:for-each>
9072
9193
  </fo:block>
@@ -9306,7 +9427,7 @@
9306
9427
 
9307
9428
  <!-- image with svg and emf -->
9308
9429
  <xsl:template match="mn:figure/mn:image[*[local-name() = 'svg']]" priority="3">
9309
- <xsl:variable name="name" select="ancestor::mn:figure/mn:name"/>
9430
+ <xsl:variable name="name" select="ancestor::mn:figure/mn:fmt-name"/>
9310
9431
  <xsl:for-each select="*[local-name() = 'svg']">
9311
9432
  <xsl:call-template name="image_svg">
9312
9433
  <xsl:with-param name="name" select="$name"/>
@@ -9323,7 +9444,7 @@
9323
9444
 
9324
9445
  <xsl:template match="mn:figure/mn:image[@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
9325
9446
  <xsl:variable name="svg_content" select="document(@src)"/>
9326
- <xsl:variable name="name" select="ancestor::mn:figure/mn:name"/>
9447
+ <xsl:variable name="name" select="ancestor::mn:figure/mn:fmt-name"/>
9327
9448
  <xsl:for-each select="xalan:nodeset($svg_content)/node()">
9328
9449
  <xsl:call-template name="image_svg">
9329
9450
  <xsl:with-param name="name" select="$name"/>
@@ -9446,7 +9567,7 @@
9446
9567
  <xsl:template match="mn:emf"/>
9447
9568
 
9448
9569
  <!-- figure/name -->
9449
- <xsl:template match="mn:figure/mn:name | mn:image/mn:name">
9570
+ <xsl:template match="mn:figure/mn:fmt-name | mn:image/mn:fmt-name">
9450
9571
  <xsl:if test="normalize-space() != ''">
9451
9572
  <fo:block xsl:use-attribute-sets="figure-name-style">
9452
9573
 
@@ -9516,25 +9637,25 @@
9516
9637
  <fo:block-container margin-left="0mm" role="SKIP">
9517
9638
  <xsl:call-template name="setNamedDestination"/>
9518
9639
  <fo:block id="{@id}">
9519
- <xsl:apply-templates select="node()[not(self::mn:name)]"/> <!-- formula's number will be process in 'stem' template -->
9640
+ <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/> <!-- formula's number will be process in 'stem' template -->
9520
9641
  </fo:block>
9521
9642
  </fo:block-container>
9522
9643
  </fo:block-container>
9523
9644
  </xsl:template>
9524
9645
 
9525
- <xsl:template match="mn:formula/mn:dt/mn:stem">
9646
+ <xsl:template match="mn:formula/mn:dt/mn:fmt-stem">
9526
9647
  <fo:inline>
9527
9648
  <xsl:apply-templates/>
9528
9649
  </fo:inline>
9529
9650
  </xsl:template>
9530
9651
 
9531
- <xsl:template match="mn:admitted/mn:stem">
9652
+ <xsl:template match="mn:fmt-admitted/mn:fmt-stem">
9532
9653
  <fo:inline>
9533
9654
  <xsl:apply-templates/>
9534
9655
  </fo:inline>
9535
9656
  </xsl:template>
9536
9657
 
9537
- <xsl:template match="mn:formula/mn:name"> <!-- show in 'stem' template -->
9658
+ <xsl:template match="mn:formula/mn:fmt-name"> <!-- show in 'stem' template -->
9538
9659
  <!-- https://github.com/metanorma/isodoc/issues/607
9539
9660
  <xsl:if test="normalize-space() != ''">
9540
9661
  <xsl:text>(</xsl:text><xsl:apply-templates /><xsl:text>)</xsl:text>
@@ -9543,7 +9664,7 @@
9543
9664
  </xsl:template>
9544
9665
 
9545
9666
  <!-- stem inside formula with name (with formula's number) -->
9546
- <xsl:template match="mn:formula[mn:name]/mn:stem">
9667
+ <xsl:template match="mn:formula[mn:fmt-name]/mn:fmt-stem">
9547
9668
  <fo:block xsl:use-attribute-sets="formula-style">
9548
9669
 
9549
9670
  <fo:table table-layout="fixed" width="100%">
@@ -9563,13 +9684,13 @@
9563
9684
 
9564
9685
  <fo:block xsl:use-attribute-sets="formula-stem-number-style" role="SKIP">
9565
9686
 
9566
- <xsl:for-each select="../mn:name">
9687
+ <xsl:for-each select="../mn:fmt-name">
9567
9688
  <xsl:call-template name="setIDforNamedDestination"/>
9568
9689
  </xsl:for-each>
9569
9690
 
9570
9691
  <xsl:call-template name="refine_formula-stem-number-style"/>
9571
9692
 
9572
- <xsl:apply-templates select="../mn:name"/>
9693
+ <xsl:apply-templates select="../mn:fmt-name"/>
9573
9694
  </fo:block>
9574
9695
  </fo:table-cell>
9575
9696
  </fo:table-row>
@@ -9579,7 +9700,7 @@
9579
9700
  </xsl:template>
9580
9701
 
9581
9702
  <!-- stem inside formula without name (without formula's number) -->
9582
- <xsl:template match="mn:formula[not(mn:name)]/mn:stem">
9703
+ <xsl:template match="mn:formula[not(mn:fmt-name)]/mn:fmt-stem">
9583
9704
  <fo:block xsl:use-attribute-sets="formula-style">
9584
9705
  <fo:block xsl:use-attribute-sets="formula-stem-block-style">
9585
9706
  <xsl:apply-templates/>
@@ -9933,7 +10054,7 @@
9933
10054
  <stem type="AsciiMath"><asciimath>x = 1</asciimath></stem>
9934
10055
  <stem type="AsciiMath"><asciimath>x = 1</asciimath><latexmath>x = 1</latexmath></stem>
9935
10056
  -->
9936
- <xsl:template match="mn:stem[@type = 'AsciiMath'][count(*) = 0]/text() | mn:stem[@type = 'AsciiMath'][mn:asciimath]" priority="3">
10057
+ <xsl:template match="mn:fmt-stem[@type = 'AsciiMath'][count(*) = 0]/text() | mn:fmt-stem[@type = 'AsciiMath'][mn:asciimath]" priority="3">
9937
10058
  <fo:inline xsl:use-attribute-sets="mathml-style">
9938
10059
 
9939
10060
  <xsl:call-template name="refine_mathml-style"/>
@@ -10201,7 +10322,7 @@
10201
10322
 
10202
10323
  <xsl:template match="mn:ul | mn:ol" mode="list" name="list">
10203
10324
 
10204
- <xsl:apply-templates select="mn:name">
10325
+ <xsl:apply-templates select="mn:fmt-name">
10205
10326
  <xsl:with-param name="process">true</xsl:with-param>
10206
10327
  </xsl:apply-templates>
10207
10328
 
@@ -10247,7 +10368,7 @@
10247
10368
 
10248
10369
  <xsl:call-template name="refine_list-style"/>
10249
10370
 
10250
- <xsl:if test="mn:name">
10371
+ <xsl:if test="mn:fmt-name">
10251
10372
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
10252
10373
  </xsl:if>
10253
10374
 
@@ -10262,7 +10383,7 @@
10262
10383
  <xsl:template name="refine_list-style_provisional-distance-between-starts">
10263
10384
  </xsl:template> <!-- refine_list-style_provisional-distance-between-starts -->
10264
10385
 
10265
- <xsl:template match="*[self::mn:ol or self::mn:ul]/mn:name">
10386
+ <xsl:template match="*[self::mn:ol or self::mn:ul]/mn:fmt-name">
10266
10387
  <xsl:param name="process">false</xsl:param>
10267
10388
  <xsl:if test="$process = 'true'">
10268
10389
  <fo:block xsl:use-attribute-sets="list-name-style">
@@ -10390,7 +10511,7 @@
10390
10511
  -->
10391
10512
  <!-- footnotes in text (title, bibliography, main body), not for tables, figures and names --> <!-- table's, figure's names -->
10392
10513
  <!-- fn in text -->
10393
- <xsl:template match="mn:fn[not(ancestor::*[(self::mn:table or self::mn:figure)] and not(ancestor::mn:name))]" priority="2" name="fn">
10514
+ <xsl:template match="mn:fn[not(ancestor::*[(self::mn:table or self::mn:figure)] and not(ancestor::mn:fmt-name))]" priority="2" name="fn">
10394
10515
  <xsl:param name="footnote_body_from_table">false</xsl:param>
10395
10516
 
10396
10517
  <!-- list of unique footnotes -->
@@ -10514,7 +10635,7 @@
10514
10635
  <!-- commented:
10515
10636
  .//mn:bibitem[ancestor::mn:references]/mn:note |
10516
10637
  because 'fn' there is in biblio-tag -->
10517
- <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])]">
10638
+ <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])]">
10518
10639
  <!-- copy unique fn -->
10519
10640
  <fn gen_id="{generate-id(.)}">
10520
10641
  <xsl:copy-of select="@*"/>
@@ -10594,7 +10715,7 @@
10594
10715
  <xsl:call-template name="displayAdmonitionName"/>
10595
10716
  </fo:block>
10596
10717
  <fo:block xsl:use-attribute-sets="admonition-p-style">
10597
- <xsl:apply-templates select="node()[not(self::mn:name)]"/>
10718
+ <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
10598
10719
  </fo:block>
10599
10720
 
10600
10721
  </fo:block-container>
@@ -10620,7 +10741,7 @@
10620
10741
  </xsl:otherwise>
10621
10742
  </xsl:choose> -->
10622
10743
  <xsl:variable name="name">
10623
- <xsl:apply-templates select="mn:name"/>
10744
+ <xsl:apply-templates select="mn:fmt-name"/>
10624
10745
  </xsl:variable>
10625
10746
  <xsl:copy-of select="$name"/>
10626
10747
  <xsl:if test="normalize-space($name) != ''">
@@ -10628,7 +10749,7 @@
10628
10749
  </xsl:if>
10629
10750
  </xsl:template>
10630
10751
 
10631
- <xsl:template match="mn:admonition/mn:name">
10752
+ <xsl:template match="mn:admonition/mn:fmt-name">
10632
10753
  <xsl:apply-templates/>
10633
10754
  </xsl:template>
10634
10755
 
@@ -10750,10 +10871,10 @@
10750
10871
  <xsl:call-template name="setNamedDestination"/>
10751
10872
  <fo:block id="{@id}"/>
10752
10873
 
10753
- <xsl:apply-templates select="mn:title[@columns = 1]"/>
10874
+ <xsl:apply-templates select="mn:fmt-title[@columns = 1]"/>
10754
10875
 
10755
10876
  <fo:block xsl:use-attribute-sets="references-non-normative-style">
10756
- <xsl:apply-templates select="node()[not(self::mn:title and @columns = 1)]"/>
10877
+ <xsl:apply-templates select="node()[not(self::mn:fmt-title and @columns = 1)]"/>
10757
10878
  </fo:block>
10758
10879
  </xsl:template> <!-- references -->
10759
10880
 
@@ -11077,7 +11198,8 @@
11077
11198
  </xsl:copy>
11078
11199
  </xsl:template>
11079
11200
 
11080
- <xsl:template match="mn:xref" mode="index_add_id">
11201
+ <xsl:template match="mn:xref" mode="index_add_id"/>
11202
+ <xsl:template match="mn:fmt-xref" mode="index_add_id">
11081
11203
  <xsl:param name="docid"/>
11082
11204
  <xsl:variable name="id">
11083
11205
  <xsl:call-template name="generateIndexXrefId">
@@ -11119,7 +11241,7 @@
11119
11241
  <xsl:template match="mn:indexsect//mn:li" mode="index_update">
11120
11242
  <xsl:copy>
11121
11243
  <xsl:apply-templates select="@*" mode="index_update"/>
11122
- <xsl:apply-templates select="node()[1]" mode="process_li_element"/>
11244
+ <xsl:apply-templates select="node()[not(self::mn:fmt-name)][1]" mode="process_li_element"/>
11123
11245
  </xsl:copy>
11124
11246
  </xsl:template>
11125
11247
 
@@ -11140,11 +11262,11 @@
11140
11262
  <xsl:value-of select="."/>
11141
11263
  <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
11142
11264
  </xsl:when>
11143
- <xsl:when test="self::* and local-name(.) = 'xref'">
11265
+ <xsl:when test="self::* and local-name(.) = 'fmt-xref'">
11144
11266
  <xsl:variable name="id" select="@id"/>
11145
11267
 
11146
- <xsl:variable name="id_next" select="following-sibling::mn:xref[1]/@id"/>
11147
- <xsl:variable name="id_prev" select="preceding-sibling::mn:xref[1]/@id"/>
11268
+ <xsl:variable name="id_next" select="following-sibling::mn:fmt-xref[1]/@id"/>
11269
+ <xsl:variable name="id_prev" select="preceding-sibling::mn:fmt-xref[1]/@id"/>
11148
11270
 
11149
11271
  <xsl:variable name="pages_">
11150
11272
  <xsl:for-each select="$index/index/item[@id = $id or @id = $id_next or @id = $id_prev]">
@@ -11240,18 +11362,18 @@
11240
11362
  <xsl:variable name="item_number">
11241
11363
  <xsl:number count="mn:li[ancestor::mn:indexsect]" level="any"/>
11242
11364
  </xsl:variable>
11243
- <xsl:variable name="xref_number"><xsl:number count="mn:xref"/></xsl:variable>
11365
+ <xsl:variable name="xref_number"><xsl:number count="mn:fmt-xref"/></xsl:variable>
11244
11366
  <xsl:value-of select="concat($docid_curr, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
11245
11367
  </xsl:template>
11246
11368
 
11247
- <xsl:template match="mn:indexsect/mn:title" priority="4">
11369
+ <xsl:template match="mn:indexsect/mn:fmt-title | mn:indexsect/mn:title" priority="4">
11248
11370
  <fo:block xsl:use-attribute-sets="indexsect-title-style">
11249
11371
  <!-- Index -->
11250
11372
  <xsl:apply-templates/>
11251
11373
  </fo:block>
11252
11374
  </xsl:template>
11253
11375
 
11254
- <xsl:template match="mn:indexsect/mn:clause/mn:title" priority="4">
11376
+ <xsl:template match="mn:indexsect/mn:clause/mn:fmt-title | mn:indexsect/mn:clause/mn:title" priority="4">
11255
11377
  <!-- Letter A, B, C, ... -->
11256
11378
  <fo:block xsl:use-attribute-sets="indexsect-clause-title-style">
11257
11379
  <xsl:apply-templates/>
@@ -11292,12 +11414,12 @@
11292
11414
  <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"/>
11293
11415
  <bookmark id="_dda23915-8574-ef1e-29a1-822d465a5b97"/>
11294
11416
  <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"/> -->
11295
- <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]">
11417
+ <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]">
11296
11418
  <!-- skip here, see the template 'fmt-review-start' -->
11297
11419
  </xsl:when>
11298
11420
  <xsl:otherwise>
11299
11421
  <!-- <fo:inline id="{@id}" font-size="1pt"/> -->
11300
- <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>
11422
+ <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>
11301
11423
  <!-- we need to add zero-width space, otherwise this fo:inline is missing in IF xml -->
11302
11424
  <xsl:if test="not(following-sibling::node()[normalize-space() != ''])"><fo:inline font-size="1pt"> </fo:inline></xsl:if>
11303
11425
  </xsl:otherwise>
@@ -11461,7 +11583,7 @@
11461
11583
 
11462
11584
  <xsl:template name="processTables_Contents">
11463
11585
  <mnx:tables>
11464
- <xsl:for-each select="//mn:table[not(ancestor::mn:metanorma-extension)][@id and mn:name and normalize-space(@id) != '']">
11586
+ <xsl:for-each select="//mn:table[not(ancestor::mn:metanorma-extension)][@id and mn:fmt-name and normalize-space(@id) != '']">
11465
11587
  <xsl:choose>
11466
11588
  <xsl:when test="mn:fmt-name">
11467
11589
  <xsl:variable name="fmt_name">
@@ -11483,7 +11605,7 @@
11483
11605
 
11484
11606
  <xsl:template name="processFigures_Contents">
11485
11607
  <mnx:figures>
11486
- <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) != '']">
11608
+ <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) != '']">
11487
11609
  <xsl:choose>
11488
11610
  <xsl:when test="mn:fmt-name">
11489
11611
  <xsl:variable name="fmt_name">
@@ -11512,7 +11634,7 @@
11512
11634
 
11513
11635
  <xsl:template match="mn:title[following-sibling::*[1][self::mn:fmt-title]]" mode="contents"/>
11514
11636
 
11515
- <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">
11637
+ <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">
11516
11638
  <xsl:apply-templates mode="contents"/>
11517
11639
  <xsl:text> </xsl:text>
11518
11640
  </xsl:template>
@@ -11524,7 +11646,7 @@
11524
11646
  </xsl:if>
11525
11647
  </xsl:template>
11526
11648
 
11527
- <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">
11649
+ <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">
11528
11650
  <xsl:apply-templates mode="bookmarks"/>
11529
11651
  <xsl:text> </xsl:text>
11530
11652
  </xsl:template>
@@ -11535,7 +11657,7 @@
11535
11657
  </xsl:if>
11536
11658
  </xsl:template>
11537
11659
 
11538
- <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">
11660
+ <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">
11539
11661
  <xsl:value-of select="."/>
11540
11662
  </xsl:template>
11541
11663
 
@@ -11545,7 +11667,7 @@
11545
11667
  </xsl:if>
11546
11668
  </xsl:template>
11547
11669
 
11548
- <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">
11670
+ <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">
11549
11671
  <xsl:value-of select="."/>
11550
11672
  </xsl:template>
11551
11673
 
@@ -12006,7 +12128,7 @@
12006
12128
  <xsl:value-of select="."/>
12007
12129
  </xsl:template>
12008
12130
 
12009
- <xsl:template match="mn:review" mode="contents_item"/>
12131
+ <xsl:template match="mn:annotation" mode="contents_item"/>
12010
12132
 
12011
12133
  <xsl:template match="mn:tab" mode="contents_item">
12012
12134
  <xsl:text> </xsl:text>
@@ -12161,7 +12283,7 @@
12161
12283
  <xsl:apply-templates/>
12162
12284
  </xsl:template>
12163
12285
 
12164
- <xsl:template match="mn:toc//mn:xref" priority="3">
12286
+ <xsl:template match="mn:toc//mn:xref | mn:toc//mn:fmt-xref" priority="3">
12165
12287
  <!-- <xref target="cgpm9th1948r6">1.6.3<tab/>&#8220;9th CGPM, 1948:<tab/>decision to establish the SI&#8221;</xref> -->
12166
12288
  <!-- New format: one tab <xref target="cgpm9th1948r6">&#8220;9th CGPM, 1948:<tab/>decision to establish the SI&#8221;</xref> -->
12167
12289
  <!-- <test><xsl:copy-of select="."/></test> -->
@@ -12229,8 +12351,8 @@
12229
12351
  <xsl:apply-templates mode="toc_table_width"/>
12230
12352
  </xsl:template>
12231
12353
 
12232
- <xsl:template match="mn:clause[@type = 'toc']/mn:title" mode="toc_table_width"/>
12233
- <xsl:template match="mn:clause[not(@type = 'toc')]/mn:title" mode="toc_table_width"/>
12354
+ <xsl:template match="mn:clause[@type = 'toc']/mn:fmt-title" mode="toc_table_width"/>
12355
+ <xsl:template match="mn:clause[not(@type = 'toc')]/mn:fmt-title" mode="toc_table_width"/>
12234
12356
 
12235
12357
  <xsl:template match="mn:li" mode="toc_table_width">
12236
12358
  <mn:tr>
@@ -12238,7 +12360,7 @@
12238
12360
  </mn:tr>
12239
12361
  </xsl:template>
12240
12362
 
12241
- <xsl:template match="mn:xref" mode="toc_table_width">
12363
+ <xsl:template match="mn:fmt-xref" mode="toc_table_width">
12242
12364
  <!-- <xref target="cgpm9th1948r6">1.6.3<tab/>&#8220;9th CGPM, 1948:<tab/>decision to establish the SI&#8221;</xref> -->
12243
12365
  <!-- New format - one tab <xref target="cgpm9th1948r6">&#8220;9th CGPM, 1948:<tab/>decision to establish the SI&#8221;</xref> -->
12244
12366
  <xsl:for-each select="mn:tab">
@@ -12317,10 +12439,10 @@
12317
12439
 
12318
12440
  </xsl:template> <!-- tab -->
12319
12441
 
12320
- <xsl:template match="mn:note/mn:name/mn:tab" priority="2"/>
12321
- <xsl:template match="mn:termnote/mn:name/mn:tab" priority="2"/>
12442
+ <xsl:template match="mn:note/mn:fmt-name/mn:tab" priority="2"/>
12443
+ <xsl:template match="mn:termnote/mn:fmt-name/mn:tab" priority="2"/>
12322
12444
 
12323
- <xsl:template match="mn:note/mn:name/mn:tab" mode="tab">
12445
+ <xsl:template match="mn:note/mn:fmt-name/mn:tab" mode="tab">
12324
12446
  <xsl:attribute name="padding-right">2mm</xsl:attribute>
12325
12447
  </xsl:template>
12326
12448
 
@@ -12335,13 +12457,13 @@
12335
12457
  </xsl:template>
12336
12458
 
12337
12459
  <xsl:variable name="reviews_">
12338
- <xsl:for-each select="//mn:review[not(parent::mn:review-container)][@from]">
12460
+ <xsl:for-each select="//mn:annotation[not(parent::mn:annotation-container)][@from]">
12339
12461
  <xsl:copy>
12340
12462
  <xsl:copy-of select="@from"/>
12341
12463
  <xsl:copy-of select="@id"/>
12342
12464
  </xsl:copy>
12343
12465
  </xsl:for-each>
12344
- <xsl:for-each select="//mn:fmt-review-start[@source]">
12466
+ <xsl:for-each select="//mn:fmt-annotation-start[@source]">
12345
12467
  <xsl:copy>
12346
12468
  <xsl:copy-of select="@source"/>
12347
12469
  <xsl:copy-of select="@id"/>
@@ -12355,7 +12477,7 @@
12355
12477
  <!-- if there is review with from="...", then add small helper block for Annot tag adding, see 'review' template -->
12356
12478
  <xsl:variable name="curr_id" select="@id"/>
12357
12479
  <!-- <xsl:variable name="review_id" select="normalize-space(/@id)"/> -->
12358
- <xsl:for-each select="$reviews//mn:review[@from = $curr_id]"> <!-- $reviews//mn:fmt-review-start[@source = $curr_id] -->
12480
+ <xsl:for-each select="$reviews//mn:annotation[@from = $curr_id]"> <!-- $reviews//mn:fmt-review-start[@source = $curr_id] -->
12359
12481
  <xsl:variable name="review_id" select="normalize-space(@id)"/>
12360
12482
  <xsl:if test="$review_id != ''"> <!-- i.e. if review found -->
12361
12483
  <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>
@@ -12370,7 +12492,7 @@
12370
12492
 
12371
12493
  <!-- document text (not figures, or tables) footnotes -->
12372
12494
  <xsl:variable name="reviews_container_">
12373
- <xsl:for-each select="//mn:review-container/mn:fmt-review-body">
12495
+ <xsl:for-each select="//mn:annotation-container/mn:fmt-annotation-body">
12374
12496
  <xsl:variable name="update_xml_step1">
12375
12497
  <xsl:apply-templates select="." mode="update_xml_step1"/>
12376
12498
  </xsl:variable>
@@ -12379,10 +12501,10 @@
12379
12501
  </xsl:variable>
12380
12502
  <xsl:variable name="reviews_container" select="xalan:nodeset($reviews_container_)"/>
12381
12503
 
12382
- <xsl:template match="mn:review-container"/>
12504
+ <xsl:template match="mn:annotation-container"/>
12383
12505
 
12384
12506
  <!-- for old Presentation XML (before https://github.com/metanorma/isodoc/issues/670) -->
12385
- <xsl:template match="mn:review[not(parent::mn:review-container)]"> <!-- 'review' will be processed in mn2pdf/review.xsl -->
12507
+ <xsl:template match="mn:annotation[not(parent::mn:annotation-container)]"> <!-- 'review' will be processed in mn2pdf/review.xsl -->
12386
12508
  <xsl:variable name="id_from" select="normalize-space(current()/@from)"/>
12387
12509
  <xsl:if test="$isGenerateTableIF = 'false'">
12388
12510
  <xsl:choose>
@@ -12402,7 +12524,7 @@
12402
12524
  </xsl:template>
12403
12525
 
12404
12526
  <!-- for new Presentation XML (https://github.com/metanorma/isodoc/issues/670) -->
12405
- <xsl:template match="mn:fmt-review-start" name="fmt-review-start"> <!-- 'review' will be processed in mn2pdf/review.xsl -->
12527
+ <xsl:template match="mn:fmt-annotation-start" name="fmt-annotation-start"> <!-- 'review' will be processed in mn2pdf/review.xsl -->
12406
12528
  <!-- comment 2019-11-29 -->
12407
12529
  <!-- <fo:block font-weight="bold">Review:</fo:block>
12408
12530
  <xsl:apply-templates /> -->
@@ -12458,7 +12580,7 @@
12458
12580
  </xsl:template>
12459
12581
 
12460
12582
  <!-- https://github.com/metanorma/mn-samples-bsi/issues/312 -->
12461
- <xsl:template match="mn:review[@type = 'other']"/>
12583
+ <xsl:template match="mn:annotation[@type = 'other']"/>
12462
12584
 
12463
12585
  <!-- ============ -->
12464
12586
  <!-- errata -->
@@ -12851,9 +12973,12 @@
12851
12973
  <xsl:choose>
12852
12974
  <xsl:when test="mn:fmt-title">
12853
12975
  <xsl:variable name="fmt_title_section">
12854
- <xsl:copy-of select="mn:fmt-title//mn:span[@class = 'fmt-caption-delim'][mn:tab][1]/preceding-sibling::node()[not(self::mn:review)]"/>
12976
+ <xsl:copy-of select="mn:fmt-title//mn:span[@class = 'fmt-caption-delim'][mn:tab][1]/preceding-sibling::node()[not(self::mn:annotation)]"/>
12855
12977
  </xsl:variable>
12856
12978
  <xsl:value-of select="normalize-space($fmt_title_section)"/>
12979
+ <xsl:if test="normalize-space($fmt_title_section) = ''">
12980
+ <xsl:value-of select="mn:fmt-title/mn:tab[1]/preceding-sibling::node()"/>
12981
+ </xsl:if>
12857
12982
  </xsl:when>
12858
12983
  <xsl:otherwise>
12859
12984
  <xsl:value-of select="mn:title/mn:tab[1]/preceding-sibling::node()"/>
@@ -12866,6 +12991,9 @@
12866
12991
  <xsl:when test="mn:fmt-title//mn:span[@class = 'fmt-caption-delim'][mn:tab]">
12867
12992
  <xsl:copy-of select="mn:fmt-title//mn:span[@class = 'fmt-caption-delim'][mn:tab][1]/following-sibling::node()"/>
12868
12993
  </xsl:when>
12994
+ <xsl:when test="mn:fmt-title/mn:tab">
12995
+ <xsl:copy-of select="mn:fmt-title/mn:tab[1]/following-sibling::node()"/>
12996
+ </xsl:when>
12869
12997
  <xsl:when test="mn:fmt-title">
12870
12998
  <xsl:copy-of select="mn:fmt-title/node()"/>
12871
12999
  </xsl:when>
@@ -13003,10 +13131,10 @@
13003
13131
 
13004
13132
  </fo:block>
13005
13133
 
13006
- <xsl:apply-templates select="mn:title[@columns = 1]"/>
13134
+ <xsl:apply-templates select="mn:fmt-title[@columns = 1]"/>
13007
13135
 
13008
13136
  <fo:block>
13009
- <xsl:apply-templates select="node()[not(self::mn:title and @columns = 1)]"/>
13137
+ <xsl:apply-templates select="node()[not(self::mn:fmt-title and @columns = 1)]"/>
13010
13138
  </fo:block>
13011
13139
  </xsl:otherwise>
13012
13140
  </xsl:choose>
@@ -13015,7 +13143,7 @@
13015
13143
  <xsl:template name="refine_annex_style">
13016
13144
  </xsl:template>
13017
13145
 
13018
- <xsl:template match="mn:name/text()">
13146
+ <xsl:template match="mn:name/text() | mn:fmt-name/text()">
13019
13147
  <!-- 0xA0 to space replacement -->
13020
13148
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
13021
13149
  </xsl:template>
@@ -13071,28 +13199,28 @@
13071
13199
  <xsl:template match="mn:amend"/>
13072
13200
 
13073
13201
  <!-- fmt-title renamed to title in update_xml_step1 -->
13074
- <xsl:template match="mn:fmt-title"/>
13202
+ <!-- <xsl:template match="mn:fmt-title" /> -->
13075
13203
 
13076
13204
  <!-- fmt-name renamed to name in update_xml_step1 -->
13077
- <xsl:template match="mn:fmt-name"/>
13205
+ <!-- <xsl:template match="mn:fmt-name" /> -->
13078
13206
 
13079
13207
  <!-- fmt-preferred renamed to preferred in update_xml_step1 -->
13080
- <xsl:template match="mn:fmt-preferred"/>
13208
+ <!-- <xsl:template match="mn:fmt-preferred" /> -->
13081
13209
 
13082
13210
  <!-- fmt-admitted renamed to admitted in update_xml_step1 -->
13083
- <xsl:template match="mn:fmt-admitted"/>
13211
+ <!-- <xsl:template match="mn:fmt-admitted" /> -->
13084
13212
 
13085
13213
  <!-- fmt-deprecates renamed to deprecates in update_xml_step1 -->
13086
- <xsl:template match="mn:fmt-deprecates"/>
13214
+ <!-- <xsl:template match="mn:fmt-deprecates" /> -->
13087
13215
 
13088
13216
  <!-- fmt-definition renamed to definition in update_xml_step1 -->
13089
- <xsl:template match="mn:fmt-definition"/>
13217
+ <!-- <xsl:template match="mn:fmt-definition" /> -->
13090
13218
 
13091
13219
  <!-- fmt-termsource renamed to termsource in update_xml_step1 -->
13092
- <xsl:template match="mn:fmt-termsource"/>
13220
+ <!-- <xsl:template match="mn:fmt-termsource" /> -->
13093
13221
 
13094
13222
  <!-- fmt-source renamed to source in update_xml_step1 -->
13095
- <xsl:template match="mn:fmt-source"/>
13223
+ <!-- <xsl:template match="mn:fmt-source" /> -->
13096
13224
 
13097
13225
  <xsl:template match="mn:semx">
13098
13226
  <xsl:apply-templates/>
@@ -13537,12 +13665,12 @@
13537
13665
  <xsl:when test="ancestor::mn:preface">
13538
13666
  <xsl:value-of select="$level_total - 2"/>
13539
13667
  </xsl:when>
13540
- <xsl:when test="ancestor::mn:sections and self::mn:title">
13668
+ <xsl:when test="ancestor::mn:sections and self::mn:fmt-title">
13541
13669
  <!-- determine 'depth' depends on upper clause with title/@depth -->
13542
13670
  <!-- <xsl:message>title=<xsl:value-of select="."/></xsl:message> -->
13543
- <xsl:variable name="clause_with_depth_depth" select="ancestor::mn:clause[mn:title/@depth][1]/mn:title/@depth"/>
13671
+ <xsl:variable name="clause_with_depth_depth" select="ancestor::mn:clause[mn:fmt-title/@depth][1]/mn:fmt-title/@depth"/>
13544
13672
  <!-- <xsl:message>clause_with_depth_depth=<xsl:value-of select="$clause_with_depth_depth"/></xsl:message> -->
13545
- <xsl:variable name="clause_with_depth_level" select="count(ancestor::mn:clause[mn:title/@depth][1]/ancestor::*)"/>
13673
+ <xsl:variable name="clause_with_depth_level" select="count(ancestor::mn:clause[mn:fmt-title/@depth][1]/ancestor::*)"/>
13546
13674
  <!-- <xsl:message>clause_with_depth_level=<xsl:value-of select="$clause_with_depth_level"/></xsl:message> -->
13547
13675
  <xsl:variable name="curr_level" select="count(ancestor::*) - 1"/>
13548
13676
  <!-- <xsl:message>curr_level=<xsl:value-of select="$curr_level"/></xsl:message> -->
@@ -13558,8 +13686,8 @@
13558
13686
  </xsl:otherwise>
13559
13687
  </xsl:choose>
13560
13688
  </xsl:when>
13561
- <xsl:when test="ancestor::mn:sections and self::mn:name and parent::mn:term">
13562
- <xsl:variable name="upper_terms_depth" select="normalize-space(ancestor::mn:terms[1]/mn:title/@depth)"/>
13689
+ <xsl:when test="ancestor::mn:sections and self::mn:fmt-name and parent::mn:term">
13690
+ <xsl:variable name="upper_terms_depth" select="normalize-space(ancestor::mn:terms[1]/mn:fmt-title/@depth)"/>
13563
13691
  <xsl:choose>
13564
13692
  <xsl:when test="string(number($upper_terms_depth)) != 'NaN'">
13565
13693
  <xsl:value-of select="number($upper_terms_depth + 1)"/>
@@ -13570,7 +13698,7 @@
13570
13698
  </xsl:choose>
13571
13699
  </xsl:when>
13572
13700
  <xsl:when test="ancestor::mn:sections">
13573
- <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[self::mn:clause or self::mn:terms][1]/mn:title/@depth)"/>
13701
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[self::mn:clause or self::mn:terms][1]/mn:fmt-title/@depth)"/>
13574
13702
  <xsl:choose>
13575
13703
  <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
13576
13704
  <xsl:value-of select="number($upper_clause_depth + 1)"/>
@@ -13586,8 +13714,8 @@
13586
13714
  <xsl:when test="parent::mn:annex">
13587
13715
  <xsl:value-of select="$level_total - 1"/>
13588
13716
  </xsl:when>
13589
- <xsl:when test="ancestor::mn:annex and self::mn:title">
13590
- <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::mn:clause[2]/mn:title/@depth)"/>
13717
+ <xsl:when test="ancestor::mn:annex and self::mn:fmt-title">
13718
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::mn:clause[2]/mn:fmt-title/@depth)"/>
13591
13719
  <xsl:choose>
13592
13720
  <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
13593
13721
  <xsl:value-of select="number($upper_clause_depth + 1)"/>
@@ -13620,7 +13748,7 @@
13620
13748
  </xsl:when>
13621
13749
  <xsl:otherwise>
13622
13750
  <xsl:variable name="title_level_">
13623
- <xsl:for-each select="../preceding-sibling::mn:title[1]">
13751
+ <xsl:for-each select="../preceding-sibling::mn:fmt-title[1]">
13624
13752
  <xsl:call-template name="getLevel"/>
13625
13753
  </xsl:for-each>
13626
13754
  </xsl:variable>
@@ -13697,15 +13825,17 @@
13697
13825
  </xsl:template>
13698
13826
 
13699
13827
  <xsl:template name="setNamedDestination">
13700
- <!-- skip GUID, e.g. _33eac3cb-9663-4291-ae26-1d4b6f4635fc -->
13701
- <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'">
13702
- <fox:destination internal-destination="{@id}"/>
13703
- </xsl:if>
13704
- <xsl:for-each select=". | mn:title | mn:name">
13705
- <xsl:if test="@named_dest">
13706
- <fox:destination internal-destination="{@named_dest}"/>
13828
+ <xsl:if test="$isGenerateTableIF = 'false'">
13829
+ <!-- skip GUID, e.g. _33eac3cb-9663-4291-ae26-1d4b6f4635fc -->
13830
+ <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'">
13831
+ <fox:destination internal-destination="{@id}"/>
13707
13832
  </xsl:if>
13708
- </xsl:for-each>
13833
+ <xsl:for-each select=". | mn:fmt-title | mn:fmt-name">
13834
+ <xsl:if test="@named_dest">
13835
+ <fox:destination internal-destination="{@named_dest}"/>
13836
+ </xsl:if>
13837
+ </xsl:for-each>
13838
+ </xsl:if>
13709
13839
  </xsl:template>
13710
13840
 
13711
13841
  <xsl:template name="add-letter-spacing">
@@ -14053,7 +14183,7 @@
14053
14183
  </xsl:when>
14054
14184
  <xsl:otherwise>
14055
14185
  <!-- namespace-uri(ancestor::mn:title) != '' to skip title from $contents -->
14056
- <xsl:if test="namespace-uri(ancestor::mn:title) != '' and ($char_prev = '' and ../preceding-sibling::node())">
14186
+ <xsl:if test="namespace-uri(ancestor::mn:fmt-title) != '' and ($char_prev = '' and ../preceding-sibling::node())">
14057
14187
  <fo:inline padding-left="1mm"><xsl:value-of select="$zero_width_space"/></fo:inline>
14058
14188
  </xsl:if>
14059
14189
  <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">
@@ -14087,7 +14217,7 @@
14087
14217
  </fo:block>
14088
14218
  </fo:block-container>
14089
14219
  </fo:inline-container>
14090
- <xsl:if test="namespace-uri(ancestor::mn:title) != '' and ($char_next != '' or ../following-sibling::node())">
14220
+ <xsl:if test="namespace-uri(ancestor::mn:fmt-title) != '' and ($char_next != '' or ../following-sibling::node())">
14091
14221
  <fo:inline padding-left="1mm"><xsl:value-of select="$zero_width_space"/></fo:inline>
14092
14222
  </xsl:if>
14093
14223
  </xsl:otherwise>