metanorma-un 0.12.0 → 0.12.3

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: 4c3c66613107924289af1b33291546fa8717b4996181af780f81297f752958cf
4
- data.tar.gz: 4995ac1ee1a94e5db030c0949092af32912b01f2c9f698029421ada090a602fc
3
+ metadata.gz: afef4ddbab8e145f16145d3073dab882a4655888e14361bfcd0cafa8df0df6f5
4
+ data.tar.gz: 376ced8cee4bb57461c1aeaaf4dc93d1160da3e08cdc2aa455c5e30faff1d5c7
5
5
  SHA512:
6
- metadata.gz: 444fb6a39677210cfc127e3b152951d5439f9db073804e6ab8ca129f31f2f7a4b3e6c683fed84fd79c2fe2bd87a60aa8ec020c4eb218e89ac8c4a56594096fae
7
- data.tar.gz: df48a2bb88f06daff0ab17270eb384dde091b5d863ad24d58c3ffa395eec7231ea2456369c503ed4af6a1b728dfea98bffc0dee78b6a51f34d2a6cc3ae42b3a3
6
+ metadata.gz: e78e0ea377c90c1f10c2dad246747f34d52bcc4135bf4d5528cec7cad043f72fe1546bbe53057eaf0ade3bbc421e95f3d311d3ffe61fe4b52c94adc26143b146
7
+ data.tar.gz: 5f951a6ac21e68a2bc21e4b60d855d8230f978d242fc96bbad62ca691287461cea5d9c8a8e686235510a0a2b5f7513f8eeda5483eddf855417d5f0d109541884
@@ -12,24 +12,22 @@ module IsoDoc
12
12
  end
13
13
 
14
14
  def title(isoxml, _out)
15
- main = isoxml&.at(ns("//bibdata/title"\
16
- "[@language='en' and @type='main']"))&.text
15
+ main = isoxml.at(ns("//bibdata/title[@language='en' and @type='main']"))
16
+ &.children&.to_xml
17
17
  set(:doctitle, main)
18
18
  end
19
19
 
20
20
  def subtitle(isoxml, _out)
21
- main = isoxml&.at(ns("//bibdata/title"\
22
- "[@language='en' and @type='subtitle']"))&.text
21
+ main = isoxml.at(ns("//bibdata/title[@language='en' and @type='subtitle']"))
22
+ &.children&.to_xml
23
23
  set(:docsubtitle, main)
24
24
  end
25
25
 
26
26
  def extract_languages(nodeset)
27
- lgs = []
28
- nodeset.each do |l|
29
- l && ISO_639.find(l.text)&.english_name and
30
- lgs << ISO_639.find(l.text).english_name
27
+ lgs = nodeset.each_with_object([]) do |l, m|
28
+ l and lg = ISO_639.find(l.text) and m << lg.english_name
31
29
  end
32
- lgs.map { |l| l == "Spanish; Castilian" ? "Spanish" : l }
30
+ lgs.compact.map { |l| l == "Spanish; Castilian" ? "Spanish" : l }
33
31
  end
34
32
 
35
33
  def author(isoxml, _out)
@@ -61,10 +59,7 @@ module IsoDoc
61
59
  set(:session_date, isoxml.at(ns("//bibdata/ext/session/date"))&.text)
62
60
  set(:session_collaborator,
63
61
  isoxml.at(ns("//bibdata/ext/session/collaborator"))&.text)
64
- sid = isoxml.at(ns("//bibdata/ext/session/id"))&.text
65
- set(:session_id, sid)
66
- set(:session_id_head, sid&.sub(%r{/.*$}, ""))
67
- set(:session_id_tail, sid&.sub(%r{^[^/]+}, ""))
62
+ session_id(isoxml)
68
63
  set(:item_footnote,
69
64
  isoxml.at(ns("//bibdata/ext/session/item-footnote"))&.text)
70
65
  set(:session_itemnumber,
@@ -75,6 +70,13 @@ module IsoDoc
75
70
  multival(isoxml, "//bibdata/ext/session/subitem-name"))
76
71
  end
77
72
 
73
+ def session_id(isoxml)
74
+ sid = isoxml.at(ns("//bibdata/ext/session/id"))&.text
75
+ set(:session_id, sid)
76
+ set(:session_id_head, sid&.sub(%r{/.*$}, ""))
77
+ set(:session_id_tail, sid&.sub(%r{^[^/]+}, ""))
78
+ end
79
+
78
80
  def docid(isoxml, _out)
79
81
  dn = isoxml.at(ns("//bibdata/docidentifier"))&.text
80
82
  set(:docnumber, dn)
@@ -1240,6 +1240,10 @@
1240
1240
 
1241
1241
  </xsl:attribute-set>
1242
1242
 
1243
+ <xsl:template name="refine_termexample-style">
1244
+
1245
+ </xsl:template>
1246
+
1243
1247
  <xsl:attribute-set name="example-style">
1244
1248
 
1245
1249
  </xsl:attribute-set> <!-- example-style -->
@@ -2345,6 +2349,36 @@
2345
2349
  </xsl:for-each>
2346
2350
  </xsl:template>
2347
2351
 
2352
+ <xsl:template name="processMainSectionsDefault_flatxml">
2353
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
2354
+ <xsl:sort select="@displayorder" data-type="number"/>
2355
+ <xsl:variable name="flatxml">
2356
+ <xsl:apply-templates select="." mode="flatxml"/>
2357
+ </xsl:variable>
2358
+ <!-- debug_flatxml='<xsl:copy-of select="$flatxml"/>' -->
2359
+ <xsl:apply-templates select="xalan:nodeset($flatxml)/*"/>
2360
+
2361
+ </xsl:for-each>
2362
+
2363
+ <xsl:for-each select="/*/*[local-name()='annex']">
2364
+ <xsl:sort select="@displayorder" data-type="number"/>
2365
+ <xsl:variable name="flatxml">
2366
+ <xsl:apply-templates select="." mode="flatxml"/>
2367
+ </xsl:variable>
2368
+ <!-- debug_flatxml='<xsl:copy-of select="$flatxml"/>' -->
2369
+ <xsl:apply-templates select="xalan:nodeset($flatxml)/*"/>
2370
+ </xsl:for-each>
2371
+
2372
+ <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
2373
+ <xsl:sort select="@displayorder" data-type="number"/>
2374
+ <xsl:variable name="flatxml">
2375
+ <xsl:apply-templates select="." mode="flatxml"/>
2376
+ </xsl:variable>
2377
+ <!-- debug_flatxml='<xsl:copy-of select="$flatxml"/>' -->
2378
+ <xsl:apply-templates select="xalan:nodeset($flatxml)/*"/>
2379
+ </xsl:for-each>
2380
+ </xsl:template>
2381
+
2348
2382
  <xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
