metanorma-m3aawg 1.8.3 → 1.8.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 47f598c3d37818395591ae49cdd1d0d15ddd68466208a3a070114e62b6a6103b
4
- data.tar.gz: c264e09505ba094b1364c107dc55fe81e285cb297ef703dbb71250b5eaee0bf5
3
+ metadata.gz: 98cf9edfce9695583f5c2efdc8d2931b1260877d0fa167dd00d889632cd769e0
4
+ data.tar.gz: a6b2395106f9837e137bdb9e24183c45534420858709af82bf1577a1ee5446dd
5
5
  SHA512:
6
- metadata.gz: e2be4d3643015b3055b1952a437bec91ff56d20cf30268803fe8e4604ad63e245b1fab3e79c5d9738959f1d112c39ad34579cbec7c007de03bcddae145b3a851
7
- data.tar.gz: e40c1f0ce6a126a635ba205f902d63f540d8cd546eacbc2ee736cbdc74a632279cbce4c45dc0d14fe90d2e2b85fc58b329f0e05254be80c34c34fd1005d0fa21
6
+ metadata.gz: ad3dcafd0323b38225068e9c7f0047431e8ac30e2a11cfd9d0ce9aaca3db7b7d9a1323d6c310b460cb7a6784f013fc2ad3b5549ec0f217b664e06994215ba76f
7
+ data.tar.gz: ad5298efc2c57cb4f0040c7524a3ba3af0bf9f7457c46093f39ef56ab351b4b65b2b09965c8e5bb8777d7e89c40904473a0a1b726cde0f7c4a6ce8f1c6439e26
@@ -1,5 +1,5 @@
1
1
  require "asciidoctor/standoc/converter"
2
- require 'asciidoctor/generic/converter'
2
+ require "asciidoctor/generic/converter"
3
3
 
4
4
  module Asciidoctor
5
5
  module M3AAWG
@@ -11,19 +11,20 @@ module Asciidoctor
11
11
 
12
12
  def metadata_committee(node, xml)
13
13
  return unless node.attr("technical-committee")
14
+
14
15
  xml.editorialgroup do |a|
15
16
  a.committee node.attr("technical-committee"),
16
- **attr_code(type: node.attr("technical-committee-type"))
17
+ **attr_code(type: node.attr("technical-committee-type"))
17
18
  i = 2
18
- while node.attr("technical-committee_#{i}") do
19
+ while node.attr("technical-committee_#{i}")
19
20
  a.committee node.attr("technical-committee_#{i}"),
20
- **attr_code(type: node.attr("technical-committee-type_#{i}"))
21
+ **attr_code(type: node.attr("technical-committee-type_#{i}"))
21
22
  i += 1
22
23
  end
23
24
  end
24
25
  end
25
26
 
26
- def configuration
27
+ def configuration
27
28
  Metanorma::M3AAWG.configuration
28
29
  end
29
30
 
@@ -33,11 +34,14 @@ module Asciidoctor
33
34
  end
34
35
 
35
36
  def outputs(node, ret)
36
- File.open(@filename + ".xml", "w:UTF-8") { |f| f.write(ret) }
37
- presentation_xml_converter(node).convert(@filename + ".xml")
38
- html_converter(node).convert(@filename + ".presentation.xml", nil, false, "#{@filename}.html")
39
- doc_converter(node).convert(@filename + ".presentation.xml", nil, false, "#{@filename}.doc")
40
- pdf_converter(node)&.convert(@filename + ".presentation.xml", nil, false, "#{@filename}.pdf")
37
+ File.open("#{@filename}.xml", "w:UTF-8") { |f| f.write(ret) }
38
+ presentation_xml_converter(node).convert("#{@filename}.xml")
39
+ html_converter(node).convert("#{@filename}.presentation.xml", nil,
40
+ false, "#{@filename}.html")
41
+ doc_converter(node).convert("#{@filename}.presentation.xml", nil,
42
+ false, "#{@filename}.doc")
43
+ pdf_converter(node)&.convert("#{@filename}.presentation.xml", nil,
44
+ false, "#{@filename}.pdf")
41
45
  end
42
46
 
43
47
  def sections_cleanup(xml)
@@ -62,7 +66,7 @@ module Asciidoctor
62
66
  def pdf_converter(node)
63
67
  return nil if node.attr("no-pdf")
64
68
 
65
- IsoDoc::M3AAWG::PdfConvert.new(doc_extract_attributes(node))
69
+ IsoDoc::M3AAWG::PdfConvert.new(pdf_extract_attributes(node))
66
70
  end
67
71
  end
68
72
  end
@@ -1796,6 +1796,20 @@
1796
1796
  <data type="ID"/>
1797
1797
  </attribute>
1798
1798
  </optional>
1799
+ <optional>
1800
+ <attribute name="language"/>
1801
+ </optional>
1802
+ <optional>
1803
+ <attribute name="script"/>
1804
+ </optional>
1805
+ <optional>
1806
+ <attribute name="tag"/>
1807
+ </optional>
1808
+ <optional>
1809
+ <attribute name="multilingual-rendering">
1810
+ <ref name="MultilingualRenderingType"/>
1811
+ </attribute>
1812
+ </optional>
1799
1813
  <oneOrMore>
1800
1814
  <ref name="preferred"/>
1801
1815
  </oneOrMore>
@@ -17,7 +17,6 @@ $('#toggle').on('click', function(){
17
17
  else {
18
18
  $('nav').show();
19
19
  $('nav').animate({ 'left': '0px' }, 'slow');
20
- $('.container').animate({ 'padding-left': '360px' }, 'slow');
21
20
  }
22
21
  });
23
22
  </script>
@@ -9,7 +9,7 @@
9
9
 
10
10
 
