metanorma-bipm 2.5.11 → 2.6.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.
@@ -1,4 +1,4 @@
1
- <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:jcgm="https://www.metanorma.org/ns/bipm" xmlns:bipm="https://www.metanorma.org/ns/bipm" xmlns:mathml="http://www.w3.org/1998/Math/MathML" xmlns:xalan="http://xml.apache.org/xalan" xmlns:fox="http://xmlgraphics.apache.org/fop/extensions" xmlns:redirect="http://xml.apache.org/xalan/redirect" xmlns:java="http://xml.apache.org/xalan/java" exclude-result-prefixes="java redirect" extension-element-prefixes="redirect" version="1.0">
1
+ <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:jcgm="https://www.metanorma.org/ns/standoc" xmlns:bipm="https://www.metanorma.org/ns/standoc" xmlns:mathml="http://www.w3.org/1998/Math/MathML" xmlns:xalan="http://xml.apache.org/xalan" xmlns:fox="http://xmlgraphics.apache.org/fop/extensions" xmlns:redirect="http://xml.apache.org/xalan/redirect" xmlns:java="http://xml.apache.org/xalan/java" exclude-result-prefixes="java redirect" extension-element-prefixes="redirect" version="1.0">
2
2
 
3
3
  <xsl:output method="xml" encoding="UTF-8" indent="no"/>
4
4
 
@@ -11,7 +11,7 @@
11
11
  <xsl:choose>
12
12
  <xsl:when test="normalize-space($align-cross-elements) != ''"><xsl:value-of select="$align-cross-elements"/></xsl:when>
13
13
  <xsl:otherwise>
14
- <xsl:value-of select="normalize-space((//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:ext/jcgm:parallel-align-element)"/>
14
+ <xsl:value-of select="normalize-space((//jcgm:metanorma)[1]/jcgm:bibdata/jcgm:ext/jcgm:parallel-align-element)"/>
15
15
  </xsl:otherwise>
16
16
  </xsl:choose>
17
17
  </xsl:variable>
@@ -32,7 +32,7 @@
32
32
  <xsl:variable name="doc_first">
33
33
  <xsl:if test="*[local-name()='metanorma-collection']">
34
34
  <xsl:variable name="doc_first_step1">
35
- <xsl:apply-templates select="(/*[local-name()='metanorma-collection']//*[local-name() = 'bipm-standard'])[1]" mode="flatxml_step1">
35
+ <xsl:apply-templates select="(/*[local-name()='metanorma-collection']//*[local-name() = 'metanorma'])[1]" mode="flatxml_step1">
36
36
  <xsl:with-param name="num" select="'first'"/>
37
37
  </xsl:apply-templates>
38
38
  </xsl:variable>
@@ -44,7 +44,7 @@
44
44
  </xsl:variable>
45
45
  <xsl:variable name="docs_slave">
46
46
  <xsl:if test="*[local-name()='metanorma-collection']">
47
- <xsl:for-each select="(/*[local-name()='metanorma-collection']//*[local-name() = 'bipm-standard'])[position() &gt; 1]">
47
+ <xsl:for-each select="(/*[local-name()='metanorma-collection']//*[local-name() = 'metanorma'])[position() &gt; 1]">
48
48
  <xsl:variable name="doc_first_step1">
49
49
  <xsl:apply-templates select="." mode="flatxml_step1">
50
50
  <xsl:with-param name="num" select="'slave'"/>
@@ -63,7 +63,7 @@
63
63
  <xsl:variable name="docs_count">
64
64
  <xsl:choose>
65
65
  <xsl:when test="/*[local-name()='metanorma-collection']">
66
- <xsl:value-of select="count(/*[local-name()='metanorma-collection']//*[local-name() = 'bipm-standard'])"/>
66
+ <xsl:value-of select="count(/*[local-name()='metanorma-collection']//*[local-name() = 'metanorma'])"/>
67
67
  </xsl:when>
68
68
  <xsl:otherwise>1</xsl:otherwise>
69
69
  </xsl:choose>
@@ -80,7 +80,7 @@
80
80
  </xsl:call-template>
81
81
  </xsl:variable>
82
82
 
83
- <xsl:variable name="copyrightText" select="concat('© ', (//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:ext/jcgm:editorialgroup/jcgm:committee/@acronym, ' ', (//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:copyright/jcgm:from, ' — ', $all_rights_reserved)"/>
83
+ <xsl:variable name="copyrightText" select="concat('© ', (//jcgm:metanorma)[1]/jcgm:bibdata/jcgm:ext/jcgm:editorialgroup/jcgm:committee/@acronym, ' ', (//jcgm:metanorma)[1]/jcgm:bibdata/jcgm:copyright/jcgm:from, ' — ', $all_rights_reserved)"/>
84
84
 
85
85
  <!-- Example:
86
86
  <item level="1" id="Foreword" display="true">Foreword</item>
@@ -88,7 +88,7 @@
88
88
  -->
89
89
  <xsl:variable name="contents_">
90
90
 
91
- <xsl:for-each select="//*[local-name() = 'bipm-standard']">
91
+ <xsl:for-each select="//*[local-name() = 'metanorma']">
92
92
  <xsl:variable name="lang" select="*[local-name()='bibdata']/*[local-name()='language'][@current = 'true']"/>
93
93
  <xsl:variable name="current_document">
94
94
  <xsl:copy-of select="."/>
@@ -114,7 +114,7 @@
114
114
  <xsl:variable name="contents" select="xalan:nodeset($contents_)"/>
115
115
 
116
116
  <xsl:variable name="indexes">
117
- <xsl:for-each select="//jcgm:bipm-standard">
117
+ <xsl:for-each select="//jcgm:metanorma">
118
118
 
119
119
  <xsl:variable name="current_document">
120
120
  <xsl:copy-of select="."/>
@@ -230,11 +230,11 @@
230
230
  <xsl:call-template name="addPDFUAmeta"/>
231
231
  </fo:declarations>
232
232
 
233
- <!-- <xsl:if test="$debug = 'true'">
234
- <redirect:write file="contents_{java:getTime(java:java.util.Date.new())}.xml">
233
+ <xsl:if test="$debug = 'true'">
234
+ <redirect:write file="contents_.xml"> <!-- {java:getTime(java:java.util.Date.new())} -->
235
235
  <xsl:copy-of select="$contents"/>
236
236
  </redirect:write>
237
- </xsl:if> -->
237
+ </xsl:if>
238
238
 
239
239
  <xsl:call-template name="addBookmarks">
240
240
  <xsl:with-param name="contents" select="$contents"/>
@@ -247,15 +247,15 @@
247
247
  <xsl:call-template name="printEdition"/>
248
248
  <xsl:text>   </xsl:text>
249
249
  <xsl:call-template name="convertDate">
250
- <xsl:with-param name="date" select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:date[@type = 'published']/jcgm:on"/>
250
+ <xsl:with-param name="date" select="(//jcgm:metanorma)[1]/jcgm:bibdata/jcgm:date[@type = 'published']/jcgm:on"/>
251
251
  </xsl:call-template>
252
252
  </fo:block>
253
253
  <!-- Example © JCGM 2009 -->
254
254
  <fo:block font-size="11pt">
255
255
  <fo:inline font-family="Times New Roman" font-size="12pt"><xsl:text>© </xsl:text></fo:inline>
256
- <xsl:value-of select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:ext/jcgm:editorialgroup/jcgm:committee/@acronym"/>
256
+ <xsl:value-of select="(//jcgm:metanorma)[1]/jcgm:bibdata/jcgm:ext/jcgm:editorialgroup/jcgm:committee/@acronym"/>
257
257
  <xsl:text> </xsl:text>
258
- <xsl:value-of select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:copyright/jcgm:from"/>
258
+ <xsl:value-of select="(//jcgm:metanorma)[1]/jcgm:bibdata/jcgm:copyright/jcgm:from"/>
259
259
  </fo:block>
260
260
  </fo:static-content>
261
261
  <fo:flow flow-name="xsl-region-body">
@@ -263,20 +263,20 @@
263
263
  <xsl:call-template name="insertDraftWatermark"/>
264
264
  <fo:block-container font-weight="bold">
265
265
  <fo:block font-size="16.5pt">
266
- <xsl:value-of select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:ext/jcgm:editorialgroup/jcgm:committee/@acronym"/>
266
+ <xsl:value-of select="(//jcgm:metanorma)[1]/jcgm:bibdata/jcgm:ext/jcgm:editorialgroup/jcgm:committee/@acronym"/>
267
267
  <xsl:text> </xsl:text>
268
- <xsl:value-of select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:docnumber"/>
268
+ <xsl:value-of select="(//jcgm:metanorma)[1]/jcgm:bibdata/jcgm:docnumber"/>
269
269
  <fo:inline font-weight="normal">:</fo:inline>
270
- <xsl:value-of select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:copyright/jcgm:from"/>
270
+ <xsl:value-of select="(//jcgm:metanorma)[1]/jcgm:bibdata/jcgm:copyright/jcgm:from"/>
271
271
  </fo:block>
272
272
  <fo:block font-size="13pt" font-weight="normal" space-after="19.5mm">
273
- <xsl:value-of select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:title[@type = 'title-provenance']"/>
273
+ <xsl:value-of select="(//jcgm:metanorma)[1]/jcgm:bibdata/jcgm:title[@type = 'title-provenance']"/>
274
274
  </fo:block>
275
275
  <fo:block border-bottom="1pt solid black"> </fo:block>
276
276
  <fo:block font-size="16.5pt" margin-left="-0.5mm" padding-top="3.5mm" space-after="7mm" margin-right="7mm" line-height="105%" role="H1">
277
- <xsl:apply-templates select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:title[@language = $lang and @type = 'title-main']" mode="title"/>
277
+ <xsl:apply-templates select="(//jcgm:metanorma)[1]/jcgm:bibdata/jcgm:title[@language = $lang and @type = 'title-main']" mode="title"/>
278
278
  <xsl:variable name="title_part">
279
- <xsl:apply-templates select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:title[@language = $lang and @type = 'title-part']" mode="title"/>
279
+ <xsl:apply-templates select="(//jcgm:metanorma)[1]/jcgm:bibdata/jcgm:title[@language = $lang and @type = 'title-part']" mode="title"/>
280
280
  </xsl:variable>
281
281
  <xsl:if test="normalize-space($title_part) != ''">
282
282
  <xsl:text> — </xsl:text>
@@ -284,10 +284,10 @@
284
284
  </xsl:if>
285
285
  </fo:block>
286
286
  <fo:block font-size="12pt" font-style="italic" line-height="140%" role="H1">
287
- <xsl:variable name="secondLang" select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:title/@language[. != $lang]"/>
288
- <xsl:apply-templates select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:title[@language = $secondLang and @type = 'title-main']" mode="title"/>
287
+ <xsl:variable name="secondLang" select="(//jcgm:metanorma)[1]/jcgm:bibdata/jcgm:title/@language[. != $lang]"/>
288
+ <xsl:apply-templates select="(//jcgm:metanorma)[1]/jcgm:bibdata/jcgm:title[@language = $secondLang and @type = 'title-main']" mode="title"/>
289
289
  <xsl:variable name="title_part">