2349
2383
  <xsl:variable name="tag_fo_inline_keep-together_within-line_open">###fo:inline keep-together_within-line###</xsl:variable>
2350
2384
  <xsl:variable name="tag_fo_inline_keep-together_within-line_close">###/fo:inline keep-together_within-line###</xsl:variable>
@@ -2471,7 +2505,9 @@
2471
2505
  </xsl:template> <!-- license-statement/p -->
2472
2506
 
2473
2507
  <xsl:template match="*[local-name()='legal-statement']">
2508
+ <xsl:param name="isLegacy">false</xsl:param>
2474
2509
  <fo:block xsl:use-attribute-sets="legal-statement-style">
2510
+
2475
2511
  <xsl:apply-templates/>
2476
2512
  </fo:block>
2477
2513
  </xsl:template> <!-- legal-statement -->
@@ -4425,13 +4461,13 @@
4425
4461
  <tr>
4426
4462
  <td>
4427
4463
  <xsl:attribute name="id">
4428
- <xsl:value-of select="concat($id,'_',$row_number,'_1')"/>
4464
+ <xsl:value-of select="concat($id,'@',$row_number,'_1')"/>
4429
4465
  </xsl:attribute>
4430
4466
  <xsl:apply-templates/>
4431
4467
  </td>
4432
4468
  <td>
4433
4469
  <xsl:attribute name="id">
4434
- <xsl:value-of select="concat($id,'_',$row_number,'_2')"/>
4470
+ <xsl:value-of select="concat($id,'@',$row_number,'_2')"/>
4435
4471
  </xsl:attribute>
4436
4472
 
4437
4473
  <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]">
@@ -4740,13 +4776,14 @@
4740
4776
  <!-- ================= -->
4741
4777
  <!-- Added,deleted text -->
4742
4778
  <!-- ================= -->
4743
- <xsl:template match="*[local-name()='add']" name="tag_add">
4779
+ <xsl:template match="*[local-name()='add'] | *[local-name() = 'change-open-tag'] | *[local-name() = 'change-close-tag']" name="tag_add">
4744
4780
  <xsl:param name="skip">true</xsl:param>
4745
4781
  <xsl:param name="block">false</xsl:param>
4746
4782
  <xsl:param name="type"/>
4747
4783
  <xsl:param name="text-align"/>
4748
4784
  <xsl:choose>
4749
- <xsl:when test="starts-with(., $ace_tag)"> <!-- examples: ace-tag_A1_start, ace-tag_A2_end, C1_start, AC_start -->
4785
+ <xsl:when test="starts-with(., $ace_tag) or local-name() = 'change-open-tag' or local-name() = 'change-close-tag'"> <!-- examples: ace-tag_A1_start, ace-tag_A2_end, C1_start, AC_start, or
4786
+ <change-open-tag>A<sub>1</sub></change-open-tag>, <change-close-tag>A<sub>1</sub></change-close-tag> -->
4750
4787
  <xsl:choose>
4751
4788
  <xsl:when test="$skip = 'true' and ((local-name(../..) = 'note' and not(preceding-sibling::node())) or (local-name(..) = 'title' and preceding-sibling::node()[1][local-name() = 'tab']) or local-name(..) = 'formattedref' and not(preceding-sibling::node())) and ../node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]"><!-- start tag displayed in template name="note" and title --></xsl:when>
4752
4789
  <xsl:otherwise>
@@ -4754,12 +4791,32 @@
4754
4791
  <xsl:call-template name="insertTag">
4755
4792
  <xsl:with-param name="type">
4756
4793
  <xsl:choose>
4794
+ <xsl:when test="local-name() = 'change-open-tag'">start</xsl:when>
4795
+ <xsl:when test="local-name() = 'change-close-tag'">end</xsl:when>
4757
4796
  <xsl:when test="$type = ''"><xsl:value-of select="substring-after(substring-after(., $ace_tag), '_')"/> <!-- start or end --></xsl:when>
4758
4797
  <xsl:otherwise><xsl:value-of select="$type"/></xsl:otherwise>
4759
4798
  </xsl:choose>
4760
4799
  </xsl:with-param>
4761
- <xsl:with-param name="kind" select="substring(substring-before(substring-after(., $ace_tag), '_'), 1, 1)"/> <!-- A or C -->
4762
- <xsl:with-param name="value" select="substring(substring-before(substring-after(., $ace_tag), '_'), 2)"/> <!-- 1, 2, C -->
4800
+ <xsl:with-param name="kind">
4801
+ <xsl:choose>
4802
+ <xsl:when test="local-name() = 'change-open-tag' or local-name() = 'change-close-tag'">
4803
+ <xsl:value-of select="text()"/>
4804
+ </xsl:when>
4805
+ <xsl:otherwise>
4806
+ <xsl:value-of select="substring(substring-before(substring-after(., $ace_tag), '_'), 1, 1)"/> <!-- A or C -->
4807
+ </xsl:otherwise>
4808
+ </xsl:choose>
4809
+ </xsl:with-param>
4810
+ <xsl:with-param name="value">
4811
+ <xsl:choose>
4812
+ <xsl:when test="local-name() = 'change-open-tag' or local-name() = 'change-close-tag'">
4813
+ <xsl:value-of select="*[local-name() = 'sub']"/>
4814
+ </xsl:when>
4815
+ <xsl:otherwise>
4816
+ <xsl:value-of select="substring(substring-before(substring-after(., $ace_tag), '_'), 2)"/> <!-- 1, 2, C -->
4817
+ </xsl:otherwise>
4818
+ </xsl:choose>
4819
+ </xsl:with-param>
4763
4820
  </xsl:call-template>
4764
4821
  </xsl:variable>
4765
4822
  <xsl:choose>
@@ -5019,6 +5076,10 @@
5019
5076
  <fo:inline keep-with-next.within-line="always"><xsl:value-of select="."/></fo:inline>
5020
5077
  </xsl:template>
5021
5078
 
5079
+ <xsl:template match="*[local-name() = 'span'][contains(@style, 'text-transform:none')]//text()" priority="5">
5080
+ <xsl:value-of select="."/>
5081
+ </xsl:template>
5082
+
5022
5083
  <!-- ========================= -->