11
11
 
12
- <xsl:key name="kfn" match="m3d:p/m3d:fn" use="@reference"/>
12
+ <xsl:key name="kfn" match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" use="@reference"/>
13
13
 
14
14
 
15
15
 
@@ -363,7 +363,7 @@
363
363
  <xsl:choose>
364
364
  <xsl:when test="ancestor-or-self::m3d:preface and $level &gt;= 2">false</xsl:when>
365
365
  <xsl:when test="ancestor::m3d:annex and $level &gt;= 3">false</xsl:when>
366
- <xsl:when test="$level &lt;= 3">true</xsl:when>
366
+ <xsl:when test="$level &lt;= $toc_level">true</xsl:when>
367
367
  <xsl:otherwise>false</xsl:otherwise>
368
368
  </xsl:choose>
369
369
  </xsl:variable>
@@ -586,65 +586,11 @@
586
586
 
587
587
  </xsl:template>
588
588
 
589
- <!--
590
- <fn reference="1">
591
- <p id="_8e5cf917-f75a-4a49-b0aa-1714cb6cf954">Formerly denoted as 15 % (m/m).</p>
592
- </fn>
593
- -->
594
-
595
- <xsl:variable name="p_fn">
596
- <xsl:for-each select="//m3d:p/m3d:fn[generate-id(.)=generate-id(key('kfn',@reference)[1])]">
597
- <!-- copy unique fn -->
598
- <fn gen_id="{generate-id(.)}">
599
- <xsl:copy-of select="@*"/>
600
- <xsl:copy-of select="node()"/>
601
- </fn>
602
- </xsl:for-each>
603
- </xsl:variable>
604
-
605
- <xsl:template match="m3d:p/m3d:fn" priority="2">
606
- <xsl:variable name="gen_id" select="generate-id(.)"/>
607
- <xsl:variable name="reference" select="@reference"/>
608
- <xsl:variable name="number">
609
- <xsl:value-of select="count(xalan:nodeset($p_fn)//fn[@reference = $reference]/preceding-sibling::fn) + 1"/>
610
- </xsl:variable>
611
- <xsl:choose>
612
- <xsl:when test="xalan:nodeset($p_fn)//fn[@gen_id = $gen_id]">
613
- <fo:footnote>
614
- <fo:inline font-size="7pt" keep-with-previous.within-line="always" vertical-align="super">
615
- <fo:basic-link internal-destination="footnote_{@reference}_{$number}" fox:alt-text="footnote {@reference} {$number}">
616
- <!-- <xsl:value-of select="@reference"/> -->
617
- <xsl:value-of select="$number + count(//m3d:bibitem[ancestor::m3d:references[@normative='true' or not(preceding-sibling::m3d:references)]]/m3d:note)"/>
618
- </fo:basic-link>
619
- </fo:inline>
620
- <fo:footnote-body>
621
- <fo:block font-size="9pt" margin-bottom="12pt">
622
- <fo:inline font-size="6pt" id="footnote_{@reference}_{$number}" keep-with-next.within-line="always" vertical-align="super" padding-right="1mm">
623
- <xsl:value-of select="$number + count(//m3d:bibitem[ancestor::m3d:references[@normative='true' or not(preceding-sibling::m3d:references)]]/m3d:note)"/>
624
- </fo:inline>
625
- <xsl:for-each select="m3d:p">
626
- <xsl:apply-templates/>
627
- </xsl:for-each>
628
- </fo:block>
629
- </fo:footnote-body>
630
- </fo:footnote>
631
- </xsl:when>
632
- <xsl:otherwise>
633
- <fo:inline font-size="7pt" keep-with-previous.within-line="always" vertical-align="super">
634
- <fo:basic-link internal-destination="footnote_{@reference}_{$number}" fox:alt-text="footnote {@reference} {$number}">
635
- <xsl:value-of select="$number + count(//m3d:bibitem/m3d:note)"/>
636
- </fo:basic-link>
637
- </fo:inline>
638
- </xsl:otherwise>
639
- </xsl:choose>
640
- </xsl:template>
641
-
642
589
  <xsl:template match="m3d:p/m3d:fn/m3d:p">
643
590
  <xsl:apply-templates/>
644
591
  </xsl:template>
645
592
 
646
593
 
647
-
648
594
  <xsl:template match="m3d:bibitem">
649
595
  <fo:block id="{@id}" margin-bottom="12pt" text-indent="-11.7mm" margin-left="11.7mm"> <!-- 12 pt -->
650
596
  <!-- m3d:docidentifier -->
@@ -1455,6 +1401,78 @@
1455
1401
 
1456
1402
  </xsl:attribute-set><xsl:attribute-set name="toc-style">
1457
1403
  <xsl:attribute name="line-height">135%</xsl:attribute>
1404
+ </xsl:attribute-set><xsl:attribute-set name="fn-style">
1405
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
1406
+ </xsl:attribute-set><xsl:attribute-set name="fn-num-style">
1407
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
1408
+
1409
+
1410
+
1411
+
1412
+
1413
+
1414
+
1415
+
1416
+
1417
+
1418
+ <xsl:attribute name="font-size">7pt</xsl:attribute>
1419
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
1420
+
1421
+
1422
+
1423
+
1424
+
1425
+
1426
+
1427
+ </xsl:attribute-set><xsl:attribute-set name="fn-body-style">
1428
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
1429
+ <xsl:attribute name="font-style">normal</xsl:attribute>
1430
+ <xsl:attribute name="text-indent">0</xsl:attribute>
1431
+ <xsl:attribute name="start-indent">0</xsl:attribute>
1432
+
1433
+
1434
+
1435
+
1436
+
1437
+
1438
+
1439
+
1440
+
1441
+
1442
+ <xsl:attribute name="font-size">9pt</xsl:attribute>
1443
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1444
+
1445
+
1446
+
1447
+
1448
+
1449
+
1450
+
1451
+
1452
+
1453
+ </xsl:attribute-set><xsl:attribute-set name="fn-body-num-style">
1454
+ <xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
1455
+
1456
+
1457
+
1458
+
1459
+
1460
+
1461
+
1462
+
1463
+
1464
+
1465
+ <xsl:attribute name="font-size">6pt</xsl:attribute>
1466
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
1467
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
1468
+
1469
+
1470
+
1471
+
1472
+
1473
+
1474
+
1475
+
1458
1476
  </xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:template name="OLD_processPrefaceSectionsDefault_Contents">
