metanorma-un 0.3.7 → 0.3.8

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: 873d4b1e69a95f4b3d315783d6816908c1026dd790a0bbe3d7ce041ae7030dd2
4
- data.tar.gz: 940f35ff9d38869dac57e8227c646d286e5996ec9b287e623e6f1e892cd1fb88
3
+ metadata.gz: b8f80e35f48b43c5972281e3788e35ad0cbddbdd912d9650ca9c5631e1211c97
4
+ data.tar.gz: 89ae1f2db1f552085072fd51440d7fd340df455aaaec770e939086e50da3fa17
5
5
  SHA512:
6
- metadata.gz: ce2d0399506090653519eb73550059893bdb505c41dfc2589b7346e4641f3441b3d18af3b47783173cd18ab19fddd1d8aac287f6ae495a6a62120f5f7b09077b
7
- data.tar.gz: 75a2e3dcaba39ceb1697faf9b5071c3f5f8de513b7b1710b8ffb9c13f7cdf13c038debb540658ba377e74fbb060e78c56de23b7eb7433f30e26cb5b98ea7e0ed
6
+ metadata.gz: 0b9189ae7cdccdc42245ea6a657126c3e547683caa43aea1ceb5796ced1375ba401f9167c36b8667a472dc96ed534201d380711b183a340e90b74322c59b853a
7
+ data.tar.gz: 95849abe4398f3f91568bfdc1effc3d11ae2163bf313b4d5d22fee2439b6647869c7d39543d2bcee4347c9afbef535fd1bea0a261fe7eb60986d57175ea285bd
@@ -129,6 +129,9 @@
129
129
  </choice>
130
130
  </attribute>
131
131
  </optional>
132
+ <attribute name="normative">
133
+ <data type="boolean"/>
134
+ </attribute>
132
135
  <optional>
133
136
  <ref name="section-title"/>
134
137
  </optional>
@@ -303,11 +306,11 @@
303
306
  <ref name="paragraph"/>
304
307
  </element>
305
308
  </define>
306
- <define name="TextElement" combine="choice">
307
- <ref name="concept"/>
308
- </define>
309
309
  </include>
310
310
  <!-- end overrides -->
311
+ <define name="TextElement" combine="choice">
312
+ <ref name="concept"/>
313
+ </define>
311
314
  <define name="concept">
312
315
  <element name="concept">
313
316
  <optional>
@@ -127,6 +127,10 @@ module IsoDoc
127
127
  l10n("<b>#{@annex_lbl} #{num}</b>")
128
128
  end
129
129
 
130
+ SUBCLAUSES =
131
+ "./clause | ./references | ./term | ./terms | ./definitions".freeze
132
+
133
+
130
134
  def annex_names(clause, num)
131
135
  hierarchical_asset_names(clause, num)
132
136
  leaf_section?(clause) and
@@ -134,10 +138,14 @@ module IsoDoc
134
138
  @anchors[clause["id"]] = { label: annex_name_lbl(clause, num),
135
139
  type: "clause",
136
140
  xref: "#{@annex_lbl} #{num}", level: 1 }
137
- i = 1
138
- clause.xpath(ns("./clause")).each do |c|
139
- annex_names1(c, "#{num}.#{annex_levelnum(i, 2)}", 2)
140
- i += 1 if !leaf_section?(c)
141
+ if a = single_annex_special_section(clause)
142
+ annex_names1(a, "#{num}", 1)
143
+ else
144
+ i = 1
145
+ clause.xpath(ns(SUBCLAUSES)).each do |c|
146
+ annex_names1(c, "#{num}.#{annex_levelnum(i, 2)}", 2)
147
+ i += 1 if !leaf_section?(c)
148
+ end
141
149
  end
142
150
  end
143
151
 
@@ -18,14 +18,14 @@ module IsoDoc
18
18
  bodyfont: (
19
19
  options[:script] == "Hans" ?
20
20
  '"SimSun",serif' :
21
- '"Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif'
21
+ '"Times New Roman", serif'
22
22
  ),
23
23
  headerfont: (
24
24
  options[:script] == "Hans" ?
25
25
  '"SimHei",sans-serif' :
26
- '"Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif'
26
+ '"Times New Roman", serif'
27
27
  ),
28
- monospacefont: '"Space Mono",monospace'
28
+ monospacefont: '"Courier New",monospace'
29
29
  }
30
30
  end
31
31
 
@@ -9,6 +9,8 @@
9
9
  <xsl:variable name="pageWidth" select="'210mm'"/>
10
10
  <xsl:variable name="pageHeight" select="'297mm'"/>
11
11
 
12
+ <xsl:variable name="debug">false</xsl:variable>
13
+
12
14
  <xsl:variable name="contents">
13
15
  <contents>
14
16
  <xsl:apply-templates select="/un:un-standard/un:sections/*" mode="contents"/>
@@ -259,10 +261,12 @@
259
261
  <xsl:call-template name="insertHeaderFooter"/>
260
262
  <fo:flow flow-name="xsl-region-body">
261
263
 
262
- <xsl:text disable-output-escaping="yes">&lt;!--</xsl:text>
263
- DEBUG
264
- contents=<xsl:copy-of select="xalan:nodeset($contents)"/>
265
- <xsl:text disable-output-escaping="yes">--&gt;</xsl:text>
264
+ <xsl:if test="$debug = 'true'">
265
+ <xsl:text disable-output-escaping="yes">&lt;!--</xsl:text>
266
+ DEBUG
267
+ contents=<xsl:copy-of select="xalan:nodeset($contents)"/>
268
+ <xsl:text disable-output-escaping="yes">--&gt;</xsl:text>
269
+ </xsl:if>
266
270
 
267
271
  <fo:block>
268
272
  <xsl:apply-templates select="/un:un-standard/un:sections/*"/>
@@ -716,20 +720,13 @@
716
720
  </fo:block>
717
721
  </xsl:template>
718
722
 
719
- <xsl:template match="un:link">
720
- <fo:basic-link external-destination="{@target}" fox:alt-text="{@target}"> <!-- color="blue" text-decoration="underline" -->
723
+ <xsl:template match="un:link" priority="2">
724
+ <fo:inline>
721
725
  <xsl:if test="ancestor::un:fn and string-length(@target) &gt; 110">
