metanorma-iho 1.0.16 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -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:iho="https://www.metanorma.org/ns/iho" 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:java="http://xml.apache.org/xalan/java" xmlns:redirect="http://xml.apache.org/xalan/redirect" exclude-result-prefixes="java xalan" 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:iho="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:java="http://xml.apache.org/xalan/java" xmlns:redirect="http://xml.apache.org/xalan/redirect" exclude-result-prefixes="java xalan" extension-element-prefixes="redirect" version="1.0">
2
2
 
3
3
  <xsl:output method="xml" encoding="UTF-8" indent="no"/>
4
4
 
@@ -7,15 +7,15 @@
7
7
  <xsl:variable name="debug">false</xsl:variable>
8
8
 
9
9
  <xsl:variable name="title-en">
10
- <xsl:apply-templates select="/iho:iho-standard/iho:bibdata/iho:title[@language = 'en']/node()"/>
10
+ <xsl:apply-templates select="/iho:metanorma/iho:bibdata/iho:title[@language = 'en']/node()"/>
11
11
  </xsl:variable>
12
- <xsl:variable name="docidentifier" select="/iho:iho-standard/iho:bibdata/iho:docidentifier[@type = 'IHO']"/>
13
- <xsl:variable name="copyrightText" select="concat('© International Hydrographic Association ', /iho:iho-standard/iho:bibdata/iho:copyright/iho:from ,' – All rights reserved')"/>
12
+ <xsl:variable name="docidentifier" select="/iho:metanorma/iho:bibdata/iho:docidentifier[@type = 'IHO']"/>
13
+ <xsl:variable name="copyrightText" select="concat('© International Hydrographic Association ', /iho:metanorma/iho:bibdata/iho:copyright/iho:from ,' – All rights reserved')"/>
14
14
  <xsl:variable name="edition">
15
- <xsl:apply-templates select="/iho:iho-standard/iho:bibdata/iho:edition[normalize-space(@language) = '']"/>
15
+ <xsl:apply-templates select="/iho:metanorma/iho:bibdata/iho:edition[normalize-space(@language) = '']"/>
16
16
  </xsl:variable>
17
17
  <xsl:variable name="month_year">
18
- <xsl:apply-templates select="/iho:iho-standard/iho:bibdata/iho:date[@type = 'published']"/>
18
+ <xsl:apply-templates select="/iho:metanorma/iho:bibdata/iho:date[@type = 'published']"/>
19
19
  </xsl:variable>
20
20
 
21
21
  <!-- Example:
@@ -206,7 +206,7 @@
206
206
  <fo:block-container width="79mm" height="72mm" margin-left="56.8mm" background-color="rgb(0, 172, 158)" text-align="right" display-align="after">
207
207
  <fo:block-container margin-left="0mm">
208
208
  <fo:block font-size="8pt" color="white" margin-right="5mm" margin-bottom="5mm" line-height-shift-adjustment="disregard-shifts">
209
- <xsl:apply-templates select="/iho:iho-standard/iho:boilerplate/iho:feedback-statement"/>
209
+ <xsl:apply-templates select="/iho:metanorma/iho:boilerplate/iho:feedback-statement"/>
210
210
  </fo:block>
211
211
  </fo:block-container>
212
212
  </fo:block-container>
@@ -221,16 +221,55 @@
221
221
  <!-- =========================== -->
222
222
  <!-- =========================== -->
223
223
 
224
+ <xsl:choose>
225
+ <xsl:when test="/iho:metanorma/iho:boilerplate/*[local-name() != 'feedback-statement']">
226
+ <fo:page-sequence master-reference="preface" format="i" force-page-count="no-force">
227
+ <xsl:call-template name="insertHeaderFooter">
228
+ <xsl:with-param name="font-weight">normal</xsl:with-param>
229
+ </xsl:call-template>
230
+ <fo:flow flow-name="xsl-region-body">
231
+ <fo:block-container margin-left="-1.5mm" margin-right="-1mm">
232
+ <fo:block-container margin-left="0mm" margin-right="0mm" border="0.5pt solid black">
233
+ <fo:block-container margin-top="6.5mm" margin-left="7.5mm" margin-right="8.5mm" margin-bottom="7.5mm">
234
+ <fo:block-container margin="0">
235
+ <fo:block text-align="justify">
236
+ <xsl:apply-templates select="/iho:metanorma/iho:boilerplate/*[local-name() != 'feedback-statement']"/>
237
+ </fo:block>
238
+ </fo:block-container>
239
+ </fo:block-container>
240
+ </fo:block-container>
241
+ </fo:block-container>
242
+ </fo:flow>
243
+ </fo:page-sequence>
244
+ </xsl:when>
245
+ <xsl:otherwise>
246
+ <!-- https://github.com/metanorma/metanorma-iho/issues/293:
247
+ If the publication has no copyright boxed note (normally on page ii of the publication), page ii should be "Page intentionally left blank". -->
248
+ <fo:page-sequence master-reference="blankpage" format="i" force-page-count="no-force">
249
+ <xsl:call-template name="insertHeaderFooterBlank"/>
250
+ <fo:flow flow-name="xsl-region-body">
251
+ <fo:block/>
252
+ </fo:flow>
253
+ </fo:page-sequence>
254
+ </xsl:otherwise>
255
+ </xsl:choose>
256
+
224
257
  <xsl:variable name="updated_xml_with_pages">
225
- <xsl:call-template name="processPrefaceAndMainSectionsDefault_items"/>
258
+ <xsl:call-template name="processPrefaceAndMainSectionsIHO_items"/>
226
259
  </xsl:variable>
227
260
 
261
+ <xsl:if test="$debug = 'true'">
262
+ <redirect:write file="updated_xml_with_pages.xml">
263
+ <xsl:copy-of select="$updated_xml_with_pages"/>
264
+ </redirect:write>
265
+ </xsl:if>
266
+
228
267
  <xsl:for-each select="xalan:nodeset($updated_xml_with_pages)"> <!-- set context to preface/sections -->
229
268
 
230
269
  <xsl:for-each select=".//*[local-name() = 'page_sequence'][parent::*[local-name() = 'preface']][normalize-space() != '' or .//*[local-name() = 'image'] or .//*[local-name() = 'svg']]">
231
270
 
232
271
  <!-- Preface Pages -->
233
- <fo:page-sequence master-reference="preface" format="i">
272
+ <fo:page-sequence master-reference="preface" format="i" force-page-count="end-on-even">
234
273
 
235
274
  <xsl:attribute name="master-reference">
236
275
  <xsl:text>preface</xsl:text>
@@ -247,24 +286,54 @@
247
286
  </xsl:call-template>
248
287
  <fo:flow flow-name="xsl-region-body">
249
288
 
250
- <xsl:if test="position() = 1">
289
+ <!-- <xsl:if test="position() = 1">
251
290
  <fo:block-container margin-left="-1.5mm" margin-right="-1mm">
252
- <fo:block-container margin-left="0mm" margin-right="0mm" border="0.5pt solid black">
291
+ <fo:block-container margin-left="0mm" margin-right="0mm" border="0.5pt solid black" >
253
292
  <fo:block-container margin-top="6.5mm" margin-left="7.5mm" margin-right="8.5mm" margin-bottom="7.5mm">
254
293
  <fo:block-container margin="0">
255
294
  <fo:block text-align="justify">
256
- <xsl:apply-templates select="/iho:iho-standard/iho:boilerplate/*[local-name() != 'feedback-statement']"/>
295
+ <xsl:apply-templates select="/iho:metanorma/iho:boilerplate/*[local-name() != 'feedback-statement']"/>
257
296
  </fo:block>
