metanorma-ogc 2.6.3 → 2.6.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e3fc76cd9d97dc46e32d4eb7ede5a5df4aa9088814efb2fb7306f85babe2c66d
4
- data.tar.gz: c1ecd3aa0d5018f229f1f91e84d2fccd3360d7aebabd0371dde2a93c6c3231c2
3
+ metadata.gz: 17f8abe4584052c8638ff63af0cf4f601329a1833105aa4847d70c8746c285ca
4
+ data.tar.gz: e9287cf4b36ddf56eb74b927e677ec483f96a934bd891014d1bdada95eb07823
5
5
  SHA512:
6
- metadata.gz: fa24e603f131367c5d0ed1a17da95e83be2c798c9fccdf8376aaf92b6f6c1912092443315abc02bb824daf14d648c9a73dda0dc7ec76580e51249f90370575ca
7
- data.tar.gz: 852573bbac927f234f2df921d60f915c17c3a95413988fc277a3c644a259e3d078063f1cfb3e4c14eac3b7c9e4070e9d7629cbc72cc369476c5a8e9580655812
6
+ metadata.gz: a8e30d2b9bdc650ae6c3c953221ea480761bbc06eb8bc3a09ff8b5b65799896893ca8a4d5d928f240b877990a32f61c4d3cea183bbad3928244eea05d682bc0e
7
+ data.tar.gz: 3966ff5a7adbb26710a33606cf97cc622db0d2154a50e07453c5d5b05c2228022408435a63660dd51c54157ba4a8a6e3fee43267c2489217a781f3e2a042f053
@@ -5383,7 +5383,8 @@
5383
5383
  </xsl:choose>
5384
5384
  </xsl:variable>
5385
5385
  <xsl:variable name="current_fn_number_text">
5386
- <xsl:value-of select="$current_fn_number"/>
5386
+
5387
+ <xsl:value-of select="$current_fn_number"/>
5387
5388
 
5388
5389
  </xsl:variable>
5389
5390
 
@@ -5401,10 +5402,14 @@
5401
5402
  <xsl:variable name="fn_styles">
5402
5403
  <xsl:choose>
5403
5404
  <xsl:when test="ancestor::*[local-name() = 'bibitem']">
5404
- <fn_styles xsl:use-attribute-sets="bibitem-note-fn-style"/>
5405
+ <fn_styles xsl:use-attribute-sets="bibitem-note-fn-style">
5406
+
5407
+ </fn_styles>
5405
5408
  </xsl:when>
5406
5409
  <xsl:otherwise>
5407
- <fn_styles xsl:use-attribute-sets="fn-num-style"/>
5410
+ <fn_styles xsl:use-attribute-sets="fn-num-style">
5411
+
5412
+ </fn_styles>
5408
5413
  </xsl:otherwise>
5409
5414
  </xsl:choose>
5410
5415
  </xsl:variable>
@@ -5419,8 +5424,10 @@
5419
5424
 
5420
5425
  <xsl:call-template name="insert_basic_link">
5421
5426
  <xsl:with-param name="element">
5422
- <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}" role="Lbl">
5423
- <xsl:copy-of select="$current_fn_number_text"/>
5427
+ <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}"> <!-- note: role="Lbl" removed in https://github.com/metanorma/mn2pdf/issues/291 -->
5428
+ <fo:inline role="Lbl"> <!-- need for https://github.com/metanorma/metanorma-iso/issues/1003 -->
5429
+ <xsl:copy-of select="$current_fn_number_text"/>
5430
+ </fo:inline>
5424
5431
  </fo:basic-link>
5425
5432
  </xsl:with-param>
5426
5433
  </xsl:call-template>
@@ -5707,7 +5714,7 @@
5707
5714
 
5708
5715
  <xsl:call-template name="refine_fn-reference-style"/>
5709
5716
 
5710
- <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
5717
+ <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="footnote {@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
5711
5718
  <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> <!-- for footnotes in tables -->
5712
5719
  <xsl:attribute name="internal-destination">
5713
5720
  <xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
@@ -6722,9 +6729,19 @@
6722
6729
  </fo:inline>
6723
6730
  </xsl:template>
6724
6731
 
6725
- <xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
6732
+ <xsl:template match="text()[ancestor::*[local-name()='smallcap']]" name="smallcaps">
6733
+ <xsl:param name="txt"/>
6726
6734
  <!-- <xsl:variable name="text" select="normalize-space(.)"/> --> <!-- https://github.com/metanorma/metanorma-iso/issues/1115 -->
6727
- <xsl:variable name="text" select="."/>
6735
+ <xsl:variable name="text">
6736
+ <xsl:choose>
6737
+ <xsl:when test="$txt != ''">
6738
+ <xsl:value-of select="$txt"/>
6739
+ </xsl:when>
6740
+ <xsl:otherwise>
6741
+ <xsl:value-of select="."/>
6742
+ </xsl:otherwise>
6743
+ </xsl:choose>
6744
+ </xsl:variable>
6728
6745
  <xsl:variable name="ratio_">
6729
6746
  0.75
6730
6747
  </xsl:variable>
@@ -8170,9 +8187,12 @@
8170
8187
  <xsl:apply-templates/>
8171
8188
  </xsl:when>
8172
8189
  <xsl:otherwise>
8190
+ <xsl:variable name="alt_text">
8191
+ <xsl:call-template name="getAltText"/>
8192
+ </xsl:variable>
8173
8193
  <xsl:call-template name="insert_basic_link">
8174
8194
  <xsl:with-param name="element">
8175
- <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
8195
+ <fo:basic-link external-destination="{$target}" fox:alt-text="{$alt_text}">
8176
8196
  <xsl:if test="$isLinkToEmbeddedFile = 'true'">
8177
8197
  <xsl:attribute name="role">Annot</xsl:attribute>
8178
8198
  </xsl:if>
@@ -8199,6 +8219,14 @@
8199
8219
  </fo:inline>
8200
8220
  </xsl:template> <!-- link -->
8201
8221
 
8222
+ <xsl:template name="getAltText">
8223
+ <xsl:choose>
8224
+ <xsl:when test="normalize-space(.) = ''"><xsl:value-of select="@target"/></xsl:when>
8225
+ <xsl:otherwise><xsl:value-of select="normalize-space(translate(normalize-space(), ' —', ' -'))"/></xsl:otherwise>
8226
+ <!-- <xsl:otherwise><xsl:value-of select="@target"/></xsl:otherwise> -->
8227
+ </xsl:choose>
8228
+ </xsl:template>
8229
+
8202
8230
  <!-- ======================== -->
8203
8231
  <!-- Appendix processing -->
8204
8232
  <!-- ======================== -->
@@ -8229,7 +8257,7 @@
8229
8257
  <xsl:template match="*[local-name() = 'callout']">
8230
8258
  <xsl:choose>
8231
8259
  <xsl:when test="normalize-space(@target) = ''">&lt;<xsl:apply-templates/>&gt;</xsl:when>
8232
- <xsl:otherwise><fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link></xsl:otherwise>
8260
+ <xsl:otherwise><fo:basic-link internal-destination="{@target}" fox:alt-text="{normalize-space()}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link></xsl:otherwise>
8233
8261
  </xsl:choose>
8234
8262
  </xsl:template>
8235
8263
 
@@ -8262,10 +8290,14 @@
8262
8290
  <xsl:template match="*[local-name() = 'xref']">
8263
8291
  <xsl:call-template name="insert_basic_link">
8264
8292
  <xsl:with-param name="element">
8265
- <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
8293
+ <xsl:variable name="alt_text">
8294
+ <xsl:call-template name="getAltText"/>
8295
+ </xsl:variable>
8296
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="{$alt_text}" xsl:use-attribute-sets="xref-style">
8266
8297
  <xsl:if test="string-length(normalize-space()) &lt; 30 and not(contains(normalize-space(), 'http://')) and not(contains(normalize-space(), 'https://')) and not(ancestor::*[local-name() = 'table' or local-name() = 'dl'])">
8267
8298
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
8268
8299
  </xsl:if>
8300
+
8269
8301
  <xsl:if test="parent::*[local-name() = 'add']">
8270
8302
  <xsl:call-template name="append_add-style"/>
8271
8303
  </xsl:if>
@@ -8374,44 +8406,44 @@
8374
8406
 
8375
8407
  <xsl:template match="*[local-name() = 'note']" name="note">
8376
8408
 
8377
- <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
8409
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
8378
8410
 
8379
- <xsl:call-template name="setBlockSpanAll"/>
8411
+ <xsl:call-template name="setBlockSpanAll"/>
8380
8412
 
8381
- <xsl:call-template name="refine_note-style"/>
8413
+ <xsl:call-template name="refine_note-style"/>
8382
8414
 
8383
- <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
8415
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
8384
8416
 
8385
- <fo:block>
8417
+ <fo:block>
8386
8418
 
8387
- <xsl:call-template name="refine_note_block_style"/>
8419
+ <xsl:call-template name="refine_note_block_style"/>
8388
8420
 
8389
- <fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
8421
+ <fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
8390
8422
 
8391
- <xsl:call-template name="refine_note-name-style"/>
8423
+ <xsl:call-template name="refine_note-name-style"/>
8392
8424
 
8393
- <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
8394
- <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
8395
- <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
8396
- <xsl:call-template name="append_add-style"/>
8397
- </xsl:if>
8425
+ <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
8426
+ <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
8427
+ <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
8428
+ <xsl:call-template name="append_add-style"/>
8429
+ </xsl:if>
8398
8430
 
8399
- <!-- if note contains only one element and first and last childs are `add` ace-tag, then move start ace-tag before NOTE's name-->
8400
- <xsl:if test="count(*[not(local-name() = 'name')]) = 1 and *[not(local-name() = 'name')]/node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]">
8401
- <xsl:apply-templates select="*[not(local-name() = 'name')]/node()[1][local-name() = 'add'][starts-with(text(), $ace_tag)]">
8402
- <xsl:with-param name="skip">false</xsl:with-param>
8403
- </xsl:apply-templates>
8404
- </xsl:if>
8431
+ <!-- if note contains only one element and first and last childs are `add` ace-tag, then move start ace-tag before NOTE's name-->
8432
+ <xsl:if test="count(*[not(local-name() = 'name')]) = 1 and *[not(local-name() = 'name')]/node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]">
8433
+ <xsl:apply-templates select="*[not(local-name() = 'name')]/node()[1][local-name() = 'add'][starts-with(text(), $ace_tag)]">
8434
+ <xsl:with-param name="skip">false</xsl:with-param>
8435
+ </xsl:apply-templates>
8436
+ </xsl:if>
8405
8437
 
8406
- <xsl:apply-templates select="*[local-name() = 'name']"/>
8438
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
8407
8439
 
8408
- </fo:inline>
8440
+ </fo:inline>
8409
8441
 
8410
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
8411
- </fo:block>
8442
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
8443
+ </fo:block>
8412
8444
 
8413
- </fo:block-container>
8414
- </fo:block-container>
8445
+ </fo:block-container>
8446
+ </fo:block-container>
8415
8447
 
8416
8448
  </xsl:template>
8417
8449
 
@@ -10797,12 +10829,14 @@
10797
10829
 
10798
10830
  <xsl:when test="contains(normalize-space($fo_element), 'list')">
10799
10831
 
10800
- <xsl:variable name="provisional_distance_between_starts">
10832
+ <xsl:variable name="provisional_distance_between_starts_">
10801
10833
  7
10802
10834
  </xsl:variable>
10803
- <xsl:variable name="indent">
10835
+ <xsl:variable name="provisional_distance_between_starts" select="normalize-space($provisional_distance_between_starts_)"/>
10836
+ <xsl:variable name="indent_">
10804
10837
  0
10805
10838
  </xsl:variable>
10839
+ <xsl:variable name="indent" select="normalize-space($indent_)"/>
10806
10840
 
10807
10841
  <fo:list-block provisional-distance-between-starts="{$provisional_distance_between_starts}mm">
10808
10842
  <fo:list-item>
@@ -10866,6 +10900,7 @@
10866
10900
  </xsl:when>
10867
10901
  <xsl:when test="contains(normalize-space($fo_element), 'block')">
10868
10902
  <fo:block xsl:use-attribute-sets="example-name-style">
10903
+
10869
10904
  <xsl:apply-templates/>
10870
10905
  </fo:block>
10871
10906
  </xsl:when>
@@ -10881,6 +10916,7 @@
10881
10916
 
10882
10917
  <xsl:template match="*[local-name() = 'table']/*[local-name() = 'example']/*[local-name() = 'name']">
10883
10918
  <fo:inline xsl:use-attribute-sets="example-name-style">
10919
+
10884
10920
  <xsl:apply-templates/>
10885
10921
  </fo:inline>
10886
10922
  </xsl:template>
@@ -11250,12 +11286,14 @@
11250
11286
 
11251
11287
  <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'preferred'])"> <!-- if first preffered in term, then display term's name -->
11252
11288
  <fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
11289
+
11253
11290
  <xsl:apply-templates select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"/>
11254
11291
  </fo:block>
11255
11292
  </xsl:if>
11256
11293
 
11257
11294
  <fo:block xsl:use-attribute-sets="preferred-term-style" role="SKIP">
11258
11295
  <xsl:call-template name="setStyle_preferred"/>
11296
+
11259
11297
  <xsl:apply-templates/>
11260
11298
  </fo:block>
11261
11299
  </fo:block>
@@ -11524,14 +11562,17 @@
11524
11562
  </xsl:when>
11525
11563
  <xsl:when test="local-name(..) = 'ol' and @label"> <!-- for ordered lists 'ol', and if there is @label, for instance label="1.1.2" -->
11526
11564
 
11527
- <xsl:variable name="label">
11565
+ <xsl:variable name="type" select="../@type"/>
11528
11566
 
11529
- <xsl:variable name="type" select="../@type"/>
11567
+ <xsl:variable name="label">
11530
11568
 
11531
11569
  <xsl:variable name="style_prefix_">
11532
11570
  <xsl:if test="$type = 'roman'">
11533
11571
  <!-- Example: (i) -->
11534
11572
  </xsl:if>
11573
+ <xsl:if test="$type = 'alphabet'">
11574
+
11575
+ </xsl:if>
11535
11576
  </xsl:variable>
11536
11577
  <xsl:variable name="style_prefix" select="normalize-space($style_prefix_)"/>
11537
11578
 
@@ -11557,13 +11598,15 @@
11557
11598
  <xsl:if test="$style_prefix != '' and not(starts-with(@label, $style_prefix))">
11558
11599
  <xsl:value-of select="$style_prefix"/>
11559
11600
  </xsl:if>
11601
+
11560
11602
  <xsl:value-of select="@label"/>
11603
+
11561
11604
  <xsl:if test="not(java:endsWith(java:java.lang.String.new(@label),$style_suffix))">
11562
11605
  <xsl:value-of select="$style_suffix"/>
11563
11606
  </xsl:if>
11564
11607
  </xsl:variable>
11565
11608
 
11566
- <xsl:value-of select="normalize-space($label)"/>
11609
+ <xsl:value-of select="normalize-space($label)"/>
11567
11610
 
11568
11611
  </xsl:when>
11569
11612
  <xsl:otherwise> <!-- for ordered lists 'ol' -->
@@ -13767,7 +13810,8 @@
13767
13810
  <xsl:variable name="description" select="normalize-space($bibitem_attachment/*[local-name() = 'formattedref'])"/>
13768
13811
  <xsl:variable name="filename" select="java:org.metanorma.fop.Util.getFilenameFromPath(@name)"/>
13769
13812
  <!-- Todo: need update -->
13770
- <xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
13813
+ <xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = 'classification'][@type = 'pdf-AFRelationship'])"/>
13814
+ <xsl:variable name="volatile" select="normalize-space($bibitem_attachment//*[local-name() = 'classification'][@type = 'pdf-volatile'])"/>
13771
13815
 
13772
13816
  <pdf:embedded-file filename="{$filename}" link-as-file-annotation="true">
13773
13817
  <xsl:attribute name="src">
@@ -13788,6 +13832,9 @@
13788
13832
  <xsl:if test="$afrelationship != ''">
13789
13833
  <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
13790
13834
  </xsl:if>
13835
+ <xsl:if test="$volatile != ''">
13836
+ <xsl:attribute name="volatile"><xsl:value-of select="$volatile"/></xsl:attribute>
13837
+ </xsl:if>
13791
13838
  </pdf:embedded-file>
13792
13839
  </xsl:for-each>
13793
13840
  <!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
@@ -13798,14 +13845,18 @@
13798
13845
  <xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
13799
13846
  <xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
13800
13847
  <!-- Todo: need update -->
13801
- <xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
13848
+ <xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'classification'][@type = 'pdf-AFRelationship'])"/>
13849
+ <xsl:variable name="volatile" select="normalize-space(.//*[local-name() = 'classification'][@type = 'pdf-volatile'])"/>
13802
13850
  <pdf:embedded-file src="{$url}" filename="{$attachment_name}" link-as-file-annotation="true">
13803
13851
  <xsl:if test="$description != ''">
13804
13852
  <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
13805
13853
  </xsl:if>
13806
13854
  <xsl:if test="$afrelationship != ''">
13807
- <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
13808
- </xsl:if>
13855
+ <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
13856
+ </xsl:if>
13857
+ <xsl:if test="$volatile != ''">
13858
+ <xsl:attribute name="volatile"><xsl:value-of select="$volatile"/></xsl:attribute>
13859
+ </xsl:if>
13809
13860
  </pdf:embedded-file>
13810
13861
  </xsl:for-each>
13811
13862
  </xsl:if>
@@ -13852,10 +13903,31 @@
13852
13903
  <xsl:value-of select="$level_total - 2"/>
13853
13904
  </xsl:when>
13854
13905
  <xsl:when test="ancestor::*[local-name() = 'sections'] and self::*[local-name() = 'title']">
13855
- <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/>
13906
+ <!-- determine 'depth' depends on upper clause with title/@depth -->
13907
+ <!-- <xsl:message>title=<xsl:value-of select="."/></xsl:message> -->
13908
+ <xsl:variable name="clause_with_depth_depth" select="ancestor::*[local-name() = 'clause'][*[local-name() = 'title']/@depth][1]/*[local-name() = 'title']/@depth"/>
13909
+ <!-- <xsl:message>clause_with_depth_depth=<xsl:value-of select="$clause_with_depth_depth"/></xsl:message> -->
13910
+ <xsl:variable name="clause_with_depth_level" select="count(ancestor::*[local-name() = 'clause'][*[local-name() = 'title']/@depth][1]/ancestor::*)"/>
13911
+ <!-- <xsl:message>clause_with_depth_level=<xsl:value-of select="$clause_with_depth_level"/></xsl:message> -->
13912
+ <xsl:variable name="curr_level" select="count(ancestor::*) - 1"/>
13913
+ <!-- <xsl:message>curr_level=<xsl:value-of select="$curr_level"/></xsl:message> -->
13914
+ <!-- <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/> -->
13915
+ <xsl:variable name="curr_clause_depth" select="number($clause_with_depth_depth) + (number($curr_level) - number($clause_with_depth_level)) "/>
13916
+ <!-- <xsl:message>curr_clause_depth=<xsl:value-of select="$curr_clause_depth"/></xsl:message> -->
13856
13917
  <xsl:choose>
13857
- <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
13858
- <xsl:value-of select="number($upper_clause_depth + 1)"/>
13918
+ <xsl:when test="string(number($curr_clause_depth)) != 'NaN'">
13919
+ <xsl:value-of select="number($curr_clause_depth)"/>
13920
+ </xsl:when>
13921
+ <xsl:otherwise>
13922
+ <xsl:value-of select="$level_total - 2"/>
13923
+ </xsl:otherwise>
13924
+ </xsl:choose>
13925
+ </xsl:when>
13926
+ <xsl:when test="ancestor::*[local-name() = 'sections'] and self::*[local-name() = 'name'] and parent::*[local-name() = 'term']">
13927
+ <xsl:variable name="upper_terms_depth" select="normalize-space(ancestor::*[local-name() = 'terms'][1]/*[local-name() = 'title']/@depth)"/>
13928
+ <xsl:choose>
13929
+ <xsl:when test="string(number($upper_terms_depth)) != 'NaN'">
13930
+ <xsl:value-of select="number($upper_terms_depth + 1)"/>
13859
13931
  </xsl:when>
13860
13932
  <xsl:otherwise>
13861
13933
  <xsl:value-of select="$level_total - 2"/>
@@ -13863,7 +13935,7 @@
13863
13935
  </xsl:choose>
13864
13936
  </xsl:when>
13865
13937
  <xsl:when test="ancestor::*[local-name() = 'sections']">
13866
- <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][1]/*[local-name() = 'title']/@depth)"/>
13938
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause' or local-name() = 'terms'][1]/*[local-name() = 'title']/@depth)"/>
13867
13939
  <xsl:choose>
13868
13940
  <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
13869
13941
  <xsl:value-of select="number($upper_clause_depth + 1)"/>
@@ -14180,9 +14252,10 @@
14180
14252
  <xsl:template name="insertBackgroundPageImage">
14181
14253
  <xsl:param name="number">1</xsl:param>
14182
14254
  <xsl:param name="name">coverpage-image</xsl:param>
14255
+ <xsl:param name="suffix"/>
14183
14256
  <xsl:variable name="num" select="number($number)"/>
14184
14257
  <!-- background image -->
14185
- <fo:block-container absolute-position="fixed" left="0mm" top="0mm" font-size="0" id="__internal_layout__coverpage_{$name}_{$number}_{generate-id()}">
14258
+ <fo:block-container absolute-position="fixed" left="0mm" top="0mm" font-size="0" id="__internal_layout__coverpage{$suffix}_{$name}_{$number}_{generate-id()}">
14186
14259
  <fo:block>
14187
14260
  <xsl:for-each select="/*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = $name][1]/*[local-name() = 'value']/*[local-name() = 'image'][$num]">
14188
14261
  <xsl:choose>
@@ -14248,16 +14321,29 @@
14248
14321
 
14249
14322
  <!-- END: insert cover page image -->
14250
14323
 
14324
+ <xsl:variable name="regex_ja_spec">[\uFF08\uFF09]</xsl:variable>
14251
14325
  <xsl:template name="insertVerticalChar">
14252
14326
  <xsl:param name="str"/>
14327
+ <xsl:param name="writing-mode">lr-tb</xsl:param>
14328
+ <xsl:param name="reference-orientation">90</xsl:param>
14253
14329
  <xsl:if test="string-length($str) &gt; 0">
14254
- <fo:inline-container writing-mode="lr-tb" text-align="center" alignment-baseline="central" reference-orientation="90" width="1em" margin="0" padding="0" text-indent="0mm" last-line-end-indent="0mm" start-indent="0mm" end-indent="0mm">
14330
+ <fo:inline-container text-align="center" alignment-baseline="central" width="1em" margin="0" padding="0" text-indent="0mm" last-line-end-indent="0mm" start-indent="0mm" end-indent="0mm">
14331
+ <xsl:if test="normalize-space($writing-mode) != ''">
14332
+ <xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
14333
+ <xsl:attribute name="reference-orientation">90</xsl:attribute>
14334
+ </xsl:if>
14335
+ <xsl:variable name="char" select="substring($str,1,1)"/>
14336
+ <xsl:if test="normalize-space(java:matches(java:java.lang.String.new($char), concat('(', $regex_ja_spec, '{1,})'))) = 'true'">
14337
+ <xsl:attribute name="reference-orientation">0</xsl:attribute>
14338
+ </xsl:if>
14255
14339
  <fo:block-container width="1em">
14256
- <fo:block line-height="1em"><xsl:value-of select="substring($str,1,1)"/></fo:block>
14340
+ <fo:block line-height="1em"><xsl:value-of select="$char"/></fo:block>
14257
14341
  </fo:block-container>
14258
14342
  </fo:inline-container>
14259
14343
  <xsl:call-template name="insertVerticalChar">
14260
14344
  <xsl:with-param name="str" select="substring($str, 2)"/>
14345
+ <xsl:with-param name="writing-mode" select="$writing-mode"/>
14346
+ <xsl:with-param name="reference-orientation" select="$reference-orientation"/>
14261
14347
  </xsl:call-template>
14262
14348
  </xsl:if>
14263
14349
  </xsl:template>