5023
5084
  <!-- END Rich text formatting -->
5024
5085
  <!-- ========================= -->
@@ -5649,7 +5710,7 @@
5649
5710
  </xsl:choose>
5650
5711
  </xsl:variable>
5651
5712
  <xsl:attribute name="id">
5652
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_',$divide)"/>
5713
+ <xsl:value-of select="concat($id,'@',$row_number,'_',$col_number,'_',$divide)"/>
5653
5714
  </xsl:attribute>
5654
5715
 
5655
5716
  <xsl:for-each select="*[local-name() = 'p']">
@@ -5657,7 +5718,7 @@
5657
5718
  <xsl:copy-of select="@*"/>
5658
5719
  <xsl:variable name="p_num" select="count(preceding-sibling::*[local-name() = 'p']) + 1"/>
5659
5720
  <xsl:attribute name="id">
5660
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_p_',$p_num,'_',$divide)"/>
5721
+ <xsl:value-of select="concat($id,'@',$row_number,'_',$col_number,'_p_',$p_num,'_',$divide)"/>
5661
5722
  </xsl:attribute>
5662
5723
 
5663
5724
  <!-- <xsl:copy-of select="node()" /> -->
@@ -5721,7 +5782,7 @@
5721
5782
  <xsl:variable name="num" select="count(preceding-sibling::word) + 1"/>
5722
5783
  <xsl:copy>
5723
5784
  <xsl:attribute name="id">
5724
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_word_',$num,'_',$divide)"/>
5785
+ <xsl:value-of select="concat($id,'@',$row_number,'_',$col_number,'_word_',$num,'_',$divide)"/>
5725
5786
  </xsl:attribute>
5726
5787
  <xsl:copy-of select="node()"/>
5727
5788
  </xsl:copy>
@@ -6976,11 +7037,17 @@
6976
7037
  </xsl:when>
6977
7038
  <xsl:otherwise>
6978
7039
 
7040
+ <xsl:variable name="image_class" select="ancestor::*[local-name() = 'image']/@class"/>
7041
+ <xsl:variable name="ancestor_table_cell" select="normalize-space(ancestor::*[local-name() = 'td'] or ancestor::*[local-name() = 'th'])"/>
7042
+
6979
7043
  <xsl:variable name="element">
6980
7044
  <xsl:choose>
6981
7045
  <xsl:when test="ancestor::*[local-name() = 'tr'] and $isGenerateTableIF = 'true'">
6982
7046
  <fo:inline xsl:use-attribute-sets="image-style" text-align="left"/>
6983
7047
  </xsl:when>
7048
+ <xsl:when test="not(ancestor::*[local-name() = 'figure'])">
7049
+ <fo:inline xsl:use-attribute-sets="image-style" text-align="left"/>
7050
+ </xsl:when>
6984
7051
  <xsl:otherwise>
6985
7052
  <fo:block xsl:use-attribute-sets="image-style">
6986
7053
  <xsl:if test="ancestor::*[local-name() = 'dt']">
@@ -6996,10 +7063,24 @@
6996
7063
  <xsl:copy-of select="@*"/>
6997
7064
  <!-- <fo:block xsl:use-attribute-sets="image-style"> -->
6998
7065
  <fo:instream-foreign-object fox:alt-text="{$alt-text}">
6999
- <xsl:if test="$isGenerateTableIF = 'false'">
7000
- <xsl:attribute name="width">100%</xsl:attribute>
7001
- </xsl:if>
7002
- <xsl:attribute name="content-height">100%</xsl:attribute>
7066
+
7067
+ <xsl:choose>
7068
+ <xsl:when test="$image_class = 'corrigenda-tag'">
7069
+ <xsl:attribute name="fox:alt-text">CorrigendaTag</xsl:attribute>
7070
+ <xsl:attribute name="baseline-shift">-10%</xsl:attribute>
7071
+ <xsl:if test="$ancestor_table_cell = 'true'">
7072
+ <xsl:attribute name="baseline-shift">-25%</xsl:attribute>
7073
+ </xsl:if>
7074
+ <xsl:attribute name="height">3.5mm</xsl:attribute>
7075
+ </xsl:when>
7076
+ <xsl:otherwise>
7077
+ <xsl:if test="$isGenerateTableIF = 'false'">
7078
+ <xsl:attribute name="width">100%</xsl:attribute>
7079
+ </xsl:if>
7080
+ <xsl:attribute name="content-height">100%</xsl:attribute>
7081
+ </xsl:otherwise>
7082
+ </xsl:choose>
7083
+
7003
7084
  <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
7004
7085
  <xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
7005
7086
  <xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
@@ -8514,7 +8595,7 @@
8514
8595
  <!-- ====== -->
8515
8596
  <xsl:template match="*[local-name() = 'termexample']">
8516
8597
  <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
8517
-
8598
+ <xsl:call-template name="refine_termexample-style"/>
8518
8599
  <xsl:call-template name="setBlockSpanAll"/>
8519
8600
 
8520
8601
  <xsl:apply-templates select="*[local-name()='name']"/>
@@ -9207,13 +9288,19 @@
9207
9288
  <fo:block id="{@id}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
9208
9289
  </xsl:when>
9209
9290
  <!-- if there isn't element with id 'from', then create 'bookmark' here -->
9210
- <xsl:when test="not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
9291
+ <xsl:when test="ancestor::*[contains(local-name(), '-standard')] and not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
9292
+ <fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
9293
+ </xsl:when>
9294
+ <xsl:when test="not(//*[@id = $id_from]) and not(preceding-sibling::*[@id = $id_from])">
9211
9295
  <fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
9212
9296
  </xsl:when>
9213
9297
  </xsl:choose>
9214
9298
 
9215
9299
  </xsl:template>
9216
9300
 
9301
+ <!-- https://github.com/metanorma/mn-samples-bsi/issues/312 -->
9302
+ <xsl:template match="*[local-name() = 'review'][@type = 'other']"/>
9303
+
9217
9304
  <xsl:template match="*[local-name() = 'name']/text()">
9218
9305
  <!-- 0xA0 to space replacement -->
9219
9306
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
@@ -10803,7 +10890,7 @@
10803
10890
 
10804
10891
  <xsl:template name="printEdition">
10805
10892
  <xsl:variable name="edition_i18n" select="normalize-space((//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) != ''])"/>
10806
- <xsl:text> </xsl:text>
10893
+
10807
10894
  <xsl:choose>