258
297
  </fo:block-container>
259
298
  </fo:block-container>
260
299
  </fo:block-container>
261
300
  </fo:block-container>
262
301
  <fo:block break-after="page"/>
263
- </xsl:if>
302
+ </xsl:if> -->
264
303
 
265
- <!-- Contents, Foreword, Introduction -->
304
+ <!-- Contents, Document History, ... except Foreword and Introduction -->
266
305
  <!-- <xsl:call-template name="processPrefaceSectionsDefault"/> -->
267
- <xsl:apply-templates/>
306
+ <xsl:apply-templates select="*[not(local-name() = 'foreword') and not(local-name() = 'introduction')]"/>
307
+
308
+ </fo:flow>
309
+ </fo:page-sequence>
310
+ <!-- End Preface Pages -->
311
+ <!-- =========================== -->
312
+ <!-- =========================== -->
313
+ </xsl:for-each>
314
+
315
+ <xsl:for-each select=".//*[local-name() = 'page_sequence'][*[local-name() = 'foreword'] or *[local-name() = 'introduction']][parent::*[local-name() = 'preface']][normalize-space() != '' or .//*[local-name() = 'image'] or .//*[local-name() = 'svg']]">
316
+
317
+ <!-- Preface Pages -->
318
+ <fo:page-sequence master-reference="preface" format="i" force-page-count="end-on-even">
319
+
320
+ <xsl:attribute name="master-reference">
321
+ <xsl:text>preface</xsl:text>
322
+ <xsl:call-template name="getPageSequenceOrientation"/>
323
+ </xsl:attribute>
324
+
325
+ <fo:static-content flow-name="xsl-footnote-separator">
326
+ <fo:block>
327
+ <fo:leader leader-pattern="rule" leader-length="30%"/>
328
+ </fo:block>
329
+ </fo:static-content>
330
+ <xsl:call-template name="insertHeaderFooter">
331
+ <xsl:with-param name="font-weight">normal</xsl:with-param>
332
+ </xsl:call-template>
333
+ <fo:flow flow-name="xsl-region-body">
334
+
335
+ <!-- Foreword, Introduction -->
336
+ <xsl:apply-templates select="*[local-name() = 'foreword' or local-name() = 'introduction']"/>
268
337
 
269
338
  </fo:flow>
270
339
  </fo:page-sequence>
@@ -275,7 +344,7 @@
275
344
 
276
345
  <xsl:for-each select=".//*[local-name() = 'page_sequence'][not(parent::*[local-name() = 'preface'])][normalize-space() != '' or .//*[local-name() = 'image'] or .//*[local-name() = 'svg']]">
277
346
 
278
- <fo:page-sequence master-reference="document" format="1" force-page-count="no-force">
347
+ <fo:page-sequence master-reference="document" format="1" force-page-count="end-on-even">
279
348
 
280
349
  <xsl:attribute name="master-reference">
281
350
  <xsl:text>document</xsl:text>
@@ -317,7 +386,7 @@
317
386
  </xsl:for-each>
318
387
  </xsl:for-each>
319
388
 
320
- <!-- <xsl:if test="/iho:iho-standard/iho:annex">
389
+ <!-- <xsl:if test="/iho:metanorma/iho:annex">
321
390
  <fo:page-sequence master-reference="document">
322
391
  <fo:static-content flow-name="xsl-footnote-separator">
323
392
  <fo:block>
@@ -384,6 +453,42 @@
384
453
  </fo:block>
385
454
  </xsl:template>
386
455
 
456
+ <xsl:template name="processPrefaceAndMainSectionsIHO_items">
457
+
458
+ <xsl:variable name="updated_xml_step_move_pagebreak">
459
+ <xsl:element name="{$root_element}" namespace="{$namespace_full}">
460
+ <xsl:call-template name="copyCommonElements"/>
461
+ <xsl:call-template name="insertPrefaceSectionsPageSequences"/>
462
+
463
+ <!-- <xsl:call-template name="insertMainSectionsPageSequences"/> -->
464
+
465
+ <xsl:call-template name="insertSectionsInPageSequence"/>
466
+ <xsl:call-template name="insertAnnexInSeparatePageSequences"/>
467
+ <xsl:call-template name="insertBibliographyInSeparatePageSequences"/>
468
+ <xsl:call-template name="insertIndexInSeparatePageSequences"/>
469
+
470
+ </xsl:element>
471
+ </xsl:variable>
472
+
473
+ <xsl:variable name="updated_xml_step_move_pagebreak_filename" select="concat($output_path,'_main_', java:getTime(java:java.util.Date.new()), '.xml')"/>
474
+
475
+ <redirect:write file="{$updated_xml_step_move_pagebreak_filename}">
476
+ <xsl:copy-of select="$updated_xml_step_move_pagebreak"/>
477
+ </redirect:write>
478
+
479
+ <xsl:copy-of select="document($updated_xml_step_move_pagebreak_filename)"/>
480
+
481
+ <xsl:if test="$debug = 'true'">
482
+ <redirect:write file="page_sequence_preface_and_main.xml">
483
+ <xsl:copy-of select="$updated_xml_step_move_pagebreak"/>
484
+ </redirect:write>
485
+ </xsl:if>
486
+
487
+ <xsl:call-template name="deleteFile">
488
+ <xsl:with-param name="filepath" select="$updated_xml_step_move_pagebreak_filename"/>
489
+ </xsl:call-template>
490
+ </xsl:template>
491
+
387
492
  <xsl:template match="iho:preface//iho:clause[@type = 'toc']" priority="4">
388
493
  <!-- Table of Contents -->
389
494
  <fo:block>
@@ -419,7 +524,7 @@
419
524
  </xsl:attribute>
420
525
  <fo:list-item>
421
526
  <fo:list-item-label end-indent="label-end()">
422
- <fo:block>
527
+ <fo:block id="__internal_layout__toc_sectionnum_{generate-id()}">
423
528
  <xsl:if test="@section != '' and not(@type = 'annex')"> <!-- output below -->
424
529
  <xsl:value-of select="@section"/>
425
530
  </xsl:if>
@@ -546,7 +651,7 @@
546
651
  <!-- ============================= -->
547
652
  <!-- ============================= -->
548
653
 
549
- <xsl:template match="/iho:iho-standard/iho:bibdata/iho:edition">
654
+ <xsl:template match="/iho:metanorma/iho:bibdata/iho:edition">
550
655
  <xsl:call-template name="capitalize">
551
656
  <xsl:with-param name="str">
552
657
  <xsl:call-template name="getLocalizedString">
@@ -558,7 +663,7 @@
558
663
  <xsl:apply-templates/>
559
664
  </xsl:template>
560
665
 
561
- <xsl:template match="/iho:iho-standard/iho:bibdata/iho:date[@type = 'published']">
666
+ <xsl:template match="/iho:metanorma/iho:bibdata/iho:date[@type = 'published']">
562
667
  <xsl:call-template name="convertDate">
563
668
  <xsl:with-param name="date" select="."/>
564
669
  <xsl:with-param name="format" select="'short'"/>
@@ -831,6 +936,10 @@
831
936
  </fo:block>
832
937
  </fo:block-container>
833
938
  </fo:static-content>
939
+ <xsl:call-template name="insertHeaderBlank"/>
940
+ <xsl:call-template name="insertFooter"/>
941
+ </xsl:template>
942
+ <xsl:template name="insertHeaderBlank">
834
943
  <fo:static-content flow-name="header-blank" role="artifact">
835
944
  <fo:block-container height="100%" font-size="8pt">
836
945
  <fo:block padding-top="12.5mm">