722
726
  <xsl:attribute name="font-size">8pt</xsl:attribute>
723
727
  </xsl:if>
724
- <xsl:choose>
725
- <xsl:when test="normalize-space(.) = ''">
726
- <xsl:value-of select="@target"/>
727
- </xsl:when>
728
- <xsl:otherwise>
729
- <xsl:apply-templates/>
730
- </xsl:otherwise>
731
- </xsl:choose>
732
- </fo:basic-link>
728
+ <xsl:call-template name="link"/>
729
+ </fo:inline>
733
730
  </xsl:template>
734
731
 
735
732
  <xsl:template match="un:xref">
@@ -1231,19 +1228,22 @@
1231
1228
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
1232
1229
  </xsl:if>
1233
1230
  <xsl:text>[</xsl:text><xsl:value-of select="@citeas" disable-output-escaping="yes"/><xsl:text>]</xsl:text>
1234
- <xsl:if test="un:locality">
1235
- <xsl:text>, </xsl:text>
1236
- <xsl:choose>
1237
- <xsl:when test="un:locality/@type = 'section'">Section </xsl:when>
1238
- <xsl:when test="un:locality/@type = 'clause'">Clause </xsl:when>
1239
- <xsl:otherwise/>
1240
- </xsl:choose>
1241
- <xsl:apply-templates select="un:locality"/>
1242
- </xsl:if>
1231
+
1232
+ <xsl:apply-templates select="un:localityStack"/>
1233
+
1243
1234
  </fo:basic-link>
1244
1235
  <!-- </fo:inline> -->
1245
1236
  </xsl:template>
1246
1237
 
1238
+ <xsl:template match="un:locality">
1239
+ <xsl:choose>
1240
+ <xsl:when test="@type = 'section'">Section </xsl:when>
1241
+ <xsl:when test="@type = 'clause'">Clause </xsl:when>
1242
+ <xsl:otherwise/>
1243
+ </xsl:choose>
1244
+ <xsl:text> </xsl:text><xsl:value-of select="un:referenceFrom"/>
1245
+ </xsl:template>
1246
+
1247
1247
 
1248
1248
  <xsl:template match="un:terms[un:term[un:preferred and un:definition]]">
1249
1249
  <fo:block id="{@id}">
@@ -2467,11 +2467,14 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
2467
2467
  </xsl:text>
2468
2468
  </xsl:variable>
2469
2469
 
2470
- <xsl:variable xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:variable xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" name="linebreak" select="'&#8232;'"/><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="text()">
2470
+ <xsl:variable xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:variable xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" name="linebreak" select="'&#8232;'"/><xsl:attribute-set xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" name="link-style">
2471
+
2472
+
2473
+ </xsl:attribute-set><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="text()">
2471
2474
  <xsl:value-of select="."/>
2472
2475
  </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='br']">
2473
2476
  <xsl:value-of select="$linebreak"/>
2474
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='td']//text() | *[local-name()='th']//text()" priority="1">
2477
+ </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
2475
2478
  <xsl:call-template name="add-zero-spaces"/>
2476
2479
  </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='table']">
2477
2480
 
@@ -2487,7 +2490,9 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
2487
2490
 
2488
2491
  <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
2489
2492
 
2490
-
2493
+ <!-- <xsl:if test="$namespace = 'iso'">
2494
+ <fo:block space-before="6pt">&#xA0;</fo:block>
2495
+ </xsl:if> -->
2491
2496
 
2492
2497
  <xsl:choose>
2493
2498
  <xsl:when test="@unnumbered = 'true'"/>
@@ -2500,12 +2505,14 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
2500
2505
 
2501
2506
 
2502
2507
 
2508
+
2503
2509
  <xsl:attribute name="font-weight">normal</xsl:attribute>
2504
2510
  <xsl:attribute name="font-style">italic</xsl:attribute>
2505
2511
  <xsl:attribute name="font-size">10pt</xsl:attribute>
2506
2512
  <xsl:attribute name="text-align">left</xsl:attribute>
2507
2513
 
2508
2514
 
2515
+
2509
2516
  <xsl:text>Table </xsl:text>
2510
2517
  <xsl:choose>
2511
2518
  <xsl:when test="ancestor::*[local-name()='executivesummary']"> <!-- NIST -->
@@ -2517,6 +2524,8 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
2517
2524
 
2518
2525
 
2519
2526
 
2527
+
2528
+
2520
2529
  <xsl:variable name="annex-id" select="ancestor::*[local-name()='annex']/@id"/>
2521
2530
  <xsl:number format="I." count="*[local-name()='annex']"/>
2522
2531
  <xsl:number format="1" level="any" count="*[local-name()='table'][not(@unnumbered) or @unnumbered != 'true'][ancestor::*[local-name()='annex'][@id = $annex-id]]"/>
@@ -2573,11 +2582,11 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
2573
2582
  </xsl:call-template>
2574
2583
  </xsl:variable>
2575
2584
 
2576
- <xsl:variable name="colwidths2">
2585
+ <!-- <xsl:variable name="colwidths2">
2577
2586
  <xsl:call-template name="calculate-column-widths">
2578
2587
  <xsl:with-param name="cols-count" select="$cols-count"/>
2579
2588
  </xsl:call-template>
2580
- </xsl:variable>
2589
+ </xsl:variable> -->
2581
2590
 
2582
2591
  <!-- cols-count=<xsl:copy-of select="$cols-count"/>
2583
2592
  colwidthsNew=<xsl:copy-of select="$colwidths"/>
@@ -2599,7 +2608,9 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
2599
2608
 
2600
2609
 
2601
2610
 
2602
- <fo:table id="{@id}" table-layout="fixed" width="100%" margin-left="{$margin-left}mm" margin-right="{$margin-left}mm">
2611
+
2612
+ <fo:table id="{@id}" table-layout="fixed" width="100%" margin-left="{$margin-left}mm" margin-right="{$margin-left}mm" table-omit-footer-at-break="true">
2613
+
2603
2614
 
2604
2615
 
2605
2616
 