10808
10895
  <xsl:when test="$edition_i18n != ''">
10809
10896
  <!-- Example: <edition language="fr">deuxième édition</edition> -->
@@ -1240,6 +1240,10 @@
1240
1240
 
1241
1241
  </xsl:attribute-set>
1242
1242
 
1243
+ <xsl:template name="refine_termexample-style">
1244
+
1245
+ </xsl:template>
1246
+
1243
1247
  <xsl:attribute-set name="example-style">
1244
1248
 
1245
1249
  </xsl:attribute-set> <!-- example-style -->
@@ -2345,6 +2349,36 @@
2345
2349
  </xsl:for-each>
2346
2350
  </xsl:template>
2347
2351
 
2352
+ <xsl:template name="processMainSectionsDefault_flatxml">
2353
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
2354
+ <xsl:sort select="@displayorder" data-type="number"/>
2355
+ <xsl:variable name="flatxml">
2356
+ <xsl:apply-templates select="." mode="flatxml"/>
2357
+ </xsl:variable>
2358
+ <!-- debug_flatxml='<xsl:copy-of select="$flatxml"/>' -->
2359
+ <xsl:apply-templates select="xalan:nodeset($flatxml)/*"/>
2360
+
2361
+ </xsl:for-each>
2362
+
2363
+ <xsl:for-each select="/*/*[local-name()='annex']">
2364
+ <xsl:sort select="@displayorder" data-type="number"/>
2365
+ <xsl:variable name="flatxml">
2366
+ <xsl:apply-templates select="." mode="flatxml"/>
2367
+ </xsl:variable>
2368
+ <!-- debug_flatxml='<xsl:copy-of select="$flatxml"/>' -->
2369
+ <xsl:apply-templates select="xalan:nodeset($flatxml)/*"/>
2370
+ </xsl:for-each>
2371
+
2372
+ <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
2373
+ <xsl:sort select="@displayorder" data-type="number"/>
2374
+ <xsl:variable name="flatxml">
2375
+ <xsl:apply-templates select="." mode="flatxml"/>
2376
+ </xsl:variable>
2377
+ <!-- debug_flatxml='<xsl:copy-of select="$flatxml"/>' -->
2378
+ <xsl:apply-templates select="xalan:nodeset($flatxml)/*"/>
2379
+ </xsl:for-each>
2380
+ </xsl:template>
2381
+
2348
2382
  <xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
2349
2383
  <xsl:variable name="tag_fo_inline_keep-together_within-line_open">###fo:inline keep-together_within-line###</xsl:variable>
2350
2384
  <xsl:variable name="tag_fo_inline_keep-together_within-line_close">###/fo:inline keep-together_within-line###</xsl:variable>
@@ -2471,7 +2505,9 @@
2471
2505
  </xsl:template> <!-- license-statement/p -->
2472
2506
 
2473
2507
  <xsl:template match="*[local-name()='legal-statement']">
2508
+ <xsl:param name="isLegacy">false</xsl:param>
2474
2509
  <fo:block xsl:use-attribute-sets="legal-statement-style">
2510
+
2475
2511
  <xsl:apply-templates/>
2476
2512
  </fo:block>
2477
2513
  </xsl:template> <!-- legal-statement -->
@@ -4425,13 +4461,13 @@
4425
4461
  <tr>
4426
4462
  <td>
4427
4463
  <xsl:attribute name="id">
4428
- <xsl:value-of select="concat($id,'_',$row_number,'_1')"/>
4464
+ <xsl:value-of select="concat($id,'@',$row_number,'_1')"/>
4429
4465
  </xsl:attribute>
4430
4466
  <xsl:apply-templates/>
4431
4467
  </td>
4432
4468
  <td>
4433
4469
  <xsl:attribute name="id">
4434
- <xsl:value-of select="concat($id,'_',$row_number,'_2')"/>
4470
+ <xsl:value-of select="concat($id,'@',$row_number,'_2')"/>
4435
4471
  </xsl:attribute>
4436
4472
 
4437
4473
  <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]">
@@ -4740,13 +4776,14 @@
4740
4776
  <!-- ================= -->
4741
4777
  <!-- Added,deleted text -->
4742
4778
  <!-- ================= -->
4743
- <xsl:template match="*[local-name()='add']" name="tag_add">
4779
+ <xsl:template match="*[local-name()='add'] | *[local-name() = 'change-open-tag'] | *[local-name() = 'change-close-tag']" name="tag_add">
4744
4780
  <xsl:param name="skip">true</xsl:param>
4745
4781
  <xsl:param name="block">false</xsl:param>
4746
4782
  <xsl:param name="type"/>
4747
4783
  <xsl:param name="text-align"/>
4748
4784
  <xsl:choose>
4749
- <xsl:when test="starts-with(., $ace_tag)"> <!-- examples: ace-tag_A1_start, ace-tag_A2_end, C1_start, AC_start -->
4785
+ <xsl:when test="starts-with(., $ace_tag) or local-name() = 'change-open-tag' or local-name() = 'change-close-tag'"> <!-- examples: ace-tag_A1_start, ace-tag_A2_end, C1_start, AC_start, or
4786
+ <change-open-tag>A<sub>1</sub></change-open-tag>, <change-close-tag>A<sub>1</sub></change-close-tag> -->
4750
4787
  <xsl:choose>
4751
4788
  <xsl:when test="$skip = 'true' and ((local-name(../..) = 'note' and not(preceding-sibling::node())) or (local-name(..) = 'title' and preceding-sibling::node()[1][local-name() = 'tab']) or local-name(..) = 'formattedref' and not(preceding-sibling::node())) and ../node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]"><!-- start tag displayed in template name="note" and title --></xsl:when>
4752
4789
  <xsl:otherwise>
@@ -4754,12 +4791,32 @@
4754
4791
  <xsl:call-template name="insertTag">
4755
4792
  <xsl:with-param name="type">
4756
4793
  <xsl:choose>
4794
+ <xsl:when test="local-name() = 'change-open-tag'">start</xsl:when>
4795
+ <xsl:when test="local-name() = 'change-close-tag'">end</xsl:when>
4757
4796
  <xsl:when test="$type = ''"><xsl:value-of select="substring-after(substring-after(., $ace_tag), '_')"/> <!-- start or end --></xsl:when>
4758
4797
  <xsl:otherwise><xsl:value-of select="$type"/></xsl:otherwise>
4759
4798
  </xsl:choose>
4760
4799
  </xsl:with-param>
4761
- <xsl:with-param name="kind" select="substring(substring-before(substring-after(., $ace_tag), '_'), 1, 1)"/> <!-- A or C -->
4762
- <xsl:with-param name="value" select="substring(substring-before(substring-after(., $ace_tag), '_'), 2)"/> <!-- 1, 2, C -->
4800
+ <xsl:with-param name="kind">
4801
+ <xsl:choose>
4802
+ <xsl:when test="local-name() = 'change-open-tag' or local-name() = 'change-close-tag'">
4803
+ <xsl:value-of select="text()"/>
4804
+ </xsl:when>
4805
+ <xsl:otherwise>
4806
+ <xsl:value-of select="substring(substring-before(substring-after(., $ace_tag), '_'), 1, 1)"/> <!-- A or C -->
4807
+ </xsl:otherwise>
4808
+ </xsl:choose>
4809
+ </xsl:with-param>
4810
+ <xsl:with-param name="value">
4811
+ <xsl:choose>
4812
+ <xsl:when test="local-name() = 'change-open-tag' or local-name() = 'change-close-tag'">
4813
+ <xsl:value-of select="*[local-name() = 'sub']"/>
4814
+ </xsl:when>
4815
+ <xsl:otherwise>
4816
+ <xsl:value-of select="substring(substring-before(substring-after(., $ace_tag), '_'), 2)"/> <!-- 1, 2, C -->
4817
+ </xsl:otherwise>
4818
+ </xsl:choose>
4819
+ </xsl:with-param>
4763
4820
  </xsl:call-template>
4764
4821
  </xsl:variable>
4765
4822
  <xsl:choose>
@@ -5019,6 +5076,10 @@
5019
5076
  <fo:inline keep-with-next.within-line="always"><xsl:value-of select="."/></fo:inline>
5020
5077
  </xsl:template>
5021
5078
 
5079
+ <xsl:template match="*[local-name() = 'span'][contains(@style, 'text-transform:none')]//text()" priority="5">
5080
+ <xsl:value-of select="."/>
5081
+ </xsl:template>
5082
+
5022
5083
  <!-- ========================= -->
5023
5084
  <!-- END Rich text formatting -->
5024
5085
  <!-- ========================= -->
@@ -5649,7 +5710,7 @@
5649
5710
  </xsl:choose>
5650
5711
  </xsl:variable>
5651
5712
  <xsl:attribute name="id">
5652
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_',$divide)"/>
5713
+ <xsl:value-of select="concat($id,'@',$row_number,'_',$col_number,'_',$divide)"/>
5653
5714
  </xsl:attribute>
5654
5715
 
5655
5716
  <xsl:for-each select="*[local-name() = 'p']">
@@ -5657,7 +5718,7 @@
5657
5718
  <xsl:copy-of select="@*"/>
5658
5719
  <xsl:variable name="p_num" select="count(preceding-sibling::*[local-name() = 'p']) + 1"/>
5659
5720
  <xsl:attribute name="id">
5660
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_p_',$p_num,'_',$divide)"/>
5721
+ <xsl:value-of select="concat($id,'@',$row_number,'_',$col_number,'_p_',$p_num,'_',$divide)"/>
5661
5722
  </xsl:attribute>
5662
5723
 
5663
5724
  <!-- <xsl:copy-of select="node()" /> -->
@@ -5721,7 +5782,7 @@
5721
5782
  <xsl:variable name="num" select="count(preceding-sibling::word) + 1"/>
5722
5783
  <xsl:copy>
5723
5784
  <xsl:attribute name="id">
5724
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_word_',$num,'_',$divide)"/>
5785
+ <xsl:value-of select="concat($id,'@',$row_number,'_',$col_number,'_word_',$num,'_',$divide)"/>
5725
5786
  </xsl:attribute>
5726
5787
  <xsl:copy-of select="node()"/>
5727
5788
  </xsl:copy>
@@ -6976,11 +7037,17 @@
6976
7037
  </xsl:when>
6977
7038
  <xsl:otherwise>
6978
7039
 
7040
+ <xsl:variable name="image_class" select="ancestor::*[local-name() = 'image']/@class"/>
7041
+ <xsl:variable name="ancestor_table_cell" select="normalize-space(ancestor::*[local-name() = 'td'] or ancestor::*[local-name() = 'th'])"/>
7042
+
6979
7043
  <xsl:variable name="element">
6980
7044
  <xsl:choose>
6981
7045
  <xsl:when test="ancestor::*[local-name() = 'tr'] and $isGenerateTableIF = 'true'">
6982
7046
  <fo:inline xsl:use-attribute-sets="image-style" text-align="left"/>
6983
7047
  </xsl:when>
7048
+ <xsl:when test="not(ancestor::*[local-name() = 'figure'])">
7049
+ <fo:inline xsl:use-attribute-sets="image-style" text-align="left"/>
7050
+ </xsl:when>
6984
7051
  <xsl:otherwise>
6985
7052
  <fo:block xsl:use-attribute-sets="image-style">
6986
7053
  <xsl:if test="ancestor::*[local-name() = 'dt']">
@@ -6996,10 +7063,24 @@
6996
7063
  <xsl:copy-of select="@*"/>
6997
7064
  <!-- <fo:block xsl:use-attribute-sets="image-style"> -->
6998
7065
  <fo:instream-foreign-object fox:alt-text="{$alt-text}">
6999
- <xsl:if test="$isGenerateTableIF = 'false'">
7000
- <xsl:attribute name="width">100%</xsl:attribute>
7001
- </xsl:if>
7002
- <xsl:attribute name="content-height">100%</xsl:attribute>
7066
+
7067
+ <xsl:choose>
7068
+ <xsl:when test="$image_class = 'corrigenda-tag'">
7069
+ <xsl:attribute name="fox:alt-text">CorrigendaTag</xsl:attribute>
7070
+ <xsl:attribute name="baseline-shift">-10%</xsl:attribute>
7071
+ <xsl:if test="$ancestor_table_cell = 'true'">
7072
+ <xsl:attribute name="baseline-shift">-25%</xsl:attribute>
7073
+ </xsl:if>
7074
+ <xsl:attribute name="height">3.5mm</xsl:attribute>
7075
+ </xsl:when>
7076
+ <xsl:otherwise>
7077
+ <xsl:if test="$isGenerateTableIF = 'false'">
7078
+ <xsl:attribute name="width">100%</xsl:attribute>
7079
+ </xsl:if>
7080
+ <xsl:attribute name="content-height">100%</xsl:attribute>
7081
+ </xsl:otherwise>
7082
+ </xsl:choose>
7083
+
7003
7084
  <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
