metanorma-ogc 2.6.5 → 2.6.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -117,6 +117,35 @@
117
117
 
118
118
  <xsl:call-template name="addBookmarks">
119
119
  <xsl:with-param name="contents" select="$contents"/>
120
+ <xsl:with-param name="contents_addon">
121
+ <xsl:variable name="list_of_tables_figures_">
122
+ <xsl:for-each select="//*[local-name() = 'table'][@id and *[local-name() = 'name']] | //*[local-name() = 'figure'][@id and *[local-name() = 'name']]">
123
+ <table_figure id="{@id}"><xsl:apply-templates select="*[local-name() = 'fmt-name']" mode="bookmarks"/></table_figure>
124
+ </xsl:for-each>
125
+ </xsl:variable>
126
+ <xsl:variable name="list_of_tables_figures" select="xalan:nodeset($list_of_tables_figures_)"/>
127
+
128
+ <xsl:if test="$list_of_tables_figures/table_figure">
129
+ <fo:bookmark internal-destination="empty_bookmark">
130
+ <fo:bookmark-title>—————</fo:bookmark-title>
131
+ </fo:bookmark>
132
+ </xsl:if>
133
+
134
+ <xsl:if test="$list_of_tables_figures//table_figure">
135
+ <fo:bookmark internal-destination="empty_bookmark" starting-state="hide">
136
+ <fo:bookmark-title>
137
+ <xsl:call-template name="getLocalizedString">
138
+ <xsl:with-param name="key">table_of_figures</xsl:with-param>
139
+ </xsl:call-template>
140
+ </fo:bookmark-title>
141
+ <xsl:for-each select="$list_of_tables_figures//table_figure">
142
+ <fo:bookmark internal-destination="{@id}">
143
+ <fo:bookmark-title><xsl:value-of select="."/></fo:bookmark-title>
144
+ </fo:bookmark>
145
+ </xsl:for-each>
146
+ </fo:bookmark>
147
+ </xsl:if>
148
+ </xsl:with-param>
120
149
  </xsl:call-template>
121
150
 
122
151
  <!-- Cover Page -->
@@ -176,11 +205,17 @@
176
205
  <fo:block-container font-size="9pt" margin-left="-5mm" margin-right="-5mm">
177
206
  <fo:block-container margin-left="0mm" margin-right="0mm">
178
207
  <fo:block margin-top="8pt">
179
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:boilerplate/ogc:copyright-statement"/>
208
+ <xsl:variable name="copyright_statement">
209
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:boilerplate/ogc:copyright-statement" mode="update_xml_step1"/>
210
+ </xsl:variable>
211
+ <xsl:apply-templates select="xalan:nodeset($copyright_statement)/*"/>
180
212
  </fo:block>
181
213
  <fo:block margin-top="8pt"> </fo:block>
182
214
  <fo:block margin-top="8pt">
183
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:boilerplate/ogc:legal-statement"/>
215
+ <xsl:variable name="legal_statement">
216
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:boilerplate/ogc:legal-statement" mode="update_xml_step1"/>
217
+ </xsl:variable>
218
+ <xsl:apply-templates select="xalan:nodeset($legal_statement)/*"/>
184
219
  </fo:block>
185
220
  </fo:block-container>
186
221
  </fo:block-container>
@@ -196,6 +231,12 @@
196
231
  <!-- <xsl:copy-of select="."/> -->
197
232
  </xsl:variable>
198
233
 
234
+ <xsl:if test="$debug = 'true'">
235
+ <redirect:write file="contents_.xml"> <!-- {java:getTime(java:java.util.Date.new())} -->
236
+ <xsl:copy-of select="$contents"/>
237
+ </redirect:write>
238
+ </xsl:if>
239
+
199
240
  <xsl:for-each select="xalan:nodeset($updated_xml)/*">
200
241
 
201
242
  <xsl:variable name="updated_xml_with_pages">
@@ -217,12 +258,6 @@
217
258
  <xsl:call-template name="insertHeaderFooter"/>
218
259
  <fo:flow flow-name="xsl-region-body">
219
260
 
220
- <!-- <xsl:if test="$debug = 'true'">
221
- <redirect:write file="contents_{java:getTime(java:java.util.Date.new())}.xml">
222
- <xsl:copy-of select="$contents"/>
223
- </redirect:write>
224
- </xsl:if> -->
225
-
226
261
  <!-- <xsl:apply-templates select="/ogc:ogc-standard/ogc:boilerplate/ogc:license-statement"/>
227
262
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:boilerplate/ogc:feedback-statement"/> -->
228
263
 
@@ -419,10 +454,10 @@
419
454
  <!-- ============================= -->
420
455
 
421
456
  <!-- element with title -->
422
- <xsl:template match="*[ogc:title]" mode="contents">
457
+ <xsl:template match="*[ogc:title or ogc:fmt-title]" mode="contents">
423
458
  <xsl:variable name="level">
424
459
  <xsl:call-template name="getLevel">
425
- <xsl:with-param name="depth" select="ogc:title/@depth"/>
460
+ <xsl:with-param name="depth" select="ogc:fmt-title/@depth | ogc:title/@depth"/>
426
461
  </xsl:call-template>
427
462
  </xsl:variable>
428
463
 
@@ -512,6 +547,7 @@
512
547
 
513
548
  <fo:block>
514
549
  <xsl:call-template name="setId"/>
550
+ <xsl:call-template name="addReviewHelper"/>
515
551
  <xsl:apply-templates/>
516
552
  </fo:block>
517
553
  </xsl:template>
@@ -738,7 +774,7 @@
738
774
  </xsl:choose>
739
775
  </xsl:template>
740
776
 
741
- <xsl:strip-space elements="ogc:xref"/>
777
+ <!-- <xsl:strip-space elements="ogc:xref"/> -->
742
778
 
743
779
  <xsl:variable name="namespace_full" select="namespace-uri(/*)"/> <!-- example: https://www.metanorma.org/ns/iso -->
744
780
  <xsl:variable name="root_element" select="local-name(/*)"/> <!-- example: iso-standard -->
@@ -1780,6 +1816,10 @@
1780
1816
 
1781
1817
  <xsl:template name="refine_termnote-name-style">
1782
1818
 
1819
+ <!-- <xsl:if test="$namespace = 'ieee'">
1820
+ <xsl:attribute name="padding-right">0mm</xsl:attribute>
1821
+ </xsl:if> -->
1822
+
1783
1823
  </xsl:template>
1784
1824
 
1785
1825
  <xsl:attribute-set name="termnote-p-style">
@@ -2480,9 +2520,21 @@
2480
2520
  <xsl:template name="processTables_Contents">
2481
2521
  <tables>
2482
2522
  <xsl:for-each select="//*[local-name() = 'table'][not(ancestor::*[local-name() = 'metanorma-extension'])][@id and *[local-name() = 'name'] and normalize-space(@id) != '']">
2483
- <table id="{@id}" alt-text="{*[local-name() = 'name']}">
2484
- <xsl:copy-of select="*[local-name() = 'name']"/>
2485
- </table>
2523
+ <xsl:choose>
2524
+ <xsl:when test="*[local-name() = 'fmt-name']">
2525
+ <xsl:variable name="fmt_name">
2526
+ <xsl:apply-templates select="*[local-name() = 'fmt-name']" mode="update_xml_step1"/>
2527
+ </xsl:variable>
2528
+ <table id="{@id}" alt-text="{normalize-space($fmt_name)}">
2529
+ <xsl:copy-of select="$fmt_name"/>
2530
+ </table>
2531
+ </xsl:when>
2532
+ <xsl:otherwise>
2533
+ <table id="{@id}" alt-text="{*[local-name() = 'name']}">
2534
+ <xsl:copy-of select="*[local-name() = 'name']"/>
2535
+ </table>
2536
+ </xsl:otherwise>
2537
+ </xsl:choose>
2486
2538
  </xsl:for-each>
2487
2539
  </tables>
2488
2540
  </xsl:template>
@@ -2490,9 +2542,21 @@
2490
2542
  <xsl:template name="processFigures_Contents">
2491
2543
  <figures>
2492
2544
  <xsl:for-each select="//*[local-name() = 'figure'][@id and *[local-name() = 'name'] and not(@unnumbered = 'true') and normalize-space(@id) != ''] | //*[@id and starts-with(*[local-name() = 'name'], 'Figure ') and normalize-space(@id) != '']">
2493
- <figure id="{@id}" alt-text="{*[local-name() = 'name']}">
2494
- <xsl:copy-of select="*[local-name() = 'name']"/>
2495
- </figure>
2545
+ <xsl:choose>
2546
+ <xsl:when test="*[local-name() = 'fmt-name']">
2547
+ <xsl:variable name="fmt_name">
2548
+ <xsl:apply-templates select="*[local-name() = 'fmt-name']" mode="update_xml_step1"/>
2549
+ </xsl:variable>
2550
+ <figure id="{@id}" alt-text="{normalize-space($fmt_name)}">
2551
+ <xsl:copy-of select="$fmt_name"/>
2552
+ </figure>
2553
+ </xsl:when>
2554
+ <xsl:otherwise>
2555
+ <figure id="{@id}" alt-text="{*[local-name() = 'name']}">
2556
+ <xsl:copy-of select="*[local-name() = 'name']"/>
2557
+ </figure>
2558
+ </xsl:otherwise>
2559
+ </xsl:choose>
2496
2560
  </xsl:for-each>
2497
2561
  </figures>
2498
2562
  </xsl:template>
@@ -4349,6 +4413,11 @@
4349
4413
 
4350
4414
  <xsl:value-of select="@reference"/>
4351
4415
 
4416
+ <!-- commented https://github.com/metanorma/isodoc/issues/614 -->
4417
+ <!-- <xsl:if test="$namespace = 'itu'">
4418
+ <xsl:text>)</xsl:text>
4419
+ </xsl:if> -->
4420
+
4352
4421
  </fo:inline>
4353
4422
  <fo:inline xsl:use-attribute-sets="table-fn-body-style">
4354
4423
  <xsl:copy-of select="./node()"/>
@@ -4358,7 +4427,7 @@
4358
4427
 
4359
4428
  </xsl:if>
4360
4429
  </xsl:for-each>
4361
- </xsl:template>
4430
+ </xsl:template> <!-- table_fn_display -->
4362
4431
 
4363
4432
  <xsl:template name="create_fn">
4364
4433
  <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
@@ -4392,8 +4461,10 @@
4392
4461
  <!-- EMD table's footnotes rendering -->