@@ -2624,6 +2635,9 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
2624
2635
  </xsl:for-each>
2625
2636
  <xsl:apply-templates/>
2626
2637
  </fo:table>
2638
+
2639
+
2640
+
2627
2641
  </fo:block-container>
2628
2642
  </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='table']/*[local-name()='name']"/><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='table']/*[local-name()='name']" mode="process">
2629
2643
  <xsl:apply-templates/>
@@ -2677,9 +2691,13 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
2677
2691
  </xsl:when>
2678
2692
  <xsl:otherwise>
2679
2693
  <xsl:for-each select="xalan:nodeset($table)//tr">
2694
+ <xsl:variable name="td_text">
2695
+ <xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
2696
+ </xsl:variable>
2680
2697
  <xsl:variable name="words">
2681
2698
  <xsl:call-template name="tokenize">
2682
- <xsl:with-param name="text" select="translate(td[$curr-col],'- —:', ' ')"/>
2699
+ <!-- <xsl:with-param name="text" select="translate(td[$curr-col],'- —:', ' ')"/> -->
2700
+ <xsl:with-param name="text" select="translate(normalize-space($td_text),'- —:', ' ')"/>
2683
2701
  </xsl:call-template>
2684
2702
  </xsl:variable>
2685
2703
  <xsl:variable name="max_length">
@@ -2720,58 +2738,82 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
2720
2738
  <xsl:with-param name="table" select="$table"/>
2721
2739
  </xsl:call-template>
2722
2740
  </xsl:if>
2741
+ </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="text()" mode="td_text">
2742
+ <xsl:variable name="zero-space">​</xsl:variable>
2743
+ <xsl:value-of select="translate(., $zero-space, ' ')"/><xsl:text> </xsl:text>
2723
2744
  </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='table2']"/><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='thead']"/><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='thead']" mode="process">
2724
- <!-- <fo:table-header font-weight="bold">
2725
- <xsl:apply-templates />
2726
- </fo:table-header> -->
2727
- <xsl:apply-templates/>
2745
+ <!-- font-weight="bold" -->
2746
+ <fo:table-header>
2747
+ <xsl:apply-templates/>
2748
+ </fo:table-header>
2728
2749
  </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='tfoot']"/><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='tfoot']" mode="process">
2729
2750
  <xsl:apply-templates/>
2751
+ </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" name="insertTableFooter">
2752
+ <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
2753
+ <xsl:if test="../*[local-name()='tfoot'] or $isNoteOrFnExist = 'true'">
2754
+
2755
+ <fo:table-footer>
2756
+
2757
+ <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/>
2758
+
2759
+ <!-- if there are note(s) or fn(s) then create footer row -->
2760
+ <xsl:if test="$isNoteOrFnExist = 'true'">
2761
+
2762
+ <xsl:variable name="cols-count">
2763
+ <xsl:choose>
2764
+ <xsl:when test="../*[local-name()='thead']">
2765
+ <!-- <xsl:value-of select="count(../*[local-name()='thead']/*[local-name()='tr']/*[local-name()='th'])"/> -->
2766
+ <xsl:call-template name="calculate-columns-numbers">
2767
+ <xsl:with-param name="table-row" select="../*[local-name()='thead']/*[local-name()='tr'][1]"/>
2768
+ </xsl:call-template>
2769
+ </xsl:when>
2770
+ <xsl:otherwise>
2771
+ <!-- <xsl:value-of select="count(./*[local-name()='tr'][1]/*[local-name()='td'])"/> -->
2772
+ <xsl:call-template name="calculate-columns-numbers">
2773
+ <xsl:with-param name="table-row" select="./*[local-name()='tr'][1]"/>
2774
+ </xsl:call-template>
2775
+ </xsl:otherwise>
2776
+ </xsl:choose>
2777
+ </xsl:variable>
2778
+
2779
+ <fo:table-row>
2780
+ <fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
2781
+
2782
+
2783
+
2784
+ <!-- fn will be processed inside 'note' processing -->
2785
+
2786
+
2787
+ <!-- except gb -->
2788
+
2789
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
2790
+
2791
+
2792
+ <!-- horizontal row separator -->
2793
+
2794
+
2795
+ <!-- fn processing -->
2796
+ <xsl:call-template name="fn_display"/>
2797
+
2798
+ </fo:table-cell>
2799
+ </fo:table-row>
2800
+
2801
+ </xsl:if>
2802
+ </fo:table-footer>
2803
+
2804
+ </xsl:if>
2730
2805
  </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='tbody']">
2731
- <xsl:variable name="cols-count">
2732
- <xsl:choose>
2733
- <xsl:when test="../*[local-name()='thead']">
2734
- <!-- <xsl:value-of select="count(../*[local-name()='thead']/*[local-name()='tr']/*[local-name()='th'])"/> -->
2735
- <xsl:call-template name="calculate-columns-numbers">
2736
- <xsl:with-param name="table-row" select="../*[local-name()='thead']/*[local-name()='tr'][1]"/>
2737
- </xsl:call-template>
2738
- </xsl:when>
2739
- <xsl:otherwise>
2740
- <!-- <xsl:value-of select="count(./*[local-name()='tr'][1]/*[local-name()='td'])"/> -->
2741
- <xsl:call-template name="calculate-columns-numbers">
2742
- <xsl:with-param name="table-row" select="./*[local-name()='tr'][1]"/>
2743
- </xsl:call-template>
2744
- </xsl:otherwise>
2745
- </xsl:choose>
2746
- </xsl:variable>
2747
-
2806
+
2807
+ <xsl:apply-templates select="../*[local-name()='thead']" mode="process"/>
2808
+
2809
+ <xsl:call-template name="insertTableFooter"/>
2810
+
2748
2811
  <fo:table-body>
2749
- <xsl:apply-templates select="../*[local-name()='thead']" mode="process"/>
2750
2812
  <xsl:apply-templates/>
2751
- <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/>
2752
- <!-- if there are note(s) or fn(s) then create footer row -->
2753
- <xsl:if test="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']">
2754
- <fo:table-row>
2755
- <fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
2756
-
2757
-
2758
-
2759
- <!-- fn will be processed inside 'note' processing -->
2760
-
2761
-
2762
- <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
2763
-
2764
- <!-- horizontal row separator -->
2765
-
2766
-
2767
- <!-- fn processing -->
2768
- <xsl:call-template name="fn_display"/>
2769
-
2770
- </fo:table-cell>
2771
- </fo:table-row>
2772
-
2773
- </xsl:if>
2813
+ <!-- <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/> -->
2814
+
2774
2815
  </fo:table-body>
2816
+
2775
2817
  </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='tr']">
2776
2818
  <xsl:variable name="parent-name" select="local-name(..)"/>
2777
2819
  <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
@@ -2789,6 +2831,7 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
2789
2831
 
2790
2832
  </xsl:if>
2791
2833
 
2834
+
2792
2835
  <xsl:if test="not(*[local-name()='th'])">
2793
2836
  <xsl:attribute name="min-height">8mm</xsl:attribute>
2794
2837
  </xsl:if>
@@ -2835,6 +2878,8 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
2835
2878
 
2836
2879
 
2837
2880
 
2881
+
2882
+
2838
2883
  <xsl:attribute name="display-align">before</xsl:attribute>
2839
2884
  <xsl:attribute name="padding-left">0mm</xsl:attribute>
2840
2885
  <xsl:attribute name="padding-top">2mm</xsl:attribute>
@@ -2875,10 +2920,13 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
2875
2920
  <fo:block font-size="10pt" margin-bottom="12pt">
2876
2921
 
2877
2922
 
2923
+
2878
2924
  <fo:inline padding-right="2mm">
2925
+
2879
2926
  <xsl:text>NOTE </xsl:text>
2880
2927
 
2881
2928
 
2929
+
2882
2930
  <xsl:number format="1 "/>
2883
2931
 
2884
2932
  </fo:inline>
@@ -2903,6 +2951,7 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
2903
2951
  <fo:block margin-bottom="12pt">
2904
2952
 
2905
2953
 
2954
+
2906
2955
  <fo:inline font-size="80%" padding-right="5mm" id="{@id}">
2907
2956
 
2908
2957
  <xsl:attribute name="vertical-align">super</xsl:attribute>
@@ -2911,6 +2960,7 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
2911
2960
 
2912
2961
 
2913
2962
 
2963
+
2914
2964
  <xsl:value-of select="@reference"/>
2915
2965
 
2916
2966
  </fo:inline>
@@ -2994,6 +3044,7 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
2994
3044
 
2995
3045
 
2996
3046
 
3047
+
2997
3048
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
2998
3049
 
2999
3050
  <xsl:value-of select="@reference"/>
@@ -3015,7 +3066,7 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
3015
3066
 
3016
3067
 
3017
3068
  <fo:block margin-bottom="12pt" text-align="left">
3018
-
3069
+
3019
3070
  <xsl:text>where </xsl:text>
3020
3071
  <xsl:apply-templates select="*[local-name()='dt']/*"/>
3021
3072
  <xsl:text/>
@@ -3028,6 +3079,7 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
3028
3079
 
3029
3080
 
3030
3081
 
3082
+
3031
3083
  <xsl:text>where</xsl:text>
3032
3084
  </fo:block>
3033
3085
  </xsl:when>
@@ -3035,6 +3087,7 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
3035
3087
  <fo:block font-weight="bold" text-align="left" margin-bottom="12pt">
3036
3088
 
3037
3089
 
3090
+
3038
3091
  <xsl:text>Key</xsl:text>
3039
3092
  </fo:block>
3040
3093
  </xsl:when>
@@ -3046,9 +3099,9 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
3046
3099
 
3047
3100
 
3048
3101
 
3049
-
3050
3102
  <fo:block>
3051
3103
 
3104
+
3052
3105
  <!-- create virtual html table for dl/[dt and dd] -->
3053
3106
  <xsl:variable name="html-table">
3054
3107
  <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
@@ -3068,6 +3121,7 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
3068
3121
  <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
3069
3122
 
3070
3123
  <fo:table width="95%" table-layout="fixed">
3124
+
3071
3125
  <xsl:choose>
3072
3126
  <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'">
3073
3127
  <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
@@ -3167,6 +3221,7 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
3167
3221
  <fo:table-cell>
3168
3222
  <fo:block margin-top="6pt">
3169
3223
 
3224
+
3170
3225
  <xsl:if test="normalize-space($key_iso) = 'true'">
3171
3226
  <xsl:attribute name="margin-top">0</xsl:attribute>
3172
3227
 
@@ -3174,6 +3229,7 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
3174
3229
 
3175
3230
 
3176
3231
  <xsl:apply-templates/>
3232
+
3177
3233
  </fo:block>
3178
3234
  </fo:table-cell>
3179
3235
  <fo:table-cell>
@@ -3192,7 +3248,7 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
3192
3248
  </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='dd']"/><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='dd']" mode="process">
3193
3249
  <xsl:apply-templates/>
3194
3250
  </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='dd']/*[local-name()='p']" mode="inline">
3195
- <fo:inline><xsl:apply-templates/></fo:inline>
3251
+ <fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
3196
3252
  </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='em']">
3197
3253
  <fo:inline font-style="italic">
3198
3254
  <xsl:apply-templates/>
@@ -3307,6 +3363,7 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
3307
3363
  <xsl:variable name="zero-space-after-dot">.</xsl:variable>
3308
3364
  <xsl:variable name="zero-space-after-colon">:</xsl:variable>
3309
3365
  <xsl:variable name="zero-space-after-equal">=</xsl:variable>
3366
+ <xsl:variable name="zero-space-after-underscore">_</xsl:variable>
3310
3367
  <xsl:variable name="zero-space">​</xsl:variable>
3311
3368
  <xsl:choose>
3312
3369
  <xsl:when test="contains($text, $zero-space-after-chars)">
@@ -3341,6 +3398,14 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
3341
3398
  <xsl:with-param name="text" select="substring-after($text, $zero-space-after-equal)"/>
3342
3399
  </xsl:call-template>
3343
3400
  </xsl:when>
3401
+ <xsl:when test="contains($text, $zero-space-after-underscore)">
3402
+ <xsl:value-of select="substring-before($text, $zero-space-after-underscore)"/>
3403
+ <xsl:value-of select="$zero-space-after-underscore"/>
3404
+ <xsl:value-of select="$zero-space"/>
3405
+ <xsl:call-template name="add-zero-spaces">
3406
+ <xsl:with-param name="text" select="substring-after($text, $zero-space-after-underscore)"/>
3407
+ </xsl:call-template>
3408
+ </xsl:when>
3344
3409
  <xsl:otherwise>
3345
3410
  <xsl:value-of select="$text"/>
3346
3411
  </xsl:otherwise>
@@ -3517,4 +3582,40 @@ k7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO
3517
3582
  <xsl:copy-of select="."/>
3518
3583
  </fo:instream-foreign-object>
3519
3584
  </fo:inline>
3585
+ </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='localityStack']">
3586
+ <xsl:for-each select="*[local-name()='locality']">
3587
+ <xsl:if test="position() =1"><xsl:text>, </xsl:text></xsl:if>
3588
+ <xsl:apply-templates select="."/>
3589
+ <xsl:if test="position() != last()"><xsl:text>; </xsl:text></xsl:if>
3590
+ </xsl:for-each>
3591
+ </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='link']" name="link">
3592
+ <xsl:variable name="target">
3593
+ <xsl:choose>
3594
+ <xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
3595
+ <xsl:value-of select="normalize-space(substring-after(@target, 'mailto:'))"/>
3596
+ </xsl:when>
3597
+ <xsl:otherwise>
3598
+ <xsl:value-of select="normalize-space(@target)"/>
3599
+ </xsl:otherwise>
3600
+ </xsl:choose>
3601
+ </xsl:variable>
3602
+ <fo:inline xsl:use-attribute-sets="link-style">
3603
+ <xsl:choose>
3604
+ <xsl:when test="$target = ''">
3605
+ <xsl:apply-templates/>
3606
+ </xsl:when>
3607
+ <xsl:otherwise>
3608
+ <fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
3609
+ <xsl:choose>
3610
+ <xsl:when test="normalize-space(.) = ''">
3611
+ <xsl:value-of select="$target"/>
3612
+ </xsl:when>
3613
+ <xsl:otherwise>
3614
+ <xsl:apply-templates/>
3615
+ </xsl:otherwise>
3616
+ </xsl:choose>
3617
+ </fo:basic-link>
3618
+ </xsl:otherwise>
3619
+ </xsl:choose>
3620
+ </fo:inline>
3520
3621
  </xsl:template></xsl:stylesheet>
@@ -6,6 +6,7 @@
6
6
 
7
7
 
8
8
 
9
+ <xsl:variable name="debug">false</xsl:variable>
9
10
  <xsl:variable name="pageWidth" select="'210mm'"/>
10
11
  <xsl:variable name="pageHeight" select="'297mm'"/>
11
12
 
@@ -289,10 +290,12 @@
289
290
  <xsl:call-template name="insertFooter"/>
290
291
  <fo:flow flow-name="xsl-region-body">
291
292
 
292
- <xsl:text disable-output-escaping="yes">&lt;!--</xsl:text>
293
- DEBUG
294
- contents=<xsl:copy-of select="xalan:nodeset($contents)"/>
295
- <xsl:text disable-output-escaping="yes"> --&gt;</xsl:text>
293
+ <xsl:if test="$debug = 'true'">
294
+ <xsl:text disable-output-escaping="yes">&lt;!--</xsl:text>
295
+ DEBUG
296
+ contents=<xsl:copy-of select="xalan:nodeset($contents)"/>
297
+ <xsl:text disable-output-escaping="yes"> --&gt;</xsl:text>
298
+ </xsl:if>
296
299
 
297
300
  <fo:block>
298
301
  <xsl:apply-templates select="/un:un-standard/un:sections/*"/>
@@ -617,7 +620,7 @@
617
620
  </fo:block>
618
621
  </xsl:template>
619
622
 
620
- <xsl:template match="un:feedback-statement//un:clause//un:p//un:link"/>
623
+ <xsl:template match="un:feedback-statement//un:clause//un:p//un:link" priority="2"/>
621
624
 
622
625
  <xsl:template name="show_fs_table">
623
626
  <fo:block>
@@ -813,20 +816,7 @@
813
816
  <xsl:apply-templates/>
814
817
  </fo:block>
815
818
  </xsl:template>
816
-
817
- <xsl:template match="un:link">
818
- <fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
819
- <xsl:choose>
820
- <xsl:when test="normalize-space(.) = ''">
821
- <xsl:value-of select="@target"/>
822
- </xsl:when>
823
- <xsl:otherwise>
824
- <xsl:apply-templates/>
825
- </xsl:otherwise>
826
- </xsl:choose>
827
- </fo:basic-link>
828
- </xsl:template>
829
-
819
+
830
820
  <xsl:template match="un:xref">
831
821
  <xsl:variable name="section" select="xalan:nodeset($contents)//item[@id = current()/@target]/@section"/>
832
822
  <xsl:variable name="type" select="xalan:nodeset($contents)//item[@id = current()/@target]/@type"/>
@@ -1304,18 +1294,19 @@
1304
1294
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
1305
1295
  </xsl:if> -->
1306
1296
  <xsl:text>[</xsl:text><xsl:value-of select="@citeas" disable-output-escaping="yes"/><xsl:text>]</xsl:text>
1307
- <xsl:if test="un:locality">
1308
- <xsl:text>, </xsl:text>
1309
- <xsl:choose>
1310
- <xsl:when test="un:locality/@type = 'section'">Section </xsl:when>
1311
- <xsl:when test="un:locality/@type = 'clause'">Clause </xsl:when>
1312
- <xsl:otherwise/>
1313
- </xsl:choose>
1314
- <xsl:apply-templates select="un:locality"/>
1315
- </xsl:if>
1297
+ <xsl:apply-templates select="un:localityStack"/>
1316
1298
  </fo:basic-link>
1317
1299
  </xsl:template>
1318
1300
 
1301
+ <xsl:template match="un:locality">
1302
+ <xsl:choose>
1303
+ <xsl:when test="@type = 'section'">Section </xsl:when>
1304
+ <xsl:when test="@type = 'clause'">Clause </xsl:when>
1305
+ <xsl:otherwise/>
1306
+ </xsl:choose>
1307
+ <xsl:text> </xsl:text><xsl:value-of select="un:referenceFrom"/>
1308
+ </xsl:template>
1309
+
1319
1310
 
1320
1311
  <xsl:template match="un:terms[un:term[un:preferred and un:definition]]">
1321
1312
  <fo:block id="{@id}">
@@ -11911,11 +11902,14 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
11911
11902
  </xsl:text>
11912
11903
  </xsl:variable>
11913
11904
 
11914
- <xsl:variable xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:variable xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" name="linebreak" select="'&#8232;'"/><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="text()">
11905
+ <xsl:variable xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:variable xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" name="linebreak" select="'&#8232;'"/><xsl:attribute-set xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" name="link-style">
11906
+
11907
+
11908
+ </xsl:attribute-set><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="text()">
11915
11909
  <xsl:value-of select="."/>
11916
11910
  </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='br']">
11917
11911
  <xsl:value-of select="$linebreak"/>
11918
- </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='td']//text() | *[local-name()='th']//text()" priority="1">
11912
+ </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
11919
11913
  <xsl:call-template name="add-zero-spaces"/>
11920
11914
  </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='table']">
11921
11915
 
@@ -11931,7 +11925,9 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
11931
11925
 
11932
11926
  <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
11933
11927
 
11934
-
11928
+ <!-- <xsl:if test="$namespace = 'iso'">
11929
+ <fo:block space-before="6pt">&#xA0;</fo:block>
11930
+ </xsl:if> -->
11935
11931
 
11936
11932
  <xsl:choose>
11937
11933
  <xsl:when test="@unnumbered = 'true'"/>
@@ -12009,11 +12005,11 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12009
12005
  </xsl:call-template>
12010
12006
  </xsl:variable>
12011
12007
 
12012
- <xsl:variable name="colwidths2">
12008
+ <!-- <xsl:variable name="colwidths2">
12013
12009
  <xsl:call-template name="calculate-column-widths">
12014
12010
  <xsl:with-param name="cols-count" select="$cols-count"/>
12015
12011
  </xsl:call-template>
12016
- </xsl:variable>
12012
+ </xsl:variable> -->
12017
12013
 
12018
12014
  <!-- cols-count=<xsl:copy-of select="$cols-count"/>
12019
12015
  colwidthsNew=<xsl:copy-of select="$colwidths"/>
@@ -12035,7 +12031,9 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12035
12031
 
12036
12032
 
12037
12033
 
12038
- <fo:table id="{@id}" table-layout="fixed" width="100%" margin-left="{$margin-left}mm" margin-right="{$margin-left}mm">
12034
+
12035
+ <fo:table id="{@id}" table-layout="fixed" width="100%" margin-left="{$margin-left}mm" margin-right="{$margin-left}mm" table-omit-footer-at-break="true">
12036
+
12039
12037
 
12040
12038
 
12041
12039
 
@@ -12065,6 +12063,9 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12065
12063
  </xsl:for-each>
12066
12064
  <xsl:apply-templates/>
12067
12065
  </fo:table>
12066
+
12067
+
12068
+
12068
12069
  </fo:block-container>
12069
12070
  </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='table']/*[local-name()='name']"/><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='table']/*[local-name()='name']" mode="process">
12070
12071
  <xsl:apply-templates/>
@@ -12118,9 +12119,13 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12118
12119
  </xsl:when>
12119
12120
  <xsl:otherwise>
12120
12121
  <xsl:for-each select="xalan:nodeset($table)//tr">
12122
+ <xsl:variable name="td_text">
12123
+ <xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
12124
+ </xsl:variable>
12121
12125
  <xsl:variable name="words">
12122
12126
  <xsl:call-template name="tokenize">
12123
- <xsl:with-param name="text" select="translate(td[$curr-col],'- —:', ' ')"/>
12127
+ <!-- <xsl:with-param name="text" select="translate(td[$curr-col],'- —:', ' ')"/> -->
12128
+ <xsl:with-param name="text" select="translate(normalize-space($td_text),'- —:', ' ')"/>
12124
12129
  </xsl:call-template>
12125
12130
  </xsl:variable>
12126
12131
  <xsl:variable name="max_length">
@@ -12161,58 +12166,82 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12161
12166
  <xsl:with-param name="table" select="$table"/>
12162
12167
  </xsl:call-template>
12163
12168
  </xsl:if>
12169
+ </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="text()" mode="td_text">
12170
+ <xsl:variable name="zero-space">​</xsl:variable>
12171
+ <xsl:value-of select="translate(., $zero-space, ' ')"/><xsl:text> </xsl:text>
12164
12172
  </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='table2']"/><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='thead']"/><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='thead']" mode="process">
12165
- <!-- <fo:table-header font-weight="bold">
12166
- <xsl:apply-templates />
12167
- </fo:table-header> -->
12168
- <xsl:apply-templates/>
12173
+ <!-- font-weight="bold" -->
12174
+ <fo:table-header>
12175
+ <xsl:apply-templates/>
12176
+ </fo:table-header>
12169
12177
  </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='tfoot']"/><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='tfoot']" mode="process">
12170
12178
  <xsl:apply-templates/>
12179
+ </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" name="insertTableFooter">
12180
+ <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
12181
+ <xsl:if test="../*[local-name()='tfoot'] or $isNoteOrFnExist = 'true'">
12182
+
12183
+ <fo:table-footer>
12184
+
12185
+ <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/>
12186
+
12187
+ <!-- if there are note(s) or fn(s) then create footer row -->
12188
+ <xsl:if test="$isNoteOrFnExist = 'true'">
12189
+
12190
+ <xsl:variable name="cols-count">
12191
+ <xsl:choose>
12192
+ <xsl:when test="../*[local-name()='thead']">
12193
+ <!-- <xsl:value-of select="count(../*[local-name()='thead']/*[local-name()='tr']/*[local-name()='th'])"/> -->
12194
+ <xsl:call-template name="calculate-columns-numbers">
12195
+ <xsl:with-param name="table-row" select="../*[local-name()='thead']/*[local-name()='tr'][1]"/>
12196
+ </xsl:call-template>
12197
+ </xsl:when>
12198
+ <xsl:otherwise>
12199
+ <!-- <xsl:value-of select="count(./*[local-name()='tr'][1]/*[local-name()='td'])"/> -->
12200
+ <xsl:call-template name="calculate-columns-numbers">
12201
+ <xsl:with-param name="table-row" select="./*[local-name()='tr'][1]"/>
12202
+ </xsl:call-template>
12203
+ </xsl:otherwise>
12204
+ </xsl:choose>
12205
+ </xsl:variable>
12206
+
12207
+ <fo:table-row>
12208
+ <fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
12209
+
12210
+
12211
+
12212
+ <!-- fn will be processed inside 'note' processing -->
12213
+
12214
+
12215
+ <!-- except gb -->
12216
+
12217
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
12218
+
12219
+
12220
+ <!-- horizontal row separator -->
12221
+
12222
+
12223
+ <!-- fn processing -->
12224
+ <xsl:call-template name="fn_display"/>
12225
+
12226
+ </fo:table-cell>
12227
+ </fo:table-row>
12228
+
12229
+ </xsl:if>
12230
+ </fo:table-footer>
12231
+
12232
+ </xsl:if>
12171
12233
  </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='tbody']">
12172
- <xsl:variable name="cols-count">
12173
- <xsl:choose>
12174
- <xsl:when test="../*[local-name()='thead']">
12175
- <!-- <xsl:value-of select="count(../*[local-name()='thead']/*[local-name()='tr']/*[local-name()='th'])"/> -->
12176
- <xsl:call-template name="calculate-columns-numbers">
12177
- <xsl:with-param name="table-row" select="../*[local-name()='thead']/*[local-name()='tr'][1]"/>
12178
- </xsl:call-template>
12179
- </xsl:when>
12180
- <xsl:otherwise>
12181
- <!-- <xsl:value-of select="count(./*[local-name()='tr'][1]/*[local-name()='td'])"/> -->
12182
- <xsl:call-template name="calculate-columns-numbers">
12183
- <xsl:with-param name="table-row" select="./*[local-name()='tr'][1]"/>
12184
- </xsl:call-template>
12185
- </xsl:otherwise>
12186
- </xsl:choose>
12187
- </xsl:variable>
12188
-
12234
+
12235
+ <xsl:apply-templates select="../*[local-name()='thead']" mode="process"/>
12236
+
12237
+ <xsl:call-template name="insertTableFooter"/>
12238
+
12189
12239
  <fo:table-body>
12190
- <xsl:apply-templates select="../*[local-name()='thead']" mode="process"/>
12191
12240
  <xsl:apply-templates/>
12192
- <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/>
12193
- <!-- if there are note(s) or fn(s) then create footer row -->
12194
- <xsl:if test="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']">
12195
- <fo:table-row>
12196
- <fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
12197
-
12198
-
12199
-
12200
- <!-- fn will be processed inside 'note' processing -->
12201
-
12202
-
12203
- <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
12204
-
12205
- <!-- horizontal row separator -->
12206
-
12207
-
12208
- <!-- fn processing -->
12209
- <xsl:call-template name="fn_display"/>
12210
-
12211
- </fo:table-cell>
12212
- </fo:table-row>
12213
-
12214
- </xsl:if>
12241
+ <!-- <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/> -->
12242
+
12215
12243
  </fo:table-body>
12244
+
12216
12245
  </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='tr']">
12217
12246
  <xsl:variable name="parent-name" select="local-name(..)"/>
12218
12247
  <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
@@ -12230,6 +12259,7 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12230
12259
 
12231
12260
  </xsl:if>
12232
12261
 
12262
+
12233
12263
  <xsl:apply-templates/>
12234
12264
  </fo:table-row>
12235
12265
  </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='th']">
@@ -12278,6 +12308,8 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12278
12308
 
12279
12309
 
12280
12310
 
12311
+
12312
+
12281
12313
  <xsl:if test="ancestor::*[local-name()='sections']">
12282
12314
  <xsl:attribute name="border">solid black 0pt</xsl:attribute>
12283
12315
  <xsl:attribute name="padding-top">1mm</xsl:attribute>
@@ -12317,10 +12349,13 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12317
12349
  <fo:block font-size="10pt" margin-bottom="12pt">
12318
12350
 
12319
12351
 
12352
+
12320
12353
  <fo:inline padding-right="2mm">
12354
+
12321
12355
  <xsl:text>NOTE </xsl:text>
12322
12356
 
12323
12357
 
12358
+
12324
12359
  <xsl:number format="1 "/>
12325
12360
 
12326
12361
  </fo:inline>
@@ -12345,6 +12380,7 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12345
12380
  <fo:block margin-bottom="12pt">
12346
12381
 
12347
12382
 
12383
+
12348
12384
  <fo:inline font-size="80%" padding-right="5mm" id="{@id}">
12349
12385
 
12350
12386
  <xsl:attribute name="vertical-align">super</xsl:attribute>
@@ -12353,6 +12389,7 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12353
12389
 
12354
12390
 
12355
12391
 
12392
+
12356
12393
  <xsl:value-of select="@reference"/>
12357
12394
 
12358
12395
  </fo:inline>
@@ -12436,6 +12473,7 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12436
12473
 
12437
12474
 
12438
12475
 
12476
+
12439
12477
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
12440
12478
 
12441
12479
  <xsl:value-of select="@reference"/>
@@ -12457,7 +12495,7 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12457
12495
 
12458
12496
 
12459
12497
  <fo:block margin-bottom="12pt" text-align="left">
12460
-
12498
+
12461
12499
  <xsl:text>where </xsl:text>
12462
12500
  <xsl:apply-templates select="*[local-name()='dt']/*"/>
12463
12501
  <xsl:text/>
@@ -12470,6 +12508,7 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12470
12508
 
12471
12509
 
12472
12510
 
12511
+
12473
12512
  <xsl:text>where</xsl:text>
12474
12513
  </fo:block>
12475
12514
  </xsl:when>
@@ -12477,6 +12516,7 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12477
12516
  <fo:block font-weight="bold" text-align="left" margin-bottom="12pt">
12478
12517
 
12479
12518
 
12519
+
12480
12520
  <xsl:text>Key</xsl:text>
12481
12521
  </fo:block>
12482
12522
  </xsl:when>
@@ -12488,9 +12528,9 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12488
12528
 
12489
12529
 
12490
12530
 
12491
-
12492
12531
  <fo:block>
12493
12532
 
12533
+
12494
12534
  <!-- create virtual html table for dl/[dt and dd] -->
12495
12535
  <xsl:variable name="html-table">
12496
12536
  <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
@@ -12510,6 +12550,7 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12510
12550
  <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
12511
12551
 
12512
12552
  <fo:table width="95%" table-layout="fixed">
12553
+
12513
12554
  <xsl:choose>
12514
12555
  <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'">
12515
12556
  <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
@@ -12609,6 +12650,7 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12609
12650
  <fo:table-cell>
12610
12651
  <fo:block margin-top="6pt">
12611
12652
 
12653
+
12612
12654
  <xsl:if test="normalize-space($key_iso) = 'true'">
12613
12655
  <xsl:attribute name="margin-top">0</xsl:attribute>
12614
12656
 
@@ -12616,6 +12658,7 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12616
12658
 
12617
12659
 
12618
12660
  <xsl:apply-templates/>
12661
+
12619
12662
  </fo:block>
12620
12663
  </fo:table-cell>
12621
12664
  <fo:table-cell>
@@ -12634,7 +12677,7 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12634
12677
  </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='dd']"/><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='dd']" mode="process">
12635
12678
  <xsl:apply-templates/>
12636
12679
  </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='dd']/*[local-name()='p']" mode="inline">
12637
- <fo:inline><xsl:apply-templates/></fo:inline>
12680
+ <fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
12638
12681
  </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='em']">
12639
12682
  <fo:inline font-style="italic">
12640
12683
  <xsl:apply-templates/>
@@ -12749,6 +12792,7 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12749
12792
  <xsl:variable name="zero-space-after-dot">.</xsl:variable>
12750
12793
  <xsl:variable name="zero-space-after-colon">:</xsl:variable>
12751
12794
  <xsl:variable name="zero-space-after-equal">=</xsl:variable>
12795
+ <xsl:variable name="zero-space-after-underscore">_</xsl:variable>
12752
12796
  <xsl:variable name="zero-space">​</xsl:variable>
12753
12797
  <xsl:choose>
12754
12798
  <xsl:when test="contains($text, $zero-space-after-chars)">
@@ -12783,6 +12827,14 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12783
12827
  <xsl:with-param name="text" select="substring-after($text, $zero-space-after-equal)"/>
12784
12828
  </xsl:call-template>
12785
12829
  </xsl:when>
12830
+ <xsl:when test="contains($text, $zero-space-after-underscore)">
12831
+ <xsl:value-of select="substring-before($text, $zero-space-after-underscore)"/>
12832
+ <xsl:value-of select="$zero-space-after-underscore"/>
12833
+ <xsl:value-of select="$zero-space"/>
12834
+ <xsl:call-template name="add-zero-spaces">
12835
+ <xsl:with-param name="text" select="substring-after($text, $zero-space-after-underscore)"/>
12836
+ </xsl:call-template>
12837
+ </xsl:when>
12786
12838
  <xsl:otherwise>
12787
12839
  <xsl:value-of select="$text"/>
12788
12840
  </xsl:otherwise>
@@ -12959,4 +13011,40 @@ w+FwgnQ4HA4nSIfD4XCCdDgcDidIh8Ph6HT8T4ABAB91/nepRFURAAAAAElFTkSuQmCC
12959
13011
  <xsl:copy-of select="."/>
12960
13012
  </fo:instream-foreign-object>
12961
13013
  </fo:inline>
13014
+ </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='localityStack']">
13015
+ <xsl:for-each select="*[local-name()='locality']">
13016
+ <xsl:if test="position() =1"><xsl:text>, </xsl:text></xsl:if>
13017
+ <xsl:apply-templates select="."/>
13018
+ <xsl:if test="position() != last()"><xsl:text>; </xsl:text></xsl:if>
13019
+ </xsl:for-each>
13020
+ </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:ogc="https://www.metanorma.org/ns/ogc" match="*[local-name()='link']" name="link">
13021
+ <xsl:variable name="target">
13022
+ <xsl:choose>
13023
+ <xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
13024
+ <xsl:value-of select="normalize-space(substring-after(@target, 'mailto:'))"/>
13025
+ </xsl:when>
13026
+ <xsl:otherwise>
13027
+ <xsl:value-of select="normalize-space(@target)"/>
13028
+ </xsl:otherwise>
13029
+ </xsl:choose>
13030
+ </xsl:variable>
13031
+ <fo:inline xsl:use-attribute-sets="link-style">
13032
+ <xsl:choose>
13033
+ <xsl:when test="$target = ''">
13034
+ <xsl:apply-templates/>
13035
+ </xsl:when>
13036
+ <xsl:otherwise>
13037
+ <fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
13038
+ <xsl:choose>
13039
+ <xsl:when test="normalize-space(.) = ''">
13040
+ <xsl:value-of select="$target"/>
13041
+ </xsl:when>
13042
+ <xsl:otherwise>
13043
+ <xsl:apply-templates/>
13044
+ </xsl:otherwise>
13045
+ </xsl:choose>
13046
+ </fo:basic-link>
13047
+ </xsl:otherwise>
13048
+ </xsl:choose>
13049
+ </fo:inline>
12962
13050
  </xsl:template></xsl:stylesheet>
@@ -2,7 +2,7 @@ require "metanorma/processor"
2
2
 
3
3
  module Metanorma
4
4
  module UN
5
- def self.pdf_fonts
5
+ def self.fonts_used
6
6
  ["Arial", "Arial Black", "Courier", "Times New Roman", "HanSans"]
7
7
  end
8
8
 
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module UN
3
- VERSION = "0.3.7"
3
+ VERSION = "0.3.8"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-un
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-05-01 00:00:00.000000000 Z
11
+ date: 2020-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities