metanorma-bipm 2.4.0 → 2.4.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -4391,6 +4391,10 @@
4391
4391
 
4392
4392
  </xsl:attribute-set>
4393
4393
 
4394
+ <xsl:template name="refine_termexample-style">
4395
+
4396
+ </xsl:template>
4397
+
4394
4398
  <xsl:attribute-set name="example-style">
4395
4399
 
4396
4400
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
@@ -5538,6 +5542,36 @@
5538
5542
  </xsl:for-each>
5539
5543
  </xsl:template>
5540
5544
 
5545
+ <xsl:template name="processMainSectionsDefault_flatxml">
5546
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
5547
+ <xsl:sort select="@displayorder" data-type="number"/>
5548
+ <xsl:variable name="flatxml">
5549
+ <xsl:apply-templates select="." mode="flatxml"/>
5550
+ </xsl:variable>
5551
+ <!-- debug_flatxml='<xsl:copy-of select="$flatxml"/>' -->
5552
+ <xsl:apply-templates select="xalan:nodeset($flatxml)/*"/>
5553
+
5554
+ </xsl:for-each>
5555
+
5556
+ <xsl:for-each select="/*/*[local-name()='annex']">
5557
+ <xsl:sort select="@displayorder" data-type="number"/>
5558
+ <xsl:variable name="flatxml">
5559
+ <xsl:apply-templates select="." mode="flatxml"/>
5560
+ </xsl:variable>
5561
+ <!-- debug_flatxml='<xsl:copy-of select="$flatxml"/>' -->
5562
+ <xsl:apply-templates select="xalan:nodeset($flatxml)/*"/>
5563
+ </xsl:for-each>
5564
+
5565
+ <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
5566
+ <xsl:sort select="@displayorder" data-type="number"/>
5567
+ <xsl:variable name="flatxml">
5568
+ <xsl:apply-templates select="." mode="flatxml"/>
5569
+ </xsl:variable>
5570
+ <!-- debug_flatxml='<xsl:copy-of select="$flatxml"/>' -->
5571
+ <xsl:apply-templates select="xalan:nodeset($flatxml)/*"/>
5572
+ </xsl:for-each>
5573
+ </xsl:template>
5574
+
5541
5575
  <xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
5542
5576
  <xsl:variable name="tag_fo_inline_keep-together_within-line_open">###fo:inline keep-together_within-line###</xsl:variable>
5543
5577
  <xsl:variable name="tag_fo_inline_keep-together_within-line_close">###/fo:inline keep-together_within-line###</xsl:variable>
@@ -5670,7 +5704,9 @@
5670
5704
  </xsl:template> <!-- license-statement/p -->
5671
5705
 
5672
5706
  <xsl:template match="*[local-name()='legal-statement']">
5707
+ <xsl:param name="isLegacy">false</xsl:param>
5673
5708
  <fo:block xsl:use-attribute-sets="legal-statement-style">
5709
+
5674
5710
  <xsl:apply-templates/>
5675
5711
  </fo:block>
5676
5712
  </xsl:template> <!-- legal-statement -->
@@ -7675,13 +7711,13 @@
7675
7711
  <tr>
7676
7712
  <td>
7677
7713
  <xsl:attribute name="id">
7678
- <xsl:value-of select="concat($id,'_',$row_number,'_1')"/>
7714
+ <xsl:value-of select="concat($id,'@',$row_number,'_1')"/>
7679
7715
  </xsl:attribute>
7680
7716
  <xsl:apply-templates/>
7681
7717
  </td>
7682
7718
  <td>
7683
7719
  <xsl:attribute name="id">
7684
- <xsl:value-of select="concat($id,'_',$row_number,'_2')"/>
7720
+ <xsl:value-of select="concat($id,'@',$row_number,'_2')"/>
7685
7721
  </xsl:attribute>
7686
7722
 
7687
7723
  <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]">
@@ -7990,13 +8026,14 @@
7990
8026
  <!-- ================= -->
7991
8027
  <!-- Added,deleted text -->
7992
8028
  <!-- ================= -->