4393
4462
  <!-- ============================ -->
4394
4463
 
4464
+ <!-- ============================ -->
4395
4465
  <!-- figure's footnotes rendering -->
4396
- <xsl:template name="fn_display_figure">
4466
+ <!-- ============================ -->
4467
+ <xsl:template name="fn_display_figure"> <!-- figure_fn_display -->
4397
4468
 
4398
4469
  <!-- current figure id -->
4399
4470
  <xsl:variable name="figure_id_">
@@ -4506,9 +4577,28 @@
4506
4577
 
4507
4578
  </fo:block>
4508
4579
  </xsl:if>
4509
-
4510
4580
  </xsl:template> <!-- fn_display_figure -->
4511
4581
 
4582
+ <!-- added for https://github.com/metanorma/isodoc/issues/607 -->
4583
+ <!-- figure's footnote label -->
4584
+ <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'dl'][@key = 'true']/*[local-name() = 'dt']/ *[local-name() = 'p'][count(node()[normalize-space() != '']) = 1]/*[local-name() = 'sup']" priority="3">
4585
+ <xsl:variable name="key_iso">
4586
+
4587
+ </xsl:variable>
4588
+ <xsl:if test="normalize-space($key_iso) = 'true'">
4589
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
4590
+
4591
+ </xsl:if>
4592
+ <fo:inline xsl:use-attribute-sets="figure-fn-number-style"> <!-- id="{@id}" -->
4593
+ <!-- <xsl:value-of select="@reference"/> -->
4594
+ <xsl:apply-templates/>
4595
+ </fo:inline>
4596
+ </xsl:template>
4597
+
4598
+ <!-- ============================ -->
4599
+ <!-- END: figure's footnotes rendering -->
4600
+ <!-- ============================ -->
4601
+
4512
4602
  <!-- fn reference in the text rendering (for instance, 'some text 1) some text' ) -->
4513
4603
  <xsl:template match="*[local-name()='fn']">
4514
4604
  <fo:inline xsl:use-attribute-sets="fn-reference-style">
@@ -4529,6 +4619,10 @@
4529
4619
 
4530
4620
  <xsl:value-of select="@reference"/>
4531
4621
 
4622
+ <!-- commented, https://github.com/metanorma/isodoc/issues/614 -->
4623
+ <!-- <xsl:if test="$namespace = 'jis'">
4624
+ <fo:inline font-weight="normal">)</fo:inline>
4625
+ </xsl:if> -->
4532
4626
  </fo:basic-link>
4533
4627
  </fo:inline>
4534
4628
  </xsl:template>
@@ -4655,17 +4749,22 @@
4655
4749
  </fo:block>
4656
4750
  </xsl:when> <!-- END: a few components -->
4657
4751
  <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')"> <!-- definition list in a figure -->
4658
- <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
4752
+ <!-- Presentation XML contains 'Key' caption, https://github.com/metanorma/isodoc/issues/607 -->
4753
+ <xsl:if test="not(preceding-sibling::*[1][local-name() = 'p' and @keep-with-next])"> <!-- for old Presentation XML -->
4659
4754
 
4660
- <xsl:call-template name="refine_figure_key_style"/>
4755
+ <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
4661
4756
 
4662
- <xsl:variable name="title-key">
4663
- <xsl:call-template name="getLocalizedString">
4664
- <xsl:with-param name="key">key</xsl:with-param>
4665
- </xsl:call-template>
4666
- </xsl:variable>
4667
- <xsl:value-of select="$title-key"/>
4668
- </fo:block>
4757
+ <xsl:call-template name="refine_figure_key_style"/>
4758
+
4759
+ <xsl:variable name="title-key">
4760
+ <xsl:call-template name="getLocalizedString">
4761
+ <xsl:with-param name="key">key</xsl:with-param>
4762
+ </xsl:call-template>
4763
+ </xsl:variable>
4764
+ <xsl:value-of select="$title-key"/>
4765
+ </fo:block>
4766
+
4767
+ </xsl:if>
4669
4768
  </xsl:when> <!-- END: definition list in a figure -->
4670
4769
  </xsl:choose>
4671
4770
 
@@ -4851,6 +4950,14 @@
4851
4950
 
4852
4951
  </xsl:template> <!-- END: dl -->
4853
4952
 
4953
+ <!-- caption for figure key and another caption, https://github.com/metanorma/isodoc/issues/607 -->
4954
+ <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'p'][@keep-with-next = 'true' and *[local-name() = 'strong']]" priority="3">
4955
+ <fo:block text-align="left" margin-bottom="12pt" keep-with-next="always">
4956
+ <xsl:call-template name="refine_figure_key_style"/>
4957
+ <xsl:apply-templates/>
4958
+ </fo:block>
4959
+ </xsl:template>
4960
+
4854
4961
  <xsl:template name="refine_dl_formula_where_style">
4855
4962
 
4856
4963
  </xsl:template> <!-- refine_dl_formula_where_style -->
@@ -6886,6 +6993,39 @@
6886
6993
  </xsl:copy>
6887
6994
  </xsl:template>
6888
6995
 
6996
+ <xsl:template match="@*|node()" mode="mathml_linebreak">
6997
+ <xsl:copy>
6998
+ <xsl:apply-templates select="@*|node()" mode="mathml_linebreak"/>
6999
+ </xsl:copy>
7000
+ </xsl:template>
7001
+
7002
+ <!-- split math into two math -->
7003
+ <xsl:template match="mathml:mo[@linebreak] | mathml:mspace[@linebreak]" mode="mathml_linebreak">
7004
+ <xsl:variable name="math_elements_tree_">
7005
+ <xsl:for-each select="ancestor::*[ancestor-or-self::mathml:math]">
7006
+ <element pos="{position()}">
7007
+ <xsl:copy-of select="@*[local-name() != 'id']"/>
7008
+ <xsl:value-of select="name()"/>
7009
+ </element>
7010
+ </xsl:for-each>
7011
+ </xsl:variable>
7012
+
7013
+ <xsl:variable name="math_elements_tree" select="xalan:nodeset($math_elements_tree_)"/>
7014
+
7015
+ <xsl:call-template name="insertClosingElements">
7016
+ <xsl:with-param name="tree" select="$math_elements_tree"/>
7017
+ </xsl:call-template>
7018
+
7019
+ <xsl:element name="br" namespace="{$namespace_full}"/>
7020
+
7021
+ <xsl:call-template name="insertOpeningElements">
7022
+ <xsl:with-param name="tree" select="$math_elements_tree"/>
7023
+ <xsl:with-param name="xmlns">http://www.w3.org/1998/Math/MathML</xsl:with-param>
7024
+ <xsl:with-param name="add_continue">false</xsl:with-param>
7025
+ </xsl:call-template>
7026
+
7027
+ </xsl:template>
7028
+
6889
7029
  <!-- Examples:
6890
7030
  <stem type="AsciiMath">x = 1</stem>
6891
7031
  <stem type="AsciiMath"><asciimath>x = 1</asciimath></stem>
@@ -7137,9 +7277,11 @@
7137
7277
  </xsl:template>
7138
7278
 
7139
7279
  <xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']"> <!-- show in 'stem' template -->
7280
+ <!-- https://github.com/metanorma/isodoc/issues/607
7140
7281
  <xsl:if test="normalize-space() != ''">
7141
- <xsl:text>(</xsl:text><xsl:apply-templates/><xsl:text>)</xsl:text>
7142
- </xsl:if>
7282
+ <xsl:text>(</xsl:text><xsl:apply-templates /><xsl:text>)</xsl:text>
7283
+ </xsl:if> -->
7284
+ <xsl:apply-templates/>
7143
7285
  </xsl:template>
7144
7286
 
7145
7287
  <!-- stem inside formula with name (with formula's number) -->
@@ -7210,6 +7352,8 @@
7210
7352
 
7211
7353
  <fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
7212
7354
 
7355
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'tab']" mode="tab"/>
7356
+
7213
7357
  <xsl:call-template name="refine_note-name-style"/>
7214
7358
 
7215
7359
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
@@ -7266,10 +7410,6 @@
7266
7410
 
7267
7411
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
7268
7412
 
7269
- <xsl:if test="not(*[local-name() = 'name']/following-sibling::node()[1][self::text()][normalize-space()=''])">
7270
- <xsl:attribute name="padding-right">1mm</xsl:attribute>
7271
- </xsl:if>
7272
-
7273
7413
  <xsl:call-template name="refine_termnote-name-style"/>
7274
7414
 
7275
7415
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
@@ -7295,6 +7435,17 @@
7295
7435
  </xsl:when>
7296
7436
  <xsl:otherwise>
7297
7437
 
7438
+ <!-- https://github.com/metanorma/isodoc/issues/607 -->
7439
+ <!-- <xsl:if test="$namespace = 'ieee'">
7440
+ <xsl:text>—</xsl:text> em dash &#x2014;
7441
+ </xsl:if> -->
7442
+ <!-- <xsl:if test="$namespace = 'iho' or $namespace = 'gb' or $namespace = 'm3d' or $namespace = 'unece-rec' or $namespace = 'unece' or $namespace = 'rsd'">
7443
+ <xsl:text>:</xsl:text>
7444
+ </xsl:if> -->
7445
+
7446
+ <!-- <xsl:if test="$namespace = 'itu' or $namespace = 'nist-cswp' or $namespace = 'nist-sp'">
7447
+ <xsl:text> – </xsl:text> en dash &#x2013;
7448
+ </xsl:if> -->
7298
7449
  </xsl:otherwise>
7299
7450
  </xsl:choose>
7300
7451
  </xsl:variable>
@@ -7313,8 +7464,16 @@
7313
7464
  </xsl:when>
7314
7465
  <xsl:otherwise>
7315
7466
 
7467
+ <!-- https://github.com/metanorma/isodoc/issues/607 -->
7468
+ <!-- <xsl:if test="$namespace = 'ieee'">
7469
+ <xsl:text>—</xsl:text> em dash &#x2014;
7470
+ </xsl:if> -->
7471
+ <!-- <xsl:if test="$namespace = 'gb' or $namespace = 'iso' or $namespace = 'iec' or $namespace = 'ogc' or $namespace = 'ogc-white-paper' or $namespace = 'rsd' or $namespace = 'jcgm'">
7316
7472
  <xsl:text>:</xsl:text>
7317
-
7473
+ </xsl:if> -->
7474
+ <!-- <xsl:if test="$namespace = 'itu' or $namespace = 'nist-cswp' or $namespace = 'nist-sp' or $namespace = 'unece-rec' or $namespace = 'unece'">
7475
+ <xsl:text> – </xsl:text> en dash &#x2013;
7476
+ </xsl:if> -->
7318
7477
  </xsl:otherwise>
7319
7478
  </xsl:choose>
7320
7479
  </xsl:variable>
@@ -7397,17 +7556,29 @@
7397
7556
  <!-- Example: Dimensions in millimeters -->
7398
7557
  <xsl:apply-templates select="*[local-name() = 'note'][@type = 'units']"/>
7399
7558
 
7559
+ <xsl:variable name="show_figure_key_in_block_container">
7560
+ true
7561
+ </xsl:variable>
7562
+
7400
7563
  <fo:block xsl:use-attribute-sets="figure-style" role="SKIP">
7401
7564
  <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note' and @type = 'units')]"/>
7402
7565
  </fo:block>
7403
- <xsl:for-each select="*[local-name() = 'note'][not(@type = 'units')]">
7404
- <xsl:call-template name="note"/>
7405
- </xsl:for-each>
7406
- <xsl:call-template name="fn_display_figure"/>
7566
+
7567
+ <xsl:if test="normalize-space($show_figure_key_in_block_container) = 'true'">
7568
+ <xsl:call-template name="showFigureKey"/>
7569
+ </xsl:if>
7407
7570
 
7408
7571
  <xsl:apply-templates select="*[local-name() = 'name']"/> <!-- show figure's name AFTER image -->
7409
7572
 
7410
7573
  </fo:block-container>
7574
+
7575
+ </xsl:template>
7576
+
7577
+ <xsl:template name="showFigureKey">
7578
+ <xsl:for-each select="*[local-name() = 'note'][not(@type = 'units')]">
7579
+ <xsl:call-template name="note"/>
7580
+ </xsl:for-each>
7581
+ <xsl:call-template name="fn_display_figure"/>
7411
7582
  </xsl:template>
7412
7583
 
7413
7584
  <xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
@@ -7603,6 +7774,22 @@
7603
7774
  </xsl:if>
7604
7775
  </xsl:template>
7605
7776
 
7777
+ <xsl:template name="getImageSrc">
7778
+ <xsl:choose>
7779
+ <xsl:when test="not(starts-with(@src, 'data:'))">
7780
+ <xsl:choose>
7781
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
7782
+ <xsl:value-of select="@src"/>
7783
+ </xsl:when>
7784
+ <xsl:otherwise>
7785
+ <xsl:value-of select="concat($basepath, @src)"/>
7786
+ </xsl:otherwise>
7787
+ </xsl:choose>
7788
+ </xsl:when>
7789
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
7790
+ </xsl:choose>
7791
+ </xsl:template>
7792
+
7606
7793
  <xsl:template name="getImageScale">
7607
7794
  <xsl:param name="indent"/>
7608
7795
  <xsl:variable name="indent_left">
@@ -7612,19 +7799,7 @@
7612
7799
  </xsl:choose>
7613
7800
  </xsl:variable>
7614
7801
  <xsl:variable name="img_src">
7615
- <xsl:choose>
7616
- <xsl:when test="not(starts-with(@src, 'data:'))">
7617
- <xsl:choose>
7618
- <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
7619
- <xsl:value-of select="@src"/>
7620
- </xsl:when>
7621
- <xsl:otherwise>
7622
- <xsl:value-of select="concat($basepath, @src)"/>
7623
- </xsl:otherwise>
7624
- </xsl:choose>
7625
- </xsl:when>
7626
- <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
7627
- </xsl:choose>
7802
+ <xsl:call-template name="getImageSrc"/>
7628
7803
  </xsl:variable>
7629
7804
 
7630
7805
  <xsl:variable name="image_width_effective">
@@ -7632,10 +7807,15 @@
7632
7807
  <xsl:value-of select="$width_effective - number($indent_left)"/>
7633
7808
 
7634
7809
  </xsl:variable>
7810
+ <xsl:variable name="image_height_effective" select="$height_effective - number($indent_left)"/>
7635
7811
  <!-- <xsl:message>width_effective=<xsl:value-of select="$width_effective"/></xsl:message>
7636
7812
  <xsl:message>indent_left=<xsl:value-of select="$indent_left"/></xsl:message>
7637
7813
  <xsl:message>image_width_effective=<xsl:value-of select="$image_width_effective"/> for <xsl:value-of select="ancestor::ogc:p[1]/@id"/></xsl:message> -->
7638
- <xsl:variable name="scale" select="java:org.metanorma.fop.utils.ImageUtils.getImageScale($img_src, $image_width_effective, $height_effective)"/>
7814
+ <xsl:variable name="scale">
7815
+
7816
+ <xsl:value-of select="java:org.metanorma.fop.utils.ImageUtils.getImageScale($img_src, $image_width_effective, $height_effective)"/>
7817
+
7818
+ </xsl:variable>
7639
7819
  <xsl:value-of select="$scale"/>
7640
7820
  </xsl:template>
7641
7821
 
@@ -8188,20 +8368,48 @@
8188
8368
  <xsl:template match="*[local-name() = 'emf']"/>
8189
8369
 
8190
8370
  <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
8371
+ <xsl:if test="not(following-sibling::*[1][local-name() = 'fmt-name'])">
8372
+ <xsl:apply-templates mode="contents"/>
8373
+ <xsl:text> </xsl:text>
8374
+ </xsl:if>
8375
+ </xsl:template>
8376
+
8377
+ <xsl:template match="*[local-name() = 'title'][following-sibling::*[1][local-name() = 'fmt-title']]" mode="contents"/>
8378
+
8379
+ <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fmt-name'] | *[local-name() = 'table']/*[local-name() = 'fmt-name'] | *[local-name() = 'permission']/*[local-name() = 'fmt-name'] | *[local-name() = 'recommendation']/*[local-name() = 'fmt-name'] | *[local-name() = 'requirement']/*[local-name() = 'fmt-name']" mode="contents">
8191
8380
  <xsl:apply-templates mode="contents"/>
8192
8381
  <xsl:text> </xsl:text>
8193
8382
  </xsl:template>
8194
8383
 
8195
8384
  <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name'] | *[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="bookmarks">
8385
+ <xsl:if test="not(following-sibling::*[1][local-name() = 'fmt-name'])">
8386
+ <xsl:apply-templates mode="bookmarks"/>
8387
+ <xsl:text> </xsl:text>
8388
+ </xsl:if>
8389
+ </xsl:template>
8390
+
8391
+ <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fmt-name'] | *[local-name() = 'table']/*[local-name() = 'fmt-name'] | *[local-name() = 'permission']/*[local-name() = 'fmt-name'] | *[local-name() = 'recommendation']/*[local-name() = 'fmt-name'] | *[local-name() = 'requirement']/*[local-name() = 'fmt-name'] | *[local-name() = 'sourcecode']/*[local-name() = 'fmt-name']" mode="bookmarks">
8196
8392
  <xsl:apply-templates mode="bookmarks"/>
8197
8393
  <xsl:text> </xsl:text>
8198
8394
  </xsl:template>
8199
8395
 
8200
8396
  <xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']/text()" mode="contents" priority="2">
8397
+ <xsl:if test="not(../following-sibling::*[1][local-name() = 'fmt-name'])">
8398
+ <xsl:value-of select="."/>
8399
+ </xsl:if>
8400
+ </xsl:template>
8401
+
8402
+ <xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'fmt-name']/text()" mode="contents" priority="2">
8201
8403
  <xsl:value-of select="."/>
8202
8404
  </xsl:template>
8203
8405
 
8204
8406
  <xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement' or local-name() = 'sourcecode']/*[local-name() = 'name']//text()" mode="bookmarks" priority="2">
8407
+ <xsl:if test="not(../following-sibling::*[1][local-name() = 'fmt-name'])">
8408
+ <xsl:value-of select="."/>
8409
+ </xsl:if>
8410
+ </xsl:template>
8411
+
8412
+ <xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement' or local-name() = 'sourcecode']/*[local-name() = 'fmt-name']//text()" mode="bookmarks" priority="2">
8205
8413
  <xsl:value-of select="."/>
8206
8414
  </xsl:template>
8207
8415
 
@@ -8222,7 +8430,7 @@
8222
8430
  </xsl:template>
8223
8431
 
8224
8432
  <!-- special case: ignore section-title if @depth different than @depth of parent clause, or @depth of parent clause = 1 -->
8225
- <xsl:template match="*[local-name() = 'clause']/*[local-name() = 'p'][@type = 'section-title' and (@depth != ../*[local-name() = 'title']/@depth or ../*[local-name() = 'title']/@depth = 1)]" priority="3" mode="contents"/>
8433
+ <xsl:template match="*[local-name() = 'clause']/*[local-name() = 'p'][@type = 'section-title' and (@depth != ../*[local-name() = 'title' or local-name() = 'fmt-title']/@depth or ../*[local-name() = 'title' or local-name() = 'fmt-title']/@depth = 1)]" priority="3" mode="contents"/>
8226
8434
 
8227
8435
  <xsl:template match="*[local-name() = 'p'][@type = 'floating-title' or @type = 'section-title']" priority="2" name="contents_section-title" mode="contents">
8228
8436
  <xsl:variable name="level">
@@ -8234,6 +8442,9 @@
8234
8442
  <xsl:variable name="section">
8235
8443
  <xsl:choose>
8236
8444
  <xsl:when test="@type = 'section-title'"/>
8445
+ <xsl:when test="*[local-name() = 'span'][@class = 'fmt-caption-delim']">
8446
+ <xsl:value-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/preceding-sibling::node()"/>
8447
+ </xsl:when>
8237
8448
  <xsl:otherwise>
8238
8449
  <xsl:value-of select="*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
8239
8450
  </xsl:otherwise>
@@ -8256,6 +8467,19 @@
8256
8467
 
8257
8468
  <xsl:variable name="title">
8258
8469
  <xsl:choose>
8470
+ <!-- https://github.com/metanorma/mn-native-pdf/issues/770 -->
8471
+ <xsl:when test="*[local-name() = 'span'][@class = 'fmt-caption-delim']">
8472
+ <xsl:choose>
8473
+ <xsl:when test="@type = 'section-title'">
8474
+ <xsl:value-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/preceding-sibling::node()"/>
8475
+ <xsl:text>: </xsl:text>
8476
+ <xsl:copy-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/following-sibling::node()[not(local-name = 'fmt-xref-label')]"/>
8477
+ </xsl:when>
8478
+ <xsl:otherwise>
8479
+ <xsl:copy-of select="*[local-name() = 'span'][@class = 'fmt-caption-delim'][1]/following-sibling::node()[not(local-name = 'fmt-xref-label')]"/>
8480
+ </xsl:otherwise>
8481
+ </xsl:choose>
8482
+ </xsl:when>
8259
8483
  <xsl:when test="*[local-name() = 'tab']">
8260
8484
  <xsl:choose>
8261
8485
  <xsl:when test="@type = 'section-title'">
@@ -8291,7 +8515,7 @@
8291
8515
  <xsl:apply-templates mode="bookmarks"/>
8292
8516
  </xsl:template>
8293
8517
 
8294
- <xsl:template match="*[local-name() = 'title' or local-name() = 'name']//*[local-name() = 'stem']" mode="contents">
8518
+ <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">
8295
8519
  <xsl:apply-templates select="."/>
8296
8520
  </xsl:template>
8297
8521
 
@@ -8304,6 +8528,10 @@
8304
8528
  <xsl:apply-templates mode="contents"/>
8305
8529
  </xsl:template>
8306
8530
 
8531
+ <xsl:template match="*[local-name() = 'semx']" mode="contents">
8532
+ <xsl:apply-templates mode="contents"/>
8533
+ </xsl:template>
8534
+
8307
8535
  <xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
8308
8536
  <xsl:apply-templates mode="bookmarks"/>
8309
8537
  </xsl:template>
@@ -8313,9 +8541,14 @@
8313
8541
  <xsl:apply-templates mode="bookmarks"/>
8314
8542
  </xsl:template>
8315
8543
 
8544
+ <xsl:template match="*[local-name() = 'semx']" mode="bookmarks">
8545
+ <xsl:apply-templates mode="bookmarks"/>
8546
+ </xsl:template>
8547
+
8316
8548
  <!-- Bookmarks -->
8317
8549
  <xsl:template name="addBookmarks">
8318
8550
  <xsl:param name="contents"/>
8551
+ <xsl:param name="contents_addon"/>
8319
8552
  <xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
8320
8553
  <xsl:if test="$contents_nodes//item">
8321
8554
  <fo:bookmark-tree>
@@ -8413,34 +8646,8 @@
8413
8646
  </xsl:otherwise>
8414
8647
  </xsl:choose>
8415
8648
 
8416
- <xsl:variable name="list_of_tables_figures_">
8417
- <xsl:for-each select="//*[local-name() = 'table'][@id and *[local-name() = 'name']] | //*[local-name() = 'figure'][@id and *[local-name() = 'name']]">
8418
- <table_figure id="{@id}"><xsl:apply-templates select="*[local-name() = 'name']" mode="bookmarks"/></table_figure>
8419
- </xsl:for-each>
8420
- </xsl:variable>
8421
- <xsl:variable name="list_of_tables_figures" select="xalan:nodeset($list_of_tables_figures_)"/>
8422
-
8423
- <xsl:if test="$list_of_tables_figures/table_figure">
8424
- <fo:bookmark internal-destination="empty_bookmark">
8425
- <fo:bookmark-title>—————</fo:bookmark-title>
8426
- </fo:bookmark>
8427
- </xsl:if>
8428
-
8429
- <xsl:if test="$list_of_tables_figures//table_figure">
8430
- <fo:bookmark internal-destination="empty_bookmark" starting-state="hide">
8431
- <fo:bookmark-title>
8432
- <xsl:call-template name="getLocalizedString">
8433
- <xsl:with-param name="key">table_of_figures</xsl:with-param>
8434
- </xsl:call-template>
8435
- </fo:bookmark-title>
8436
- <xsl:for-each select="$list_of_tables_figures//table_figure">
8437
- <fo:bookmark internal-destination="{@id}">
8438
- <fo:bookmark-title><xsl:value-of select="."/></fo:bookmark-title>
8439
- </fo:bookmark>
8440
- </xsl:for-each>
8441
- </fo:bookmark>
8442
- </xsl:if>
8443
- <!-- $namespace = 'ogc-white-paper' -->
8649
+ <!-- for $namespace = 'nist-sp' $namespace = 'ogc' $namespace = 'ogc-white-paper' -->
8650
+ <xsl:copy-of select="$contents_addon"/>
8444
8651
 
8445
8652
  </fo:bookmark-tree>
8446
8653
  </xsl:if>
@@ -8561,6 +8768,16 @@
8561
8768
  <!-- ====== -->
8562
8769
  <!-- ====== -->
8563
8770
  <xsl:template match="*[local-name() = 'title']" mode="contents_item">
8771
+ <xsl:param name="mode">bookmarks</xsl:param>
8772
+ <xsl:if test="not(following-sibling::*[1][local-name() = 'fmt-title'])">
8773
+ <xsl:apply-templates mode="contents_item">
8774
+ <xsl:with-param name="mode" select="$mode"/>
8775
+ </xsl:apply-templates>
8776
+ <!-- <xsl:text> </xsl:text> -->
8777
+ </xsl:if>
8778
+ </xsl:template>
8779
+
8780
+ <xsl:template match="*[local-name() = 'fmt-title']" mode="contents_item">
8564
8781
  <xsl:param name="mode">bookmarks</xsl:param>
8565
8782
  <xsl:apply-templates mode="contents_item">
8566
8783
  <xsl:with-param name="mode" select="$mode"/>
@@ -8568,12 +8785,38 @@
8568
8785
  <!-- <xsl:text> </xsl:text> -->
8569
8786
  </xsl:template>
8570
8787
 
8788
+ <xsl:template match="*[local-name() = 'span'][ @class = 'fmt-caption-label' or @class = 'fmt-element-name' or @class = 'fmt-caption-delim']" mode="contents_item" priority="3">
8789
+ <xsl:apply-templates mode="contents_item"/>
8790
+ </xsl:template>
8791
+
8792
+ <xsl:template match="*[local-name() = 'semx']" mode="contents_item">
8793
+ <xsl:apply-templates mode="contents_item"/>
8794
+ </xsl:template>
8795
+
8796
+ <xsl:template match="*[local-name() = 'fmt-xref-label']" mode="contents_item"/>
8797
+
8571
8798
  <xsl:template name="getSection">
8572
- <xsl:value-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
8799
+ <xsl:choose>
8800
+ <xsl:when test="*[local-name() = 'fmt-title']">
8801
+ <xsl:variable name="fmt_title_section">
8802
+ <xsl:copy-of select="*[local-name() = 'fmt-title']//*[local-name() = 'span'][@class = 'fmt-caption-delim'][*[local-name() = 'tab']][1]/preceding-sibling::node()[not(local-name() = 'review')]"/>
8803
+ </xsl:variable>
8804
+ <xsl:value-of select="normalize-space($fmt_title_section)"/>
8805
+ </xsl:when>
8806
+ <xsl:otherwise>
8807
+ <xsl:value-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
8808
+ </xsl:otherwise>
8809
+ </xsl:choose>
8573
8810
  </xsl:template>
8574
8811
 
8575
8812
  <xsl:template name="getName">
8576
8813
  <xsl:choose>
8814
+ <xsl:when test="*[local-name() = 'fmt-title']//*[local-name() = 'span'][@class = 'fmt-caption-delim'][*[local-name() = 'tab']]">
8815
+ <xsl:copy-of select="*[local-name() = 'fmt-title']//*[local-name() = 'span'][@class = 'fmt-caption-delim'][*[local-name() = 'tab']][1]/following-sibling::node()"/>
8816
+ </xsl:when>
8817
+ <xsl:when test="*[local-name() = 'fmt-title']">
8818
+ <xsl:copy-of select="*[local-name() = 'fmt-title']/node()"/>
8819
+ </xsl:when>
8577
8820
  <xsl:when test="*[local-name() = 'title']/*[local-name() = 'tab']">
8578
8821
  <xsl:copy-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/following-sibling::node()"/>
8579
8822
  </xsl:when>
@@ -8680,6 +8923,15 @@
8680
8923
  </xsl:template>
8681
8924
 
8682
8925
  <xsl:template match="*[local-name() = 'name']" mode="contents_item">
8926
+ <xsl:param name="mode">bookmarks</xsl:param>
8927
+ <xsl:if test="not(following-sibling::*[1][local-name() = 'fmt-name'])">
8928
+ <xsl:apply-templates mode="contents_item">
8929
+ <xsl:with-param name="mode" select="$mode"/>
8930
+ </xsl:apply-templates>
8931
+ </xsl:if>
8932
+ </xsl:template>
8933
+
8934
+ <xsl:template match="*[local-name() = 'fmt-name']" mode="contents_item">
8683
8935
  <xsl:param name="mode">bookmarks</xsl:param>
8684
8936
  <xsl:apply-templates mode="contents_item">
8685
8937
  <xsl:with-param name="mode" select="$mode"/>
@@ -9502,7 +9754,7 @@
9502
9754
  <xsl:if test="normalize-space() != ''">
9503
9755
  <fo:inline xsl:use-attribute-sets="termexample-name-style">
9504
9756
  <xsl:call-template name="refine_termexample-name-style"/>
9505
- <xsl:apply-templates/>
9757
+ <xsl:apply-templates/> <!-- commented $namespace = 'ieee', https://github.com/metanorma/isodoc/issues/614-->
9506
9758
  </fo:inline>
9507
9759
  </xsl:if>
9508
9760
  </xsl:template>
@@ -9543,107 +9795,108 @@
9543
9795
  -->
9544
9796
  <xsl:template match="*[local-name() = 'example']">
9545
9797
 
9546
- <fo:block-container id="{@id}" xsl:use-attribute-sets="example-style" role="SKIP">
9547
-
9548
- <xsl:call-template name="setBlockSpanAll"/>
9798
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="example-style" role="SKIP">
9549
9799
 
9550
- <xsl:call-template name="refine_example-style"/>
9800
+ <xsl:call-template name="setBlockSpanAll"/>
9551
9801
 
9552
- <xsl:variable name="fo_element">
9553
- <xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl'] or *[not(local-name() = 'name')][1][local-name() = 'sourcecode']">block</xsl:if>
9554
- block
9555
- </xsl:variable>
9802
+ <xsl:call-template name="refine_example-style"/>
9556
9803
 
9557
- <fo:block-container margin-left="0mm" role="SKIP">
9804
+ <xsl:variable name="fo_element">
9805
+ <xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl'] or *[not(local-name() = 'name')][1][local-name() = 'sourcecode']">block</xsl:if>
9806
+ block
9807
+ </xsl:variable>
9558
9808
 
9559
- <xsl:choose>
9809
+ <fo:block-container margin-left="0mm" role="SKIP">
9560
9810
 
9561
- <xsl:when test="contains(normalize-space($fo_element), 'block')">
9811
+ <xsl:choose>
9562
9812
 
9563
- <!-- display name 'EXAMPLE' in a separate block -->
9564
- <fo:block>
9565
- <xsl:apply-templates select="*[local-name()='name']">
9566
- <xsl:with-param name="fo_element" select="$fo_element"/>
9567
- </xsl:apply-templates>
9568
- </fo:block>
9813
+ <xsl:when test="contains(normalize-space($fo_element), 'block')">
9569
9814
 
9570
- <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
9571
- <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
9572
- <xsl:variable name="example_body">
9573
- <xsl:apply-templates select="node()[not(local-name() = 'name')]">
9815
+ <!-- display name 'EXAMPLE' in a separate block -->
9816
+ <fo:block>
9817
+ <xsl:apply-templates select="*[local-name()='name']">
9574
9818
  <xsl:with-param name="fo_element" select="$fo_element"/>
9575
9819
  </xsl:apply-templates>
9576
- </xsl:variable>
9577
- <xsl:choose>
9578
- <xsl:when test="xalan:nodeset($example_body)/*">
9579
- <xsl:copy-of select="$example_body"/>
9580
- </xsl:when>
9581
- <xsl:otherwise><fo:block/><!-- prevent empty block-container --></xsl:otherwise>
9582
- </xsl:choose>
9583
- </fo:block-container>
9584
- </fo:block-container>
9585
- </xsl:when> <!-- end block -->
9820
+ </fo:block>
9586
9821
 
9587
- <xsl:when test="contains(normalize-space($fo_element), 'list')">
9822
+ <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
9823
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
9824
+ <xsl:variable name="example_body">
9825
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]">
9826
+ <xsl:with-param name="fo_element" select="$fo_element"/>
9827
+ </xsl:apply-templates>
9828
+ </xsl:variable>
9829
+ <xsl:choose>
9830
+ <xsl:when test="xalan:nodeset($example_body)/*">
9831
+ <xsl:copy-of select="$example_body"/>
9832
+ </xsl:when>
9833
+ <xsl:otherwise><fo:block/><!-- prevent empty block-container --></xsl:otherwise>
9834
+ </xsl:choose>
9835
+ </fo:block-container>
9836
+ </fo:block-container>
9837
+ </xsl:when> <!-- end block -->
9588
9838
 
9589
- <xsl:variable name="provisional_distance_between_starts_">
9590
- 7
9591
- </xsl:variable>
9592
- <xsl:variable name="provisional_distance_between_starts" select="normalize-space($provisional_distance_between_starts_)"/>
9593
- <xsl:variable name="indent_">
9594
- 0
9595
- </xsl:variable>
9596
- <xsl:variable name="indent" select="normalize-space($indent_)"/>
9839
+ <xsl:when test="contains(normalize-space($fo_element), 'list')">
9597
9840
 
9598
- <fo:list-block provisional-distance-between-starts="{$provisional_distance_between_starts}mm">
9599
- <fo:list-item>
9600
- <fo:list-item-label start-indent="{$indent}mm" end-indent="label-end()">
9601
- <fo:block>
9602
- <xsl:apply-templates select="*[local-name()='name']">
9603
- <xsl:with-param name="fo_element">block</xsl:with-param>
9604
- </xsl:apply-templates>
9605
- </fo:block>
9606
- </fo:list-item-label>
9607
- <fo:list-item-body start-indent="body-start()">
9608
- <fo:block>
9609
- <xsl:apply-templates select="node()[not(local-name() = 'name')]">
9841
+ <xsl:variable name="provisional_distance_between_starts_">
9842
+ 7
9843
+ </xsl:variable>
9844
+ <xsl:variable name="provisional_distance_between_starts" select="normalize-space($provisional_distance_between_starts_)"/>
9845
+ <xsl:variable name="indent_">
9846
+ 0
9847
+ </xsl:variable>
9848
+ <xsl:variable name="indent" select="normalize-space($indent_)"/>
9849
+
9850
+ <fo:list-block provisional-distance-between-starts="{$provisional_distance_between_starts}mm">
9851
+ <fo:list-item>
9852
+ <fo:list-item-label start-indent="{$indent}mm" end-indent="label-end()">
9853
+ <fo:block>
9854
+ <xsl:apply-templates select="*[local-name()='name']">
9855
+ <xsl:with-param name="fo_element">block</xsl:with-param>
9856
+ </xsl:apply-templates>
9857
+ </fo:block>
9858
+ </fo:list-item-label>
9859
+ <fo:list-item-body start-indent="body-start()">
9860
+ <fo:block>
9861
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]">
9862
+ <xsl:with-param name="fo_element" select="$fo_element"/>
9863
+ </xsl:apply-templates>
9864
+ </fo:block>
9865
+ </fo:list-item-body>
9866
+ </fo:list-item>
9867
+ </fo:list-block>
9868
+ </xsl:when> <!-- end list -->
9869
+
9870
+ <xsl:otherwise> <!-- inline -->
9871
+
9872
+ <!-- display 'EXAMPLE' and first element in the same line -->
9873
+ <fo:block>
9874
+ <xsl:apply-templates select="*[local-name()='name']">
9875
+ <xsl:with-param name="fo_element" select="$fo_element"/>
9876
+ </xsl:apply-templates>
9877
+ <fo:inline>
9878
+ <xsl:apply-templates select="*[not(local-name() = 'name')][1]">
9610
9879
  <xsl:with-param name="fo_element" select="$fo_element"/>
9611
9880
  </xsl:apply-templates>
9612
- </fo:block>
9613
- </fo:list-item-body>
9614
- </fo:list-item>
9615
- </fo:list-block>
9616
- </xsl:when> <!-- end list -->
9617
-
9618
- <xsl:otherwise> <!-- inline -->
9881
+ </fo:inline>
9882
+ </fo:block>
9619
9883
 
9620
- <!-- display 'EXAMPLE' and first element in the same line -->
9621
- <fo:block>
9622
- <xsl:apply-templates select="*[local-name()='name']">
9623
- <xsl:with-param name="fo_element" select="$fo_element"/>
9624
- </xsl:apply-templates>
9625
- <fo:inline>
9626
- <xsl:apply-templates select="*[not(local-name() = 'name')][1]">
9627
- <xsl:with-param name="fo_element" select="$fo_element"/>
9628
- </xsl:apply-templates>
9629
- </fo:inline>
9630
- </fo:block>
9884
+ <xsl:if test="*[not(local-name() = 'name')][position() &gt; 1]">
9885
+ <!-- display further elements in blocks -->
9886
+ <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
9887
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
9888
+ <xsl:apply-templates select="*[not(local-name() = 'name')][position() &gt; 1]">
9889
+ <xsl:with-param name="fo_element" select="'block'"/>
9890
+ </xsl:apply-templates>
9891
+ </fo:block-container>
9892
+ </fo:block-container>
9893
+ </xsl:if>
9894
+ </xsl:otherwise> <!-- end inline -->
9631
9895
 
9632
- <xsl:if test="*[not(local-name() = 'name')][position() &gt; 1]">
9633
- <!-- display further elements in blocks -->
9634
- <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
9635
- <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
9636
- <xsl:apply-templates select="*[not(local-name() = 'name')][position() &gt; 1]">
9637
- <xsl:with-param name="fo_element" select="'block'"/>
9638
- </xsl:apply-templates>
9639
- </fo:block-container>
9640
- </fo:block-container>
9641
- </xsl:if>
9642
- </xsl:otherwise> <!-- end inline -->
9896
+ </xsl:choose>
9897
+ </fo:block-container>
9898
+ </fo:block-container>
9643
9899
 
9644
- </xsl:choose>
9645
- </fo:block-container>
9646
- </fo:block-container>
9647
9900
  </xsl:template>
9648
9901
 
9649
9902
  <xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']">
@@ -9664,7 +9917,7 @@
9664
9917
  <xsl:otherwise>
9665
9918
  <fo:inline xsl:use-attribute-sets="example-name-style">
9666
9919
  <xsl:call-template name="refine_example-name-style"/>
9667
- <xsl:apply-templates/>
9920
+ <xsl:apply-templates/> <!-- $namespace = 'ieee', see https://github.com/metanorma/isodoc/issues/614 -->
9668
9921
  </fo:inline>
9669
9922
  </xsl:otherwise>
9670
9923
  </xsl:choose>
@@ -9846,15 +10099,17 @@
9846
10099
 
9847
10100
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
9848
10101
  <fo:block role="BlockQuote">
9849
- <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
10102
+ <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source') and not(local-name() = 'attribution')]"/> <!-- process all nested nodes, except author and source -->
9850
10103
  </fo:block>
9851
10104
  </fo:block-container>
9852
10105
  </fo:block-container>
9853
- <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
10106
+ <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source'] or *[local-name() = 'attribution']">
9854
10107
  <fo:block xsl:use-attribute-sets="quote-source-style">
9855
10108
  <!-- — ISO, ISO 7301:2011, Clause 1 -->
9856
10109
  <xsl:apply-templates select="*[local-name() = 'author']"/>
9857
10110
  <xsl:apply-templates select="*[local-name() = 'source']"/>
10111
+ <!-- added for https://github.com/metanorma/isodoc/issues/607 -->
10112
+ <xsl:apply-templates select="*[local-name() = 'attribution']/*[local-name() = 'p']/node()"/>
9858
10113
  </fo:block>
9859
10114
  </xsl:if>
9860
10115
 
@@ -9876,9 +10131,13 @@
9876
10131
  </xsl:template>
9877
10132
 
9878
10133
  <xsl:template match="*[local-name() = 'author']">
9879
- <xsl:text>— </xsl:text>
10134
+ <xsl:if test="local-name(..) = 'quote'"> <!-- for old Presentation XML, https://github.com/metanorma/isodoc/issues/607 -->
10135
+ <xsl:text>— </xsl:text>
10136
+ </xsl:if>
9880
10137
  <xsl:apply-templates/>
9881
10138
  </xsl:template>
10139
+
10140
+ <xsl:template match="*[local-name() = 'quote']//*[local-name() = 'referenceFrom']"/>
9882
10141
  <!-- ====== -->
9883
10142
  <!-- ====== -->
9884
10143
 
@@ -10025,6 +10284,13 @@
10025
10284
 
10026
10285
  </xsl:template> <!-- tab -->
10027
10286
 
10287
+ <xsl:template match="*[local-name() = 'note']/*[local-name() = 'name']/*[local-name() = 'tab']" priority="2"/>
10288
+ <xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'name']/*[local-name() = 'tab']" priority="2"/>
10289
+
10290
+ <xsl:template match="*[local-name() = 'note']/*[local-name() = 'name']/*[local-name() = 'tab']" mode="tab">
10291
+
10292
+ </xsl:template>
10293
+
10028
10294
  <xsl:template name="insertNonBreakSpaces">
10029
10295
  <xsl:param name="count"/>
10030
10296
  <xsl:if test="$count &gt; 0">
@@ -10069,8 +10335,12 @@
10069
10335
  </xsl:template>
10070
10336
 
10071
10337
  <xsl:template match="*[local-name() = 'domain']">
10338
+ <!-- https://github.com/metanorma/isodoc/issues/607
10072
10339
  <fo:inline xsl:use-attribute-sets="domain-style">&lt;<xsl:apply-templates/>&gt;</fo:inline>
10073
- <xsl:text> </xsl:text>
10340
+ <xsl:text> </xsl:text> -->
10341
+ <xsl:if test="not(@hidden = 'true')">
10342
+ <xsl:apply-templates/>
10343
+ </xsl:if>
10074
10344
  </xsl:template>
10075
10345
 
10076
10346
  <xsl:template match="*[local-name() = 'admitted']">
@@ -10118,6 +10388,29 @@
10118
10388
  <!-- END definition -->
10119
10389
  <!-- ========== -->
10120
10390
 
10391
+ <xsl:variable name="reviews_">
10392
+ <xsl:for-each select="//*[local-name() = 'review'][@from]">
10393
+ <xsl:copy>
10394
+ <xsl:copy-of select="@from"/>
10395
+ <xsl:copy-of select="@id"/>
10396
+ </xsl:copy>
10397
+ </xsl:for-each>
10398
+ </xsl:variable>
10399
+ <xsl:variable name="reviews" select="xalan:nodeset($reviews_)"/>
10400
+
10401
+ <xsl:template name="addReviewHelper">
10402
+ <!-- if there is review with from="...", then add small helper block for Annot tag adding, see 'review' template -->
10403
+ <xsl:variable name="curr_id" select="@id"/>
10404
+ <xsl:variable name="review_id" select="normalize-space($reviews//*[local-name() = 'review'][@from = $curr_id]/@id)"/>
10405
+ <xsl:if test="$review_id != ''"> <!-- i.e. if review found -->
10406
+ <fo:block keep-with-next="always" line-height="0.1" id="{$review_id}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{$review_id}" fox:alt-text="Annot___{$review_id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
10407
+ </xsl:if>
10408
+ <!-- <fo:block>
10409
+ <curr_id><xsl:value-of select="$curr_id"/></curr_id>
10410
+ <xsl:copy-of select="$reviews"/>
10411
+ </fo:block> -->
10412
+ </xsl:template>
10413
+
10121
10414
  <!-- main sections -->
10122
10415
  <xsl:template match="/*/*[local-name() = 'sections']/*" name="sections_node" priority="2">
10123
10416
 
@@ -10126,6 +10419,8 @@
10126
10419
 
10127
10420
  <xsl:call-template name="sections_element_style"/>
10128
10421
 
10422
+ <xsl:call-template name="addReviewHelper"/>
10423
+
10129
10424
  <xsl:apply-templates/>
10130
10425
  </fo:block>
10131
10426
 
@@ -10166,6 +10461,7 @@
10166
10461
 
10167
10462
  <fo:block>
10168
10463
  <xsl:call-template name="setId"/>
10464
+ <xsl:call-template name="addReviewHelper"/>
10169
10465
  <xsl:apply-templates/>
10170
10466
  </fo:block>
10171
10467
  </xsl:template>
@@ -10202,6 +10498,8 @@
10202
10498
 
10203
10499
  <xsl:call-template name="refine_clause_style"/>
10204
10500
 
10501
+ <xsl:call-template name="addReviewHelper"/>
10502
+
10205
10503
  <xsl:apply-templates/>
10206
10504
  </fo:block>
10207
10505
  </xsl:template>
@@ -10254,6 +10552,23 @@
10254
10552
 
10255
10553
  <xsl:variable name="id_from" select="normalize-space(current()/@from)"/>
10256
10554
 
10555
+ <xsl:if test="1 = 1">
10556
+ <xsl:choose>
10557
+ <!-- if there isn't the attribute '@from', then -->
10558
+ <xsl:when test="$id_from = ''">
10559
+ <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>
10560
+ </xsl:when>
10561
+ <!-- if there isn't element with id 'from', then create 'bookmark' here -->
10562
+ <xsl:when test="ancestor::*[contains(local-name(), '-standard')] and not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
10563
+ <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>
10564
+ </xsl:when>
10565
+ <xsl:when test="not(/*[@id = $id_from]) and not(/*//*[@id = $id_from]) and not(preceding-sibling::*[@id = $id_from])">
10566
+ <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>
10567
+ </xsl:when>
10568
+ </xsl:choose>
10569
+ </xsl:if>
10570
+
10571
+ <xsl:if test="1 = 2">
10257
10572
  <xsl:choose>
10258
10573
  <!-- if there isn't the attribute '@from', then -->
10259
10574
  <xsl:when test="$id_from = ''">
@@ -10267,6 +10582,7 @@
10267
10582
  <fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
10268
10583
  </xsl:when>
10269
10584
  </xsl:choose>
10585
+ </xsl:if>
10270
10586
 
10271
10587
  </xsl:template>
10272
10588
 
@@ -11523,6 +11839,10 @@
11523
11839
  <!-- - Remove semantic xml part -->
11524
11840
  <!-- - Remove image/emf (EMF vector image for Word) -->
11525
11841
  <!-- - add @id, redundant for table auto-layout algorithm -->
11842
+ <!-- - process 'passthrough' element -->
11843
+ <!-- - split math by element with @linebreak into maths -->
11844
+ <!-- - rename fmt-title to title, fmt-name to name and another changes to convert new presentation XML to -->
11845
+ <!-- - old XML without significant changes in XSLT -->
11526
11846
  <!-- =========================================================================== -->
11527
11847
  <xsl:template match="@*|node()" mode="update_xml_step1">
11528
11848
  <xsl:copy>
@@ -11530,6 +11850,12 @@
11530
11850
  </xsl:copy>
11531
11851
  </xsl:template>
11532
11852
 
11853
+ <xsl:template match="@*|node()" mode="update_xml_pres">
11854
+ <xsl:copy>
11855
+ <xsl:apply-templates select="@*|node()" mode="update_xml_pres"/>
11856
+ </xsl:copy>
11857
+ </xsl:template>
11858
+
11533
11859
  <!-- change section's order based on @displayorder value -->
11534
11860
  <xsl:template match="*[local-name() = 'preface']" mode="update_xml_step1">
11535
11861
  <xsl:copy>
@@ -11606,7 +11932,7 @@
11606
11932
  </xsl:template>
11607
11933
 
11608
11934
  <!-- Example with 'class': <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
11609
- <xsl:template match="*[local-name() = 'span'][@style or @class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']" mode="update_xml_step1" priority="2">
11935
+ <xsl:template match="*[local-name() = 'span'][@style or @class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear' or @class = 'horizontal' or @class = 'norotate' or @class = 'halffontsize']" mode="update_xml_step1" priority="2">
11610
11936
  <xsl:copy>
11611
11937
  <xsl:copy-of select="@*"/>
11612
11938
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -11625,14 +11951,17 @@
11625
11951
 
11626
11952
  <!-- remove semantic xml -->
11627
11953
  <xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'metanorma']/*[local-name() = 'source']" mode="update_xml_step1"/>
11954
+ <xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'metanorma']/*[local-name() = 'source']" mode="update_xml_pres"/>
11628
11955
 
11629
11956
  <!-- remove image/emf -->
11630
11957
  <xsl:template match="*[local-name() = 'image']/*[local-name() = 'emf']" mode="update_xml_step1"/>
11958
+ <xsl:template match="*[local-name() = 'image']/*[local-name() = 'emf']" mode="update_xml_pres"/>
11631
11959
 
11632
11960
  <!-- remove preprocess-xslt -->
11633
11961
  <xsl:template match="*[local-name() = 'preprocess-xslt']" mode="update_xml_step1"/>
11962
+ <xsl:template match="*[local-name() = 'preprocess-xslt']" mode="update_xml_pres"/>
11634
11963
 
11635
- <xsl:template match="*[local-name() = 'stem'] | *[local-name() = 'image'] | *[local-name() = 'sourcecode'] | *[local-name() = 'bibdata'] | *[local-name() = 'localized-strings']" mode="update_xml_step1">
11964
+ <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">
11636
11965
  <xsl:copy-of select="."/>
11637
11966
  </xsl:template>
11638
11967
 
@@ -11698,6 +12027,93 @@
11698
12027
  </xsl:choose>
11699
12028
  </xsl:template>
11700
12029
 
12030
+ <xsl:variable name="regex_passthrough">.*\bpdf\b.*</xsl:variable>
12031
+ <xsl:template match="*[local-name() = 'passthrough']" mode="update_xml_step1">
12032
+ <!-- <xsl:if test="contains(@formats, ' pdf ')"> -->
12033
+ <xsl:if test="normalize-space(java:matches(java:java.lang.String.new(@formats), $regex_passthrough)) = 'true'">
12034
+ <xsl:apply-templates mode="update_xml_step1"/>
12035
+ </xsl:if>
12036
+ </xsl:template>
12037
+
12038
+ <!-- split math by element with @linebreak into maths -->
12039
+ <xsl:template match="mathml:math[.//mathml:mo[@linebreak] or .//mathml:mspace[@linebreak]]" mode="update_xml_step1">
12040
+ <xsl:variable name="maths">
12041
+ <xsl:apply-templates select="." mode="mathml_linebreak"/>
12042
+ </xsl:variable>
12043
+ <xsl:copy-of select="$maths"/>
12044
+ </xsl:template>
12045
+
12046
+ <!-- update new Presentation XML -->
12047
+ <xsl:template match="*[local-name() = 'title'][following-sibling::*[1][local-name() = 'fmt-title']]" mode="update_xml_step1"/>
12048
+ <xsl:template match="*[local-name() = 'title'][following-sibling::*[1][local-name() = 'fmt-title']]" mode="update_xml_pres"/>
12049
+ <xsl:template match="*[local-name() = 'name'][following-sibling::*[1][local-name() = 'fmt-name']]" mode="update_xml_step1"/>
12050
+ <xsl:template match="*[local-name() = 'name'][following-sibling::*[1][local-name() = 'fmt-name']]" mode="update_xml_pres"/>
12051
+ <xsl:template match="*[local-name() = 'section-title'][following-sibling::*[1][local-name() = 'p'][@type = 'section-title' or @type = 'floating-title']]" mode="update_xml_step1"/>
12052
+ <xsl:template match="*[local-name() = 'section-title'][following-sibling::*[1][local-name() = 'p'][@type = 'section-title' or @type = 'floating-title']]" mode="update_xml_pres"/>
12053
+
12054
+ <xsl:template match="*[local-name() = 'p'][@type = 'section-title' or @type = 'floating-title'][preceding-sibling::*[1][local-name() = 'section-title']]" mode="update_xml_step1">
12055
+ <xsl:copy>
12056
+ <xsl:apply-templates select="@*" mode="update_xml_step1"/>
12057
+ <xsl:copy-of select="preceding-sibling::*[1][local-name() = 'section-title']/@depth"/>
12058
+ <xsl:apply-templates select="node()" mode="update_xml_step1"/>
12059
+ </xsl:copy>
12060
+ </xsl:template>
12061
+ <xsl:template match="*[local-name() = 'p'][@type = 'section-title' or @type = 'floating-title'][preceding-sibling::*[1][local-name() = 'section-title']]" mode="update_xml_pres">
12062
+ <xsl:copy>
12063
+ <xsl:apply-templates select="@*" mode="update_xml_pres"/>
12064
+ <xsl:copy-of select="preceding-sibling::*[1][local-name() = 'section-title']/@depth"/>
12065
+ <xsl:apply-templates select="node()" mode="update_xml_pres"/>
12066
+ </xsl:copy>
12067
+ </xsl:template>
12068
+
12069
+ <xsl:template match="*[local-name() = 'fmt-title']"/>
12070
+ <xsl:template match="*[local-name() = 'fmt-title']" mode="update_xml_step1">
12071
+ <xsl:element name="title" namespace="{$namespace_full}">
12072
+ <xsl:copy-of select="@*"/>
12073
+ <xsl:apply-templates mode="update_xml_step1"/>
12074
+ </xsl:element>
12075
+ </xsl:template>
12076
+ <xsl:template match="*[local-name() = 'fmt-title']" mode="update_xml_pres">
12077
+ <xsl:element name="title" namespace="{$namespace_full}">
12078
+ <xsl:copy-of select="@*"/>
12079
+ <xsl:apply-templates mode="update_xml_pres"/>
12080
+ </xsl:element>
12081
+ </xsl:template>
12082
+
12083
+ <xsl:template match="*[local-name() = 'fmt-name']"/>
12084
+ <xsl:template match="*[local-name() = 'fmt-name']" mode="update_xml_step1">
12085
+ <xsl:element name="name" namespace="{$namespace_full}">
12086
+ <xsl:copy-of select="@*"/>
12087
+ <xsl:apply-templates mode="update_xml_step1"/>
12088
+ </xsl:element>
12089
+ </xsl:template>
12090
+ <xsl:template match="*[local-name() = 'fmt-name']" mode="update_xml_pres">
12091
+ <xsl:element name="name" namespace="{$namespace_full}">
12092
+ <xsl:copy-of select="@*"/>
12093
+ <xsl:apply-templates mode="update_xml_pres"/>
12094
+ </xsl:element>
12095
+ </xsl:template>
12096
+
12097
+ <xsl:template match="*[local-name() = 'span'][ @class = 'fmt-caption-label' or @class = 'fmt-element-name' or @class = 'fmt-caption-delim' or @class = 'fmt-autonum-delim']" mode="update_xml_step1" priority="3">
12098
+ <xsl:apply-templates mode="update_xml_step1"/>
12099
+ </xsl:template>
12100
+ <xsl:template match="*[local-name() = 'span'][ @class = 'fmt-caption-label' or @class = 'fmt-element-name' or @class = 'fmt-caption-delim' or @class = 'fmt-autonum-delim']" mode="update_xml_pres" priority="3">
12101
+ <xsl:apply-templates mode="update_xml_pres"/>
12102
+ </xsl:template>
12103
+
12104
+ <xsl:template match="*[local-name() = 'semx']" mode="update_xml_step1">
12105
+ <xsl:apply-templates mode="update_xml_step1"/>
12106
+ </xsl:template>
12107
+ <xsl:template match="*[local-name() = 'semx']" mode="update_xml_pres">
12108
+ <xsl:apply-templates mode="update_xml_pres"/>
12109
+ </xsl:template>
12110
+
12111
+ <xsl:template match="*[local-name() = 'fmt-xref-label']"/>
12112
+ <xsl:template match="*[local-name() = 'fmt-xref-label']" mode="update_xml_step1"/>
12113
+ <xsl:template match="*[local-name() = 'fmt-xref-label']" mode="update_xml_pres"/>
12114
+
12115
+ <!-- END: update new Presentation XML -->
12116
+
11701
12117
  <!-- =========================================================================== -->
11702
12118
  <!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
11703
12119
  <!-- =========================================================================== -->
@@ -11801,6 +12217,8 @@
11801
12217
 
11802
12218
  <xsl:template name="insertOpeningElements">
11803
12219
  <xsl:param name="tree"/>
12220
+ <xsl:param name="xmlns"/>
12221
+ <xsl:param name="add_continue">true</xsl:param>
11804
12222
  <xsl:for-each select="$tree//element">
11805
12223
  <xsl:text disable-output-escaping="yes">&lt;</xsl:text>
11806
12224
  <xsl:value-of select="."/>
@@ -11811,7 +12229,8 @@
11811
12229
  <xsl:value-of select="."/>
11812
12230
  <xsl:text>"</xsl:text>
11813
12231
  </xsl:for-each>
11814
- <xsl:if test="position() = 1"> continue="true"</xsl:if>
12232
+ <xsl:if test="position() = 1 and $add_continue = 'true'"> continue="true"</xsl:if>
12233
+ <xsl:if test="position() = 1 and $xmlns != ''"> xmlns="<xsl:value-of select="$xmlns"/>"</xsl:if>
11815
12234
  <xsl:text disable-output-escaping="yes">&gt;</xsl:text>
11816
12235
  <xsl:if test="$debug = 'true'">
11817
12236
  <xsl:message>&lt;<xsl:value-of select="."/>&gt;</xsl:message>
@@ -11887,7 +12306,7 @@
11887
12306
  <xsl:variable name="non_white_space">[^\s\u3000-\u9FFF]</xsl:variable>
11888
12307
  <xsl:variable name="regex_dots_units">((\b((<xsl:value-of select="$non_white_space"/>{1,3}\.<xsl:value-of select="$non_white_space"/>+)|(<xsl:value-of select="$non_white_space"/>+\.<xsl:value-of select="$non_white_space"/>{1,3}))\b)|(\.<xsl:value-of select="$non_white_space"/>{1,3})\b)</xsl:variable>
11889
12308
 
11890
- <xsl:template match="text()[not(ancestor::*[local-name() = 'bibdata'] or ancestor::*[local-name() = 'link'][not(contains(.,' '))] or ancestor::*[local-name() = 'sourcecode'] or ancestor::*[local-name() = 'math'] or ancestor::*[local-name() = 'svg'] or starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.') or normalize-space() = '' )]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
12309
+ <xsl:template match="text()[not(ancestor::*[local-name() = 'bibdata'] or ancestor::*[local-name() = 'link'][not(contains(.,' '))] or ancestor::*[local-name() = 'sourcecode'] or ancestor::*[local-name() = 'math'] or ancestor::*[local-name() = 'svg'] or ancestor::*[local-name() = 'name'] or starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.') or normalize-space() = '' )]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
11891
12310
 
11892
12311
  <xsl:variable name="parent" select="local-name(..)"/>
11893
12312
 
@@ -12466,6 +12885,7 @@
12466
12885
  </pdf:catalog>
12467
12886
  <x:xmpmeta xmlns:x="adobe:ns:meta/">
12468
12887
  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
12888
+ <!-- Commented after upgrade to Apache FOP 2.10
12469
12889
  <rdf:Description xmlns:pdfaExtension="http://www.aiim.org/pdfa/ns/extension/" xmlns:pdfaProperty="http://www.aiim.org/pdfa/ns/property#" xmlns:pdfaSchema="http://www.aiim.org/pdfa/ns/schema#" rdf:about="">
12470
12890
  <pdfaExtension:schemas>
12471
12891
  <rdf:Bag>
@@ -12498,7 +12918,7 @@
12498
12918
  </rdf:li>
12499
12919
  </rdf:Bag>
12500
12920
  </pdfaExtension:schemas>
12501
- </rdf:Description>
12921
+ </rdf:Description> -->
12502
12922
  <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
12503
12923
  <!-- Dublin Core properties go here -->
12504
12924
  <dc:title>
@@ -12545,7 +12965,7 @@
12545
12965
  <xsl:variable name="dc_description">
12546
12966
  <xsl:variable name="abstract">
12547
12967
 
12548
- <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()[not(ancestor::*[local-name() = 'title'])]"/>
12968
+ <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'])]"/>
12549
12969
 
12550
12970
  </xsl:variable>
12551
12971
  <rdf:Alt>
@@ -13090,31 +13510,123 @@
13090
13510
 
13091
13511
  <!-- END: insert cover page image -->
13092
13512
 
13093
- <xsl:variable name="regex_ja_spec">[\uFF08\uFF09]</xsl:variable>
13513
+ <!-- https://github.com/metanorma/docs/blob/main/109.adoc -->
13514
+ <xsl:variable name="regex_ja_spec_">[
13515
+ <!-- Rotate 90° clockwise -->
13516
+ \u0028 <!-- U+0028 LEFT PARENTHESIS (() -->
13517
+ \uFF08 <!-- U+FF08 FULLWIDTH LEFT PARENTHESIS (() -->
13518
+ \u0029 <!-- U+0029 RIGHT PARENTHESIS ()) -->
13519
+ \uFF09 <!-- U+FF09 FULLWIDTH RIGHT PARENTHESIS ()) -->
13520
+ \u007B <!-- U+007B LEFT CURLY BRACKET ({) -->
13521
+ \uFF5B <!-- U+FF5B FULLWIDTH LEFT CURLY BRACKET ({) -->
13522
+ \u007D <!-- U+007D RIGHT CURLY BRACKET (}) -->
13523
+ \uFF5D <!-- U+FF5D FULLWIDTH RIGHT CURLY BRACKET (}) -->
13524
+ \u3014 <!-- U+3014 LEFT TORTOISE SHELL BRACKET (〔) -->
13525
+ \u3015 <!-- U+3015 RIGHT TORTOISE SHELL BRACKET (〕) -->
13526
+ \u3010 <!-- U+3010 LEFT BLACK LENTICULAR BRACKET (【) -->
13527
+ \u3011 <!-- U+3011 RIGHT BLACK LENTICULAR BRACKET (】) -->
13528
+ \u300A <!-- U+300A LEFT DOUBLE ANGLE BRACKET (《) -->
13529
+ \u300B <!-- U+300B RIGHT DOUBLE ANGLE BRACKET (》) -->
13530
+ \uFF62 <!-- U+FF62 HALFWIDTH LEFT CORNER BRACKET (「) -->
13531
+ \u300C <!-- U+300C LEFT CORNER BRACKET (「) -->
13532
+ \uFF63 <!-- U+FF63 HALFWIDTH RIGHT CORNER BRACKET (」) -->
13533
+ \u300D <!-- U+300D RIGHT CORNER BRACKET (」) -->
13534
+ \u300E <!-- U+300E LEFT WHITE CORNER BRACKET (『) -->
13535
+ \u300F <!-- U+300F RIGHT WHITE CORNER BRACKET (』) -->
13536
+ \u005B <!-- U+005B LEFT SQUARE BRACKET ([) -->
13537
+ \uFF3B <!-- U+FF3B FULLWIDTH LEFT SQUARE BRACKET ([) -->
13538
+ \u005D <!-- U+005D RIGHT SQUARE BRACKET (]) -->
13539
+ \uFF3D <!-- U+FF3D FULLWIDTH RIGHT SQUARE BRACKET (]) -->
13540
+ \u3008 <!-- U+3008 LEFT ANGLE BRACKET (〈) -->
13541
+ \u3009 <!-- U+3009 RIGHT ANGLE BRACKET (〉) -->
13542
+ \u3016 <!-- U+3016 LEFT WHITE LENTICULAR BRACKET (〖) -->
13543
+ \u3017 <!-- U+3017 RIGHT WHITE LENTICULAR BRACKET (〗) -->
13544
+
13545
+ \u301A <!-- U+301A LEFT WHITE SQUARE BRACKET (〚) -->
13546
+ \u301B <!-- U+301B RIGHT WHITE SQUARE BRACKET (〛) -->
13547
+ \u301C <!-- U+301C WAVE DASH (〜) -->
13548
+ \u3030 <!-- U+3030 WAVY DASH (〰 )-->
13549
+ \u30FC <!-- U+30FC KATAKANA-HIRAGANA PROLONGED SOUND MARK (ー) -->
13550
+ \u2329 <!-- U+2329 LEFT-POINTING ANGLE BRACKET (〈) -->
13551
+ \u232A <!-- U+232A RIGHT-POINTING ANGLE BRACKET (〉) -->
13552
+ \u3018 <!-- U+3018 LEFT WHITE TORTOISE SHELL BRACKET (〘) -->
13553
+ \u3019 <!-- U+3019 RIGHT WHITE TORTOISE SHELL BRACKET (〙) -->
13554
+ \u30A0 <!-- U+30A0 KATAKANA-HIRAGANA DOUBLE HYPHEN (゠) -->
13555
+ \uFE59 <!-- U+FE59 SMALL LEFT PARENTHESIS (﹙) -->
13556
+ \uFE5A <!-- U+FE5A SMALL RIGHT PARENTHESIS (﹚) -->
13557
+ \uFE5B <!-- U+FE5B SMALL LEFT CURLY BRACKET (﹛) -->
13558
+ \uFE5C <!-- U+FE5C SMALL RIGHT CURLY BRACKET (﹜) -->
13559
+ \uFE5D <!-- U+FE5D SMALL LEFT TORTOISE SHELL BRACKET (﹝) -->
13560
+ \uFE5E <!-- U+FE5E SMALL RIGHT TORTOISE SHELL BRACKET (﹞) -->
13561
+ \uFF5C <!-- U+FF5C FULLWIDTH VERTICAL LINE (|) -->
13562
+ \uFF5F <!-- U+FF5F FULLWIDTH LEFT WHITE PARENTHESIS (⦅) -->
13563
+ \uFF60 <!-- U+FF60 FULLWIDTH RIGHT WHITE PARENTHESIS (⦆) -->
13564
+ \uFFE3 <!-- U+FFE3 FULLWIDTH MACRON ( ̄) -->
13565
+ \uFF3F <!-- U+FF3F FULLWIDTH LOW LINE (_) -->
13566
+ \uFF5E <!-- U+FF5E FULLWIDTH TILDE (~) -->
13567
+ <!-- Rotate 180° -->
13568
+ \u309C <!-- U+309C KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK (゜) -->
13569
+ \u3002 <!-- U+3002 IDEOGRAPHIC FULL STOP (。) -->
13570
+ \uFE52 <!-- U+FE52 SMALL FULL STOP (﹒) -->
13571
+ \uFF0E <!-- U+FF0E FULLWIDTH FULL STOP (.) -->
13572
+ ]</xsl:variable>
13573
+ <xsl:variable name="regex_ja_spec"><xsl:value-of select="translate(normalize-space($regex_ja_spec_), ' ', '')"/></xsl:variable>
13094
13574
  <xsl:template name="insertVerticalChar">
13095
13575
  <xsl:param name="str"/>
13096
13576
  <xsl:param name="writing-mode">lr-tb</xsl:param>
13097
13577
  <xsl:param name="reference-orientation">90</xsl:param>
13098
- <xsl:if test="string-length($str) &gt; 0">
13099
- <fo:inline-container text-align="center" alignment-baseline="central" width="1em" margin="0" padding="0" text-indent="0mm" last-line-end-indent="0mm" start-indent="0mm" end-indent="0mm">
13100
- <xsl:if test="normalize-space($writing-mode) != ''">
13101
- <xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
13102
- <xsl:attribute name="reference-orientation">90</xsl:attribute>
13103
- </xsl:if>
13104
- <xsl:variable name="char" select="substring($str,1,1)"/>
13105
- <xsl:if test="normalize-space(java:matches(java:java.lang.String.new($char), concat('(', $regex_ja_spec, '{1,})'))) = 'true'">
13106
- <xsl:attribute name="reference-orientation">0</xsl:attribute>
13578
+ <xsl:param name="add_zero_width_space">false</xsl:param>
13579
+ <xsl:choose>
13580
+ <xsl:when test="ancestor::*[local-name() = 'span'][@class = 'norotate']">
13581
+ <xsl:value-of select="$str"/>
13582
+ </xsl:when>
13583
+ <xsl:otherwise>
13584
+ <xsl:if test="string-length($str) &gt; 0">
13585
+ <xsl:variable name="horizontal_mode" select="normalize-space(ancestor::*[local-name() = 'span'][@class = 'horizontal'] and 1 = 1)"/>
13586
+ <xsl:variable name="char" select="substring($str,1,1)"/>
13587
+ <fo:inline-container text-align="center" alignment-baseline="central" width="1em" margin="0" padding="0" text-indent="0mm" last-line-end-indent="0mm" start-indent="0mm" end-indent="0mm">
13588
+ <xsl:if test="normalize-space($writing-mode) != ''">
13589
+ <xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
13590
+ <xsl:attribute name="reference-orientation">90</xsl:attribute>
13591
+ </xsl:if>
13592
+ <xsl:if test="normalize-space(java:matches(java:java.lang.String.new($char), concat('(', $regex_ja_spec, '{1,})'))) = 'true'">
13593
+ <xsl:attribute name="reference-orientation">0</xsl:attribute>
13594
+ </xsl:if>
13595
+ <xsl:if test="$char = '゜' or $char = '。' or $char = '﹒' or $char = '.'">
13596
+ <!-- Rotate 180°:
13597
+ U+309C KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK (゜)
13598
+ U+3002 IDEOGRAPHIC FULL STOP (。)
13599
+ U+FE52 SMALL FULL STOP (﹒)
13600
+ U+FF0E FULLWIDTH FULL STOP (.)
13601
+ -->
13602
+ <xsl:attribute name="reference-orientation">-90</xsl:attribute>
13603
+ </xsl:if>
13604
+ <fo:block-container width="1em">
13605
+ <fo:block line-height="1em">
13606
+ <xsl:choose>
13607
+ <xsl:when test="$horizontal_mode = 'true'">
13608
+ <xsl:value-of select="$str"/>
13609
+ </xsl:when>
13610
+ <xsl:otherwise>
13611
+ <xsl:value-of select="$char"/>
13612
+ </xsl:otherwise>
13613
+ </xsl:choose>
13614
+ </fo:block>
13615
+ </fo:block-container>
13616
+ </fo:inline-container>
13617
+ <xsl:if test="$add_zero_width_space = 'true' and ($char = ',' or $char = '.' or $char = ' ' or $char = '·' or $char = ')' or $char = ']' or $char = '}')"><xsl:value-of select="$zero_width_space"/></xsl:if>
13618
+
13619
+ <xsl:if test="$horizontal_mode = 'false'">
13620
+ <xsl:call-template name="insertVerticalChar">
13621
+ <xsl:with-param name="str" select="substring($str, 2)"/>
13622
+ <xsl:with-param name="writing-mode" select="$writing-mode"/>
13623
+ <xsl:with-param name="reference-orientation" select="$reference-orientation"/>
13624
+ <xsl:with-param name="add_zero_width_space" select="$add_zero_width_space"/>
13625
+ </xsl:call-template>
13626
+ </xsl:if>
13107
13627
  </xsl:if>
13108
- <fo:block-container width="1em">
13109
- <fo:block line-height="1em"><xsl:value-of select="$char"/></fo:block>
13110
- </fo:block-container>
13111
- </fo:inline-container>
13112
- <xsl:call-template name="insertVerticalChar">
13113
- <xsl:with-param name="str" select="substring($str, 2)"/>
13114
- <xsl:with-param name="writing-mode" select="$writing-mode"/>
13115
- <xsl:with-param name="reference-orientation" select="$reference-orientation"/>
13116
- </xsl:call-template>
13117
- </xsl:if>
13628
+ </xsl:otherwise>
13629
+ </xsl:choose>
13118
13630
  </xsl:template>
13119
13631
 
13120
13632
  <xsl:template name="number-to-words">