1459
1477
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
1460
1478
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
@@ -2395,6 +2413,102 @@
2395
2413
 
2396
2414
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='name']" mode="process"/><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" mode="process">
2397
2415
  <xsl:apply-templates/>
2416
+ </xsl:template><xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" priority="2" name="fn">
2417
+
2418
+ <!-- list of footnotes to calculate actual footnotes number -->
2419
+ <xsl:variable name="p_fn_">
2420
+ <xsl:choose>
2421
+ <xsl:when test="@current_fn_number"> <!-- for BSI, footnote reference number calculated already -->
2422
+ <fn gen_id="{generate-id(.)}">
2423
+ <xsl:copy-of select="@*"/>
2424
+ <xsl:copy-of select="node()"/>
2425
+ </fn>
2426
+ </xsl:when>
2427
+ <xsl:otherwise>
2428
+ <!-- itetation for:
2429
+ footnotes in bibdata/title
2430
+ footnotes in bibliography
2431
+ footnotes in document's body (except table's head/body/foot and figure text)
2432
+ -->
2433
+ <xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']/*[local-name() = 'note'][@type='title-footnote']">
2434
+ <fn gen_id="{generate-id(.)}">
2435
+ <xsl:copy-of select="@*"/>
2436
+ <xsl:copy-of select="node()"/>
2437
+ </fn>
2438
+ </xsl:for-each>
2439
+ <xsl:for-each select="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']/*">
2440
+ <xsl:sort select="@displayorder" data-type="number"/>
2441
+ <xsl:for-each select=".//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] | .//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
2442
+ <!-- copy unique fn -->
2443
+ <fn gen_id="{generate-id(.)}">
2444
+ <xsl:copy-of select="@*"/>
2445
+ <xsl:copy-of select="node()"/>
2446
+ </fn>
2447
+ </xsl:for-each>
2448
+ </xsl:for-each>
2449
+ </xsl:otherwise>
2450
+ </xsl:choose>
2451
+ </xsl:variable>
2452
+ <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
2453
+
2454
+ <xsl:variable name="gen_id" select="generate-id(.)"/>
2455
+ <xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
2456
+ <xsl:variable name="reference" select="@reference"/>
2457
+ <!-- fn sequence number in document -->
2458
+ <xsl:variable name="current_fn_number">
2459
+ <xsl:choose>
2460
+ <xsl:when test="@current_fn_number"><xsl:value-of select="@current_fn_number"/></xsl:when> <!-- for BSI -->
2461
+ <xsl:otherwise>
2462
+ <xsl:value-of select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1"/>
2463
+ </xsl:otherwise>
2464
+ </xsl:choose>
2465
+ </xsl:variable>
2466
+ <xsl:variable name="current_fn_number_text">
2467
+ <xsl:value-of select="$current_fn_number"/>
2468
+
2469
+
2470
+ </xsl:variable>
2471
+
2472
+ <xsl:variable name="ref_id" select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
2473
+ <xsl:variable name="footnote_inline">
2474
+ <fo:inline xsl:use-attribute-sets="fn-num-style">
2475
+
2476
+ <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
2477
+ <xsl:value-of select="$current_fn_number_text"/>
2478
+ </fo:basic-link>
2479
+ </fo:inline>
2480
+ </xsl:variable>
2481
+ <!-- DEBUG: p_fn=<xsl:copy-of select="$p_fn"/>
2482
+ gen_id=<xsl:value-of select="$gen_id"/> -->
2483
+ <xsl:choose>
2484
+ <xsl:when test="normalize-space(@skip_footnote_body) = 'true'">
2485
+ <xsl:copy-of select="$footnote_inline"/>
2486
+ </xsl:when>
2487
+ <xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false'">
2488
+ <fo:footnote xsl:use-attribute-sets="fn-style">
2489
+ <xsl:copy-of select="$footnote_inline"/>
2490
+ <fo:footnote-body>
2491
+
2492
+ <fo:block-container text-indent="0" start-indent="0">
2493
+
2494
+
2495
+ <fo:block xsl:use-attribute-sets="fn-body-style">
2496
+
2497
+
2498
+ <fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style">
2499
+
2500
+ <xsl:value-of select="$current_fn_number_text"/>
2501
+ </fo:inline>
2502
+ <xsl:apply-templates/>
2503
+ </fo:block>
2504
+ </fo:block-container>
2505
+ </fo:footnote-body>
2506
+ </fo:footnote>
2507
+ </xsl:when>
2508
+ <xsl:otherwise>
2509
+ <xsl:copy-of select="$footnote_inline"/>
2510
+ </xsl:otherwise>
2511
+ </xsl:choose>
2398
2512
  </xsl:template><xsl:template name="fn_display">
2399
2513
  <xsl:variable name="references">
2400
2514
 
@@ -2587,6 +2701,8 @@
2587
2701
 
2588
2702
  </fo:basic-link>
2589
2703
  </fo:inline>
2704
+ </xsl:template><xsl:template match="*[local-name()='fn']/text()[normalize-space() != '']">
2705
+ <fo:inline><xsl:value-of select="."/></fo:inline>
2590
2706
  </xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
2591
2707
  <fo:inline>
2592
2708
  <xsl:apply-templates/>
@@ -3582,22 +3698,6 @@
3582
3698
  <xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
3583
3699
  <xsl:apply-templates/>
3584
3700
  </fo:inline>
3585
- </xsl:template><xsl:template match="*[local-name() = 'modification']">
3586
- <xsl:variable name="title-modified">
3587
-
3588
-
3589
- <xsl:call-template name="getTitle">
3590
- <xsl:with-param name="name" select="'title-modified'"/>
3591
- </xsl:call-template>
3592
-
3593
- </xsl:variable>
3594
-
3595
- <xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
3596
- <xsl:choose>
3597
- <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text>—</xsl:text></xsl:if></xsl:when>
3598
- <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text> — </xsl:text></xsl:if></xsl:otherwise>
3599
- </xsl:choose>
3600
- <xsl:apply-templates/>
3601
3701
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
3602
3702
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
3603
3703
 
@@ -4835,45 +4935,69 @@
4835
4935
  <xsl:variable name="termsource_text">
4836
4936
  <xsl:apply-templates/>
4837
4937
  </xsl:variable>
4838
-
4839
- <xsl:choose>
4938
+ <xsl:copy-of select="$termsource_text"/>
4939
+ <!-- <xsl:choose>
4840
4940
  <xsl:when test="starts-with(normalize-space($termsource_text), '[')">
4841
- <!-- <xsl:apply-templates /> -->
4842
4941
  <xsl:copy-of select="$termsource_text"/>
4843
4942
  </xsl:when>
4844
4943
  <xsl:otherwise>
4845
-
4846
-
4944
+ <xsl:if test="$namespace = 'bsi'">
4945
+ <xsl:choose>
4946
+ <xsl:when test="$document_type = 'PAS' and starts-with(*[local-name() = 'origin']/@citeas, '[')"><xsl:text>{</xsl:text></xsl:when>
4947
+ <xsl:otherwise><xsl:text>[</xsl:text></xsl:otherwise>
4948
+ </xsl:choose>
4949
+ </xsl:if>
4950
+ <xsl:if test="$namespace = 'gb' or $namespace = 'iso' or $namespace = 'iec' or $namespace = 'itu' or $namespace = 'unece' or $namespace = 'unece-rec' or $namespace = 'nist-cswp' or $namespace = 'nist-sp' or $namespace = 'ogc-white-paper' or $namespace = 'csa' or $namespace = 'csd' or $namespace = 'm3d' or $namespace = 'iho' or $namespace = 'bipm' or $namespace = 'jcgm'">
4847
4951
  <xsl:text>[</xsl:text>
4848
-
4849
- <!-- <xsl:apply-templates /> -->
4952
+ </xsl:if>
4850
4953
  <xsl:copy-of select="$termsource_text"/>
4851
-
4852
-
4954
+ <xsl:if test="$namespace = 'bsi'">
4955
+ <xsl:choose>
4956
+ <xsl:when test="$document_type = 'PAS' and starts-with(*[local-name() = 'origin']/@citeas, '[')"><xsl:text>}</xsl:text></xsl:when>
4957
+ <xsl:otherwise><xsl:text>]</xsl:text></xsl:otherwise>
4958
+ </xsl:choose>
4959
+ </xsl:if>
4960
+ <xsl:if test="$namespace = 'gb' or $namespace = 'iso' or $namespace = 'iec' or $namespace = 'itu' or $namespace = 'unece' or $namespace = 'unece-rec' or $namespace = 'nist-cswp' or $namespace = 'nist-sp' or $namespace = 'ogc-white-paper' or $namespace = 'csa' or $namespace = 'csd' or $namespace = 'm3d' or $namespace = 'iho' or $namespace = 'bipm' or $namespace = 'jcgm'">
4853
4961
  <xsl:text>]</xsl:text>
4854
-
4962
+ </xsl:if>
4855
4963
  </xsl:otherwise>
4856
- </xsl:choose>
4964
+ </xsl:choose> -->
4857
4965
  </fo:block>
4858
4966
  </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()">
4859
4967
  <xsl:if test="normalize-space() != ''">
4860
4968
  <xsl:value-of select="."/>
4861
4969
  </xsl:if>
4862
- </xsl:template><xsl:variable name="localized.source">
4863
- <xsl:call-template name="getLocalizedString">
4864
- <xsl:with-param name="key">source</xsl:with-param>
4865
- </xsl:call-template>
4866
- </xsl:variable><xsl:template match="*[local-name() = 'origin']">
4970
+ </xsl:template><xsl:template match="*[local-name() = 'termsource']/*[local-name() = 'strong'][1][following-sibling::*[1][local-name() = 'origin']]/text()">
4971
+ <fo:inline>
4972
+
4973
+
4974
+ <xsl:value-of select="."/>
4975
+ </fo:inline>
4976
+ </xsl:template><xsl:template match="*[local-name() = 'origin']">
4867
4977
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
4868
4978
  <xsl:if test="normalize-space(@citeas) = ''">
4869
4979
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
4870
4980
  </xsl:if>
4871
-
4872
4981
  <fo:inline xsl:use-attribute-sets="origin-style">
4873
4982
  <xsl:apply-templates/>
4874
4983
  </fo:inline>
4984
+ </fo:basic-link>
4985
+ </xsl:template><xsl:template match="*[local-name() = 'modification']">
4986
+ <xsl:variable name="title-modified">
4875
4987
 
4876
- </fo:basic-link>
4988
+
4989
+ <xsl:call-template name="getTitle">
4990
+ <xsl:with-param name="name" select="'title-modified'"/>
4991
+ </xsl:call-template>
4992
+
4993
+ </xsl:variable>
4994
+
4995
+ <xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
4996
+ <xsl:choose>
4997
+ <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text>—</xsl:text></xsl:if></xsl:when>
4998
+ <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text> — </xsl:text></xsl:if></xsl:otherwise>
4999
+ </xsl:choose>
5000
+ <xsl:apply-templates/>
4877
5001
  </xsl:template><xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']">
4878
5002
  <fo:inline><xsl:apply-templates/></fo:inline>
4879
5003
  </xsl:template><xsl:template match="*[local-name() = 'modification']/text()">
@@ -5481,7 +5605,31 @@
5481
5605
  <fo:block-container border="1pt solid black" width="50%">
5482
5606
  <fo:block> </fo:block>
5483
5607
  </fo:block-container>
5484
- </xsl:template><xsl:template match="*[local-name() = 'toc']">
5608
+ </xsl:template><xsl:variable name="toc_level">
5609
+ <xsl:choose>
5610
+ <xsl:when test="1 = 2"/> <!-- to do https://github.com/metanorma/mn-native-pdf/issues/337: if there is value in xml -->
5611
+ <xsl:otherwise><!-- default value -->
5612
+
5613
+
5614
+
5615
+
5616
+
5617
+
5618
+
5619
+
5620
+
5621
+ 3
5622
+
5623
+
5624
+
5625
+
5626
+
5627
+
5628
+
5629
+
5630
+ </xsl:otherwise>
5631
+ </xsl:choose>
5632
+ </xsl:variable><xsl:template match="*[local-name() = 'toc']">
5485
5633
  <xsl:param name="colwidths"/>
5486
5634
  <xsl:variable name="colwidths_">
5487
5635
  <xsl:choose>
@@ -6121,4 +6269,14 @@
6121
6269
  </xsl:otherwise>
6122
6270
  </xsl:choose>
6123
6271
  </xsl:if>
6272
+ </xsl:template><xsl:template name="setAltText">
6273
+ <xsl:param name="value"/>
6274
+ <xsl:attribute name="fox:alt-text">
6275
+ <xsl:choose>
6276
+ <xsl:when test="normalize-space($value) != ''">
6277
+ <xsl:value-of select="$value"/>
6278
+ </xsl:when>
6279
+ <xsl:otherwise>_</xsl:otherwise>
6280
+ </xsl:choose>
6281
+ </xsl:attribute>
6124
6282
  </xsl:template></xsl:stylesheet>
@@ -9,7 +9,7 @@
9
9
 
10
10
 
11
11
 
12
- <xsl:key name="kfn" match="m3d:p/m3d:fn" use="@reference"/>
12
+ <xsl:key name="kfn" match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" use="@reference"/>
13
13
 
14
14
 
15
15
 
@@ -363,7 +363,7 @@
363
363
  <xsl:choose>
364
364
  <xsl:when test="ancestor-or-self::m3d:preface and $level &gt;= 2">false</xsl:when>
365
365
  <xsl:when test="ancestor::m3d:annex and $level &gt;= 3">false</xsl:when>
366
- <xsl:when test="$level &lt;= 3">true</xsl:when>
366
+ <xsl:when test="$level &lt;= $toc_level">true</xsl:when>
367
367
  <xsl:otherwise>false</xsl:otherwise>
368
368
  </xsl:choose>
369
369
  </xsl:variable>
@@ -586,65 +586,11 @@
586
586
 
587
587
  </xsl:template>
588
588
 
589
- <!--
590
- <fn reference="1">
591
- <p id="_8e5cf917-f75a-4a49-b0aa-1714cb6cf954">Formerly denoted as 15 % (m/m).</p>
592
- </fn>
593
- -->
594
-
595
- <xsl:variable name="p_fn">
596
- <xsl:for-each select="//m3d:p/m3d:fn[generate-id(.)=generate-id(key('kfn',@reference)[1])]">
597
- <!-- copy unique fn -->
598
- <fn gen_id="{generate-id(.)}">
599
- <xsl:copy-of select="@*"/>
600
- <xsl:copy-of select="node()"/>
601
- </fn>
602
- </xsl:for-each>
603
- </xsl:variable>
604
-
605
- <xsl:template match="m3d:p/m3d:fn" priority="2">
606
- <xsl:variable name="gen_id" select="generate-id(.)"/>
607
- <xsl:variable name="reference" select="@reference"/>
608
- <xsl:variable name="number">
609
- <xsl:value-of select="count(xalan:nodeset($p_fn)//fn[@reference = $reference]/preceding-sibling::fn) + 1"/>
610
- </xsl:variable>
611
- <xsl:choose>
612
- <xsl:when test="xalan:nodeset($p_fn)//fn[@gen_id = $gen_id]">
613
- <fo:footnote>
614
- <fo:inline font-size="7pt" keep-with-previous.within-line="always" vertical-align="super">
615
- <fo:basic-link internal-destination="footnote_{@reference}_{$number}" fox:alt-text="footnote {@reference} {$number}">
616
- <!-- <xsl:value-of select="@reference"/> -->
617
- <xsl:value-of select="$number + count(//m3d:bibitem[ancestor::m3d:references[@normative='true' or not(preceding-sibling::m3d:references)]]/m3d:note)"/>
618
- </fo:basic-link>
619
- </fo:inline>
620
- <fo:footnote-body>
621
- <fo:block font-size="9pt" margin-bottom="12pt">
622
- <fo:inline font-size="6pt" id="footnote_{@reference}_{$number}" keep-with-next.within-line="always" vertical-align="super" padding-right="1mm">
623
- <xsl:value-of select="$number + count(//m3d:bibitem[ancestor::m3d:references[@normative='true' or not(preceding-sibling::m3d:references)]]/m3d:note)"/>
624
- </fo:inline>
625
- <xsl:for-each select="m3d:p">
626
- <xsl:apply-templates/>
627
- </xsl:for-each>
628
- </fo:block>
629
- </fo:footnote-body>
630
- </fo:footnote>
631
- </xsl:when>
632
- <xsl:otherwise>
633
- <fo:inline font-size="7pt" keep-with-previous.within-line="always" vertical-align="super">
634
- <fo:basic-link internal-destination="footnote_{@reference}_{$number}" fox:alt-text="footnote {@reference} {$number}">
635
- <xsl:value-of select="$number + count(//m3d:bibitem/m3d:note)"/>
636
- </fo:basic-link>
637
- </fo:inline>
638
- </xsl:otherwise>
639
- </xsl:choose>
640
- </xsl:template>
641
-
642
589
  <xsl:template match="m3d:p/m3d:fn/m3d:p">
643
590
  <xsl:apply-templates/>
644
591
  </xsl:template>
645
592
 
646
593
 
647
-
648
594
  <xsl:template match="m3d:bibitem">
649
595
  <fo:block id="{@id}" margin-bottom="12pt" text-indent="-11.7mm" margin-left="11.7mm"> <!-- 12 pt -->
650
596
  <!-- m3d:docidentifier -->
@@ -1455,6 +1401,78 @@
1455
1401
 
1456
1402
  </xsl:attribute-set><xsl:attribute-set name="toc-style">
1457
1403
  <xsl:attribute name="line-height">135%</xsl:attribute>
1404
+ </xsl:attribute-set><xsl:attribute-set name="fn-style">
1405
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
1406
+ </xsl:attribute-set><xsl:attribute-set name="fn-num-style">
1407
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
1408
+
1409
+
1410
+
1411
+
1412
+
1413
+
1414
+
1415
+
1416
+
1417
+
1418
+ <xsl:attribute name="font-size">7pt</xsl:attribute>
1419
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
1420
+
1421
+
1422
+
1423
+
1424
+
1425
+
1426
+
1427
+ </xsl:attribute-set><xsl:attribute-set name="fn-body-style">
1428
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
1429
+ <xsl:attribute name="font-style">normal</xsl:attribute>
1430
+ <xsl:attribute name="text-indent">0</xsl:attribute>
1431
+ <xsl:attribute name="start-indent">0</xsl:attribute>
1432
+
1433
+
1434
+
1435
+
1436
+
1437
+
1438
+
1439
+
1440
+
1441
+
1442
+ <xsl:attribute name="font-size">9pt</xsl:attribute>
1443
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1444
+
1445
+
1446
+
1447
+
1448
+
1449
+
1450
+
1451
+
1452
+
1453
+ </xsl:attribute-set><xsl:attribute-set name="fn-body-num-style">
1454
+ <xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
1455
+
1456
+
1457
+
1458
+
1459
+
1460
+
1461
+
1462
+
1463
+
1464
+
1465
+ <xsl:attribute name="font-size">6pt</xsl:attribute>
1466
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
1467
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
1468
+
1469
+
1470
+
1471
+
1472
+
1473
+
1474
+
1475
+
1458
1476
  </xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:template name="OLD_processPrefaceSectionsDefault_Contents">
1459
1477
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
1460
1478
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
@@ -2395,6 +2413,102 @@
2395
2413
 
2396
2414
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='name']" mode="process"/><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" mode="process">
2397
2415
  <xsl:apply-templates/>
2416
+ </xsl:template><xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" priority="2" name="fn">
2417
+
2418
+ <!-- list of footnotes to calculate actual footnotes number -->
2419
+ <xsl:variable name="p_fn_">
2420
+ <xsl:choose>
2421
+ <xsl:when test="@current_fn_number"> <!-- for BSI, footnote reference number calculated already -->
2422
+ <fn gen_id="{generate-id(.)}">
2423
+ <xsl:copy-of select="@*"/>
2424
+ <xsl:copy-of select="node()"/>
2425
+ </fn>
2426
+ </xsl:when>
2427
+ <xsl:otherwise>
2428
+ <!-- itetation for:
2429
+ footnotes in bibdata/title
2430
+ footnotes in bibliography
2431
+ footnotes in document's body (except table's head/body/foot and figure text)
2432
+ -->
2433
+ <xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']/*[local-name() = 'note'][@type='title-footnote']">
2434
+ <fn gen_id="{generate-id(.)}">
2435
+ <xsl:copy-of select="@*"/>
2436
+ <xsl:copy-of select="node()"/>
2437
+ </fn>
2438
+ </xsl:for-each>
2439
+ <xsl:for-each select="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']/*">
2440
+ <xsl:sort select="@displayorder" data-type="number"/>
2441
+ <xsl:for-each select=".//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] | .//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
2442
+ <!-- copy unique fn -->
2443
+ <fn gen_id="{generate-id(.)}">
2444
+ <xsl:copy-of select="@*"/>
2445
+ <xsl:copy-of select="node()"/>
2446
+ </fn>
2447
+ </xsl:for-each>
2448
+ </xsl:for-each>
2449
+ </xsl:otherwise>
2450
+ </xsl:choose>
2451
+ </xsl:variable>
2452
+ <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
2453
+
2454
+ <xsl:variable name="gen_id" select="generate-id(.)"/>
2455
+ <xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
2456
+ <xsl:variable name="reference" select="@reference"/>
2457
+ <!-- fn sequence number in document -->
2458
+ <xsl:variable name="current_fn_number">
2459
+ <xsl:choose>
2460
+ <xsl:when test="@current_fn_number"><xsl:value-of select="@current_fn_number"/></xsl:when> <!-- for BSI -->
2461
+ <xsl:otherwise>
2462
+ <xsl:value-of select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1"/>
2463
+ </xsl:otherwise>
2464
+ </xsl:choose>
2465
+ </xsl:variable>
2466
+ <xsl:variable name="current_fn_number_text">
2467
+ <xsl:value-of select="$current_fn_number"/>
2468
+
2469
+
2470
+ </xsl:variable>
2471
+
2472
+ <xsl:variable name="ref_id" select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
2473
+ <xsl:variable name="footnote_inline">
2474
+ <fo:inline xsl:use-attribute-sets="fn-num-style">
2475
+
2476
+ <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
2477
+ <xsl:value-of select="$current_fn_number_text"/>
2478
+ </fo:basic-link>
2479
+ </fo:inline>
2480
+ </xsl:variable>
2481
+ <!-- DEBUG: p_fn=<xsl:copy-of select="$p_fn"/>
2482
+ gen_id=<xsl:value-of select="$gen_id"/> -->
2483
+ <xsl:choose>
2484
+ <xsl:when test="normalize-space(@skip_footnote_body) = 'true'">
2485
+ <xsl:copy-of select="$footnote_inline"/>
2486
+ </xsl:when>
2487
+ <xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false'">
2488
+ <fo:footnote xsl:use-attribute-sets="fn-style">
2489
+ <xsl:copy-of select="$footnote_inline"/>
2490
+ <fo:footnote-body>
2491
+
2492
+ <fo:block-container text-indent="0" start-indent="0">
2493
+
2494
+
2495
+ <fo:block xsl:use-attribute-sets="fn-body-style">
2496
+
2497
+
2498
+ <fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style">
2499
+
2500
+ <xsl:value-of select="$current_fn_number_text"/>
2501
+ </fo:inline>
2502
+ <xsl:apply-templates/>
2503
+ </fo:block>
2504
+ </fo:block-container>
2505
+ </fo:footnote-body>
2506
+ </fo:footnote>
2507
+ </xsl:when>
2508
+ <xsl:otherwise>
2509
+ <xsl:copy-of select="$footnote_inline"/>
2510
+ </xsl:otherwise>
2511
+ </xsl:choose>
2398
2512
  </xsl:template><xsl:template name="fn_display">
2399
2513
  <xsl:variable name="references">
2400
2514
 
@@ -2587,6 +2701,8 @@
2587
2701
 
2588
2702
  </fo:basic-link>
2589
2703
  </fo:inline>
2704
+ </xsl:template><xsl:template match="*[local-name()='fn']/text()[normalize-space() != '']">
2705
+ <fo:inline><xsl:value-of select="."/></fo:inline>
2590
2706
  </xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
2591
2707
  <fo:inline>
2592
2708
  <xsl:apply-templates/>
@@ -3582,22 +3698,6 @@
3582
3698
  <xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
3583
3699
  <xsl:apply-templates/>
3584
3700
  </fo:inline>
3585
- </xsl:template><xsl:template match="*[local-name() = 'modification']">
3586
- <xsl:variable name="title-modified">
3587
-
3588
-
3589
- <xsl:call-template name="getTitle">
3590
- <xsl:with-param name="name" select="'title-modified'"/>
3591
- </xsl:call-template>
3592
-
3593
- </xsl:variable>
3594
-
3595
- <xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
3596
- <xsl:choose>
3597
- <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text>—</xsl:text></xsl:if></xsl:when>
3598
- <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text> — </xsl:text></xsl:if></xsl:otherwise>
3599
- </xsl:choose>
3600
- <xsl:apply-templates/>
3601
3701
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
3602
3702
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
3603
3703
 
@@ -4835,45 +4935,69 @@
4835
4935
  <xsl:variable name="termsource_text">
4836
4936
  <xsl:apply-templates/>
4837
4937
  </xsl:variable>
4838
-
4839
- <xsl:choose>
4938
+ <xsl:copy-of select="$termsource_text"/>
4939
+ <!-- <xsl:choose>
4840
4940
  <xsl:when test="starts-with(normalize-space($termsource_text), '[')">
4841
- <!-- <xsl:apply-templates /> -->
4842
4941
  <xsl:copy-of select="$termsource_text"/>
4843
4942
  </xsl:when>
4844
4943
  <xsl:otherwise>
4845
-
4846
-
4944
+ <xsl:if test="$namespace = 'bsi'">
4945
+ <xsl:choose>
4946
+ <xsl:when test="$document_type = 'PAS' and starts-with(*[local-name() = 'origin']/@citeas, '[')"><xsl:text>{</xsl:text></xsl:when>
4947
+ <xsl:otherwise><xsl:text>[</xsl:text></xsl:otherwise>
4948
+ </xsl:choose>
4949
+ </xsl:if>
4950
+ <xsl:if test="$namespace = 'gb' or $namespace = 'iso' or $namespace = 'iec' or $namespace = 'itu' or $namespace = 'unece' or $namespace = 'unece-rec' or $namespace = 'nist-cswp' or $namespace = 'nist-sp' or $namespace = 'ogc-white-paper' or $namespace = 'csa' or $namespace = 'csd' or $namespace = 'm3d' or $namespace = 'iho' or $namespace = 'bipm' or $namespace = 'jcgm'">
4847
4951
  <xsl:text>[</xsl:text>
4848
-
4849
- <!-- <xsl:apply-templates /> -->
4952
+ </xsl:if>
4850
4953
  <xsl:copy-of select="$termsource_text"/>
4851
-
4852
-
4954
+ <xsl:if test="$namespace = 'bsi'">
4955
+ <xsl:choose>
4956
+ <xsl:when test="$document_type = 'PAS' and starts-with(*[local-name() = 'origin']/@citeas, '[')"><xsl:text>}</xsl:text></xsl:when>
4957
+ <xsl:otherwise><xsl:text>]</xsl:text></xsl:otherwise>
4958
+ </xsl:choose>
4959
+ </xsl:if>
4960
+ <xsl:if test="$namespace = 'gb' or $namespace = 'iso' or $namespace = 'iec' or $namespace = 'itu' or $namespace = 'unece' or $namespace = 'unece-rec' or $namespace = 'nist-cswp' or $namespace = 'nist-sp' or $namespace = 'ogc-white-paper' or $namespace = 'csa' or $namespace = 'csd' or $namespace = 'm3d' or $namespace = 'iho' or $namespace = 'bipm' or $namespace = 'jcgm'">
4853
4961
  <xsl:text>]</xsl:text>