7004
7085
  <xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
7005
7086
  <xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
@@ -8514,7 +8595,7 @@
8514
8595
  <!-- ====== -->
8515
8596
  <xsl:template match="*[local-name() = 'termexample']">
8516
8597
  <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
8517
-
8598
+ <xsl:call-template name="refine_termexample-style"/>
8518
8599
  <xsl:call-template name="setBlockSpanAll"/>
8519
8600
 
8520
8601
  <xsl:apply-templates select="*[local-name()='name']"/>
@@ -9207,13 +9288,19 @@
9207
9288
  <fo:block id="{@id}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
9208
9289
  </xsl:when>
9209
9290
  <!-- if there isn't element with id 'from', then create 'bookmark' here -->
9210
- <xsl:when test="not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
9291
+ <xsl:when test="ancestor::*[contains(local-name(), '-standard')] and not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
9292
+ <fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
9293
+ </xsl:when>
9294
+ <xsl:when test="not(//*[@id = $id_from]) and not(preceding-sibling::*[@id = $id_from])">
9211
9295
  <fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
9212
9296
  </xsl:when>
9213
9297
  </xsl:choose>
9214
9298
 
9215
9299
  </xsl:template>
9216
9300
 
9301
+ <!-- https://github.com/metanorma/mn-samples-bsi/issues/312 -->
9302
+ <xsl:template match="*[local-name() = 'review'][@type = 'other']"/>
9303
+
9217
9304
  <xsl:template match="*[local-name() = 'name']/text()">
9218
9305
  <!-- 0xA0 to space replacement -->
9219
9306
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
@@ -10803,7 +10890,7 @@
10803
10890
 
10804
10891
  <xsl:template name="printEdition">
10805
10892
  <xsl:variable name="edition_i18n" select="normalize-space((//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) != ''])"/>
10806
- <xsl:text> </xsl:text>
10893
+
10807
10894
  <xsl:choose>
10808
10895
  <xsl:when test="$edition_i18n != ''">
10809
10896
  <!-- Example: <edition language="fr">deuxième édition</edition> -->
@@ -1346,6 +1346,10 @@
1346
1346
 
1347
1347
  </xsl:attribute-set>
1348
1348
 
1349
+ <xsl:template name="refine_termexample-style">
1350
+
1351
+ </xsl:template>
1352
+
1349
1353
  <xsl:attribute-set name="example-style">
1350
1354
 
1351
1355
  </xsl:attribute-set> <!-- example-style -->
@@ -2476,6 +2480,36 @@
2476
2480
  </xsl:for-each>
2477
2481
  </xsl:template>
2478
2482
 
2483
+ <xsl:template name="processMainSectionsDefault_flatxml">
2484
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
2485
+ <xsl:sort select="@displayorder" data-type="number"/>
2486
+ <xsl:variable name="flatxml">
2487
+ <xsl:apply-templates select="." mode="flatxml"/>
2488
+ </xsl:variable>
2489
+ <!-- debug_flatxml='<xsl:copy-of select="$flatxml"/>' -->
2490
+ <xsl:apply-templates select="xalan:nodeset($flatxml)/*"/>
2491
+
2492
+ </xsl:for-each>
2493
+
2494
+ <xsl:for-each select="/*/*[local-name()='annex']">
2495
+ <xsl:sort select="@displayorder" data-type="number"/>
2496
+ <xsl:variable name="flatxml">
2497
+ <xsl:apply-templates select="." mode="flatxml"/>
2498
+ </xsl:variable>
2499
+ <!-- debug_flatxml='<xsl:copy-of select="$flatxml"/>' -->
2500
+ <xsl:apply-templates select="xalan:nodeset($flatxml)/*"/>
2501
+ </xsl:for-each>
2502
+
2503
+ <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
2504
+ <xsl:sort select="@displayorder" data-type="number"/>
2505
+ <xsl:variable name="flatxml">
2506
+ <xsl:apply-templates select="." mode="flatxml"/>
2507
+ </xsl:variable>
2508
+ <!-- debug_flatxml='<xsl:copy-of select="$flatxml"/>' -->
2509
+ <xsl:apply-templates select="xalan:nodeset($flatxml)/*"/>
2510
+ </xsl:for-each>
2511
+ </xsl:template>
2512
+
2479
2513
  <xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
2480
2514
  <xsl:variable name="tag_fo_inline_keep-together_within-line_open">###fo:inline keep-together_within-line###</xsl:variable>
2481
2515
  <xsl:variable name="tag_fo_inline_keep-together_within-line_close">###/fo:inline keep-together_within-line###</xsl:variable>
@@ -2602,7 +2636,9 @@
2602
2636
  </xsl:template> <!-- license-statement/p -->
2603
2637
 
2604
2638
  <xsl:template match="*[local-name()='legal-statement']">
2639
+ <xsl:param name="isLegacy">false</xsl:param>
2605
2640
  <fo:block xsl:use-attribute-sets="legal-statement-style">
2641
+
2606
2642
  <xsl:apply-templates/>
2607
2643
  </fo:block>
2608
2644
  </xsl:template> <!-- legal-statement -->
@@ -4552,13 +4588,13 @@
4552
4588
  <tr>
4553
4589
  <td>
4554
4590
  <xsl:attribute name="id">
4555
- <xsl:value-of select="concat($id,'_',$row_number,'_1')"/>
4591
+ <xsl:value-of select="concat($id,'@',$row_number,'_1')"/>
4556
4592
  </xsl:attribute>
4557
4593
  <xsl:apply-templates/>
4558
4594
  </td>
4559
4595
  <td>
4560
4596
  <xsl:attribute name="id">
4561
- <xsl:value-of select="concat($id,'_',$row_number,'_2')"/>
4597
+ <xsl:value-of select="concat($id,'@',$row_number,'_2')"/>
4562
4598
  </xsl:attribute>
4563
4599
 
4564
4600
  <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]">
@@ -4867,13 +4903,14 @@
4867
4903
  <!-- ================= -->
4868
4904
  <!-- Added,deleted text -->
4869
4905
  <!-- ================= -->
4870
- <xsl:template match="*[local-name()='add']" name="tag_add">
4906
+ <xsl:template match="*[local-name()='add'] | *[local-name() = 'change-open-tag'] | *[local-name() = 'change-close-tag']" name="tag_add">
4871
4907
  <xsl:param name="skip">true</xsl:param>
4872
4908
  <xsl:param name="block">false</xsl:param>
4873
4909
  <xsl:param name="type"/>
4874
4910
  <xsl:param name="text-align"/>
4875
4911
  <xsl:choose>
4876
- <xsl:when test="starts-with(., $ace_tag)"> <!-- examples: ace-tag_A1_start, ace-tag_A2_end, C1_start, AC_start -->
4912
+ <xsl:when test="starts-with(., $ace_tag) or local-name() = 'change-open-tag' or local-name() = 'change-close-tag'"> <!-- examples: ace-tag_A1_start, ace-tag_A2_end, C1_start, AC_start, or
4913
+ <change-open-tag>A<sub>1</sub></change-open-tag>, <change-close-tag>A<sub>1</sub></change-close-tag> -->
4877
4914
  <xsl:choose>
4878
4915
  <xsl:when test="$skip = 'true' and ((local-name(../..) = 'note' and not(preceding-sibling::node())) or (local-name(..) = 'title' and preceding-sibling::node()[1][local-name() = 'tab']) or local-name(..) = 'formattedref' and not(preceding-sibling::node())) and ../node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]"><!-- start tag displayed in template name="note" and title --></xsl:when>
4879
4916
  <xsl:otherwise>
@@ -4881,12 +4918,32 @@
4881
4918
  <xsl:call-template name="insertTag">
4882
4919
  <xsl:with-param name="type">
4883
4920
  <xsl:choose>
4921
+ <xsl:when test="local-name() = 'change-open-tag'">start</xsl:when>
4922
+ <xsl:when test="local-name() = 'change-close-tag'">end</xsl:when>
4884
4923
  <xsl:when test="$type = ''"><xsl:value-of select="substring-after(substring-after(., $ace_tag), '_')"/> <!-- start or end --></xsl:when>
4885
4924
  <xsl:otherwise><xsl:value-of select="$type"/></xsl:otherwise>
4886
4925
  </xsl:choose>
4887
4926
  </xsl:with-param>
4888
- <xsl:with-param name="kind" select="substring(substring-before(substring-after(., $ace_tag), '_'), 1, 1)"/> <!-- A or C -->
4889
- <xsl:with-param name="value" select="substring(substring-before(substring-after(., $ace_tag), '_'), 2)"/> <!-- 1, 2, C -->
4927
+ <xsl:with-param name="kind">
4928
+ <xsl:choose>
4929
+ <xsl:when test="local-name() = 'change-open-tag' or local-name() = 'change-close-tag'">
4930
+ <xsl:value-of select="text()"/>
4931
+ </xsl:when>
4932
+ <xsl:otherwise>
4933
+ <xsl:value-of select="substring(substring-before(substring-after(., $ace_tag), '_'), 1, 1)"/> <!-- A or C -->
4934
+ </xsl:otherwise>
4935
+ </xsl:choose>
4936
+ </xsl:with-param>
4937
+ <xsl:with-param name="value">
4938
+ <xsl:choose>
4939
+ <xsl:when test="local-name() = 'change-open-tag' or local-name() = 'change-close-tag'">
4940
+ <xsl:value-of select="*[local-name() = 'sub']"/>
4941
+ </xsl:when>
4942
+ <xsl:otherwise>
4943
+ <xsl:value-of select="substring(substring-before(substring-after(., $ace_tag), '_'), 2)"/> <!-- 1, 2, C -->
4944
+ </xsl:otherwise>
4945
+ </xsl:choose>
4946
+ </xsl:with-param>
4890
4947
  </xsl:call-template>
4891
4948
  </xsl:variable>
4892
4949
  <xsl:choose>
@@ -5146,6 +5203,10 @@
5146
5203
  <fo:inline keep-with-next.within-line="always"><xsl:value-of select="."/></fo:inline>
5147
5204
  </xsl:template>
5148
5205
 
5206
+ <xsl:template match="*[local-name() = 'span'][contains(@style, 'text-transform:none')]//text()" priority="5">
5207
+ <xsl:value-of select="."/>
5208
+ </xsl:template>
5209
+
5149
5210
  <!-- ========================= -->
5150
5211
  <!-- END Rich text formatting -->
5151
5212
  <!-- ========================= -->
@@ -5776,7 +5837,7 @@
5776
5837
  </xsl:choose>
5777
5838
  </xsl:variable>
5778
5839
  <xsl:attribute name="id">
5779
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_',$divide)"/>
5840
+ <xsl:value-of select="concat($id,'@',$row_number,'_',$col_number,'_',$divide)"/>
5780
5841
  </xsl:attribute>
5781
5842
 
5782
5843
  <xsl:for-each select="*[local-name() = 'p']">
@@ -5784,7 +5845,7 @@
5784
5845
  <xsl:copy-of select="@*"/>
5785
5846
  <xsl:variable name="p_num" select="count(preceding-sibling::*[local-name() = 'p']) + 1"/>
5786
5847
  <xsl:attribute name="id">
5787
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_p_',$p_num,'_',$divide)"/>
5848
+ <xsl:value-of select="concat($id,'@',$row_number,'_',$col_number,'_p_',$p_num,'_',$divide)"/>
5788
5849
  </xsl:attribute>
5789
5850
 
5790
5851
  <!-- <xsl:copy-of select="node()" /> -->
@@ -5848,7 +5909,7 @@
5848
5909
  <xsl:variable name="num" select="count(preceding-sibling::word) + 1"/>
5849
5910
  <xsl:copy>
5850
5911
  <xsl:attribute name="id">
5851
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_word_',$num,'_',$divide)"/>
5912
+ <xsl:value-of select="concat($id,'@',$row_number,'_',$col_number,'_word_',$num,'_',$divide)"/>
5852
5913
  </xsl:attribute>
5853
5914
  <xsl:copy-of select="node()"/>
5854
5915
  </xsl:copy>
@@ -7103,11 +7164,17 @@
7103
7164
  </xsl:when>
7104
7165
  <xsl:otherwise>
7105
7166
 
7167
+ <xsl:variable name="image_class" select="ancestor::*[local-name() = 'image']/@class"/>
7168
+ <xsl:variable name="ancestor_table_cell" select="normalize-space(ancestor::*[local-name() = 'td'] or ancestor::*[local-name() = 'th'])"/>
7169
+
7106
7170
  <xsl:variable name="element">
7107
7171
  <xsl:choose>
7108
7172
  <xsl:when test="ancestor::*[local-name() = 'tr'] and $isGenerateTableIF = 'true'">