7993
- <xsl:template match="*[local-name()='add']" name="tag_add">
8029
+ <xsl:template match="*[local-name()='add'] | *[local-name() = 'change-open-tag'] | *[local-name() = 'change-close-tag']" name="tag_add">
7994
8030
  <xsl:param name="skip">true</xsl:param>
7995
8031
  <xsl:param name="block">false</xsl:param>
7996
8032
  <xsl:param name="type"/>
7997
8033
  <xsl:param name="text-align"/>
7998
8034
  <xsl:choose>
7999
- <xsl:when test="starts-with(., $ace_tag)"> <!-- examples: ace-tag_A1_start, ace-tag_A2_end, C1_start, AC_start -->
8035
+ <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
8036
+ <change-open-tag>A<sub>1</sub></change-open-tag>, <change-close-tag>A<sub>1</sub></change-close-tag> -->
8000
8037
  <xsl:choose>
8001
8038
  <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>
8002
8039
  <xsl:otherwise>
@@ -8004,12 +8041,32 @@
8004
8041
  <xsl:call-template name="insertTag">
8005
8042
  <xsl:with-param name="type">
8006
8043
  <xsl:choose>
8044
+ <xsl:when test="local-name() = 'change-open-tag'">start</xsl:when>
8045
+ <xsl:when test="local-name() = 'change-close-tag'">end</xsl:when>
8007
8046
  <xsl:when test="$type = ''"><xsl:value-of select="substring-after(substring-after(., $ace_tag), '_')"/> <!-- start or end --></xsl:when>
8008
8047
  <xsl:otherwise><xsl:value-of select="$type"/></xsl:otherwise>
8009
8048
  </xsl:choose>
8010
8049
  </xsl:with-param>
8011
- <xsl:with-param name="kind" select="substring(substring-before(substring-after(., $ace_tag), '_'), 1, 1)"/> <!-- A or C -->
8012
- <xsl:with-param name="value" select="substring(substring-before(substring-after(., $ace_tag), '_'), 2)"/> <!-- 1, 2, C -->
8050
+ <xsl:with-param name="kind">
8051
+ <xsl:choose>
8052
+ <xsl:when test="local-name() = 'change-open-tag' or local-name() = 'change-close-tag'">
8053
+ <xsl:value-of select="text()"/>
8054
+ </xsl:when>
8055
+ <xsl:otherwise>
8056
+ <xsl:value-of select="substring(substring-before(substring-after(., $ace_tag), '_'), 1, 1)"/> <!-- A or C -->
8057
+ </xsl:otherwise>
8058
+ </xsl:choose>
8059
+ </xsl:with-param>
8060
+ <xsl:with-param name="value">
8061
+ <xsl:choose>
8062
+ <xsl:when test="local-name() = 'change-open-tag' or local-name() = 'change-close-tag'">
8063
+ <xsl:value-of select="*[local-name() = 'sub']"/>
8064
+ </xsl:when>
8065
+ <xsl:otherwise>
8066
+ <xsl:value-of select="substring(substring-before(substring-after(., $ace_tag), '_'), 2)"/> <!-- 1, 2, C -->
8067
+ </xsl:otherwise>
8068
+ </xsl:choose>
8069
+ </xsl:with-param>
8013
8070
  </xsl:call-template>
8014
8071
  </xsl:variable>
8015
8072
  <xsl:choose>
@@ -8269,6 +8326,10 @@
8269
8326
  <fo:inline keep-with-next.within-line="always"><xsl:value-of select="."/></fo:inline>
8270
8327
  </xsl:template>
8271
8328
 
8329
+ <xsl:template match="*[local-name() = 'span'][contains(@style, 'text-transform:none')]//text()" priority="5">
8330
+ <xsl:value-of select="."/>
8331
+ </xsl:template>
8332
+
8272
8333
  <!-- ========================= -->
8273
8334
  <!-- END Rich text formatting -->
8274
8335
  <!-- ========================= -->
@@ -8899,7 +8960,7 @@
8899
8960
  </xsl:choose>
8900
8961
  </xsl:variable>
8901
8962
  <xsl:attribute name="id">
8902
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_',$divide)"/>
8963
+ <xsl:value-of select="concat($id,'@',$row_number,'_',$col_number,'_',$divide)"/>
8903
8964
  </xsl:attribute>
8904
8965
 
8905
8966
  <xsl:for-each select="*[local-name() = 'p']">
@@ -8907,7 +8968,7 @@
8907
8968
  <xsl:copy-of select="@*"/>
8908
8969
  <xsl:variable name="p_num" select="count(preceding-sibling::*[local-name() = 'p']) + 1"/>
8909
8970
  <xsl:attribute name="id">
8910
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_p_',$p_num,'_',$divide)"/>
8971
+ <xsl:value-of select="concat($id,'@',$row_number,'_',$col_number,'_p_',$p_num,'_',$divide)"/>
8911
8972
  </xsl:attribute>
8912
8973
 
8913
8974
  <!-- <xsl:copy-of select="node()" /> -->
@@ -8971,7 +9032,7 @@
8971
9032
  <xsl:variable name="num" select="count(preceding-sibling::word) + 1"/>
8972
9033
  <xsl:copy>
8973
9034
  <xsl:attribute name="id">
8974
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_word_',$num,'_',$divide)"/>
9035
+ <xsl:value-of select="concat($id,'@',$row_number,'_',$col_number,'_word_',$num,'_',$divide)"/>
8975
9036
  </xsl:attribute>
8976
9037
  <xsl:copy-of select="node()"/>
8977
9038
  </xsl:copy>
@@ -10270,11 +10331,17 @@
10270
10331
  </xsl:when>
10271
10332
  <xsl:otherwise>
10272
10333
 
10334
+ <xsl:variable name="image_class" select="ancestor::*[local-name() = 'image']/@class"/>
10335
+ <xsl:variable name="ancestor_table_cell" select="normalize-space(ancestor::*[local-name() = 'td'] or ancestor::*[local-name() = 'th'])"/>
10336
+
10273
10337
  <xsl:variable name="element">
10274
10338
  <xsl:choose>
10275
10339
  <xsl:when test="ancestor::*[local-name() = 'tr'] and $isGenerateTableIF = 'true'">
10276
10340
  <fo:inline xsl:use-attribute-sets="image-style" text-align="left"/>
10277
10341
  </xsl:when>
10342
+ <xsl:when test="not(ancestor::*[local-name() = 'figure'])">
10343
+ <fo:inline xsl:use-attribute-sets="image-style" text-align="left"/>
10344
+ </xsl:when>
10278
10345
  <xsl:otherwise>
10279
10346
  <fo:block xsl:use-attribute-sets="image-style">
10280
10347
  <xsl:if test="ancestor::*[local-name() = 'dt']">
@@ -10290,10 +10357,24 @@
10290
10357
  <xsl:copy-of select="@*"/>
10291
10358
  <!-- <fo:block xsl:use-attribute-sets="image-style"> -->
10292
10359
  <fo:instream-foreign-object fox:alt-text="{$alt-text}">
10293
- <xsl:if test="$isGenerateTableIF = 'false'">
10294
- <xsl:attribute name="width">100%</xsl:attribute>
10295
- </xsl:if>
10296
- <xsl:attribute name="content-height">100%</xsl:attribute>
10360
+
10361
+ <xsl:choose>
10362
+ <xsl:when test="$image_class = 'corrigenda-tag'">
10363
+ <xsl:attribute name="fox:alt-text">CorrigendaTag</xsl:attribute>
10364
+ <xsl:attribute name="baseline-shift">-10%</xsl:attribute>
10365
+ <xsl:if test="$ancestor_table_cell = 'true'">
10366
+ <xsl:attribute name="baseline-shift">-25%</xsl:attribute>
10367
+ </xsl:if>
10368
+ <xsl:attribute name="height">3.5mm</xsl:attribute>
10369
+ </xsl:when>
10370
+ <xsl:otherwise>
10371
+ <xsl:if test="$isGenerateTableIF = 'false'">
10372
+ <xsl:attribute name="width">100%</xsl:attribute>
10373
+ </xsl:if>
10374
+ <xsl:attribute name="content-height">100%</xsl:attribute>
10375
+ </xsl:otherwise>
10376
+ </xsl:choose>
10377
+
10297
10378
  <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
10298
10379
  <xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
10299
10380
  <xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
@@ -11821,7 +11902,7 @@
11821
11902
  <!-- ====== -->
11822
11903
  <xsl:template match="*[local-name() = 'termexample']">
11823
11904
  <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
11824
-
11905
+ <xsl:call-template name="refine_termexample-style"/>
11825
11906
  <xsl:call-template name="setBlockSpanAll"/>
11826
11907
 
11827
11908
  <xsl:apply-templates select="*[local-name()='name']"/>
@@ -12513,13 +12594,19 @@
12513
12594
  <fo:block id="{@id}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
12514
12595
  </xsl:when>
12515
12596
  <!-- if there isn't element with id 'from', then create 'bookmark' here -->
12516
- <xsl:when test="not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
12597
+ <xsl:when test="ancestor::*[contains(local-name(), '-standard')] and not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
12598
+ <fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
12599
+ </xsl:when>
12600
+ <xsl:when test="not(//*[@id = $id_from]) and not(preceding-sibling::*[@id = $id_from])">
12517
12601
  <fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
12518
12602
  </xsl:when>
12519
12603
  </xsl:choose>
12520
12604
 
12521
12605
  </xsl:template>
12522
12606
 
12607
+ <!-- https://github.com/metanorma/mn-samples-bsi/issues/312 -->
12608
+ <xsl:template match="*[local-name() = 'review'][@type = 'other']"/>
12609
+
12523
12610
  <xsl:template match="*[local-name() = 'name']/text()">
12524
12611
  <!-- 0xA0 to space replacement -->
12525
12612
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
@@ -14124,7 +14211,7 @@
14124
14211
 
14125
14212
  <xsl:template name="printEdition">
14126
14213
  <xsl:variable name="edition_i18n" select="normalize-space((//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) != ''])"/>
14127
- <xsl:text> </xsl:text>
14214
+
14128
14215
  <xsl:choose>
14129
14216
  <xsl:when test="$edition_i18n != ''">
14130
14217
  <!-- Example: <edition language="fr">deuxième édition</edition> -->
@@ -4391,6 +4391,10 @@
4391
4391
 
4392
4392
  </xsl:attribute-set>
4393
4393
 
4394
+ <xsl:template name="refine_termexample-style">
4395
+
4396
+ </xsl:template>
4397
+
4394
4398
  <xsl:attribute-set name="example-style">
4395
4399
 
4396
4400
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
@@ -5538,6 +5542,36 @@
5538
5542
  </xsl:for-each>
5539
5543
  </xsl:template>
5540
5544
 
5545
+ <xsl:template name="processMainSectionsDefault_flatxml">
5546
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
5547
+ <xsl:sort select="@displayorder" data-type="number"/>
5548
+ <xsl:variable name="flatxml">
5549
+ <xsl:apply-templates select="." mode="flatxml"/>
5550
+ </xsl:variable>
5551
+ <!-- debug_flatxml='<xsl:copy-of select="$flatxml"/>' -->
5552
+ <xsl:apply-templates select="xalan:nodeset($flatxml)/*"/>
5553
+
5554
+ </xsl:for-each>
5555
+
5556
+ <xsl:for-each select="/*/*[local-name()='annex']">
5557
+ <xsl:sort select="@displayorder" data-type="number"/>
5558
+ <xsl:variable name="flatxml">
5559
+ <xsl:apply-templates select="." mode="flatxml"/>
5560
+ </xsl:variable>
5561
+ <!-- debug_flatxml='<xsl:copy-of select="$flatxml"/>' -->
5562
+ <xsl:apply-templates select="xalan:nodeset($flatxml)/*"/>
5563
+ </xsl:for-each>
5564
+
5565
+ <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
5566
+ <xsl:sort select="@displayorder" data-type="number"/>
5567
+ <xsl:variable name="flatxml">
5568
+ <xsl:apply-templates select="." mode="flatxml"/>
5569
+ </xsl:variable>
5570
+ <!-- debug_flatxml='<xsl:copy-of select="$flatxml"/>' -->
5571
+ <xsl:apply-templates select="xalan:nodeset($flatxml)/*"/>
5572
+ </xsl:for-each>
5573
+ </xsl:template>
5574
+
5541
5575
  <xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
5542
5576
  <xsl:variable name="tag_fo_inline_keep-together_within-line_open">###fo:inline keep-together_within-line###</xsl:variable>
5543
5577
  <xsl:variable name="tag_fo_inline_keep-together_within-line_close">###/fo:inline keep-together_within-line###</xsl:variable>
@@ -5670,7 +5704,9 @@
5670
5704
  </xsl:template> <!-- license-statement/p -->
5671
5705
 
5672
5706
  <xsl:template match="*[local-name()='legal-statement']">
5707
+ <xsl:param name="isLegacy">false</xsl:param>
5673
5708
  <fo:block xsl:use-attribute-sets="legal-statement-style">
5709
+
5674
5710
  <xsl:apply-templates/>
5675
5711
  </fo:block>
5676
5712
  </xsl:template> <!-- legal-statement -->
@@ -7675,13 +7711,13 @@
7675
7711
  <tr>
7676
7712
  <td>
7677
7713
  <xsl:attribute name="id">
7678
- <xsl:value-of select="concat($id,'_',$row_number,'_1')"/>
7714
+ <xsl:value-of select="concat($id,'@',$row_number,'_1')"/>
7679
7715
  </xsl:attribute>
7680
7716
  <xsl:apply-templates/>
7681
7717
  </td>
7682
7718
  <td>
7683
7719
  <xsl:attribute name="id">
7684
- <xsl:value-of select="concat($id,'_',$row_number,'_2')"/>
7720
+ <xsl:value-of select="concat($id,'@',$row_number,'_2')"/>
7685
7721
  </xsl:attribute>
7686
7722
 
7687
7723
  <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]">
@@ -7990,13 +8026,14 @@
7990
8026
  <!-- ================= -->
7991
8027
  <!-- Added,deleted text -->
7992
8028
  <!-- ================= -->
7993
- <xsl:template match="*[local-name()='add']" name="tag_add">
8029
+ <xsl:template match="*[local-name()='add'] | *[local-name() = 'change-open-tag'] | *[local-name() = 'change-close-tag']" name="tag_add">
7994
8030
  <xsl:param name="skip">true</xsl:param>
7995
8031
  <xsl:param name="block">false</xsl:param>
7996
8032
  <xsl:param name="type"/>
7997
8033
  <xsl:param name="text-align"/>
7998
8034
  <xsl:choose>
7999
- <xsl:when test="starts-with(., $ace_tag)"> <!-- examples: ace-tag_A1_start, ace-tag_A2_end, C1_start, AC_start -->
8035
+ <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
8036
+ <change-open-tag>A<sub>1</sub></change-open-tag>, <change-close-tag>A<sub>1</sub></change-close-tag> -->
8000
8037
  <xsl:choose>
8001
8038
  <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>
8002
8039
  <xsl:otherwise>
@@ -8004,12 +8041,32 @@
8004
8041
  <xsl:call-template name="insertTag">
8005
8042
  <xsl:with-param name="type">
8006
8043
  <xsl:choose>
8044
+ <xsl:when test="local-name() = 'change-open-tag'">start</xsl:when>
8045
+ <xsl:when test="local-name() = 'change-close-tag'">end</xsl:when>
8007
8046
  <xsl:when test="$type = ''"><xsl:value-of select="substring-after(substring-after(., $ace_tag), '_')"/> <!-- start or end --></xsl:when>
8008
8047
  <xsl:otherwise><xsl:value-of select="$type"/></xsl:otherwise>
8009
8048
  </xsl:choose>
8010
8049
  </xsl:with-param>
8011
- <xsl:with-param name="kind" select="substring(substring-before(substring-after(., $ace_tag), '_'), 1, 1)"/> <!-- A or C -->
8012
- <xsl:with-param name="value" select="substring(substring-before(substring-after(., $ace_tag), '_'), 2)"/> <!-- 1, 2, C -->
8050
+ <xsl:with-param name="kind">
8051
+ <xsl:choose>
8052
+ <xsl:when test="local-name() = 'change-open-tag' or local-name() = 'change-close-tag'">
8053
+ <xsl:value-of select="text()"/>
8054
+ </xsl:when>
8055
+ <xsl:otherwise>
8056
+ <xsl:value-of select="substring(substring-before(substring-after(., $ace_tag), '_'), 1, 1)"/> <!-- A or C -->
8057
+ </xsl:otherwise>
8058
+ </xsl:choose>
8059
+ </xsl:with-param>
8060
+ <xsl:with-param name="value">
8061
+ <xsl:choose>
8062
+ <xsl:when test="local-name() = 'change-open-tag' or local-name() = 'change-close-tag'">
8063
+ <xsl:value-of select="*[local-name() = 'sub']"/>
8064
+ </xsl:when>
8065
+ <xsl:otherwise>
8066
+ <xsl:value-of select="substring(substring-before(substring-after(., $ace_tag), '_'), 2)"/> <!-- 1, 2, C -->
8067
+ </xsl:otherwise>
8068
+ </xsl:choose>
8069
+ </xsl:with-param>
8013
8070
  </xsl:call-template>
8014
8071
  </xsl:variable>
8015
8072
  <xsl:choose>
@@ -8269,6 +8326,10 @@
8269
8326
  <fo:inline keep-with-next.within-line="always"><xsl:value-of select="."/></fo:inline>
8270
8327
  </xsl:template>
8271
8328
 
8329
+ <xsl:template match="*[local-name() = 'span'][contains(@style, 'text-transform:none')]//text()" priority="5">
8330
+ <xsl:value-of select="."/>
8331
+ </xsl:template>
8332
+
8272
8333
  <!-- ========================= -->
8273
8334
  <!-- END Rich text formatting -->
8274
8335
  <!-- ========================= -->
@@ -8899,7 +8960,7 @@
8899
8960
  </xsl:choose>
8900
8961
  </xsl:variable>
8901
8962
  <xsl:attribute name="id">
8902
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_',$divide)"/>
8963
+ <xsl:value-of select="concat($id,'@',$row_number,'_',$col_number,'_',$divide)"/>
8903
8964
  </xsl:attribute>
8904
8965
 
8905
8966
  <xsl:for-each select="*[local-name() = 'p']">
@@ -8907,7 +8968,7 @@
8907
8968
  <xsl:copy-of select="@*"/>
8908
8969
  <xsl:variable name="p_num" select="count(preceding-sibling::*[local-name() = 'p']) + 1"/>
8909
8970
  <xsl:attribute name="id">
8910
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_p_',$p_num,'_',$divide)"/>
8971
+ <xsl:value-of select="concat($id,'@',$row_number,'_',$col_number,'_p_',$p_num,'_',$divide)"/>
8911
8972
  </xsl:attribute>
8912
8973
 
8913
8974
  <!-- <xsl:copy-of select="node()" /> -->
@@ -8971,7 +9032,7 @@
8971
9032
  <xsl:variable name="num" select="count(preceding-sibling::word) + 1"/>
8972
9033
  <xsl:copy>
8973
9034
  <xsl:attribute name="id">
8974
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_word_',$num,'_',$divide)"/>
9035
+ <xsl:value-of select="concat($id,'@',$row_number,'_',$col_number,'_word_',$num,'_',$divide)"/>
8975
9036
  </xsl:attribute>
8976
9037
  <xsl:copy-of select="node()"/>
8977
9038
  </xsl:copy>
@@ -10270,11 +10331,17 @@
10270
10331
  </xsl:when>
10271
10332
  <xsl:otherwise>
10272
10333
 
10334
+ <xsl:variable name="image_class" select="ancestor::*[local-name() = 'image']/@class"/>
10335
+ <xsl:variable name="ancestor_table_cell" select="normalize-space(ancestor::*[local-name() = 'td'] or ancestor::*[local-name() = 'th'])"/>
10336
+
10273
10337
  <xsl:variable name="element">
10274
10338
  <xsl:choose>
10275
10339
  <xsl:when test="ancestor::*[local-name() = 'tr'] and $isGenerateTableIF = 'true'">
10276
10340
  <fo:inline xsl:use-attribute-sets="image-style" text-align="left"/>
10277
10341
  </xsl:when>
10342
+ <xsl:when test="not(ancestor::*[local-name() = 'figure'])">
10343
+ <fo:inline xsl:use-attribute-sets="image-style" text-align="left"/>
10344
+ </xsl:when>
10278
10345
  <xsl:otherwise>
10279
10346
  <fo:block xsl:use-attribute-sets="image-style">
10280
10347
  <xsl:if test="ancestor::*[local-name() = 'dt']">
@@ -10290,10 +10357,24 @@
10290
10357
  <xsl:copy-of select="@*"/>
10291
10358
  <!-- <fo:block xsl:use-attribute-sets="image-style"> -->
10292
10359
  <fo:instream-foreign-object fox:alt-text="{$alt-text}">
10293
- <xsl:if test="$isGenerateTableIF = 'false'">
10294
- <xsl:attribute name="width">100%</xsl:attribute>
10295
- </xsl:if>
10296
- <xsl:attribute name="content-height">100%</xsl:attribute>
10360
+
10361
+ <xsl:choose>
10362
+ <xsl:when test="$image_class = 'corrigenda-tag'">
10363
+ <xsl:attribute name="fox:alt-text">CorrigendaTag</xsl:attribute>
10364
+ <xsl:attribute name="baseline-shift">-10%</xsl:attribute>
10365
+ <xsl:if test="$ancestor_table_cell = 'true'">
10366
+ <xsl:attribute name="baseline-shift">-25%</xsl:attribute>
10367
+ </xsl:if>
10368
+ <xsl:attribute name="height">3.5mm</xsl:attribute>
10369
+ </xsl:when>
10370
+ <xsl:otherwise>
10371
+ <xsl:if test="$isGenerateTableIF = 'false'">
10372
+ <xsl:attribute name="width">100%</xsl:attribute>
10373
+ </xsl:if>
10374
+ <xsl:attribute name="content-height">100%</xsl:attribute>
10375
+ </xsl:otherwise>
10376
+ </xsl:choose>
10377
+
10297
10378
  <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
10298
10379
  <xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
10299
10380
  <xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
@@ -11821,7 +11902,7 @@
11821
11902
  <!-- ====== -->
11822
11903
  <xsl:template match="*[local-name() = 'termexample']">
11823
11904
  <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
11824
-
11905
+ <xsl:call-template name="refine_termexample-style"/>
11825
11906
  <xsl:call-template name="setBlockSpanAll"/>
11826
11907
 
11827
11908
  <xsl:apply-templates select="*[local-name()='name']"/>
@@ -12513,13 +12594,19 @@
12513
12594
  <fo:block id="{@id}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
12514
12595
  </xsl:when>
12515
12596
  <!-- if there isn't element with id 'from', then create 'bookmark' here -->
12516
- <xsl:when test="not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
12597
+ <xsl:when test="ancestor::*[contains(local-name(), '-standard')] and not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
12598
+ <fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
12599
+ </xsl:when>
12600
+ <xsl:when test="not(//*[@id = $id_from]) and not(preceding-sibling::*[@id = $id_from])">
12517
12601
  <fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
12518
12602
  </xsl:when>
12519
12603
  </xsl:choose>
12520
12604
 
12521
12605
  </xsl:template>
12522
12606
 
12607
+ <!-- https://github.com/metanorma/mn-samples-bsi/issues/312 -->
12608
+ <xsl:template match="*[local-name() = 'review'][@type = 'other']"/>
12609
+
12523
12610
  <xsl:template match="*[local-name() = 'name']/text()">
12524
12611
  <!-- 0xA0 to space replacement -->
12525
12612
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
@@ -14124,7 +14211,7 @@
14124
14211
 
14125
14212
  <xsl:template name="printEdition">
14126
14213
  <xsl:variable name="edition_i18n" select="normalize-space((//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) != ''])"/>
14127
- <xsl:text> </xsl:text>
14214
+
14128
14215
  <xsl:choose>
14129
14216
  <xsl:when test="$edition_i18n != ''">
14130
14217
  <!-- Example: <edition language="fr">deuxième édition</edition> -->