4854
-
4962
+ </xsl:if>
4855
4963
  </xsl:otherwise>
4856
- </xsl:choose>
4964
+ </xsl:choose> -->
4857
4965
  </fo:block>
4858
4966
  </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()">
4859
4967
  <xsl:if test="normalize-space() != ''">
4860
4968
  <xsl:value-of select="."/>
4861
4969
  </xsl:if>
4862
- </xsl:template><xsl:variable name="localized.source">
4863
- <xsl:call-template name="getLocalizedString">
4864
- <xsl:with-param name="key">source</xsl:with-param>
4865
- </xsl:call-template>
4866
- </xsl:variable><xsl:template match="*[local-name() = 'origin']">
4970
+ </xsl:template><xsl:template match="*[local-name() = 'termsource']/*[local-name() = 'strong'][1][following-sibling::*[1][local-name() = 'origin']]/text()">
4971
+ <fo:inline>
4972
+
4973
+
4974
+ <xsl:value-of select="."/>
4975
+ </fo:inline>
4976
+ </xsl:template><xsl:template match="*[local-name() = 'origin']">
4867
4977
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
4868
4978
  <xsl:if test="normalize-space(@citeas) = ''">
4869
4979
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
4870
4980
  </xsl:if>
4871
-
4872
4981
  <fo:inline xsl:use-attribute-sets="origin-style">
4873
4982
  <xsl:apply-templates/>
4874
4983
  </fo:inline>
4984
+ </fo:basic-link>
4985
+ </xsl:template><xsl:template match="*[local-name() = 'modification']">
4986
+ <xsl:variable name="title-modified">
4875
4987
 
4876
- </fo:basic-link>
4988
+
4989
+ <xsl:call-template name="getTitle">
4990
+ <xsl:with-param name="name" select="'title-modified'"/>
4991
+ </xsl:call-template>
4992
+
4993
+ </xsl:variable>
4994
+
4995
+ <xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
4996
+ <xsl:choose>
4997
+ <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text>—</xsl:text></xsl:if></xsl:when>
4998
+ <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text> — </xsl:text></xsl:if></xsl:otherwise>
4999
+ </xsl:choose>
5000
+ <xsl:apply-templates/>
4877
5001
  </xsl:template><xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']">
4878
5002
  <fo:inline><xsl:apply-templates/></fo:inline>
4879
5003
  </xsl:template><xsl:template match="*[local-name() = 'modification']/text()">
@@ -5481,7 +5605,31 @@
5481
5605
  <fo:block-container border="1pt solid black" width="50%">
5482
5606
  <fo:block> </fo:block>
5483
5607
  </fo:block-container>
5484
- </xsl:template><xsl:template match="*[local-name() = 'toc']">
5608
+ </xsl:template><xsl:variable name="toc_level">
5609
+ <xsl:choose>
5610
+ <xsl:when test="1 = 2"/> <!-- to do https://github.com/metanorma/mn-native-pdf/issues/337: if there is value in xml -->
5611
+ <xsl:otherwise><!-- default value -->
5612
+
5613
+
5614
+
5615
+
5616
+
5617
+
5618
+
5619
+
5620
+
5621
+ 3
5622
+
5623
+
5624
+
5625
+
5626
+
5627
+
5628
+
5629
+
5630
+ </xsl:otherwise>
5631
+ </xsl:choose>
5632
+ </xsl:variable><xsl:template match="*[local-name() = 'toc']">
5485
5633
  <xsl:param name="colwidths"/>
5486
5634
  <xsl:variable name="colwidths_">
5487
5635
  <xsl:choose>
@@ -6121,4 +6269,14 @@
6121
6269
  </xsl:otherwise>
6122
6270
  </xsl:choose>
6123
6271
  </xsl:if>
6272
+ </xsl:template><xsl:template name="setAltText">
6273
+ <xsl:param name="value"/>
6274
+ <xsl:attribute name="fox:alt-text">
6275
+ <xsl:choose>
6276
+ <xsl:when test="normalize-space($value) != ''">
6277
+ <xsl:value-of select="$value"/>
6278
+ </xsl:when>
6279
+ <xsl:otherwise>_</xsl:otherwise>
6280
+ </xsl:choose>
6281
+ </xsl:attribute>
6124
6282
  </xsl:template></xsl:stylesheet>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module M3AAWG
3
- VERSION = "1.8.3".freeze
3
+ VERSION = "1.8.4".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-m3aawg
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.3
4
+ version: 1.8.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-11-29 00:00:00.000000000 Z
11
+ date: 2021-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities
@@ -277,7 +277,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
277
277
  - !ruby/object:Gem::Version
278
278
  version: '0'
279
279
  requirements: []
280
- rubygems_version: 3.2.22
280
+ rubygems_version: 3.2.32
281
281
  signing_key:
282
282
  specification_version: 4
283
283
  summary: metanorma-m3d lets you write M3AAWG Documents in AsciiDoc.