290
- <xsl:apply-templates select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:title[@language = $secondLang and @type = 'title-part']" mode="title"/>
290
+ <xsl:apply-templates select="(//jcgm:metanorma)[1]/jcgm:bibdata/jcgm:title[@language = $secondLang and @type = 'title-part']" mode="title"/>
291
291
  </xsl:variable>
292
292
  <xsl:if test="normalize-space($title_part) != ''">
293
293
  <xsl:text> — </xsl:text>
@@ -313,20 +313,20 @@
313
313
  <fo:table-body>
314
314
  <fo:table-row>
315
315
  <fo:table-cell>
316
- <fo:block><xsl:value-of select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:ext/jcgm:editorialgroup/jcgm:committee"/></fo:block>
316
+ <fo:block><xsl:value-of select="(//jcgm:metanorma)[1]/jcgm:bibdata/jcgm:ext/jcgm:editorialgroup/jcgm:committee"/></fo:block>
317
317
  </fo:table-cell>
318
318
  <fo:table-cell line-height="140%">
319
- <fo:block><xsl:value-of select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:ext/jcgm:editorialgroup/jcgm:committee/@acronym"/></fo:block>
320
- <fo:block><xsl:value-of select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:docnumber"/></fo:block>
321
- <fo:block><xsl:value-of select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:copyright/jcgm:from"/></fo:block>
319
+ <fo:block><xsl:value-of select="(//jcgm:metanorma)[1]/jcgm:bibdata/jcgm:ext/jcgm:editorialgroup/jcgm:committee/@acronym"/></fo:block>
320
+ <fo:block><xsl:value-of select="(//jcgm:metanorma)[1]/jcgm:bibdata/jcgm:docnumber"/></fo:block>
321
+ <fo:block><xsl:value-of select="(//jcgm:metanorma)[1]/jcgm:bibdata/jcgm:copyright/jcgm:from"/></fo:block>
322
322
  </fo:table-cell>
323
323
  </fo:table-row>
324
324
  </fo:table-body>
325
325
  </fo:table>
326
326
  <fo:block font-size="18pt" space-before="70mm" role="H1">
327
- <xsl:apply-templates select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:title[@language = $lang and @type = 'title-main']" mode="title"/>
327
+ <xsl:apply-templates select="(//jcgm:metanorma)[1]/jcgm:bibdata/jcgm:title[@language = $lang and @type = 'title-main']" mode="title"/>
328
328
  <xsl:variable name="title_part">
329
- <xsl:apply-templates select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:title[@language = $lang and @type = 'title-part']" mode="title"/>
329
+ <xsl:apply-templates select="(//jcgm:metanorma)[1]/jcgm:bibdata/jcgm:title[@language = $lang and @type = 'title-part']" mode="title"/>
330
330
  </xsl:variable>
331
331
  <xsl:if test="normalize-space($title_part) != ''">
332
332
  <xsl:text> — </xsl:text>
@@ -334,10 +334,10 @@
334
334
  </xsl:if>
335
335
  </fo:block>
336
336
  <fo:block font-size="13pt" space-before="35mm" role="H1">
337
- <xsl:variable name="secondLang" select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:title/@language[. != $lang]"/>
338
- <xsl:apply-templates select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:title[@language = $secondLang and @type = 'title-main']" mode="title"/>
337
+ <xsl:variable name="secondLang" select="(//jcgm:metanorma)[1]/jcgm:bibdata/jcgm:title/@language[. != $lang]"/>
338
+ <xsl:apply-templates select="(//jcgm:metanorma)[1]/jcgm:bibdata/jcgm:title[@language = $secondLang and @type = 'title-main']" mode="title"/>
339
339
  <xsl:variable name="title_part">
340
- <xsl:apply-templates select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:title[@language = $secondLang and @type = 'title-part']" mode="title"/>
340
+ <xsl:apply-templates select="(//jcgm:metanorma)[1]/jcgm:bibdata/jcgm:title[@language = $secondLang and @type = 'title-part']" mode="title"/>
341
341
  </xsl:variable>
342
342
  <xsl:if test="normalize-space($title_part) != ''">
343
343
  <xsl:text> — </xsl:text>
@@ -388,7 +388,7 @@
388
388
  </xsl:for-each> <!-- END: preface pages -->
389
389
 
390
390
  <xsl:choose>
391
- <xsl:when test="count(..//*[local-name() = 'bipm-standard']) = 1">
391
+ <xsl:when test="count(..//*[local-name() = 'metanorma']) = 1">
392
392
 
393
393
  <xsl:for-each select="xalan:nodeset($updated_xml_with_pages)"> <!-- set context to preface -->
394
394
 
@@ -420,9 +420,9 @@
420
420
  </fo:page-sequence>
421
421
  </xsl:for-each>
422
422
  </xsl:for-each>