@@ -852,6 +961,8 @@
852
961
  <fo:block>Page intentionally left blank</fo:block>
853
962
  </fo:block-container>
854
963
  </fo:static-content>
964
+ </xsl:template>
965
+ <xsl:template name="insertFooter">
855
966
  <fo:static-content flow-name="footer" role="artifact">
856
967
  <fo:block-container height="100%" display-align="after">
857
968
  <fo:block padding-bottom="12.5mm" font-size="8pt" text-align-last="justify">
@@ -868,6 +979,10 @@
868
979
  </fo:block-container>
869
980
  </fo:static-content>
870
981
  </xsl:template>
982
+ <xsl:template name="insertHeaderFooterBlank">
983
+ <xsl:call-template name="insertHeaderBlank"/>
984
+ <xsl:call-template name="insertFooter"/>
985
+ </xsl:template>
871
986
 
872
987
  <xsl:variable name="Image-IHO">
873
988
  <xsl:text>iVBORw0KGgoAAAANSUhEUgAAAOEAAADfCAIAAACPoSPwAAAAAXNSR0IArs4c6QAAAAlwSFlzAAAh1QAAIdUBBJy0nQAAEYdJREFUeAHtnQlsHNUZx3dmba+9dmzHtxMntusEJ04IBJKQkEASVGhLqUI5SgGVVlSVKIKGCqoiaKWiFrVUasvVU1BatbSlFEGRAAEiKKTkgIQckMOJncN2Dl/xsWt7N7sz02/jxnm2d+3vjXf9nst/ZFlvZ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olI0KhooIQKOKwMMtmwA0ykYFQ0UEoFFF4OGWTQAaZaOCoSIC0Kgi8HDLJgCNslHBUBEBaFQReLhlE4BG2ahgqIgANKoIPNyyCUCjbFQwVEQAGlUEHm7ZBKBRNioYKiIAjSoCD7dsAtAoGxUMFRGARhWBh1s2AWiUjQqGighAo4rAwy2bADTKRgVDRQSgUUXg4ZZNABplo4KhIgLQqCLwcMsmAI2yUcFQEQFoVBF4uGUTgEbZqGCoiAA0qgg83LIJQKNsVDBURAAaVQQebtkEoFE2KhgqIgCNKgIPt2wC0CgbFQwVEYBGFYGHWzYBaJSNCoaKCECjisDDLZsANMpGBUNFBKBRReDhlk0AGmWjgqEiAtCoIvBwyyYAjbJRwVARAWhUEXi4ZRP4L/81MZBcCh3tAAAAAElFTkSuQmCC</xsl:text>
@@ -885,21 +1000,21 @@
885
1000
 
886
1001
  <xsl:variable name="namespace_full_">
887
1002
  <xsl:choose>
888
- <xsl:when test="local-name(/*) = 'metanorma-collection'"><xsl:value-of select="namespace-uri(//*[contains(local-name(), '-standard')][1])"/></xsl:when>
889
- <xsl:otherwise><xsl:value-of select="namespace-uri(/*)"/></xsl:otherwise><!-- example: https://www.metanorma.org/ns/iso -->
1003
+ <xsl:when test="local-name(/*) = 'metanorma-collection'"><xsl:value-of select="namespace-uri(//*[local-name() = 'metanorma'][1])"/></xsl:when>
1004
+ <xsl:otherwise><xsl:value-of select="namespace-uri(/*)"/></xsl:otherwise><!-- example: https://www.metanorma.org/ns/standoc -->
890
1005
  </xsl:choose>
891
1006
  </xsl:variable>
892
1007
  <xsl:variable name="namespace_full" select="normalize-space($namespace_full_)"/>
893
1008
 
894
1009
  <xsl:variable name="root_element_">
895
1010
  <xsl:choose>
896
- <xsl:when test="local-name(/*) = 'metanorma-collection'"><xsl:value-of select="local-name(//*[contains(local-name(), '-standard')][1])"/></xsl:when>
897
- <xsl:otherwise><xsl:value-of select="local-name(/*)"/></xsl:otherwise><!-- example: iso-standard -->
1011
+ <xsl:when test="local-name(/*) = 'metanorma-collection'"><xsl:value-of select="local-name(//*[local-name() = 'metanorma'][1])"/></xsl:when>
1012
+ <xsl:otherwise><xsl:value-of select="local-name(/*)"/></xsl:otherwise><!-- example: metanorma (former iso-standard) -->
898
1013
  </xsl:choose>
899
1014
  </xsl:variable>
900
1015
  <xsl:variable name="root_element" select="normalize-space($root_element_)"/>
901
1016
 
902
- <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'])"/>
1017
+ <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'])"/>
903
1018
 
904
1019
  <!-- external parameters -->
905
1020
 
@@ -1000,7 +1115,7 @@
1000
1115
  </metanorma-extension>
1001
1116
  -->
1002
1117
 
1003
- <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'])))"/>
1118
+ <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'])))"/>
1004
1119
  <xsl:variable name="papersize_width_">
1005
1120
  <xsl:choose>
1006
1121
  <xsl:when test="$papersize = 'letter'">215.9</xsl:when>
@@ -1062,7 +1177,7 @@
1062
1177
  <xsl:variable name="marginBottom" select="normalize-space($marginBottom_)"/>
1063
1178
 
1064
1179
  <xsl:variable name="layout_columns_default">1</xsl:variable>
1065
- <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'])"/>
1180
+ <xsl:variable name="layout_columns_" select="normalize-space((//*[local-name() = 'metanorma'])[1]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata']/*[local-name() = 'layout-columns'])"/>
1066
1181
  <xsl:variable name="layout_columns">
1067
1182
  <xsl:choose>
1068
1183
  <xsl:when test="$layout_columns_ != ''"><xsl:value-of select="$layout_columns_"/></xsl:when>
@@ -1123,7 +1238,7 @@
1123
1238
  <xsl:variable name="titles" select="xalan:nodeset($titles_)"/>
1124
1239
 
1125
1240
  <xsl:variable name="title-list-tables">
1126
- <xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']"/>
1241
+ <xsl:variable name="toc_table_title" select="//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']"/>
1127
1242
  <xsl:value-of select="$toc_table_title"/>
1128
1243
  <xsl:if test="normalize-space($toc_table_title) = ''">
1129
1244
  <xsl:call-template name="getLocalizedString">
@@ -1133,7 +1248,7 @@
1133
1248
  </xsl:variable>
1134
1249
 
1135
1250
  <xsl:variable name="title-list-figures">
1136
- <xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']"/>
1251
+ <xsl:variable name="toc_figure_title" select="//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']"/>
1137
1252
  <xsl:value-of select="$toc_figure_title"/>
1138
1253
  <xsl:if test="normalize-space($toc_figure_title) = ''">
1139
1254
  <xsl:call-template name="getLocalizedString">
@@ -1143,7 +1258,7 @@
1143
1258
  </xsl:variable>
1144
1259
 
1145
1260
  <xsl:variable name="title-list-recommendations">
1146
- <xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='requirement']/*[local-name() = 'title']"/>
1261
+ <xsl:variable name="toc_requirement_title" select="//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='requirement']/*[local-name() = 'title']"/>
1147
1262
  <xsl:value-of select="$toc_requirement_title"/>
1148
1263
  <xsl:if test="normalize-space($toc_requirement_title) = ''">
1149
1264
  <xsl:call-template name="getLocalizedString">
@@ -1153,8 +1268,8 @@
1153
1268
  </xsl:variable>
1154
1269
 
1155
1270
  <xsl:variable name="bibdata">
1156
- <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']"/>
1157
- <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'localized-strings']"/>
1271
+ <xsl:copy-of select="//*[local-name() = 'metanorma']/*[local-name() = 'bibdata']"/>
1272
+ <xsl:copy-of select="//*[local-name() = 'metanorma']/*[local-name() = 'localized-strings']"/>
1158
1273
  </xsl:variable>
1159
1274
 
1160
1275
  <!-- Characters -->
@@ -1219,7 +1334,7 @@
1219
1334
  <xsl:variable name="root-style_" select="xalan:nodeset($root-style)"/>
1220
1335
 
1221
1336
  <xsl:variable name="additional_fonts_">
1222
- <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']">
1337
+ <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']">
1223
1338
  <xsl:value-of select="."/><xsl:if test="position() != last()">, </xsl:if>
1224
1339
  </xsl:for-each>
1225
1340
  </xsl:variable>
@@ -2560,10 +2675,10 @@
2560
2675
 
2561
2676
  <xsl:template name="processTablesFigures_Contents">
2562
2677
  <xsl:param name="always"/>
2563
- <xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
2678
+ <xsl:if test="(//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
2564
2679
  <xsl:call-template name="processTables_Contents"/>
2565
2680
  </xsl:if>
2566
- <xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
2681
+ <xsl:if test="(//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
2567
2682
  <xsl:call-template name="processFigures_Contents"/>
2568
2683
  </xsl:if>
2569
2684
  </xsl:template>
@@ -2643,7 +2758,7 @@
2643
2758
  </xsl:template><!-- END: processMainSectionsDefault -->
2644
2759
 
2645
2760
  <!-- Example:
2646
- <iso-standard>
2761
+ <metanorma>
2647
2762
  <preface>
2648
2763
  <page_sequence>
2649
2764
  <clause...
@@ -2666,7 +2781,7 @@
2666
2781
  <page_sequence>
2667
2782
  <annex ..
2668
2783
  </page_sequence>
2669
- </iso-standard>
2784
+ </metanorma>
2670
2785
  -->
2671
2786
  <xsl:template name="processPrefaceAndMainSectionsDefault_items">
2672
2787
 
@@ -2709,15 +2824,8 @@
2709
2824
  </xsl:template> <!-- END: insertPrefaceSectionsPageSequences -->
2710
2825
 
2711
2826
  <xsl:template name="insertMainSectionsPageSequences">
2712
- <xsl:element name="sections" namespace="{$namespace_full}"> <!-- save context element -->
2713
- <xsl:element name="page_sequence" namespace="{$namespace_full}">
2714
- <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
2715
- <xsl:sort select="@displayorder" data-type="number"/>
2716
- <xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
2717
2827
 
2718
- </xsl:for-each>
2719
- </xsl:element>
2720
- </xsl:element>
2828
+ <xsl:call-template name="insertSectionsInPageSequence"/>
2721
2829
 
2722
2830
  <xsl:element name="page_sequence" namespace="{$namespace_full}">
2723
2831
  <xsl:for-each select="/*/*[local-name()='annex']">
@@ -2736,6 +2844,18 @@
2736
2844
  </xsl:element>
2737
2845
  </xsl:template> <!-- END: insertMainSectionsPageSequences -->
2738
2846
 
2847
+ <xsl:template name="insertSectionsInPageSequence">
2848
+ <xsl:element name="sections" namespace="{$namespace_full}"> <!-- save context element -->
2849
+ <xsl:element name="page_sequence" namespace="{$namespace_full}">
2850
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
2851
+ <xsl:sort select="@displayorder" data-type="number"/>
2852
+ <xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
2853
+
2854
+ </xsl:for-each>
2855
+ </xsl:element>
2856
+ </xsl:element>
2857
+ </xsl:template>
2858
+
2739
2859
  <xsl:template name="insertMainSectionsInSeparatePageSequences">
2740
2860
  <xsl:element name="sections" namespace="{$namespace_full}"> <!-- save context element -->
2741
2861
  <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
@@ -4249,7 +4369,7 @@
4249
4369
  <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
4250
4370
 
4251
4371
  <xsl:variable name="gen_id" select="generate-id(.)"/>
4252
- <xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
4372
+ <xsl:variable name="lang" select="ancestor::*[local-name() = 'metanorma']/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
4253
4373
  <xsl:variable name="reference_">
4254
4374
  <xsl:value-of select="@reference"/>
4255
4375
  <xsl:if test="normalize-space(@reference) = ''"><xsl:value-of select="$gen_id"/></xsl:if>
@@ -4370,13 +4490,13 @@
4370
4490
  footnotes in bibliography
4371
4491
  footnotes in document's body (except table's head/body/foot and figure text)
4372
4492
  -->
4373
- <xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']/*[local-name() = 'note'][@type='title-footnote']">
4493
+ <xsl:for-each select="ancestor::*[local-name() = 'metanorma']/*[local-name() = 'bibdata']/*[local-name() = 'note'][@type='title-footnote']">
4374
4494
  <fn gen_id="{generate-id(.)}">
4375
4495
  <xsl:copy-of select="@*"/>
4376
4496
  <xsl:copy-of select="node()"/>
4377
4497
  </fn>
4378
4498
  </xsl:for-each>
4379
- <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']/*">
4499
+ <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']/*">
4380
4500
  <xsl:sort select="@displayorder" data-type="number"/>
4381
4501
  <!-- commented:
4382
4502
  .//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] |
@@ -6813,6 +6933,8 @@
6813
6933
  <!-- ======================================= -->
6814
6934
  <!-- math -->
6815
6935
  <!-- ======================================= -->
6936
+ <xsl:template match="*[local-name() = 'stem'][following-sibling::*[1][local-name() = 'fmt-stem']]"/> <!-- for tablesonly.xml generated by mn2pdf -->
6937
+
6816
6938
  <xsl:template match="mathml:math">
6817
6939
  <xsl:variable name="isAdded" select="@added"/>
6818
6940
  <xsl:variable name="isDeleted" select="@deleted"/>
@@ -7172,10 +7294,10 @@
7172
7294
  <xsl:template match="*[local-name()='localityStack']"/>
7173
7295
 
7174
7296
  <xsl:variable name="pdfAttachmentsList_">
7175
- <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
7297
+ <xsl:for-each select="//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
7176
7298
  <attachment filename="{@name}"/>
7177
7299
  </xsl:for-each>
7178
- <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
7300
+ <xsl:if test="not(//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
7179
7301
  <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
7180
7302
  <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
7181
7303
  <attachment filename="{$attachment_path}"/>
@@ -8641,7 +8763,9 @@
8641
8763
  <xsl:apply-templates mode="bookmarks"/>
8642
8764
  </xsl:template>
8643
8765
 
8644
- <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">
8766
+ <xsl:template match="*[local-name() = 'stem']" mode="contents"/>
8767
+
8768
+ <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">
8645
8769
  <xsl:apply-templates select="."/>
8646
8770
  </xsl:template>
8647
8771
 
@@ -8658,7 +8782,15 @@
8658
8782
  <xsl:apply-templates mode="contents"/>
8659
8783
  </xsl:template>
8660
8784
 
8661
- <xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
8785
+ <xsl:template match="*[local-name() = 'concept']" mode="contents"/>
8786
+ <xsl:template match="*[local-name() = 'eref']" mode="contents"/>
8787
+ <xsl:template match="*[local-name() = 'xref']" mode="contents"/>
8788
+ <xsl:template match="*[local-name() = 'link']" mode="contents"/>
8789
+ <xsl:template match="*[local-name() = 'origin']" mode="contents"/>
8790
+ <xsl:template match="*[local-name() = 'erefstack ']" mode="contents"/>
8791
+
8792
+ <xsl:template match="*[local-name() = 'stem']" mode="bookmarks"/>
8793
+ <xsl:template match="*[local-name() = 'fmt-stem']" mode="bookmarks">
8662
8794
  <xsl:apply-templates mode="bookmarks"/>
8663
8795
  </xsl:template>
8664
8796
 
@@ -8671,6 +8803,13 @@
8671
8803
  <xsl:apply-templates mode="bookmarks"/>
8672
8804
  </xsl:template>
8673
8805
 
8806
+ <xsl:template match="*[local-name() = 'concept']" mode="bookmarks"/>
8807
+ <xsl:template match="*[local-name() = 'eref']" mode="bookmarks"/>
8808
+ <xsl:template match="*[local-name() = 'xref']" mode="bookmarks"/>
8809
+ <xsl:template match="*[local-name() = 'link']" mode="bookmarks"/>
8810
+ <xsl:template match="*[local-name() = 'origin']" mode="bookmarks"/>
8811
+ <xsl:template match="*[local-name() = 'erefstack ']" mode="bookmarks"/>
8812
+
8674
8813
  <!-- Bookmarks -->
8675
8814
  <xsl:template name="addBookmarks">
8676
8815
  <xsl:param name="contents"/>
@@ -8955,6 +9094,13 @@
8955
9094
 
8956
9095
  <xsl:template match="*[local-name() = 'fmt-xref-label']" mode="contents_item"/>
8957
9096
 
9097
+ <xsl:template match="*[local-name() = 'concept']" mode="contents_item"/>
9098
+ <xsl:template match="*[local-name() = 'eref']" mode="contents_item"/>
9099
+ <xsl:template match="*[local-name() = 'xref']" mode="contents_item"/>
9100
+ <xsl:template match="*[local-name() = 'link']" mode="contents_item"/>
9101
+ <xsl:template match="*[local-name() = 'origin']" mode="contents_item"/>
9102
+ <xsl:template match="*[local-name() = 'erefstack ']" mode="contents_item"/>
9103
+
8958
9104
  <xsl:template name="getSection">
8959
9105
  <xsl:choose>
8960
9106
  <xsl:when test="*[local-name() = 'fmt-title']">
@@ -9074,7 +9220,8 @@
9074
9220
  </xsl:copy>
9075
9221
  </xsl:template>
9076
9222
 
9077
- <xsl:template match="*[local-name() = 'stem']" mode="contents_item">
9223
+ <xsl:template match="*[local-name() = 'stem']" mode="contents_item"/>
9224
+ <xsl:template match="*[local-name() = 'fmt-stem']" mode="contents_item">
9078
9225
  <xsl:copy-of select="."/>
9079
9226
  </xsl:template>
9080
9227
 
@@ -9138,7 +9285,7 @@
9138
9285
  <!-- sourcecode -->
9139
9286
  <!-- =============== -->
9140
9287
 
9141
- <xsl:variable name="source-highlighter-css_" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'source-highlighter-css']"/>
9288
+ <xsl:variable name="source-highlighter-css_" select="//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'source-highlighter-css']"/>
9142
9289
  <xsl:variable name="sourcecode_css_" select="java:org.metanorma.fop.Util.parseCSS($source-highlighter-css_)"/>
9143
9290
  <xsl:variable name="sourcecode_css" select="xalan:nodeset($sourcecode_css_)"/>
9144
9291
 
@@ -10593,7 +10740,7 @@
10593
10740
 
10594
10741
  </xsl:template> <!-- sections_element_style -->
10595
10742
 
10596
- <xsl:template match="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*" priority="2" name="preface_node"> <!-- /*/*[local-name() = 'preface']/* -->
10743
+ <xsl:template match="//*[local-name() = 'metanorma']/*[local-name() = 'preface']/*" priority="2" name="preface_node"> <!-- /*/*[local-name() = 'preface']/* -->
10597
10744
 
10598
10745
  <fo:block break-after="page"/>
10599
10746
 
@@ -10697,7 +10844,7 @@
10697
10844
  <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>
10698
10845
  </xsl:when>
10699
10846
  <!-- if there isn't element with id 'from', then create 'bookmark' here -->
10700
- <xsl:when test="ancestor::*[contains(local-name(), '-standard')] and not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
10847
+ <xsl:when test="ancestor::*[local-name() = 'metanorma'] and not(ancestor::*[local-name() = 'metanorma']//*[@id = $id_from])">
10701
10848
  <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>
10702
10849
  </xsl:when>
10703
10850
  <xsl:when test="not(/*[@id = $id_from]) and not(/*//*[@id = $id_from]) and not(preceding-sibling::*[@id = $id_from])">
@@ -12038,7 +12185,7 @@
12038
12185
  <xsl:variable name="nodes_sections" select="xalan:nodeset($nodes_sections_)"/>
12039
12186
 
12040
12187
  <!-- move section 'Normative references' inside 'sections' -->
12041
- <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']]">
12188
+ <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']]">
12042
12189
  <xsl:sort select="@displayorder" data-type="number"/>
12043
12190
 
12044
12191
  <!-- process Section's title -->
@@ -12099,10 +12246,126 @@
12099
12246
  <xsl:template match="*[local-name() = 'preprocess-xslt']" mode="update_xml_step1"/>
12100
12247
  <xsl:template match="*[local-name() = 'preprocess-xslt']" mode="update_xml_pres"/>
12101
12248
 
12102
- <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">
12249
+ <xsl:template match="*[local-name() = 'stem']" mode="update_xml_step1"/>
12250
+ <xsl:template match="*[local-name() = 'stem']" mode="update_xml_pres"/>
12251
+
12252
+ <xsl:template match="*[local-name() = 'fmt-stem'][not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])]" mode="update_xml_step1">
12253
+ <xsl:element name="stem" namespace="{$namespace_full}">
12254
+ <xsl:copy-of select="@*"/>
12255
+ <xsl:choose>
12256
+ <xsl:when test="*[local-name() = 'semx'] and count(node()) = 1">
12257
+ <xsl:copy-of select="*[local-name() = 'semx']/node()"/>
12258
+ </xsl:when>
12259
+ <xsl:otherwise>
12260
+ <xsl:copy-of select="node()"/>
12261
+ </xsl:otherwise>
12262
+ </xsl:choose>
12263
+ </xsl:element>
12264
+ </xsl:template>
12265
+ <xsl:template match="*[local-name() = 'fmt-stem'][not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])]" mode="update_xml_pres">
12266
+ <xsl:element name="stem" namespace="{$namespace_full}">
12267
+ <xsl:copy-of select="@*"/>
12268
+ <xsl:choose>
12269
+ <xsl:when test="*[local-name() = 'semx'] and count(node()) = 1">
12270
+ <xsl:copy-of select="*[local-name() = 'semx']/node()"/>
12271
+ </xsl:when>
12272
+ <xsl:otherwise>
12273
+ <xsl:copy-of select="node()"/>
12274
+ </xsl:otherwise>
12275
+ </xsl:choose>
12276
+ </xsl:element>
12277
+ </xsl:template>
12278
+
12279
+ <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">
12103
12280
  <xsl:copy-of select="."/>
12104
12281
  </xsl:template>
12105
12282
 
12283
+ <!-- https://github.com/metanorma/isodoc/issues/651 -->
12284
+ <!-- *[local-name() = 'sourcecode'][not(.//*[local-name() = 'passthrough']) and not(.//*[local-name() = 'fmt-name'])] -->
12285
+ <xsl:template match="*[local-name() = 'sourcecode']" mode="update_xml_step1">
12286
+ <xsl:copy>
12287
+ <xsl:copy-of select="@*"/>
12288
+ <xsl:apply-templates select="*[local-name() = 'fmt-name']" mode="update_xml_step1"/>
12289
+ <xsl:choose>
12290
+ <xsl:when test="*[local-name() = 'fmt-sourcecode']">
12291
+ <xsl:choose>
12292
+ <xsl:when test="*[local-name() = 'fmt-sourcecode'][not(.//*[local-name() = 'passthrough'])] and not(.//*[local-name() = 'fmt-name'])">
12293
+ <xsl:copy-of select="*[local-name() = 'fmt-sourcecode']/node()"/>
12294
+ </xsl:when>
12295
+ <xsl:otherwise>
12296
+ <xsl:apply-templates select="*[local-name() = 'fmt-sourcecode']/node()" mode="update_xml_step1"/>
12297
+ </xsl:otherwise>
12298
+ </xsl:choose>
12299
+ </xsl:when>
12300
+ <xsl:otherwise> <!-- If fmt-sourcecode is not present -->
12301
+ <xsl:choose>
12302
+ <xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[local-name() = 'fmt-name'])">
12303
+ <xsl:copy-of select="node()"/>
12304
+ </xsl:when>
12305
+ <xsl:otherwise>
12306
+ <xsl:apply-templates select="node()[not(local-name() = 'fmt-name')]" mode="update_xml_step1"/>
12307
+ </xsl:otherwise>
12308
+ </xsl:choose>
12309
+ </xsl:otherwise>
12310
+ </xsl:choose>
12311
+ </xsl:copy>
12312
+ </xsl:template>
12313
+ <xsl:template match="*[local-name() = 'sourcecode']" mode="update_xml_pres">
12314
+ <xsl:copy>
12315
+ <xsl:copy-of select="@*"/>
12316
+ <xsl:apply-templates select="*[local-name() = 'fmt-name']" mode="update_xml_pres"/>
12317
+ <xsl:choose>
12318
+ <xsl:when test="*[local-name() = 'fmt-sourcecode']">
12319
+ <xsl:choose>
12320
+ <xsl:when test="*[local-name() = 'fmt-sourcecode'][not(.//*[local-name() = 'passthrough'])] and not(.//*[local-name() = 'fmt-name'])">
12321
+ <xsl:copy-of select="*[local-name() = 'fmt-sourcecode']/node()"/>
12322
+ </xsl:when>
12323
+ <xsl:otherwise>
12324
+ <xsl:apply-templates select="*[local-name() = 'fmt-sourcecode']/node()" mode="update_xml_pres"/>
12325
+ </xsl:otherwise>
12326
+ </xsl:choose>
12327
+ </xsl:when>
12328
+ <xsl:otherwise> <!-- If fmt-sourcecode is not present -->
12329
+ <xsl:choose>
12330
+ <xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[local-name() = 'fmt-name'])">
12331
+ <xsl:copy-of select="node()"/>
12332
+ </xsl:when>
12333
+ <xsl:otherwise>
12334
+ <xsl:apply-templates select="node()[not(local-name() = 'fmt-name')]" mode="update_xml_pres"/>
12335
+ </xsl:otherwise>
12336
+ </xsl:choose>
12337
+ </xsl:otherwise>
12338
+ </xsl:choose>
12339
+ </xsl:copy>
12340
+ </xsl:template>
12341
+
12342
+ <!-- https://github.com/metanorma/isodoc/issues/651 -->
12343
+ <xsl:template match="*[local-name() = 'figure'][*[local-name() = 'fmt-figure']]" mode="update_xml_step1" priority="2">
12344
+ <xsl:copy>
12345
+ <xsl:copy-of select="@*"/>
12346
+ <xsl:apply-templates select="*[local-name() = 'fmt-name']" mode="update_xml_step1"/>
12347
+ <xsl:apply-templates select="*[local-name() = 'fmt-figure']/node()" mode="update_xml_step1"/>
12348
+ </xsl:copy>
12349
+ </xsl:template>
12350
+ <xsl:template match="*[local-name() = 'figure'][*[local-name() = 'fmt-figure']]" mode="update_xml_pres" priority="2">
12351
+ <xsl:copy>
12352
+ <xsl:copy-of select="@*"/>
12353
+ <xsl:apply-templates select="*[local-name() = 'fmt-name']" mode="update_xml_pres"/>
12354
+ <xsl:apply-templates select="*[local-name() = 'fmt-figure']/node()" mode="update_xml_pres"/>
12355
+ </xsl:copy>
12356
+ </xsl:template>
12357
+
12358
+ <!-- https://github.com/metanorma/isodoc/issues/652 -->
12359
+ <xsl:template match="*[local-name() = 'quote']/*[local-name() = 'source']"/>
12360
+ <xsl:template match="*[local-name() = 'quote']/*[local-name() = 'author']"/>
12361
+ <xsl:template match="*[local-name() = 'amend']"/>
12362
+ <xsl:template match="*[local-name() = 'quote']/*[local-name() = 'source']" mode="update_xml_step1"/>
12363
+ <xsl:template match="*[local-name() = 'quote']/*[local-name() = 'author']" mode="update_xml_step1"/>
12364
+ <xsl:template match="*[local-name() = 'quote']/*[local-name() = 'source']" mode="update_xml_pres"/>
12365
+ <xsl:template match="*[local-name() = 'quote']/*[local-name() = 'author']" mode="update_xml_pres"/>
12366
+ <xsl:template match="*[local-name() = 'amend']" mode="update_xml_step1"/>
12367
+ <xsl:template match="*[local-name() = 'amend']" mode="update_xml_pres"/>
12368
+
12106
12369
  <xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']" mode="update_xml_step1">
12107
12370
  <xsl:copy>
12108
12371
  <xsl:copy-of select="@*"/>
@@ -12133,7 +12396,7 @@
12133
12396
  <!-- add @id - first element with @id plus '_element_name' -->
12134
12397
  <xsl:variable name="prefix_id_" select="(.//*[@id])[1]/@id"/>
12135
12398
  <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>
12136
- <xsl:variable name="document_suffix" select="ancestor::*[contains(local-name(), '-standard')]/@document_suffix"/>
12399
+ <xsl:variable name="document_suffix" select="ancestor::*[local-name() = 'metanorma']/@document_suffix"/>
12137
12400
  <xsl:attribute name="id"><xsl:value-of select="concat($prefix_id, '_', local-name(), '_', $document_suffix)"/></xsl:attribute>
12138
12401
  </xsl:if>
12139
12402
  </xsl:template>
@@ -12383,6 +12646,126 @@
12383
12646
  <xsl:template match="*[local-name() = 'fmt-xref-label']" mode="update_xml_step1"/>
12384
12647
  <xsl:template match="*[local-name() = 'fmt-xref-label']" mode="update_xml_pres"/>
12385
12648
 
12649
+ <xsl:template match="*[local-name() = 'requirement'] | *[local-name() = 'recommendation'] | *[local-name() = 'permission']" mode="update_xml_step1">
12650
+ <xsl:apply-templates mode="update_xml_step1"/>
12651
+ </xsl:template>
12652
+
12653
+ <xsl:template match="*[local-name() = 'requirement'] | *[local-name() = 'recommendation'] | *[local-name() = 'permission']" mode="update_xml_pres">
12654
+ <xsl:apply-templates mode="update_xml_pres"/>
12655
+ </xsl:template>
12656
+
12657
+ <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"/>
12658
+
12659
+ <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"/>
12660
+
12661
+ <xsl:template match="*[local-name() = 'fmt-provision']" mode="update_xml_step1">
12662
+ <xsl:apply-templates mode="update_xml_step1"/>
12663
+ </xsl:template>
12664
+ <xsl:template match="*[local-name() = 'fmt-provision']" mode="update_xml_pres">
12665
+ <xsl:apply-templates mode="update_xml_pres"/>
12666
+ </xsl:template>
12667
+
12668
+ <xsl:template match="*[local-name() = 'identifier']" mode="update_xml_step1"/>
12669
+ <xsl:template match="*[local-name() = 'identifier']" mode="update_xml_pres"/>
12670
+ <xsl:template match="*[local-name() = 'fmt-identifier']" mode="update_xml_step1">
12671
+ <xsl:element name="identifier" namespace="{$namespace_full}">
12672
+ <xsl:copy-of select="@*"/>
12673
+ <xsl:apply-templates mode="update_xml_step1"/>
12674
+ </xsl:element>
12675
+ </xsl:template>
12676
+ <xsl:template match="*[local-name() = 'fmt-identifier']" mode="update_xml_pres">
12677
+ <xsl:element name="identifier" namespace="{$namespace_full}">
12678
+ <xsl:copy-of select="@*"/>
12679
+ <xsl:apply-templates mode="update_xml_pres"/>
12680
+ </xsl:element>
12681
+ </xsl:template>
12682
+
12683
+ <xsl:template match="*[local-name() = 'concept']"/>
12684
+ <xsl:template match="*[local-name() = 'concept']" mode="update_xml_step1"/>
12685
+ <xsl:template match="*[local-name() = 'concept']" mode="update_xml_pres"/>
12686
+
12687
+ <xsl:template match="*[local-name() = 'fmt-concept']">
12688
+ <xsl:apply-templates/>
12689
+ </xsl:template>
12690
+ <xsl:template match="*[local-name() = 'fmt-concept']" mode="update_xml_step1">
12691
+ <xsl:apply-templates mode="update_xml_step1"/>
12692
+ </xsl:template>
12693
+ <xsl:template match="*[local-name() = 'fmt-concept']" mode="update_xml_pres">
12694
+ <xsl:apply-templates mode="update_xml_pres"/>
12695
+ </xsl:template>
12696
+
12697
+ <xsl:template match="*[local-name() = 'eref']" mode="update_xml_step1"/>
12698
+ <xsl:template match="*[local-name() = 'eref']" mode="update_xml_pres"/>
12699
+
12700
+ <xsl:template match="*[local-name() = 'fmt-eref']" mode="update_xml_step1">
12701
+ <xsl:element name="eref" namespace="{$namespace_full}">
12702
+ <xsl:copy-of select="@*"/>
12703
+ <xsl:apply-templates mode="update_xml_step1"/>
12704
+ </xsl:element>
12705
+ </xsl:template>
12706
+ <xsl:template match="*[local-name() = 'fmt-eref']" mode="update_xml_pres">
12707
+ <xsl:element name="eref" namespace="{$namespace_full}">
12708
+ <xsl:copy-of select="@*"/>
12709
+ <xsl:apply-templates mode="update_xml_pres"/>
12710
+ </xsl:element>
12711
+ </xsl:template>
12712
+
12713
+ <xsl:template match="*[local-name() = 'xref']" mode="update_xml_step1"/>
12714
+ <xsl:template match="*[local-name() = 'xref']" mode="update_xml_pres"/>
12715
+
12716
+ <xsl:template match="*[local-name() = 'fmt-xref']" mode="update_xml_step1">
12717
+ <xsl:element name="xref" namespace="{$namespace_full}">
12718
+ <xsl:copy-of select="@*"/>
12719
+ <xsl:apply-templates mode="update_xml_step1"/>
12720
+ </xsl:element>
12721
+ </xsl:template>
12722
+ <xsl:template match="*[local-name() = 'fmt-xref']" mode="update_xml_pres">
12723
+ <xsl:element name="xref" namespace="{$namespace_full}">
12724
+ <xsl:copy-of select="@*"/>
12725
+ <xsl:apply-templates mode="update_xml_pres"/>
12726
+ </xsl:element>
12727
+ </xsl:template>
12728
+
12729
+ <xsl:template match="*[local-name() = 'link']" mode="update_xml_step1"/>
12730
+ <xsl:template match="*[local-name() = 'link']" mode="update_xml_pres"/>
12731
+
12732
+ <xsl:template match="*[local-name() = 'fmt-link']" mode="update_xml_step1">
12733
+ <xsl:element name="link" namespace="{$namespace_full}">
12734
+ <xsl:copy-of select="@*"/>
12735
+ <xsl:apply-templates mode="update_xml_step1"/>
12736
+ </xsl:element>
12737
+ </xsl:template>
12738
+ <xsl:template match="*[local-name() = 'fmt-link']" mode="update_xml_pres">
12739
+ <xsl:element name="link" namespace="{$namespace_full}">
12740
+ <xsl:copy-of select="@*"/>
12741
+ <xsl:apply-templates mode="update_xml_pres"/>
12742
+ </xsl:element>
12743
+ </xsl:template>
12744
+
12745
+ <xsl:template match="*[local-name() = 'origin']" mode="update_xml_step1"/>
12746
+ <xsl:template match="*[local-name() = 'origin']" mode="update_xml_pres"/>
12747
+
12748
+ <xsl:template match="*[local-name() = 'fmt-origin']" mode="update_xml_step1">
12749
+ <xsl:element name="origin" namespace="{$namespace_full}">
12750
+ <xsl:copy-of select="@*"/>
12751
+ <xsl:apply-templates mode="update_xml_step1"/>
12752
+ </xsl:element>
12753
+ </xsl:template>
12754
+ <xsl:template match="*[local-name() = 'fmt-origin']" mode="update_xml_pres">
12755
+ <xsl:element name="origin" namespace="{$namespace_full}">
12756
+ <xsl:copy-of select="@*"/>
12757
+ <xsl:apply-templates mode="update_xml_pres"/>
12758
+ </xsl:element>
12759
+ </xsl:template>
12760
+
12761
+ <xsl:template match="*[local-name() = 'erefstack']"/>
12762
+ <xsl:template match="*[local-name() = 'erefstack']" mode="update_xml_step1"/>
12763
+ <xsl:template match="*[local-name() = 'erefstack']" mode="update_xml_pres"/>
12764
+
12765
+ <xsl:template match="*[local-name() = 'svgmap']"/>
12766
+ <xsl:template match="*[local-name() = 'svgmap']" mode="update_xml_step1"/>
12767
+ <xsl:template match="*[local-name() = 'svgmap']" mode="update_xml_pres"/>
12768
+
12386
12769
  <!-- END: update new Presentation XML -->
12387
12770
 
12388
12771
  <!-- =========================================================================== -->
@@ -12455,7 +12838,7 @@
12455
12838
 
12456
12839
  <xsl:choose>
12457
12840
  <xsl:when test="$page_sequence_at_top = 'true'">
12458
- <xsl:for-each select="ancestor::*[ancestor::*[contains(local-name(), '-standard')]]">
12841
+ <xsl:for-each select="ancestor::*[ancestor::*[local-name() = 'metanorma']]">
12459
12842
  <element pos="{position()}">
12460
12843
  <xsl:copy-of select="@*[local-name() != 'id']"/>
12461
12844
  <xsl:value-of select="name()"/>
@@ -12883,7 +13266,7 @@
12883
13266
  </xsl:when>
12884
13267
  <xsl:when test="contains($text, $replace)">
12885
13268
  <xsl:value-of select="substring-before($text,$replace)"/>
12886
- <xsl:element name="inlineChar" namespace="https://www.metanorma.org/ns/jis"><xsl:value-of select="$by"/></xsl:element>
13269
+ <xsl:element name="inlineChar" namespace="https://www.metanorma.org/ns/standoc"><xsl:value-of select="$by"/></xsl:element>
12887
13270
  <xsl:call-template name="replaceChar">
12888
13271
  <xsl:with-param name="text" select="substring-after($text,$replace)"/>
12889
13272
  <xsl:with-param name="replace" select="$replace"/>
@@ -12920,7 +13303,7 @@
12920
13303
  </xsl:variable>
12921
13304
  <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
12922
13305
  <xsl:variable name="gen_id" select="generate-id(.)"/>
12923
- <xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
13306
+ <xsl:variable name="lang" select="ancestor::*[local-name() = 'metanorma']/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
12924
13307
  <xsl:variable name="reference" select="@reference"/>
12925
13308
  <!-- fn sequence number in document -->
12926
13309
  <xsl:variable name="current_fn_number" select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1"/>
@@ -12965,7 +13348,7 @@
12965
13348
  </xsl:template>
12966
13349
 
12967
13350
  <xsl:template name="printEdition">
12968
- <xsl:variable name="edition_i18n" select="normalize-space((//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) != ''])"/>
13351
+ <xsl:variable name="edition_i18n" select="normalize-space((//*[local-name() = 'metanorma'])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) != ''])"/>
12969
13352
 
12970
13353
  <xsl:choose>
12971
13354
  <xsl:when test="$edition_i18n != ''">
@@ -12975,7 +13358,7 @@
12975
13358
  </xsl:call-template>
12976
13359
  </xsl:when>
12977
13360
  <xsl:otherwise>
12978
- <xsl:variable name="edition" select="normalize-space((//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'])"/>
13361
+ <xsl:variable name="edition" select="normalize-space((//*[local-name() = 'metanorma'])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'])"/>
12979
13362
  <xsl:if test="$edition != ''"> <!-- Example: 1.3 -->
12980
13363
  <xsl:call-template name="capitalize">
12981
13364
  <xsl:with-param name="str">
@@ -13109,7 +13492,7 @@
13109
13492
  <xsl:param name="charDelim" select="', '"/>
13110
13493
  <xsl:choose>
13111
13494
  <xsl:when test="$sorting = 'true' or $sorting = 'yes'">
13112
- <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
13495
+ <xsl:for-each select="//*[local-name() = 'metanorma']/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
13113
13496
  <xsl:sort data-type="text" order="ascending"/>
13114
13497
  <xsl:call-template name="insertKeyword">
13115
13498
  <xsl:with-param name="meta" select="$meta"/>
@@ -13119,7 +13502,7 @@
13119
13502
  </xsl:for-each>
13120
13503
  </xsl:when>
13121
13504
  <xsl:otherwise>
13122
- <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
13505
+ <xsl:for-each select="//*[local-name() = 'metanorma']/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
13123
13506
  <xsl:call-template name="insertKeyword">
13124
13507
  <xsl:with-param name="meta" select="$meta"/>
13125
13508
  <xsl:with-param name="charAtEnd" select="$charAtEnd"/>
@@ -13194,7 +13577,7 @@
13194
13577
  <!-- Dublin Core properties go here -->
13195
13578
  <dc:title>
13196
13579
  <xsl:variable name="title">
13197
- <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
13580
+ <xsl:for-each select="(//*[local-name() = 'metanorma'])[1]/*[local-name() = 'bibdata']">
13198
13581
 
13199
13582
  <xsl:value-of select="*[local-name() = 'title'][@language = $lang]"/>
13200
13583
 
@@ -13214,7 +13597,7 @@
13214
13597
  </rdf:Alt>
13215
13598
  </dc:title>
13216
13599
  <xsl:variable name="dc_creator">
13217
- <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
13600
+ <xsl:for-each select="(//*[local-name() = 'metanorma'])[1]/*[local-name() = 'bibdata']">
13218
13601
 
13219
13602
  <rdf:Seq>
13220
13603
  <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
@@ -13236,7 +13619,7 @@
13236
13619
  <xsl:variable name="dc_description">
13237
13620
  <xsl:variable name="abstract">
13238
13621
 
13239
- <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()[not(ancestor::*[local-name() = 'fmt-title']) and not(ancestor::*[local-name() = 'title']) and not(ancestor::*[local-name() = 'fmt-xref-label'])]"/>
13622
+ <xsl:copy-of select="//*[local-name() = 'metanorma']/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()[not(ancestor::*[local-name() = 'fmt-title']) and not(ancestor::*[local-name() = 'title']) and not(ancestor::*[local-name() = 'fmt-xref-label'])]"/>
13240
13623
 
13241
13624
  </xsl:variable>
13242
13625
  <rdf:Alt>
@@ -13264,7 +13647,7 @@
13264
13647
  </rdf:RDF>
13265
13648
  </x:xmpmeta>
13266
13649
  <!-- add attachments -->
13267
- <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
13650
+ <xsl:for-each select="//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
13268
13651
  <xsl:variable name="bibitem_attachment_" select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]"/>
13269
13652
  <xsl:variable name="bibitem_attachment" select="xalan:nodeset($bibitem_attachment_)"/>
13270
13653
  <xsl:variable name="description" select="normalize-space($bibitem_attachment/*[local-name() = 'formattedref'])"/>
@@ -13298,7 +13681,7 @@
13298
13681
  </pdf:embedded-file>
13299
13682
  </xsl:for-each>
13300
13683
  <!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
13301
- <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
13684
+ <xsl:if test="not(//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
13302
13685
  <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
13303
13686
  <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
13304
13687
  <xsl:variable name="attachment_name" select="java:org.metanorma.fop.Util.getFilenameFromPath($attachment_path)"/>
@@ -13502,9 +13885,9 @@
13502
13885
  <xsl:value-of select="document('')//*/namespace::iho"/>
13503
13886
 
13504
13887
  </xsl:variable>
13505
- <xsl:if test="$documentNS != $XSLNS">
13888
+ <!-- <xsl:if test="$documentNS != $XSLNS">
13506
13889
  <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
13507
- </xsl:if>
13890
+ </xsl:if> -->
13508
13891
  </xsl:template> <!-- namespaceCheck -->
13509
13892
 
13510
13893
  <xsl:template name="getLanguage">
@@ -13583,10 +13966,10 @@
13583
13966
 
13584
13967
  <xsl:variable name="data_value">
13585
13968
  <xsl:choose>
13586
- <xsl:when test="$formatted = 'true' and string-length($bibdata_updated) != ''">
13969
+ <xsl:when test="$formatted = 'true' and string-length($bibdata_updated) != 0">
13587
13970
  <xsl:apply-templates select="xalan:nodeset($bibdata_updated)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
13588
13971
  </xsl:when>
13589
- <xsl:when test="string-length($bibdata_updated) != ''">
13972
+ <xsl:when test="string-length($bibdata_updated) != 0">
13590
13973
  <xsl:value-of select="xalan:nodeset($bibdata_updated)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
13591
13974
  </xsl:when>
13592
13975
  <xsl:when test="$formatted = 'true'">
@@ -13724,7 +14107,7 @@
13724
14107
  <!-- background image -->
13725
14108
  <fo:block-container absolute-position="fixed" left="0mm" top="0mm" font-size="0" id="__internal_layout__coverpage{$suffix}_{$name}_{$number}_{generate-id()}">
13726
14109
  <fo:block>
13727
- <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]">
14110
+ <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]">
13728
14111
  <xsl:choose>
13729
14112
  <xsl:when test="*[local-name() = 'svg'] or java:endsWith(java:java.lang.String.new(@src), '.svg')">
13730
14113
  <fo:instream-foreign-object fox:alt-text="Image Front">