7109
7173
  <fo:inline xsl:use-attribute-sets="image-style" text-align="left"/>
7110
7174
  </xsl:when>
7175
+ <xsl:when test="not(ancestor::*[local-name() = 'figure'])">
7176
+ <fo:inline xsl:use-attribute-sets="image-style" text-align="left"/>
7177
+ </xsl:when>
7111
7178
  <xsl:otherwise>
7112
7179
  <fo:block xsl:use-attribute-sets="image-style">
7113
7180
  <xsl:if test="ancestor::*[local-name() = 'dt']">
@@ -7123,10 +7190,24 @@
7123
7190
  <xsl:copy-of select="@*"/>
7124
7191
  <!-- <fo:block xsl:use-attribute-sets="image-style"> -->
7125
7192
  <fo:instream-foreign-object fox:alt-text="{$alt-text}">
7126
- <xsl:if test="$isGenerateTableIF = 'false'">
7127
- <xsl:attribute name="width">100%</xsl:attribute>
7128
- </xsl:if>
7129
- <xsl:attribute name="content-height">100%</xsl:attribute>
7193
+
7194
+ <xsl:choose>
7195
+ <xsl:when test="$image_class = 'corrigenda-tag'">
7196
+ <xsl:attribute name="fox:alt-text">CorrigendaTag</xsl:attribute>
7197
+ <xsl:attribute name="baseline-shift">-10%</xsl:attribute>
7198
+ <xsl:if test="$ancestor_table_cell = 'true'">
7199
+ <xsl:attribute name="baseline-shift">-25%</xsl:attribute>
7200
+ </xsl:if>
7201
+ <xsl:attribute name="height">3.5mm</xsl:attribute>
7202
+ </xsl:when>
7203
+ <xsl:otherwise>
7204
+ <xsl:if test="$isGenerateTableIF = 'false'">
7205
+ <xsl:attribute name="width">100%</xsl:attribute>
7206
+ </xsl:if>
7207
+ <xsl:attribute name="content-height">100%</xsl:attribute>
7208
+ </xsl:otherwise>
7209
+ </xsl:choose>
7210
+
7130
7211
  <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
7131
7212
  <xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
7132
7213
  <xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
@@ -8641,7 +8722,7 @@
8641
8722
  <!-- ====== -->
8642
8723
  <xsl:template match="*[local-name() = 'termexample']">
8643
8724
  <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
8644
-
8725
+ <xsl:call-template name="refine_termexample-style"/>
8645
8726
  <xsl:call-template name="setBlockSpanAll"/>
8646
8727
 
8647
8728
  <xsl:apply-templates select="*[local-name()='name']"/>
@@ -9334,13 +9415,19 @@
9334
9415
  <fo:block id="{@id}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
9335
9416
  </xsl:when>
9336
9417
  <!-- if there isn't element with id 'from', then create 'bookmark' here -->
9337
- <xsl:when test="not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
9418
+ <xsl:when test="ancestor::*[contains(local-name(), '-standard')] and not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
9419
+ <fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
9420
+ </xsl:when>
9421
+ <xsl:when test="not(//*[@id = $id_from]) and not(preceding-sibling::*[@id = $id_from])">
9338
9422
  <fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
9339
9423
  </xsl:when>
9340
9424
  </xsl:choose>
9341
9425
 
9342
9426
  </xsl:template>
9343
9427
 
9428
+ <!-- https://github.com/metanorma/mn-samples-bsi/issues/312 -->
9429
+ <xsl:template match="*[local-name() = 'review'][@type = 'other']"/>
9430
+
9344
9431
  <xsl:template match="*[local-name() = 'name']/text()">
9345
9432
  <!-- 0xA0 to space replacement -->
9346
9433
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
@@ -10931,7 +11018,7 @@
10931
11018
 
10932
11019
  <xsl:template name="printEdition">
10933
11020
  <xsl:variable name="edition_i18n" select="normalize-space((//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) != ''])"/>
10934
- <xsl:text> </xsl:text>
11021
+
10935
11022
  <xsl:choose>
10936
11023
  <xsl:when test="$edition_i18n != ''">
10937
11024
  <!-- Example: <edition language="fr">deuxième édition</edition> -->
@@ -244,6 +244,9 @@
244
244
  <data type="ID"/>
245
245
  </attribute>
246
246
  <attribute name="reviewer"/>
247
+ <optional>
248
+ <attribute name="type"/>
249
+ </optional>
247
250
  <optional>
248
251
  <attribute name="date">
249
252
  <data type="dateTime"/>
@@ -60,7 +60,6 @@ module Metanorma
60
60
  end
61
61
  id = node.attr("docidentifier") and dn = id
62
62
  xml.docidentifier { |i| i << dn }
63
- xml.docnumber { |i| i << node.attr("docnumber") }
64
63
  end
65
64
 
66
65
  def metadata_distribution(node, xml)
@@ -17,7 +17,7 @@
17
17
  these elements; we just want one namespace for any child grammars
18
18
  of this.
19
19
  -->
20
- <!-- VERSION v1.2.12 -->
20
+ <!-- VERSION v1.3.0 -->
21
21
  <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
22
22
  <include href="reqt.rng"/>
23
23
  <include href="basicdoc.rng">
@@ -146,6 +146,9 @@
146
146
  <data type="boolean"/>
147
147
  </attribute>
148
148
  </optional>
149
+ <optional>
150
+ <attribute name="style"/>
151
+ </optional>
149
152
  <oneOrMore>
150
153
  <ref name="PureTextElement"/>
151
154
  </oneOrMore>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module UN
3
- VERSION = "0.12.0".freeze
3
+ VERSION = "0.12.3".freeze
4
4
  end
5
5
  end
data/metanorma-un.gemspec CHANGED
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
31
31
  spec.add_dependency "roman-numerals"
32
32
  spec.add_dependency "twitter_cldr"
33
33
 
34
- spec.add_dependency "metanorma-standoc", "~> 2.8.0"
34
+ spec.add_dependency "metanorma-standoc", "~> 2.8.2"
35
35
 
36
36
  spec.add_development_dependency "debug"
37
37
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
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.12.0
4
+ version: 0.12.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-01-09 00:00:00.000000000 Z
11
+ date: 2024-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: iso-639
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 2.8.0
61
+ version: 2.8.2
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 2.8.0
68
+ version: 2.8.2
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: debug
71
71
  requirement: !ruby/object:Gem::Requirement