423
- </xsl:when> <!-- END: count(//*[local-name() = 'bipm-standard']) = 1 -->
423
+ </xsl:when> <!-- END: count(//*[local-name() = 'metanorma']) = 1 -->
424
424
 
425
- <xsl:otherwise> <!-- count(//*[local-name() = 'bipm-standard']) != 1 -->
425
+ <xsl:otherwise> <!-- count(//*[local-name() = 'metanorma']) != 1 -->
426
426
  <fo:page-sequence master-reference="document-jcgm" initial-page-number="1" force-page-count="no-force">
427
427
 
428
428
  <xsl:call-template name="insertHeaderFooter"/>
@@ -431,7 +431,7 @@
431
431
  <!-- Show title -->
432
432
  <!-- Example: Evaluation of measurement data — An introduction to the `Guide to the expression of uncertainty in measurement' and related documents -->
433
433
 
434
- <xsl:for-each select="..//*[local-name() = 'bipm-standard']">
434
+ <xsl:for-each select="..//*[local-name() = 'metanorma']">
435
435
  <xsl:apply-templates select="jcgm:sections/jcgm:p[starts-with(@class, 'zzSTDTitle')]"/>
436
436
  </xsl:for-each>
437
437
 
@@ -456,7 +456,7 @@
456
456
 
457
457
  </fo:flow>
458
458
  </fo:page-sequence>
459
- </xsl:otherwise> <!-- count(//*[local-name() = 'bipm-standard']) != 1 -->
459
+ </xsl:otherwise> <!-- count(//*[local-name() = 'metanorma']) != 1 -->
460
460
  </xsl:choose>
461
461
 
462
462
  </xsl:for-each>
@@ -478,7 +478,7 @@
478
478
  <xsl:element name="boilerplate" namespace="{$namespace_full}"> <!-- save context element -->
479
479
 
480
480
  <!-- Copyright -->
481
- <xsl:for-each select="..//*[local-name() = 'bipm-standard']">
481
+ <xsl:for-each select="..//*[local-name() = 'metanorma']">
482
482
  <xsl:element name="page_sequence" namespace="{$namespace_full}">
483
483
  <xsl:apply-templates select="./*[local-name()='boilerplate']/*" mode="update_xml_step_move_pagebreak"/>
484
484
  </xsl:element>
@@ -489,7 +489,7 @@
489
489
  <xsl:element name="preface" namespace="{$namespace_full}"> <!-- save context element -->
490
490
 
491
491
  <!-- Table of Contents -->
492
- <xsl:for-each select="..//*[local-name() = 'bipm-standard']">
492
+ <xsl:for-each select="..//*[local-name() = 'metanorma']">
493
493
  <xsl:variable name="current_document">
494
494
  <xsl:copy-of select="."/>
495
495
  </xsl:variable>
@@ -503,27 +503,27 @@
503
503
 
504
504
  <!-- Foreword, Introduction -->
505
505
  <!-- <xsl:call-template name="processPrefaceSectionsDefault"/> -->
506
- <xsl:for-each select="..//*[local-name() = 'bipm-standard']">
506
+ <xsl:for-each select="..//*[local-name() = 'metanorma']">
507
507
  <xsl:element name="page_sequence" namespace="{$namespace_full}">
508
508
  <xsl:apply-templates select="./*[local-name()='preface']/*[local-name()='abstract']" mode="update_xml_step_move_pagebreak"/>
509
509
  </xsl:element>
510
510
  </xsl:for-each>
511
- <xsl:for-each select="..//*[local-name() = 'bipm-standard']">
511
+ <xsl:for-each select="..//*[local-name() = 'metanorma']">
512
512
  <xsl:element name="page_sequence" namespace="{$namespace_full}">
513
513
  <xsl:apply-templates select="./*[local-name()='preface']/*[local-name()='foreword']" mode="update_xml_step_move_pagebreak"/>
514
514
  </xsl:element>
515
515
  </xsl:for-each>
516
- <xsl:for-each select="..//*[local-name() = 'bipm-standard']">
516
+ <xsl:for-each select="..//*[local-name() = 'metanorma']">
517
517
  <xsl:element name="page_sequence" namespace="{$namespace_full}">
518
518
  <xsl:apply-templates select="./*[local-name()='preface']/*[local-name()='introduction']" mode="update_xml_step_move_pagebreak"/>
519
519
  </xsl:element>
520
520
  </xsl:for-each>
521
- <xsl:for-each select="..//*[local-name() = 'bipm-standard']">
521
+ <xsl:for-each select="..//*[local-name() = 'metanorma']">
522
522
  <xsl:element name="page_sequence" namespace="{$namespace_full}">
523
523
  <xsl:apply-templates select="./*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements' and local-name() != 'note' and local-name() != 'admonition' and not(local-name() = 'clause' and @type = 'toc')]" mode="update_xml_step_move_pagebreak"/>
524
524
  </xsl:element>
525
525
  </xsl:for-each>
526
- <xsl:for-each select="..//*[local-name() = 'bipm-standard']">
526
+ <xsl:for-each select="..//*[local-name() = 'metanorma']">
527
527
  <xsl:element name="page_sequence" namespace="{$namespace_full}">
528
528
  <xsl:apply-templates select="./*[local-name()='preface']/*[local-name()='acknowledgements']" mode="update_xml_step_move_pagebreak"/>
529
529
  </xsl:element>
@@ -657,9 +657,9 @@
657
657
  </xsl:if>
658
658
  <xsl:apply-templates/>
659
659
  </fo:block>
660
- <xsl:variable name="curr_lang" select="ancestor::jcgm:bipm-standard/*[local-name()='bibdata']/*[local-name()='language'][@current = 'true']"/>
660
+ <xsl:variable name="curr_lang" select="ancestor::jcgm:metanorma/*[local-name()='bibdata']/*[local-name()='language'][@current = 'true']"/>
661
661
  <xsl:variable name="edition">
662
- <xsl:apply-templates select="ancestor::jcgm:bipm-standard/*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) = '']">
662
+ <xsl:apply-templates select="ancestor::jcgm:metanorma/*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) = '']">
663
663
  <xsl:with-param name="curr_lang" select="$curr_lang"/>
664
664
  </xsl:apply-templates>
665
665
  </xsl:variable>
@@ -1014,11 +1014,11 @@
1014
1014
  </xsl:template>
1015
1015
 
1016
1016
  <xsl:variable name="header_text">
1017
- <xsl:value-of select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:ext/jcgm:editorialgroup/jcgm:committee/@acronym"/>
1017
+ <xsl:value-of select="(//jcgm:metanorma)[1]/jcgm:bibdata/jcgm:ext/jcgm:editorialgroup/jcgm:committee/@acronym"/>
1018
1018
  <xsl:text> </xsl:text>
1019
- <xsl:value-of select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:docnumber"/>
1019
+ <xsl:value-of select="(//jcgm:metanorma)[1]/jcgm:bibdata/jcgm:docnumber"/>
1020
1020
  <xsl:text>:</xsl:text>
1021
- <xsl:value-of select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:copyright/jcgm:from"/>
1021
+ <xsl:value-of select="(//jcgm:metanorma)[1]/jcgm:bibdata/jcgm:copyright/jcgm:from"/>
1022
1022
  </xsl:variable>
1023
1023
 
1024
1024
  <xsl:template name="insertHeaderFooter">
@@ -1080,7 +1080,7 @@
1080
1080
 
1081
1081
  <xsl:template name="insertDraftWatermark">
1082
1082
  <xsl:param name="isDraft"/>
1083
- <xsl:if test="$isDraft = 'true' or normalize-space(//jcgm:bipm-standard/jcgm:bibdata/jcgm:version/jcgm:draft or contains(//jcgm:bipm-standard/jcgm:bibdata/jcgm:status/jcgm:stage, 'draft') or contains(//jcgm:bipm-standard/jcgm:bibdata/jcgm:status/jcgm:stage, 'projet')) = 'true'">
1083
+ <xsl:if test="$isDraft = 'true' or normalize-space(//jcgm:metanorma/jcgm:bibdata/jcgm:version/jcgm:draft or contains(//jcgm:metanorma/jcgm:bibdata/jcgm:status/jcgm:stage, 'draft') or contains(//jcgm:metanorma/jcgm:bibdata/jcgm:status/jcgm:stage, 'projet')) = 'true'">
1084
1084
  <!-- DRAFT -->
1085
1085
  <xsl:variable name="draft_label">
1086
1086
  <xsl:call-template name="getLocalizedString">
@@ -1186,7 +1186,7 @@
1186
1186
 
1187
1187
  </xsl:template>
1188
1188
 
1189
- <xsl:template match="jcgm:bipm-standard/jcgm:bibdata/jcgm:edition">
1189
+ <xsl:template match="jcgm:metanorma/jcgm:bibdata/jcgm:edition">
1190
1190
  <xsl:param name="font-size" select="'65%'"/>
1191
1191
  <xsl:param name="baseline-shift" select="'30%'"/>
1192
1192
  <xsl:param name="curr_lang" select="'fr'"/>
@@ -1486,7 +1486,7 @@
1486
1486
  </xsl:copy>
1487
1487
  </xsl:template>
1488
1488
 
1489
- <xsl:template match="*[local-name() = 'bipm-standard']" mode="flatxml_step1">
1489
+ <xsl:template match="*[local-name() = 'metanorma']" mode="flatxml_step1">
1490
1490
  <xsl:param name="num"/>
1491
1491
  <xsl:copy>
1492
1492
  <xsl:apply-templates select="@*" mode="flatxml_step1"/>
@@ -1500,7 +1500,7 @@
1500
1500
  <!-- <section_scope>
1501
1501
  <clause @type=scope>...
1502
1502
  </section_scope> -->
1503
- <xsl:element name="section_scope" namespace="https://www.metanorma.org/ns/bipm">
1503
+ <xsl:element name="section_scope" namespace="{$namespace_full}">
1504
1504
  <xsl:call-template name="clause"/>
1505
1505
  </xsl:element>
1506
1506
  </xsl:template>
@@ -1544,7 +1544,7 @@
1544
1544
  <xsl:copy>
1545
1545
  <xsl:apply-templates select="@*" mode="flatxml_step1"/>
1546
1546
  <!-- create empty element for case if first element isn't cross-align -->
1547
- <xsl:element name="empty" namespace="https://www.metanorma.org/ns/bipm">
1547
+ <xsl:element name="empty" namespace="{$namespace_full}">
1548
1548
  <xsl:attribute name="cross-align">true</xsl:attribute>
1549
1549
  <xsl:attribute name="element-number">empty_annex<xsl:number/></xsl:attribute>
1550
1550
  </xsl:element>
@@ -1562,9 +1562,9 @@
1562
1562
  <section_terms>
1563
1563
  <terms>...</terms>
1564
1564
  </section_terms> -->
1565
- <xsl:element name="section_terms" namespace="https://www.metanorma.org/ns/bipm">
1565
+ <xsl:element name="section_terms" namespace="{$namespace_full}">
1566
1566
  <!-- create empty element for case if first element isn't cross-align -->
1567
- <xsl:element name="empty" namespace="https://www.metanorma.org/ns/bipm">
1567
+ <xsl:element name="empty" namespace="{$namespace_full}">
1568
1568
  <xsl:attribute name="cross-align">true</xsl:attribute>
1569
1569
  <xsl:attribute name="element-number">empty_terms_<xsl:number/></xsl:attribute>
1570
1570
  </xsl:element>
@@ -1572,7 +1572,7 @@
1572
1572
  </xsl:element>
1573
1573
  </xsl:template>
1574
1574
  <xsl:template match="*[local-name()='sections']//*[local-name()='definitions']" mode="flatxml_step1" priority="2">
1575
- <xsl:element name="section_terms" namespace="https://www.metanorma.org/ns/bipm">
1575
+ <xsl:element name="section_terms" namespace="{$namespace_full}">
1576
1576
  <xsl:call-template name="terms"/>
1577
1577
  </xsl:element>
1578
1578
  </xsl:template>
@@ -1616,7 +1616,7 @@
1616
1616
  <term><term_name>...</term_name></term> -->
1617
1617
  <xsl:template match="jcgm:term/jcgm:name" mode="flatxml_step1"/>
1618
1618
  <xsl:template match="jcgm:term/jcgm:fmt-name" mode="flatxml_step1">
1619
- <xsl:element name="term_name" namespace="https://www.metanorma.org/ns/bipm">
1619
+ <xsl:element name="term_name" namespace="{$namespace_full}">
1620
1620
  <xsl:apply-templates select="@*" mode="flatxml_step1"/>
1621
1621
  <xsl:call-template name="setCrossAlignAttributes"/>
1622
1622
  <xsl:apply-templates mode="flatxml_step1"/>
@@ -1714,6 +1714,98 @@
1714
1714
 
1715
1715
  <xsl:template match="*[local-name() = 'fmt-xref-label']" mode="flatxml_step1"/>
1716
1716
 
1717
+ <xsl:template match="*[local-name() = 'stem']" mode="flatxml_step1"/>
1718
+
1719
+ <xsl:template match="*[local-name() = 'fmt-stem'][not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])]" mode="flatxml_step1">
1720
+ <xsl:element name="stem" namespace="{$namespace_full}">
1721
+ <xsl:copy-of select="@*"/>
1722
+ <xsl:choose>
1723
+ <xsl:when test="*[local-name() = 'semx'] and count(node()) = 1">
1724
+ <xsl:copy-of select="*[local-name() = 'semx']/node()"/>
1725
+ </xsl:when>
1726
+ <xsl:otherwise>
1727
+ <xsl:copy-of select="node()"/>
1728
+ </xsl:otherwise>
1729
+ </xsl:choose>
1730
+ </xsl:element>
1731
+ </xsl:template>
1732
+
1733
+ <xsl:template match="*[local-name() = 'concept']" mode="flatxml_step1"/>
1734
+
1735
+ <xsl:template match="*[local-name() = 'fmt-concept']" mode="flatxml_step1">
1736
+ <xsl:apply-templates mode="flatxml_step1"/>
1737
+ </xsl:template>
1738
+
1739
+ <xsl:template match="*[local-name() = 'eref']" mode="flatxml_step1"/>
1740
+
1741
+ <xsl:template match="*[local-name() = 'fmt-eref']" mode="flatxml_step1">
1742
+ <xsl:element name="eref" namespace="{$namespace_full}">
1743
+ <xsl:copy-of select="@*"/>
1744
+ <xsl:apply-templates mode="flatxml_step1"/>
1745
+ </xsl:element>
1746
+ </xsl:template>
1747
+
1748
+ <xsl:template match="*[local-name() = 'xref']" mode="flatxml_step1"/>
1749
+
1750
+ <xsl:template match="*[local-name() = 'fmt-xref']" mode="flatxml_step1">
1751
+ <xsl:element name="xref" namespace="{$namespace_full}">
1752
+ <xsl:copy-of select="@*"/>
1753
+ <xsl:apply-templates mode="flatxml_step1"/>
1754
+ </xsl:element>
1755
+ </xsl:template>
1756
+
1757
+ <xsl:template match="*[local-name() = 'link']" mode="flatxml_step1"/>
1758
+
1759
+ <xsl:template match="*[local-name() = 'fmt-link']" mode="flatxml_step1">
1760
+ <xsl:element name="link" namespace="{$namespace_full}">
1761
+ <xsl:copy-of select="@*"/>
1762
+ <xsl:apply-templates mode="flatxml_step1"/>
1763
+ </xsl:element>
1764
+ </xsl:template>
1765
+
1766
+ <xsl:template match="*[local-name() = 'origin']" mode="flatxml_step1"/>
1767
+
1768
+ <xsl:template match="*[local-name() = 'fmt-origin']" mode="flatxml_step1">
1769
+ <xsl:element name="origin" namespace="{$namespace_full}">
1770
+ <xsl:copy-of select="@*"/>
1771
+ <xsl:apply-templates mode="flatxml_step1"/>
1772
+ </xsl:element>
1773
+ </xsl:template>
1774
+
1775
+ <xsl:template match="*[local-name() = 'erefstack']" mode="flatxml_step1"/>
1776
+
1777
+ <xsl:template match="*[local-name() = 'svgmap']" mode="flatxml_step1"/>
1778
+
1779
+ <!-- https://github.com/metanorma/isodoc/issues/651 -->
1780
+ <xsl:template match="*[local-name() = 'sourcecode']" mode="flatxml_step1">
1781
+ <xsl:copy>
1782
+ <xsl:copy-of select="@*"/>
1783
+ <xsl:apply-templates select="*[local-name() = 'fmt-name']" mode="flatxml_step1"/>
1784
+ <xsl:choose>
1785
+ <xsl:when test="*[local-name() = 'fmt-sourcecode']">
1786
+ <xsl:apply-templates select="*[local-name() = 'fmt-sourcecode']/node()" mode="flatxml_step1"/>
1787
+ </xsl:when>
1788
+ <xsl:otherwise> <!-- If fmt-sourcecode is not present -->
1789
+ <xsl:apply-templates select="node()[not(local-name() = 'fmt-name')]" mode="flatxml_step1"/>
1790
+ </xsl:otherwise>
1791
+ </xsl:choose>
1792
+ </xsl:copy>
1793
+ </xsl:template>
1794
+
1795
+ <!-- https://github.com/metanorma/isodoc/issues/651 -->
1796
+ <xsl:template match="*[local-name() = 'figure'][*[local-name() = 'fmt-figure']]" mode="flatxml_step1" priority="2">
1797
+ <xsl:copy>
1798
+ <xsl:copy-of select="@*"/>
1799
+ <xsl:apply-templates select="*[local-name() = 'fmt-name']" mode="flatxml_step1"/>
1800
+ <xsl:apply-templates select="*[local-name() = 'fmt-figure']/node()" mode="flatxml_step1"/>
1801
+ </xsl:copy>
1802
+ </xsl:template>
1803
+
1804
+ <!-- https://github.com/metanorma/isodoc/issues/652 -->
1805
+ <xsl:template match="*[local-name() = 'quote']/*[local-name() = 'source']" mode="flatxml_step1"/>
1806
+ <xsl:template match="*[local-name() = 'quote']/*[local-name() = 'author']" mode="flatxml_step1"/>
1807
+ <xsl:template match="*[local-name() = 'amend']" mode="flatxml_step1"/>
1808
+
1717
1809
  <xsl:template name="setCrossAlignAttributes">
1718
1810
  <xsl:variable name="is_cross_aligned">
1719
1811
  <xsl:call-template name="isCrossAligned"/>
@@ -1785,13 +1877,13 @@
1785
1877
  <!-- enclose elements after table/figure with @multilingual-rendering = 'common' and @multilingual-rendering = 'all-columns' in a separate element cross-align -->
1786
1878
  <xsl:template match="*[@multilingual-rendering = 'common' or @multilingual-rendering = 'all-columns']" mode="flatxml_step2" priority="2">
1787
1879
  <xsl:variable name="curr_id" select="generate-id()"/>
1788
- <xsl:element name="cross-align" namespace="https://www.metanorma.org/ns/bipm">
1880
+ <xsl:element name="cross-align" namespace="{$namespace_full}">
1789
1881
  <xsl:copy-of select="@element-number"/>
1790
1882
  <xsl:copy-of select="@multilingual-rendering"/>
1791
1883
  <xsl:copy-of select="."/>
1792
1884
  </xsl:element>
1793
1885
  <xsl:if test="following-sibling::*[(not(@cross-align) or not(@cross-align='true')) and preceding-sibling::*[@cross-align='true'][1][generate-id() = $curr_id]]">
1794
- <xsl:element name="cross-align" namespace="https://www.metanorma.org/ns/bipm">
1886
+ <xsl:element name="cross-align" namespace="{$namespace_full}">
1795
1887
  <!-- <xsl:copy-of select="following-sibling::*[(not(@cross-align) or not(@cross-align='true')) and preceding-sibling::*[@cross-align='true'][1][generate-id() = $curr_id]][1]/@element-number"/> -->
1796
1888
  <xsl:for-each select="following-sibling::*[(not(@cross-align) or not(@cross-align='true')) and preceding-sibling::*[@cross-align='true'][1][generate-id() = $curr_id]]">
1797
1889
  <xsl:if test="position() = 1">
@@ -1805,7 +1897,7 @@
1805
1897
 
1806
1898
  <xsl:template match="*[@cross-align='true']" mode="flatxml_step2">
1807
1899
  <xsl:variable name="curr_id" select="generate-id()"/>
1808
- <xsl:element name="cross-align" namespace="https://www.metanorma.org/ns/bipm">
1900
+ <xsl:element name="cross-align" namespace="{$namespace_full}">
1809
1901
  <xsl:copy-of select="@element-number"/>
1810
1902
  <xsl:if test="local-name() = 'clause'">
1811
1903
  <xsl:copy-of select="@keep-with-next"/>
@@ -1863,21 +1955,21 @@
1863
1955
 
1864
1956
  <xsl:variable name="namespace_full_">
1865
1957
  <xsl:choose>
1866
- <xsl:when test="local-name(/*) = 'metanorma-collection'"><xsl:value-of select="namespace-uri(//*[contains(local-name(), '-standard')][1])"/></xsl:when>
1867
- <xsl:otherwise><xsl:value-of select="namespace-uri(/*)"/></xsl:otherwise><!-- example: https://www.metanorma.org/ns/iso -->
1958
+ <xsl:when test="local-name(/*) = 'metanorma-collection'"><xsl:value-of select="namespace-uri(//*[local-name() = 'metanorma'][1])"/></xsl:when>
1959
+ <xsl:otherwise><xsl:value-of select="namespace-uri(/*)"/></xsl:otherwise><!-- example: https://www.metanorma.org/ns/standoc -->
1868
1960
  </xsl:choose>
1869
1961
  </xsl:variable>
1870
1962
  <xsl:variable name="namespace_full" select="normalize-space($namespace_full_)"/>
1871
1963
 
1872
1964
  <xsl:variable name="root_element_">
1873
1965
  <xsl:choose>
1874
- <xsl:when test="local-name(/*) = 'metanorma-collection'"><xsl:value-of select="local-name(//*[contains(local-name(), '-standard')][1])"/></xsl:when>
1875
- <xsl:otherwise><xsl:value-of select="local-name(/*)"/></xsl:otherwise><!-- example: iso-standard -->
1966
+ <xsl:when test="local-name(/*) = 'metanorma-collection'"><xsl:value-of select="local-name(//*[local-name() = 'metanorma'][1])"/></xsl:when>
1967
+ <xsl:otherwise><xsl:value-of select="local-name(/*)"/></xsl:otherwise><!-- example: metanorma (former iso-standard) -->
1876
1968
  </xsl:choose>
1877
1969
  </xsl:variable>
1878
1970
  <xsl:variable name="root_element" select="normalize-space($root_element_)"/>
1879
1971
 
1880
- <xsl:variable name="document_scheme" select="normalize-space(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'document-scheme']/*[local-name() = 'value'])"/>
1972
+ <xsl:variable name="document_scheme" select="normalize-space(//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'document-scheme']/*[local-name() = 'value'])"/>
1881
1973
 
1882
1974
  <!-- external parameters -->
1883
1975
 
@@ -1978,7 +2070,7 @@
1978
2070
  </metanorma-extension>
1979
2071
  -->
1980
2072
 
1981
- <xsl:variable name="papersize" select="java:toLowerCase(java:java.lang.String.new(normalize-space(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata']/*[local-name() = 'papersize'])))"/>
2073
+ <xsl:variable name="papersize" select="java:toLowerCase(java:java.lang.String.new(normalize-space(//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata']/*[local-name() = 'papersize'])))"/>
1982
2074
  <xsl:variable name="papersize_width_">
1983
2075
  <xsl:choose>
1984
2076
  <xsl:when test="$papersize = 'letter'">215.9</xsl:when>
@@ -2040,7 +2132,7 @@
2040
2132
  <xsl:variable name="marginBottom" select="normalize-space($marginBottom_)"/>
2041
2133
 
2042
2134
  <xsl:variable name="layout_columns_default">1</xsl:variable>
2043
- <xsl:variable name="layout_columns_" select="normalize-space((//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata']/*[local-name() = 'layout-columns'])"/>
2135
+ <xsl:variable name="layout_columns_" select="normalize-space((//*[local-name() = 'metanorma'])[1]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata']/*[local-name() = 'layout-columns'])"/>
2044
2136
  <xsl:variable name="layout_columns">
2045
2137
  <xsl:choose>
2046
2138
  <xsl:when test="$layout_columns_ != ''"><xsl:value-of select="$layout_columns_"/></xsl:when>
@@ -2101,7 +2193,7 @@
2101
2193
  <xsl:variable name="titles" select="xalan:nodeset($titles_)"/>
2102
2194
 
2103
2195
  <xsl:variable name="title-list-tables">
2104
- <xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']"/>
2196
+ <xsl:variable name="toc_table_title" select="//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']"/>
2105
2197
  <xsl:value-of select="$toc_table_title"/>
2106
2198
  <xsl:if test="normalize-space($toc_table_title) = ''">
2107
2199
  <xsl:call-template name="getLocalizedString">
@@ -2111,7 +2203,7 @@
2111
2203
  </xsl:variable>
2112
2204
 
2113
2205
  <xsl:variable name="title-list-figures">
2114
- <xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']"/>
2206
+ <xsl:variable name="toc_figure_title" select="//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']"/>
2115
2207
  <xsl:value-of select="$toc_figure_title"/>
2116
2208
  <xsl:if test="normalize-space($toc_figure_title) = ''">
2117
2209
  <xsl:call-template name="getLocalizedString">
@@ -2121,7 +2213,7 @@
2121
2213
  </xsl:variable>
2122
2214
 
2123
2215
  <xsl:variable name="title-list-recommendations">
2124
- <xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='requirement']/*[local-name() = 'title']"/>
2216
+ <xsl:variable name="toc_requirement_title" select="//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='requirement']/*[local-name() = 'title']"/>
2125
2217
  <xsl:value-of select="$toc_requirement_title"/>
2126
2218
  <xsl:if test="normalize-space($toc_requirement_title) = ''">
2127
2219
  <xsl:call-template name="getLocalizedString">
@@ -2131,8 +2223,8 @@
2131
2223
  </xsl:variable>
2132
2224
 
2133
2225
  <xsl:variable name="bibdata">
2134
- <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']"/>
2135
- <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'localized-strings']"/>
2226
+ <xsl:copy-of select="//*[local-name() = 'metanorma']/*[local-name() = 'bibdata']"/>
2227
+ <xsl:copy-of select="//*[local-name() = 'metanorma']/*[local-name() = 'localized-strings']"/>
2136
2228
  </xsl:variable>
2137
2229
 
2138
2230
  <!-- Characters -->
@@ -2197,7 +2289,7 @@
2197
2289
  <xsl:variable name="root-style_" select="xalan:nodeset($root-style)"/>
2198
2290
 
2199
2291
  <xsl:variable name="additional_fonts_">
2200
- <xsl:for-each select="//*[contains(local-name(), '-standard')][1]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value'] | //*[contains(local-name(), '-standard')][1]/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value']">
2292
+ <xsl:for-each select="//*[local-name() = 'metanorma'][1]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value'] | //*[local-name() = 'metanorma'][1]/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value']">
2201
2293
  <xsl:value-of select="."/><xsl:if test="position() != last()">, </xsl:if>
2202
2294
  </xsl:for-each>
2203
2295
  </xsl:variable>
@@ -3565,10 +3657,10 @@
3565
3657
 
3566
3658
  <xsl:template name="processTablesFigures_Contents">
3567
3659
  <xsl:param name="always"/>
3568
- <xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
3660
+ <xsl:if test="(//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
3569
3661
  <xsl:call-template name="processTables_Contents"/>
3570
3662
  </xsl:if>
3571
- <xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
3663
+ <xsl:if test="(//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
3572
3664
  <xsl:call-template name="processFigures_Contents"/>
3573
3665
  </xsl:if>
3574
3666
  </xsl:template>
@@ -3648,7 +3740,7 @@
3648
3740
  </xsl:template><!-- END: processMainSectionsDefault -->
3649
3741
 
3650
3742
  <!-- Example:
3651
- <iso-standard>
3743
+ <metanorma>
3652
3744
  <preface>
3653
3745
  <page_sequence>
3654
3746
  <clause...
@@ -3671,7 +3763,7 @@
3671
3763
  <page_sequence>
3672
3764
  <annex ..
3673
3765
  </page_sequence>
3674
- </iso-standard>
3766
+ </metanorma>
3675
3767
  -->
3676
3768
  <xsl:template name="processPrefaceAndMainSectionsDefault_items">
3677
3769
 
@@ -3714,15 +3806,8 @@
3714
3806
  </xsl:template> <!-- END: insertPrefaceSectionsPageSequences -->
3715
3807
 
3716
3808
  <xsl:template name="insertMainSectionsPageSequences">
3717
- <xsl:element name="sections" namespace="{$namespace_full}"> <!-- save context element -->
3718
- <xsl:element name="page_sequence" namespace="{$namespace_full}">
3719
- <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
3720
- <xsl:sort select="@displayorder" data-type="number"/>
3721
- <xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
3722
3809
 
3723
- </xsl:for-each>
3724
- </xsl:element>
3725
- </xsl:element>
3810
+ <xsl:call-template name="insertSectionsInPageSequence"/>
3726
3811
 
3727
3812
  <xsl:element name="page_sequence" namespace="{$namespace_full}">
3728
3813
  <xsl:for-each select="/*/*[local-name()='annex']">
@@ -3741,6 +3826,18 @@
3741
3826
  </xsl:element>
3742
3827
  </xsl:template> <!-- END: insertMainSectionsPageSequences -->
3743
3828
 
3829
+ <xsl:template name="insertSectionsInPageSequence">
3830
+ <xsl:element name="sections" namespace="{$namespace_full}"> <!-- save context element -->
3831
+ <xsl:element name="page_sequence" namespace="{$namespace_full}">
3832
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
3833
+ <xsl:sort select="@displayorder" data-type="number"/>
3834
+ <xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
3835
+
3836
+ </xsl:for-each>
3837
+ </xsl:element>
3838
+ </xsl:element>
3839
+ </xsl:template>
3840
+
3744
3841
  <xsl:template name="insertMainSectionsInSeparatePageSequences">
3745
3842
  <xsl:element name="sections" namespace="{$namespace_full}"> <!-- save context element -->
3746
3843
  <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
@@ -5306,7 +5403,7 @@
5306
5403
  <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
5307
5404
 
5308
5405
  <xsl:variable name="gen_id" select="generate-id(.)"/>
5309
- <xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
5406
+ <xsl:variable name="lang" select="ancestor::*[local-name() = 'metanorma']/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
5310
5407
  <xsl:variable name="reference_">
5311
5408
  <xsl:value-of select="@reference"/>
5312
5409
  <xsl:if test="normalize-space(@reference) = ''"><xsl:value-of select="$gen_id"/></xsl:if>
@@ -5427,13 +5524,13 @@
5427
5524
  footnotes in bibliography
5428
5525
  footnotes in document's body (except table's head/body/foot and figure text)
5429
5526
  -->
5430
- <xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']/*[local-name() = 'note'][@type='title-footnote']">
5527
+ <xsl:for-each select="ancestor::*[local-name() = 'metanorma']/*[local-name() = 'bibdata']/*[local-name() = 'note'][@type='title-footnote']">
5431
5528
  <fn gen_id="{generate-id(.)}">
5432
5529
  <xsl:copy-of select="@*"/>
5433
5530
  <xsl:copy-of select="node()"/>
5434
5531
  </fn>
5435
5532
  </xsl:for-each>
5436
- <xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='boilerplate']/* | ancestor::*[contains(local-name(), '-standard')]//*[local-name()='preface']/* | ancestor::*[contains(local-name(), '-standard')]//*[local-name()='sections']/* | ancestor::*[contains(local-name(), '-standard')]//*[local-name()='annex'] | ancestor::*[contains(local-name(), '-standard')]//*[local-name()='bibliography']/*">
5533
+ <xsl:for-each select="ancestor::*[local-name() = 'metanorma']/*[local-name()='boilerplate']/* | ancestor::*[local-name() = 'metanorma']//*[local-name()='preface']/* | ancestor::*[local-name() = 'metanorma']//*[local-name()='sections']/* | ancestor::*[local-name() = 'metanorma']//*[local-name()='annex'] | ancestor::*[local-name() = 'metanorma']//*[local-name()='bibliography']/*">
5437
5534
  <xsl:sort select="@displayorder" data-type="number"/>
5438
5535
  <!-- commented:
5439
5536
  .//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] |
@@ -7186,9 +7283,14 @@
7186
7283
 
7187
7284
  <xsl:variable name="simple-table">
7188
7285
 
7286
+ <xsl:variable name="table_without_semantic_elements">
7287
+ <xsl:apply-templates mode="update_xml_pres"/>
7288
+ </xsl:variable>
7289
+
7189
7290
  <!-- Step 0. replace <br/> to <p>...</p> -->
7190
7291
  <xsl:variable name="table_without_br">
7191
- <xsl:apply-templates mode="table-without-br"/>
7292
+ <!-- <xsl:apply-templates mode="table-without-br"/> -->
7293
+ <xsl:apply-templates select="xalan:nodeset($table_without_semantic_elements)" mode="table-without-br"/>
7192
7294
  </xsl:variable>
7193
7295
 
7194
7296
  <!-- Step 1. colspan processing -->
@@ -7804,6 +7906,8 @@
7804
7906
  <!-- ======================================= -->
7805
7907
  <!-- math -->
7806
7908
  <!-- ======================================= -->
7909
+ <xsl:template match="*[local-name() = 'stem'][following-sibling::*[1][local-name() = 'fmt-stem']]"/> <!-- for tablesonly.xml generated by mn2pdf -->
7910
+
7807
7911
  <xsl:template match="mathml:math">
7808
7912
  <xsl:variable name="isAdded" select="@added"/>
7809
7913
  <xsl:variable name="isDeleted" select="@deleted"/>
@@ -8170,10 +8274,10 @@
8170
8274
  <xsl:template match="*[local-name()='localityStack']"/>
8171
8275
 
8172
8276
  <xsl:variable name="pdfAttachmentsList_">
8173
- <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
8277
+ <xsl:for-each select="//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
8174
8278
  <attachment filename="{@name}"/>
8175
8279
  </xsl:for-each>
8176
- <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
8280
+ <xsl:if test="not(//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
8177
8281
  <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
8178
8282
  <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
8179
8283
  <attachment filename="{$attachment_path}"/>
@@ -9639,7 +9743,9 @@
9639
9743
  <xsl:apply-templates mode="bookmarks"/>
9640
9744
  </xsl:template>
9641
9745
 
9642
- <xsl:template match="*[local-name() = 'title' or local-name() = 'name' or local-name() = 'fmt-title' or local-name() = 'fmt-name']//*[local-name() = 'stem']" mode="contents">
9746
+ <xsl:template match="*[local-name() = 'stem']" mode="contents"/>
9747
+
9748
+ <xsl:template match="*[local-name() = 'title' or local-name() = 'name' or local-name() = 'fmt-title' or local-name() = 'fmt-name']//*[local-name() = 'fmt-stem']" mode="contents">
9643
9749
  <xsl:apply-templates select="."/>
9644
9750
  </xsl:template>
9645
9751
 
@@ -9656,7 +9762,15 @@
9656
9762
  <xsl:apply-templates mode="contents"/>
9657
9763
  </xsl:template>
9658
9764
 
9659
- <xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
9765
+ <xsl:template match="*[local-name() = 'concept']" mode="contents"/>
9766
+ <xsl:template match="*[local-name() = 'eref']" mode="contents"/>
9767
+ <xsl:template match="*[local-name() = 'xref']" mode="contents"/>
9768
+ <xsl:template match="*[local-name() = 'link']" mode="contents"/>
9769
+ <xsl:template match="*[local-name() = 'origin']" mode="contents"/>
9770
+ <xsl:template match="*[local-name() = 'erefstack ']" mode="contents"/>
9771
+
9772
+ <xsl:template match="*[local-name() = 'stem']" mode="bookmarks"/>
9773
+ <xsl:template match="*[local-name() = 'fmt-stem']" mode="bookmarks">
9660
9774
  <xsl:apply-templates mode="bookmarks"/>
9661
9775
  </xsl:template>
9662
9776
 
@@ -9669,6 +9783,13 @@
9669
9783
  <xsl:apply-templates mode="bookmarks"/>
9670
9784
  </xsl:template>
9671
9785
 
9786
+ <xsl:template match="*[local-name() = 'concept']" mode="bookmarks"/>
9787
+ <xsl:template match="*[local-name() = 'eref']" mode="bookmarks"/>
9788
+ <xsl:template match="*[local-name() = 'xref']" mode="bookmarks"/>
9789
+ <xsl:template match="*[local-name() = 'link']" mode="bookmarks"/>
9790
+ <xsl:template match="*[local-name() = 'origin']" mode="bookmarks"/>
9791
+ <xsl:template match="*[local-name() = 'erefstack ']" mode="bookmarks"/>
9792
+
9672
9793
  <!-- Bookmarks -->
9673
9794
  <xsl:template name="addBookmarks">
9674
9795
  <xsl:param name="contents"/>
@@ -9953,6 +10074,13 @@
9953
10074
 
9954
10075
  <xsl:template match="*[local-name() = 'fmt-xref-label']" mode="contents_item"/>
9955
10076
 
10077
+ <xsl:template match="*[local-name() = 'concept']" mode="contents_item"/>
10078
+ <xsl:template match="*[local-name() = 'eref']" mode="contents_item"/>
10079
+ <xsl:template match="*[local-name() = 'xref']" mode="contents_item"/>
10080
+ <xsl:template match="*[local-name() = 'link']" mode="contents_item"/>
10081
+ <xsl:template match="*[local-name() = 'origin']" mode="contents_item"/>
10082
+ <xsl:template match="*[local-name() = 'erefstack ']" mode="contents_item"/>
10083
+
9956
10084
  <xsl:template name="getSection">
9957
10085
  <xsl:choose>
9958
10086
  <xsl:when test="*[local-name() = 'fmt-title']">
@@ -10072,7 +10200,8 @@
10072
10200
  </xsl:copy>
10073
10201
  </xsl:template>
10074
10202
 
10075
- <xsl:template match="*[local-name() = 'stem']" mode="contents_item">
10203
+ <xsl:template match="*[local-name() = 'stem']" mode="contents_item"/>
10204
+ <xsl:template match="*[local-name() = 'fmt-stem']" mode="contents_item">
10076
10205
  <xsl:copy-of select="."/>
10077
10206
  </xsl:template>
10078
10207
 
@@ -10136,7 +10265,7 @@
10136
10265
  <!-- sourcecode -->
10137
10266
  <!-- =============== -->
10138
10267
 
10139
- <xsl:variable name="source-highlighter-css_" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'source-highlighter-css']"/>
10268
+ <xsl:variable name="source-highlighter-css_" select="//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'source-highlighter-css']"/>
10140
10269
  <xsl:variable name="sourcecode_css_" select="java:org.metanorma.fop.Util.parseCSS($source-highlighter-css_)"/>
10141
10270
  <xsl:variable name="sourcecode_css" select="xalan:nodeset($sourcecode_css_)"/>
10142
10271
 
@@ -11601,7 +11730,7 @@
11601
11730
 
11602
11731
  </xsl:template> <!-- sections_element_style -->
11603
11732
 
11604
- <xsl:template match="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*" priority="2" name="preface_node"> <!-- /*/*[local-name() = 'preface']/* -->
11733
+ <xsl:template match="//*[local-name() = 'metanorma']/*[local-name() = 'preface']/*" priority="2" name="preface_node"> <!-- /*/*[local-name() = 'preface']/* -->
11605
11734
 
11606
11735
  <fo:block>
11607
11736
  <xsl:call-template name="setId"/>
@@ -11707,7 +11836,7 @@
11707
11836
  <fo:block id="{@id}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@id}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
11708
11837
  </xsl:when>
11709
11838
  <!-- if there isn't element with id 'from', then create 'bookmark' here -->
11710
- <xsl:when test="ancestor::*[contains(local-name(), '-standard')] and not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
11839
+ <xsl:when test="ancestor::*[local-name() = 'metanorma'] and not(ancestor::*[local-name() = 'metanorma']//*[@id = $id_from])">
11711
11840
  <fo:block id="{@from}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@from}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
11712
11841
  </xsl:when>
11713
11842
  <xsl:when test="not(/*[@id = $id_from]) and not(/*//*[@id = $id_from]) and not(preceding-sibling::*[@id = $id_from])">
@@ -13054,7 +13183,7 @@
13054
13183
  <xsl:variable name="nodes_sections" select="xalan:nodeset($nodes_sections_)"/>
13055
13184
 
13056
13185
  <!-- move section 'Normative references' inside 'sections' -->
13057
- <xsl:for-each select="* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibliography']/*[local-name()='references'][@normative='true'] | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][@normative='true']]">
13186
+ <xsl:for-each select="* | ancestor::*[local-name() = 'metanorma']/*[local-name()='bibliography']/*[local-name()='references'][@normative='true'] | ancestor::*[local-name() = 'metanorma']/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][@normative='true']]">
13058
13187
  <xsl:sort select="@displayorder" data-type="number"/>
13059
13188
 
13060
13189
  <!-- process Section's title -->
@@ -13115,10 +13244,126 @@
13115
13244
  <xsl:template match="*[local-name() = 'preprocess-xslt']" mode="update_xml_step1"/>
13116
13245
  <xsl:template match="*[local-name() = 'preprocess-xslt']" mode="update_xml_pres"/>
13117
13246
 
13118
- <xsl:template match="*[local-name() = 'stem'][not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])] | *[local-name() = 'image'][not(.//*[local-name() = 'passthrough'])] | *[local-name() = 'sourcecode'][not(.//*[local-name() = 'passthrough']) and not(.//*[local-name() = 'fmt-name'])] | *[local-name() = 'bibdata'][not(.//*[local-name() = 'passthrough'])] | *[local-name() = 'localized-strings']" mode="update_xml_step1">
13247
+ <xsl:template match="*[local-name() = 'stem']" mode="update_xml_step1"/>
13248
+ <xsl:template match="*[local-name() = 'stem']" mode="update_xml_pres"/>
13249
+
13250
+ <xsl:template match="*[local-name() = 'fmt-stem'][not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])]" mode="update_xml_step1">
13251
+ <xsl:element name="stem" namespace="{$namespace_full}">
13252
+ <xsl:copy-of select="@*"/>
13253
+ <xsl:choose>
13254
+ <xsl:when test="*[local-name() = 'semx'] and count(node()) = 1">
13255
+ <xsl:copy-of select="*[local-name() = 'semx']/node()"/>
13256
+ </xsl:when>
13257
+ <xsl:otherwise>
13258
+ <xsl:copy-of select="node()"/>
13259
+ </xsl:otherwise>
13260
+ </xsl:choose>
13261
+ </xsl:element>
13262
+ </xsl:template>
13263
+ <xsl:template match="*[local-name() = 'fmt-stem'][not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])]" mode="update_xml_pres">
13264
+ <xsl:element name="stem" namespace="{$namespace_full}">
13265
+ <xsl:copy-of select="@*"/>
13266
+ <xsl:choose>
13267
+ <xsl:when test="*[local-name() = 'semx'] and count(node()) = 1">
13268
+ <xsl:copy-of select="*[local-name() = 'semx']/node()"/>
13269
+ </xsl:when>
13270
+ <xsl:otherwise>
13271
+ <xsl:copy-of select="node()"/>
13272
+ </xsl:otherwise>
13273
+ </xsl:choose>
13274
+ </xsl:element>
13275
+ </xsl:template>
13276
+
13277
+ <xsl:template match="*[local-name() = 'image'][not(.//*[local-name() = 'passthrough'])] | *[local-name() = 'bibdata'][not(.//*[local-name() = 'passthrough'])] | *[local-name() = 'localized-strings']" mode="update_xml_step1">
13119
13278
  <xsl:copy-of select="."/>
13120
13279
  </xsl:template>
13121
13280
 
13281
+ <!-- https://github.com/metanorma/isodoc/issues/651 -->
13282
+ <!-- *[local-name() = 'sourcecode'][not(.//*[local-name() = 'passthrough']) and not(.//*[local-name() = 'fmt-name'])] -->
13283
+ <xsl:template match="*[local-name() = 'sourcecode']" mode="update_xml_step1">
13284
+ <xsl:copy>
13285
+ <xsl:copy-of select="@*"/>
13286
+ <xsl:apply-templates select="*[local-name() = 'fmt-name']" mode="update_xml_step1"/>
13287
+ <xsl:choose>
13288
+ <xsl:when test="*[local-name() = 'fmt-sourcecode']">
13289
+ <xsl:choose>
13290
+ <xsl:when test="*[local-name() = 'fmt-sourcecode'][not(.//*[local-name() = 'passthrough'])] and not(.//*[local-name() = 'fmt-name'])">
13291
+ <xsl:copy-of select="*[local-name() = 'fmt-sourcecode']/node()"/>
13292
+ </xsl:when>
13293
+ <xsl:otherwise>
13294
+ <xsl:apply-templates select="*[local-name() = 'fmt-sourcecode']/node()" mode="update_xml_step1"/>
13295
+ </xsl:otherwise>
13296
+ </xsl:choose>
13297
+ </xsl:when>
13298
+ <xsl:otherwise> <!-- If fmt-sourcecode is not present -->
13299
+ <xsl:choose>
13300
+ <xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[local-name() = 'fmt-name'])">
13301
+ <xsl:copy-of select="node()"/>
13302
+ </xsl:when>
13303
+ <xsl:otherwise>
13304
+ <xsl:apply-templates select="node()[not(local-name() = 'fmt-name')]" mode="update_xml_step1"/>
13305
+ </xsl:otherwise>
13306
+ </xsl:choose>
13307
+ </xsl:otherwise>
13308
+ </xsl:choose>
13309
+ </xsl:copy>
13310
+ </xsl:template>
13311
+ <xsl:template match="*[local-name() = 'sourcecode']" mode="update_xml_pres">
13312
+ <xsl:copy>
13313
+ <xsl:copy-of select="@*"/>
13314
+ <xsl:apply-templates select="*[local-name() = 'fmt-name']" mode="update_xml_pres"/>
13315
+ <xsl:choose>
13316
+ <xsl:when test="*[local-name() = 'fmt-sourcecode']">
13317
+ <xsl:choose>
13318
+ <xsl:when test="*[local-name() = 'fmt-sourcecode'][not(.//*[local-name() = 'passthrough'])] and not(.//*[local-name() = 'fmt-name'])">
13319
+ <xsl:copy-of select="*[local-name() = 'fmt-sourcecode']/node()"/>
13320
+ </xsl:when>
13321
+ <xsl:otherwise>
13322
+ <xsl:apply-templates select="*[local-name() = 'fmt-sourcecode']/node()" mode="update_xml_pres"/>
13323
+ </xsl:otherwise>
13324
+ </xsl:choose>
13325
+ </xsl:when>
13326
+ <xsl:otherwise> <!-- If fmt-sourcecode is not present -->
13327
+ <xsl:choose>
13328
+ <xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[local-name() = 'fmt-name'])">
13329
+ <xsl:copy-of select="node()"/>
13330
+ </xsl:when>
13331
+ <xsl:otherwise>
13332
+ <xsl:apply-templates select="node()[not(local-name() = 'fmt-name')]" mode="update_xml_pres"/>
13333
+ </xsl:otherwise>
13334
+ </xsl:choose>
13335
+ </xsl:otherwise>
13336
+ </xsl:choose>
13337
+ </xsl:copy>
13338
+ </xsl:template>
13339
+
13340
+ <!-- https://github.com/metanorma/isodoc/issues/651 -->
13341
+ <xsl:template match="*[local-name() = 'figure'][*[local-name() = 'fmt-figure']]" mode="update_xml_step1" priority="2">
13342
+ <xsl:copy>
13343
+ <xsl:copy-of select="@*"/>
13344
+ <xsl:apply-templates select="*[local-name() = 'fmt-name']" mode="update_xml_step1"/>
13345
+ <xsl:apply-templates select="*[local-name() = 'fmt-figure']/node()" mode="update_xml_step1"/>
13346
+ </xsl:copy>
13347
+ </xsl:template>
13348
+ <xsl:template match="*[local-name() = 'figure'][*[local-name() = 'fmt-figure']]" mode="update_xml_pres" priority="2">
13349
+ <xsl:copy>
13350
+ <xsl:copy-of select="@*"/>
13351
+ <xsl:apply-templates select="*[local-name() = 'fmt-name']" mode="update_xml_pres"/>
13352
+ <xsl:apply-templates select="*[local-name() = 'fmt-figure']/node()" mode="update_xml_pres"/>
13353
+ </xsl:copy>
13354
+ </xsl:template>
13355
+
13356
+ <!-- https://github.com/metanorma/isodoc/issues/652 -->
13357
+ <xsl:template match="*[local-name() = 'quote']/*[local-name() = 'source']"/>
13358
+ <xsl:template match="*[local-name() = 'quote']/*[local-name() = 'author']"/>
13359
+ <xsl:template match="*[local-name() = 'amend']"/>
13360
+ <xsl:template match="*[local-name() = 'quote']/*[local-name() = 'source']" mode="update_xml_step1"/>
13361
+ <xsl:template match="*[local-name() = 'quote']/*[local-name() = 'author']" mode="update_xml_step1"/>
13362
+ <xsl:template match="*[local-name() = 'quote']/*[local-name() = 'source']" mode="update_xml_pres"/>
13363
+ <xsl:template match="*[local-name() = 'quote']/*[local-name() = 'author']" mode="update_xml_pres"/>
13364
+ <xsl:template match="*[local-name() = 'amend']" mode="update_xml_step1"/>
13365
+ <xsl:template match="*[local-name() = 'amend']" mode="update_xml_pres"/>
13366
+
13122
13367
  <xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']" mode="update_xml_step1">
13123
13368
  <xsl:copy>
13124
13369
  <xsl:copy-of select="@*"/>
@@ -13149,7 +13394,7 @@
13149
13394
  <!-- add @id - first element with @id plus '_element_name' -->
13150
13395
  <xsl:variable name="prefix_id_" select="(.//*[@id])[1]/@id"/>
13151
13396
  <xsl:variable name="prefix_id"><xsl:value-of select="$prefix_id_"/><xsl:if test="normalize-space($prefix_id_) = ''"><xsl:value-of select="generate-id()"/></xsl:if></xsl:variable>
13152
- <xsl:variable name="document_suffix" select="ancestor::*[contains(local-name(), '-standard')]/@document_suffix"/>
13397
+ <xsl:variable name="document_suffix" select="ancestor::*[local-name() = 'metanorma']/@document_suffix"/>
13153
13398
  <xsl:attribute name="id"><xsl:value-of select="concat($prefix_id, '_', local-name(), '_', $document_suffix)"/></xsl:attribute>
13154
13399
  </xsl:if>
13155
13400
  </xsl:template>
@@ -13264,16 +13509,30 @@
13264
13509
 
13265
13510
  <xsl:template match="*[local-name() = 'fmt-name']"/>
13266
13511
  <xsl:template match="*[local-name() = 'fmt-name']" mode="update_xml_step1">
13267
- <xsl:element name="name" namespace="{$namespace_full}">
13268
- <xsl:copy-of select="@*"/>
13269
- <xsl:apply-templates mode="update_xml_step1"/>
13270
- </xsl:element>
13512
+ <xsl:choose>
13513
+ <xsl:when test="local-name(..) = 'p' and ancestor::*[local-name() = 'table']">
13514
+ <xsl:apply-templates mode="update_xml_step1"/>
13515
+ </xsl:when>
13516
+ <xsl:otherwise>
13517
+ <xsl:element name="name" namespace="{$namespace_full}">
13518
+ <xsl:copy-of select="@*"/>
13519
+ <xsl:apply-templates mode="update_xml_step1"/>
13520
+ </xsl:element>
13521
+ </xsl:otherwise>
13522
+ </xsl:choose>
13271
13523
  </xsl:template>
13272
13524
  <xsl:template match="*[local-name() = 'fmt-name']" mode="update_xml_pres">
13273
- <xsl:element name="name" namespace="{$namespace_full}">
13274
- <xsl:copy-of select="@*"/>
13275
- <xsl:apply-templates mode="update_xml_pres"/>
13276
- </xsl:element>
13525
+ <xsl:choose>
13526
+ <xsl:when test="local-name(..) = 'p' and ancestor::*[local-name() = 'table']">
13527
+ <xsl:apply-templates mode="update_xml_step1"/>
13528
+ </xsl:when>
13529
+ <xsl:otherwise>
13530
+ <xsl:element name="name" namespace="{$namespace_full}">
13531
+ <xsl:copy-of select="@*"/>
13532
+ <xsl:apply-templates mode="update_xml_pres"/>
13533
+ </xsl:element>
13534
+ </xsl:otherwise>
13535
+ </xsl:choose>
13277
13536
  </xsl:template>
13278
13537
 
13279
13538
  <xsl:template match="*[local-name() = 'fmt-preferred']"/>
@@ -13371,6 +13630,9 @@
13371
13630
  <xsl:apply-templates mode="update_xml_pres"/>
13372
13631
  </xsl:template>
13373
13632
 
13633
+ <xsl:template match="*[local-name() = 'semx']">
13634
+ <xsl:apply-templates/>
13635
+ </xsl:template>
13374
13636
  <xsl:template match="*[local-name() = 'semx']" mode="update_xml_step1">
13375
13637
  <xsl:apply-templates mode="update_xml_step1"/>
13376
13638
  </xsl:template>
@@ -13382,6 +13644,126 @@
13382
13644
  <xsl:template match="*[local-name() = 'fmt-xref-label']" mode="update_xml_step1"/>
13383
13645
  <xsl:template match="*[local-name() = 'fmt-xref-label']" mode="update_xml_pres"/>
13384
13646
 
13647
+ <xsl:template match="*[local-name() = 'requirement'] | *[local-name() = 'recommendation'] | *[local-name() = 'permission']" mode="update_xml_step1">
13648
+ <xsl:apply-templates mode="update_xml_step1"/>
13649
+ </xsl:template>
13650
+
13651
+ <xsl:template match="*[local-name() = 'requirement'] | *[local-name() = 'recommendation'] | *[local-name() = 'permission']" mode="update_xml_pres">
13652
+ <xsl:apply-templates mode="update_xml_pres"/>
13653
+ </xsl:template>
13654
+
13655
+ <xsl:template match="*[local-name() = 'requirement']/*[not(starts-with(local-name(), 'fmt-'))] | *[local-name() = 'recommendation']/*[not(starts-with(local-name(), 'fmt-'))] | *[local-name() = 'permission']/*[not(starts-with(local-name(), 'fmt-'))]" mode="update_xml_step1"/>
13656
+
13657
+ <xsl:template match="*[local-name() = 'requirement']/*[not(starts-with(local-name(), 'fmt-'))] | *[local-name() = 'recommendation']/*[not(starts-with(local-name(), 'fmt-'))] | *[local-name() = 'permission']/*[not(starts-with(local-name(), 'fmt-'))]" mode="update_xml_pres"/>
13658
+
13659
+ <xsl:template match="*[local-name() = 'fmt-provision']" mode="update_xml_step1">
13660
+ <xsl:apply-templates mode="update_xml_step1"/>
13661
+ </xsl:template>
13662
+ <xsl:template match="*[local-name() = 'fmt-provision']" mode="update_xml_pres">
13663
+ <xsl:apply-templates mode="update_xml_pres"/>
13664
+ </xsl:template>
13665
+
13666
+ <xsl:template match="*[local-name() = 'identifier']" mode="update_xml_step1"/>
13667
+ <xsl:template match="*[local-name() = 'identifier']" mode="update_xml_pres"/>
13668
+ <xsl:template match="*[local-name() = 'fmt-identifier']" mode="update_xml_step1">
13669
+ <xsl:element name="identifier" namespace="{$namespace_full}">
13670
+ <xsl:copy-of select="@*"/>
13671
+ <xsl:apply-templates mode="update_xml_step1"/>
13672
+ </xsl:element>
13673
+ </xsl:template>
13674
+ <xsl:template match="*[local-name() = 'fmt-identifier']" mode="update_xml_pres">
13675
+ <xsl:element name="identifier" namespace="{$namespace_full}">
13676
+ <xsl:copy-of select="@*"/>
13677
+ <xsl:apply-templates mode="update_xml_pres"/>
13678
+ </xsl:element>
13679
+ </xsl:template>
13680
+
13681
+ <xsl:template match="*[local-name() = 'concept']"/>
13682
+ <xsl:template match="*[local-name() = 'concept']" mode="update_xml_step1"/>
13683
+ <xsl:template match="*[local-name() = 'concept']" mode="update_xml_pres"/>
13684
+
13685
+ <xsl:template match="*[local-name() = 'fmt-concept']">
13686
+ <xsl:apply-templates/>
13687
+ </xsl:template>
13688
+ <xsl:template match="*[local-name() = 'fmt-concept']" mode="update_xml_step1">
13689
+ <xsl:apply-templates mode="update_xml_step1"/>
13690
+ </xsl:template>
13691
+ <xsl:template match="*[local-name() = 'fmt-concept']" mode="update_xml_pres">
13692
+ <xsl:apply-templates mode="update_xml_pres"/>
13693
+ </xsl:template>
13694
+
13695
+ <xsl:template match="*[local-name() = 'eref']" mode="update_xml_step1"/>
13696
+ <xsl:template match="*[local-name() = 'eref']" mode="update_xml_pres"/>
13697
+
13698
+ <xsl:template match="*[local-name() = 'fmt-eref']" mode="update_xml_step1">
13699
+ <xsl:element name="eref" namespace="{$namespace_full}">
13700
+ <xsl:copy-of select="@*"/>
13701
+ <xsl:apply-templates mode="update_xml_step1"/>
13702
+ </xsl:element>
13703
+ </xsl:template>
13704
+ <xsl:template match="*[local-name() = 'fmt-eref']" mode="update_xml_pres">
13705
+ <xsl:element name="eref" namespace="{$namespace_full}">
13706
+ <xsl:copy-of select="@*"/>
13707
+ <xsl:apply-templates mode="update_xml_pres"/>
13708
+ </xsl:element>
13709
+ </xsl:template>
13710
+
13711
+ <xsl:template match="*[local-name() = 'xref']" mode="update_xml_step1"/>
13712
+ <xsl:template match="*[local-name() = 'xref']" mode="update_xml_pres"/>
13713
+
13714
+ <xsl:template match="*[local-name() = 'fmt-xref']" mode="update_xml_step1">
13715
+ <xsl:element name="xref" namespace="{$namespace_full}">
13716
+ <xsl:copy-of select="@*"/>
13717
+ <xsl:apply-templates mode="update_xml_step1"/>
13718
+ </xsl:element>
13719
+ </xsl:template>
13720
+ <xsl:template match="*[local-name() = 'fmt-xref']" mode="update_xml_pres">
13721
+ <xsl:element name="xref" namespace="{$namespace_full}">
13722
+ <xsl:copy-of select="@*"/>
13723
+ <xsl:apply-templates mode="update_xml_pres"/>
13724
+ </xsl:element>
13725
+ </xsl:template>
13726
+
13727
+ <xsl:template match="*[local-name() = 'link']" mode="update_xml_step1"/>
13728
+ <xsl:template match="*[local-name() = 'link']" mode="update_xml_pres"/>
13729
+
13730
+ <xsl:template match="*[local-name() = 'fmt-link']" mode="update_xml_step1">
13731
+ <xsl:element name="link" namespace="{$namespace_full}">
13732
+ <xsl:copy-of select="@*"/>
13733
+ <xsl:apply-templates mode="update_xml_step1"/>
13734
+ </xsl:element>
13735
+ </xsl:template>
13736
+ <xsl:template match="*[local-name() = 'fmt-link']" mode="update_xml_pres">
13737
+ <xsl:element name="link" namespace="{$namespace_full}">
13738
+ <xsl:copy-of select="@*"/>
13739
+ <xsl:apply-templates mode="update_xml_pres"/>
13740
+ </xsl:element>
13741
+ </xsl:template>
13742
+
13743
+ <xsl:template match="*[local-name() = 'origin']" mode="update_xml_step1"/>
13744
+ <xsl:template match="*[local-name() = 'origin']" mode="update_xml_pres"/>
13745
+
13746
+ <xsl:template match="*[local-name() = 'fmt-origin']" mode="update_xml_step1">
13747
+ <xsl:element name="origin" namespace="{$namespace_full}">
13748
+ <xsl:copy-of select="@*"/>
13749
+ <xsl:apply-templates mode="update_xml_step1"/>
13750
+ </xsl:element>
13751
+ </xsl:template>
13752
+ <xsl:template match="*[local-name() = 'fmt-origin']" mode="update_xml_pres">
13753
+ <xsl:element name="origin" namespace="{$namespace_full}">
13754
+ <xsl:copy-of select="@*"/>
13755
+ <xsl:apply-templates mode="update_xml_pres"/>
13756
+ </xsl:element>
13757
+ </xsl:template>
13758
+
13759
+ <xsl:template match="*[local-name() = 'erefstack']"/>
13760
+ <xsl:template match="*[local-name() = 'erefstack']" mode="update_xml_step1"/>
13761
+ <xsl:template match="*[local-name() = 'erefstack']" mode="update_xml_pres"/>
13762
+
13763
+ <xsl:template match="*[local-name() = 'svgmap']"/>
13764
+ <xsl:template match="*[local-name() = 'svgmap']" mode="update_xml_step1"/>
13765
+ <xsl:template match="*[local-name() = 'svgmap']" mode="update_xml_pres"/>
13766
+
13385
13767
  <!-- END: update new Presentation XML -->
13386
13768
 
13387
13769
  <!-- =========================================================================== -->
@@ -13454,7 +13836,7 @@
13454
13836
 
13455
13837
  <xsl:choose>
13456
13838
  <xsl:when test="$page_sequence_at_top = 'true'">
13457
- <xsl:for-each select="ancestor::*[ancestor::*[contains(local-name(), '-standard')]]">
13839
+ <xsl:for-each select="ancestor::*[ancestor::*[local-name() = 'metanorma']]">
13458
13840
  <element pos="{position()}">
13459
13841
  <xsl:copy-of select="@*[local-name() != 'id']"/>
13460
13842
  <xsl:value-of select="name()"/>
@@ -13882,7 +14264,7 @@
13882
14264
  </xsl:when>
13883
14265
  <xsl:when test="contains($text, $replace)">
13884
14266
  <xsl:value-of select="substring-before($text,$replace)"/>
13885
- <xsl:element name="inlineChar" namespace="https://www.metanorma.org/ns/jis"><xsl:value-of select="$by"/></xsl:element>
14267
+ <xsl:element name="inlineChar" namespace="https://www.metanorma.org/ns/standoc"><xsl:value-of select="$by"/></xsl:element>
13886
14268
  <xsl:call-template name="replaceChar">
13887
14269
  <xsl:with-param name="text" select="substring-after($text,$replace)"/>
13888
14270
  <xsl:with-param name="replace" select="$replace"/>
@@ -13919,7 +14301,7 @@
13919
14301
  </xsl:variable>
13920
14302
  <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
13921
14303
  <xsl:variable name="gen_id" select="generate-id(.)"/>
13922
- <xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
14304
+ <xsl:variable name="lang" select="ancestor::*[local-name() = 'metanorma']/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
13923
14305
  <xsl:variable name="reference" select="@reference"/>
13924
14306
  <!-- fn sequence number in document -->
13925
14307
  <xsl:variable name="current_fn_number" select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1"/>
@@ -13964,7 +14346,7 @@
13964
14346
  </xsl:template>
13965
14347
 
13966
14348
  <xsl:template name="printEdition">
13967
- <xsl:variable name="edition_i18n" select="normalize-space((//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) != ''])"/>
14349
+ <xsl:variable name="edition_i18n" select="normalize-space((//*[local-name() = 'metanorma'])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) != ''])"/>
13968
14350
  <xsl:text> </xsl:text>
13969
14351
 
13970
14352
  <xsl:choose>
@@ -13975,7 +14357,7 @@
13975
14357
  </xsl:call-template>
13976
14358
  </xsl:when>
13977
14359
  <xsl:otherwise>
13978
- <xsl:variable name="edition" select="normalize-space((//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'])"/>
14360
+ <xsl:variable name="edition" select="normalize-space((//*[local-name() = 'metanorma'])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'])"/>
13979
14361
  <xsl:if test="$edition != ''"> <!-- Example: 1.3 -->
13980
14362
  <xsl:call-template name="capitalize">
13981
14363
  <xsl:with-param name="str">
@@ -14109,7 +14491,7 @@
14109
14491
  <xsl:param name="charDelim" select="', '"/>
14110
14492
  <xsl:choose>
14111
14493
  <xsl:when test="$sorting = 'true' or $sorting = 'yes'">
14112
- <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
14494
+ <xsl:for-each select="//*[local-name() = 'metanorma']/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
14113
14495
  <xsl:sort data-type="text" order="ascending"/>
14114
14496
  <xsl:call-template name="insertKeyword">
14115
14497
  <xsl:with-param name="meta" select="$meta"/>
@@ -14119,7 +14501,7 @@
14119
14501
  </xsl:for-each>
14120
14502
  </xsl:when>
14121
14503
  <xsl:otherwise>
14122
- <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
14504
+ <xsl:for-each select="//*[local-name() = 'metanorma']/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
14123
14505
  <xsl:call-template name="insertKeyword">
14124
14506
  <xsl:with-param name="meta" select="$meta"/>
14125
14507
  <xsl:with-param name="charAtEnd" select="$charAtEnd"/>
@@ -14194,7 +14576,7 @@
14194
14576
  <!-- Dublin Core properties go here -->
14195
14577
  <dc:title>
14196
14578
  <xsl:variable name="title">
14197
- <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
14579
+ <xsl:for-each select="(//*[local-name() = 'metanorma'])[1]/*[local-name() = 'bibdata']">
14198
14580
 
14199
14581
  <xsl:value-of select="*[local-name() = 'title'][@language = $lang and @type = 'title-part']"/>
14200
14582
 
@@ -14214,7 +14596,7 @@
14214
14596
  </rdf:Alt>
14215
14597
  </dc:title>
14216
14598
  <xsl:variable name="dc_creator">
14217
- <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
14599
+ <xsl:for-each select="(//*[local-name() = 'metanorma'])[1]/*[local-name() = 'bibdata']">
14218
14600
 
14219
14601
  <rdf:Seq>
14220
14602
  <rdf:li>
@@ -14233,7 +14615,7 @@
14233
14615
  <xsl:variable name="dc_description">
14234
14616
  <xsl:variable name="abstract">
14235
14617
 
14236
- <xsl:value-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']/*[local-name() = 'title'][@language = $lang and @type = 'title-main']"/>
14618
+ <xsl:value-of select="//*[local-name() = 'metanorma']/*[local-name() = 'bibdata']/*[local-name() = 'title'][@language = $lang and @type = 'title-main']"/>
14237
14619
 
14238
14620
  </xsl:variable>
14239
14621
  <rdf:Alt>
@@ -14261,7 +14643,7 @@
14261
14643
  </rdf:RDF>
14262
14644
  </x:xmpmeta>
14263
14645
  <!-- add attachments -->
14264
- <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
14646
+ <xsl:for-each select="//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
14265
14647
  <xsl:variable name="bibitem_attachment_" select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]"/>
14266
14648
  <xsl:variable name="bibitem_attachment" select="xalan:nodeset($bibitem_attachment_)"/>
14267
14649
  <xsl:variable name="description" select="normalize-space($bibitem_attachment/*[local-name() = 'formattedref'])"/>
@@ -14295,7 +14677,7 @@
14295
14677
  </pdf:embedded-file>
14296
14678
  </xsl:for-each>
14297
14679
  <!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
14298
- <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
14680
+ <xsl:if test="not(//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
14299
14681
  <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
14300
14682
  <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
14301
14683
  <xsl:variable name="attachment_name" select="java:org.metanorma.fop.Util.getFilenameFromPath($attachment_path)"/>
@@ -14499,9 +14881,9 @@
14499
14881
  <xsl:value-of select="document('')//*/namespace::bipm"/>
14500
14882
 
14501
14883
  </xsl:variable>
14502
- <xsl:if test="$documentNS != $XSLNS">
14884
+ <!-- <xsl:if test="$documentNS != $XSLNS">
14503
14885
  <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
14504
- </xsl:if>
14886
+ </xsl:if> -->
14505
14887
  </xsl:template> <!-- namespaceCheck -->
14506
14888
 
14507
14889
  <xsl:template name="getLanguage">
@@ -14580,10 +14962,10 @@
14580
14962
 
14581
14963
  <xsl:variable name="data_value">
14582
14964
  <xsl:choose>
14583
- <xsl:when test="$formatted = 'true' and string-length($bibdata_updated) != ''">
14965
+ <xsl:when test="$formatted = 'true' and string-length($bibdata_updated) != 0">
14584
14966
  <xsl:apply-templates select="xalan:nodeset($bibdata_updated)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
14585
14967
  </xsl:when>
14586
- <xsl:when test="string-length($bibdata_updated) != ''">
14968
+ <xsl:when test="string-length($bibdata_updated) != 0">
14587
14969
  <xsl:value-of select="xalan:nodeset($bibdata_updated)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
14588
14970
  </xsl:when>
14589
14971
  <xsl:when test="$formatted = 'true'">
@@ -14721,7 +15103,7 @@
14721
15103
  <!-- background image -->
14722
15104
  <fo:block-container absolute-position="fixed" left="0mm" top="0mm" font-size="0" id="__internal_layout__coverpage{$suffix}_{$name}_{$number}_{generate-id()}">
14723
15105
  <fo:block>
14724
- <xsl:for-each select="/*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = $name][1]/*[local-name() = 'value']/*[local-name() = 'image'][$num]">
15106
+ <xsl:for-each select="/*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = $name][1]/*[local-name() = 'value']/*[local-name() = 'image'][$num]">
14725
15107
  <xsl:choose>
14726
15108
  <xsl:when test="*[local-name() = 'svg'] or java:endsWith(java:java.lang.String.new(@src), '.svg')">
14727
15109
  <fo:instream-foreign-object fox:alt-text="Image Front">