metanorma-csa 2.5.3 → 2.5.5

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: 379fbbcafcd9cf94cf6f8745dc4b884166e262758cf606d47b570bbadb154a4e
4
- data.tar.gz: bb91c273b3667bf4831eec3178b562735ee4ec46691b6823b2d85f0299394af9
3
+ metadata.gz: eda49068d6d958778c8f329b793815b355b271f5f49f22f0d9d1d0798487161d
4
+ data.tar.gz: ca907bed88cd04c20538d250ea824a2a335c632e98f49bb125d38a1b8c743f51
5
5
  SHA512:
6
- metadata.gz: a1dab799436d4f3094be42faecb1293ca5c181c4694cc1e86e5bd3a9d51862c6e7f0156071482eb74258b3e0b481f730a30cfa4fc4d81158637aa5617599a511
7
- data.tar.gz: 77149266b62dd042f42b091158d0b2b4a415d8e4d4dac68a15a76d2b794c34205e6c2f39ce7ab4b5d6833f6fee24166503b881b09771c2b02e909acbe11c6608
6
+ metadata.gz: 4fafdb26af786e6dcb2f0ad25478dfa6aa1ec49acc22d81cc64f390eedc3e59098381f09f18ae54a1fbfc53d06598152c2e4f6a5b1b8d1885e406d07c5f9f34d
7
+ data.tar.gz: 1e4113269015d96e128d8a247dbd6bb374eb8b28ec5a86a907bae8f6127bb7bb81de8ee32775e46b357059e3840415a5da1d7d16f09725edc99d408988ecb750
@@ -3974,7 +3974,8 @@
3974
3974
  </xsl:choose>
3975
3975
  </xsl:variable>
3976
3976
  <xsl:variable name="current_fn_number_text">
3977
- <xsl:value-of select="$current_fn_number"/>
3977
+
3978
+ <xsl:value-of select="$current_fn_number"/>
3978
3979
 
3979
3980
  </xsl:variable>
3980
3981
 
@@ -3992,10 +3993,14 @@
3992
3993
  <xsl:variable name="fn_styles">
3993
3994
  <xsl:choose>
3994
3995
  <xsl:when test="ancestor::*[local-name() = 'bibitem']">
3995
- <fn_styles xsl:use-attribute-sets="bibitem-note-fn-style"/>
3996
+ <fn_styles xsl:use-attribute-sets="bibitem-note-fn-style">
3997
+
3998
+ </fn_styles>
3996
3999
  </xsl:when>
3997
4000
  <xsl:otherwise>
3998
- <fn_styles xsl:use-attribute-sets="fn-num-style"/>
4001
+ <fn_styles xsl:use-attribute-sets="fn-num-style">
4002
+
4003
+ </fn_styles>
3999
4004
  </xsl:otherwise>
4000
4005
  </xsl:choose>
4001
4006
  </xsl:variable>
@@ -4010,8 +4015,10 @@
4010
4015
 
4011
4016
  <xsl:call-template name="insert_basic_link">
4012
4017
  <xsl:with-param name="element">
4013
- <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}" role="Lbl">
4014
- <xsl:copy-of select="$current_fn_number_text"/>
4018
+ <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 -->
4019
+ <fo:inline role="Lbl"> <!-- need for https://github.com/metanorma/metanorma-iso/issues/1003 -->
4020
+ <xsl:copy-of select="$current_fn_number_text"/>
4021
+ </fo:inline>
4015
4022
  </fo:basic-link>
4016
4023
  </xsl:with-param>
4017
4024
  </xsl:call-template>
@@ -4292,7 +4299,7 @@
4292
4299
 
4293
4300
  <xsl:call-template name="refine_fn-reference-style"/>
4294
4301
 
4295
- <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
4302
+ <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="footnote {@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
4296
4303
  <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> <!-- for footnotes in tables -->
4297
4304
  <xsl:attribute name="internal-destination">
4298
4305
  <xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
@@ -5292,9 +5299,19 @@
5292
5299
  </fo:inline>
5293
5300
  </xsl:template>
5294
5301
 
5295
- <xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
5302
+ <xsl:template match="text()[ancestor::*[local-name()='smallcap']]" name="smallcaps">
5303
+ <xsl:param name="txt"/>
5296
5304
  <!-- <xsl:variable name="text" select="normalize-space(.)"/> --> <!-- https://github.com/metanorma/metanorma-iso/issues/1115 -->
5297
- <xsl:variable name="text" select="."/>
5305
+ <xsl:variable name="text">
5306
+ <xsl:choose>
5307
+ <xsl:when test="$txt != ''">
5308
+ <xsl:value-of select="$txt"/>
5309
+ </xsl:when>
5310
+ <xsl:otherwise>
5311
+ <xsl:value-of select="."/>
5312
+ </xsl:otherwise>
5313
+ </xsl:choose>
5314
+ </xsl:variable>
5298
5315
  <xsl:variable name="ratio_">
5299
5316
  0.75
5300
5317
  </xsl:variable>
@@ -6740,9 +6757,12 @@
6740
6757
  <xsl:apply-templates/>
6741
6758
  </xsl:when>
6742
6759
  <xsl:otherwise>
6760
+ <xsl:variable name="alt_text">
6761
+ <xsl:call-template name="getAltText"/>
6762
+ </xsl:variable>
6743
6763
  <xsl:call-template name="insert_basic_link">
6744
6764
  <xsl:with-param name="element">
6745
- <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
6765
+ <fo:basic-link external-destination="{$target}" fox:alt-text="{$alt_text}">
6746
6766
  <xsl:if test="$isLinkToEmbeddedFile = 'true'">
6747
6767
  <xsl:attribute name="role">Annot</xsl:attribute>
6748
6768
  </xsl:if>
@@ -6769,6 +6789,14 @@
6769
6789
  </fo:inline>
6770
6790
  </xsl:template> <!-- link -->
6771
6791
 
6792
+ <xsl:template name="getAltText">
6793
+ <xsl:choose>
6794
+ <xsl:when test="normalize-space(.) = ''"><xsl:value-of select="@target"/></xsl:when>
6795
+ <xsl:otherwise><xsl:value-of select="normalize-space(translate(normalize-space(), ' —', ' -'))"/></xsl:otherwise>
6796
+ <!-- <xsl:otherwise><xsl:value-of select="@target"/></xsl:otherwise> -->
6797
+ </xsl:choose>
6798
+ </xsl:template>
6799
+
6772
6800
  <!-- ======================== -->
6773
6801
  <!-- Appendix processing -->
6774
6802
  <!-- ======================== -->
@@ -6799,7 +6827,7 @@
6799
6827
  <xsl:template match="*[local-name() = 'callout']">
6800
6828
  <xsl:choose>
6801
6829
  <xsl:when test="normalize-space(@target) = ''">&lt;<xsl:apply-templates/>&gt;</xsl:when>
6802
- <xsl:otherwise><fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link></xsl:otherwise>
6830
+ <xsl:otherwise><fo:basic-link internal-destination="{@target}" fox:alt-text="{normalize-space()}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link></xsl:otherwise>
6803
6831
  </xsl:choose>
6804
6832
  </xsl:template>
6805
6833
 
@@ -6828,10 +6856,14 @@
6828
6856
  <xsl:template match="*[local-name() = 'xref']">
6829
6857
  <xsl:call-template name="insert_basic_link">
6830
6858
  <xsl:with-param name="element">
6831
- <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
6859
+ <xsl:variable name="alt_text">
6860
+ <xsl:call-template name="getAltText"/>
6861
+ </xsl:variable>
6862
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="{$alt_text}" xsl:use-attribute-sets="xref-style">
6832
6863
  <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'])">
6833
6864
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
6834
6865
  </xsl:if>
6866
+
6835
6867
  <xsl:if test="parent::*[local-name() = 'add']">
6836
6868
  <xsl:call-template name="append_add-style"/>
6837
6869
  </xsl:if>
@@ -6940,48 +6972,48 @@
6940
6972
 
6941
6973
  <xsl:template match="*[local-name() = 'note']" name="note">
6942
6974
 
6943
- <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
6975
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
6944
6976
 
6945
- <xsl:call-template name="setBlockSpanAll"/>
6977
+ <xsl:call-template name="setBlockSpanAll"/>
6946
6978
 
6947
- <xsl:call-template name="refine_note-style"/>
6979
+ <xsl:call-template name="refine_note-style"/>
6948
6980
 
6949
- <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
6981
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
6950
6982
 
6951
- <xsl:if test="ancestor::csa:ul or ancestor::csa:ol and not(ancestor::csa:note[1]/following-sibling::*)">
6952
- <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
6953
- </xsl:if>
6983
+ <xsl:if test="ancestor::csa:ul or ancestor::csa:ol and not(ancestor::csa:note[1]/following-sibling::*)">
6984
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
6985
+ </xsl:if>
6954
6986
 
6955
- <fo:block>
6987
+ <fo:block>
6956
6988
 
6957
- <xsl:call-template name="refine_note_block_style"/>
6989
+ <xsl:call-template name="refine_note_block_style"/>
6958
6990
 
6959
- <fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
6991
+ <fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
6960
6992
 
6961
- <xsl:call-template name="refine_note-name-style"/>
6993
+ <xsl:call-template name="refine_note-name-style"/>
6962
6994
 
6963
- <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
6964
- <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
6965
- <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
6966
- <xsl:call-template name="append_add-style"/>
6967
- </xsl:if>
6995
+ <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
6996
+ <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
6997
+ <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
6998
+ <xsl:call-template name="append_add-style"/>
6999
+ </xsl:if>
6968
7000
 
6969
- <!-- if note contains only one element and first and last childs are `add` ace-tag, then move start ace-tag before NOTE's name-->
6970
- <xsl:if test="count(*[not(local-name() = 'name')]) = 1 and *[not(local-name() = 'name')]/node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]">
6971
- <xsl:apply-templates select="*[not(local-name() = 'name')]/node()[1][local-name() = 'add'][starts-with(text(), $ace_tag)]">
6972
- <xsl:with-param name="skip">false</xsl:with-param>
6973
- </xsl:apply-templates>
6974
- </xsl:if>
7001
+ <!-- if note contains only one element and first and last childs are `add` ace-tag, then move start ace-tag before NOTE's name-->
7002
+ <xsl:if test="count(*[not(local-name() = 'name')]) = 1 and *[not(local-name() = 'name')]/node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]">
7003
+ <xsl:apply-templates select="*[not(local-name() = 'name')]/node()[1][local-name() = 'add'][starts-with(text(), $ace_tag)]">
7004
+ <xsl:with-param name="skip">false</xsl:with-param>
7005
+ </xsl:apply-templates>
7006
+ </xsl:if>
6975
7007
 
6976
- <xsl:apply-templates select="*[local-name() = 'name']"/>
7008
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
6977
7009
 
6978
- </fo:inline>
7010
+ </fo:inline>
6979
7011
 
6980
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
6981
- </fo:block>
7012
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
7013
+ </fo:block>
6982
7014
 
6983
- </fo:block-container>
6984
- </fo:block-container>
7015
+ </fo:block-container>
7016
+ </fo:block-container>
6985
7017
 
6986
7018
  </xsl:template>
6987
7019
 
@@ -9312,12 +9344,14 @@
9312
9344
 
9313
9345
  <xsl:when test="contains(normalize-space($fo_element), 'list')">
9314
9346
 
9315
- <xsl:variable name="provisional_distance_between_starts">
9347
+ <xsl:variable name="provisional_distance_between_starts_">
9316
9348
  7
9317
9349
  </xsl:variable>
9318
- <xsl:variable name="indent">
9350
+ <xsl:variable name="provisional_distance_between_starts" select="normalize-space($provisional_distance_between_starts_)"/>
9351
+ <xsl:variable name="indent_">
9319
9352
  0
9320
9353
  </xsl:variable>
9354
+ <xsl:variable name="indent" select="normalize-space($indent_)"/>
9321
9355
 
9322
9356
  <fo:list-block provisional-distance-between-starts="{$provisional_distance_between_starts}mm">
9323
9357
  <fo:list-item>
@@ -9381,6 +9415,7 @@
9381
9415
  </xsl:when>
9382
9416
  <xsl:when test="contains(normalize-space($fo_element), 'block')">
9383
9417
  <fo:block xsl:use-attribute-sets="example-name-style">
9418
+
9384
9419
  <xsl:apply-templates/>
9385
9420
  </fo:block>
9386
9421
  </xsl:when>
@@ -9396,6 +9431,7 @@
9396
9431
 
9397
9432
  <xsl:template match="*[local-name() = 'table']/*[local-name() = 'example']/*[local-name() = 'name']">
9398
9433
  <fo:inline xsl:use-attribute-sets="example-name-style">
9434
+
9399
9435
  <xsl:apply-templates/>
9400
9436
  </fo:inline>
9401
9437
  </xsl:template>
@@ -9766,12 +9802,14 @@
9766
9802
 
9767
9803
  <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'preferred'])"> <!-- if first preffered in term, then display term's name -->
9768
9804
  <fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
9805
+
9769
9806
  <xsl:apply-templates select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"/>
9770
9807
  </fo:block>
9771
9808
  </xsl:if>
9772
9809
 
9773
9810
  <fo:block xsl:use-attribute-sets="preferred-term-style" role="SKIP">
9774
9811
  <xsl:call-template name="setStyle_preferred"/>
9812
+
9775
9813
  <xsl:apply-templates/>
9776
9814
  </fo:block>
9777
9815
  </fo:block>
@@ -10042,14 +10080,17 @@
10042
10080
  </xsl:when>
10043
10081
  <xsl:when test="local-name(..) = 'ol' and @label"> <!-- for ordered lists 'ol', and if there is @label, for instance label="1.1.2" -->
10044
10082
 
10045
- <xsl:variable name="label">
10083
+ <xsl:variable name="type" select="../@type"/>
10046
10084
 
10047
- <xsl:variable name="type" select="../@type"/>
10085
+ <xsl:variable name="label">
10048
10086
 
10049
10087
  <xsl:variable name="style_prefix_">
10050
10088
  <xsl:if test="$type = 'roman'">
10051
10089
  <!-- Example: (i) -->
10052
10090
  </xsl:if>
10091
+ <xsl:if test="$type = 'alphabet'">
10092
+
10093
+ </xsl:if>
10053
10094
  </xsl:variable>
10054
10095
  <xsl:variable name="style_prefix" select="normalize-space($style_prefix_)"/>
10055
10096
 
@@ -10075,13 +10116,15 @@
10075
10116
  <xsl:if test="$style_prefix != '' and not(starts-with(@label, $style_prefix))">
10076
10117
  <xsl:value-of select="$style_prefix"/>
10077
10118
  </xsl:if>
10119
+
10078
10120
  <xsl:value-of select="@label"/>
10121
+
10079
10122
  <xsl:if test="not(java:endsWith(java:java.lang.String.new(@label),$style_suffix))">
10080
10123
  <xsl:value-of select="$style_suffix"/>
10081
10124
  </xsl:if>
10082
10125
  </xsl:variable>
10083
10126
 
10084
- <xsl:value-of select="normalize-space($label)"/>
10127
+ <xsl:value-of select="normalize-space($label)"/>
10085
10128
 
10086
10129
  </xsl:when>
10087
10130
  <xsl:otherwise> <!-- for ordered lists 'ol' -->
@@ -12257,7 +12300,8 @@
12257
12300
  <xsl:variable name="description" select="normalize-space($bibitem_attachment/*[local-name() = 'formattedref'])"/>
12258
12301
  <xsl:variable name="filename" select="java:org.metanorma.fop.Util.getFilenameFromPath(@name)"/>
12259
12302
  <!-- Todo: need update -->
12260
- <xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
12303
+ <xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = 'classification'][@type = 'pdf-AFRelationship'])"/>
12304
+ <xsl:variable name="volatile" select="normalize-space($bibitem_attachment//*[local-name() = 'classification'][@type = 'pdf-volatile'])"/>
12261
12305
 
12262
12306
  <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" filename="{$filename}" link-as-file-annotation="true">
12263
12307
  <xsl:attribute name="src">
@@ -12278,6 +12322,9 @@
12278
12322
  <xsl:if test="$afrelationship != ''">
12279
12323
  <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
12280
12324
  </xsl:if>
12325
+ <xsl:if test="$volatile != ''">
12326
+ <xsl:attribute name="volatile"><xsl:value-of select="$volatile"/></xsl:attribute>
12327
+ </xsl:if>
12281
12328
  </pdf:embedded-file>
12282
12329
  </xsl:for-each>
12283
12330
  <!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
@@ -12288,14 +12335,18 @@
12288
12335
  <xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
12289
12336
  <xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
12290
12337
  <!-- Todo: need update -->
12291
- <xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
12338
+ <xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'classification'][@type = 'pdf-AFRelationship'])"/>
12339
+ <xsl:variable name="volatile" select="normalize-space(.//*[local-name() = 'classification'][@type = 'pdf-volatile'])"/>
12292
12340
  <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{$attachment_name}" link-as-file-annotation="true">
12293
12341
  <xsl:if test="$description != ''">
12294
12342
  <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
12295
12343
  </xsl:if>
12296
12344
  <xsl:if test="$afrelationship != ''">
12297
- <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
12298
- </xsl:if>
12345
+ <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
12346
+ </xsl:if>
12347
+ <xsl:if test="$volatile != ''">
12348
+ <xsl:attribute name="volatile"><xsl:value-of select="$volatile"/></xsl:attribute>
12349
+ </xsl:if>
12299
12350
  </pdf:embedded-file>
12300
12351
  </xsl:for-each>
12301
12352
  </xsl:if>
@@ -12342,10 +12393,31 @@
12342
12393
  <xsl:value-of select="$level_total - 2"/>
12343
12394
  </xsl:when>
12344
12395
  <xsl:when test="ancestor::*[local-name() = 'sections'] and self::*[local-name() = 'title']">
12345
- <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/>
12396
+ <!-- determine 'depth' depends on upper clause with title/@depth -->
12397
+ <!-- <xsl:message>title=<xsl:value-of select="."/></xsl:message> -->
12398
+ <xsl:variable name="clause_with_depth_depth" select="ancestor::*[local-name() = 'clause'][*[local-name() = 'title']/@depth][1]/*[local-name() = 'title']/@depth"/>
12399
+ <!-- <xsl:message>clause_with_depth_depth=<xsl:value-of select="$clause_with_depth_depth"/></xsl:message> -->
12400
+ <xsl:variable name="clause_with_depth_level" select="count(ancestor::*[local-name() = 'clause'][*[local-name() = 'title']/@depth][1]/ancestor::*)"/>
12401
+ <!-- <xsl:message>clause_with_depth_level=<xsl:value-of select="$clause_with_depth_level"/></xsl:message> -->
12402
+ <xsl:variable name="curr_level" select="count(ancestor::*) - 1"/>
12403
+ <!-- <xsl:message>curr_level=<xsl:value-of select="$curr_level"/></xsl:message> -->
12404
+ <!-- <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/> -->
12405
+ <xsl:variable name="curr_clause_depth" select="number($clause_with_depth_depth) + (number($curr_level) - number($clause_with_depth_level)) "/>
12406
+ <!-- <xsl:message>curr_clause_depth=<xsl:value-of select="$curr_clause_depth"/></xsl:message> -->
12346
12407
  <xsl:choose>
12347
- <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
12348
- <xsl:value-of select="number($upper_clause_depth + 1)"/>
12408
+ <xsl:when test="string(number($curr_clause_depth)) != 'NaN'">
12409
+ <xsl:value-of select="number($curr_clause_depth)"/>
12410
+ </xsl:when>
12411
+ <xsl:otherwise>
12412
+ <xsl:value-of select="$level_total - 2"/>
12413
+ </xsl:otherwise>
12414
+ </xsl:choose>
12415
+ </xsl:when>
12416
+ <xsl:when test="ancestor::*[local-name() = 'sections'] and self::*[local-name() = 'name'] and parent::*[local-name() = 'term']">
12417
+ <xsl:variable name="upper_terms_depth" select="normalize-space(ancestor::*[local-name() = 'terms'][1]/*[local-name() = 'title']/@depth)"/>
12418
+ <xsl:choose>
12419
+ <xsl:when test="string(number($upper_terms_depth)) != 'NaN'">
12420
+ <xsl:value-of select="number($upper_terms_depth + 1)"/>
12349
12421
  </xsl:when>
12350
12422
  <xsl:otherwise>
12351
12423
  <xsl:value-of select="$level_total - 2"/>
@@ -12353,7 +12425,7 @@
12353
12425
  </xsl:choose>
12354
12426
  </xsl:when>
12355
12427
  <xsl:when test="ancestor::*[local-name() = 'sections']">
12356
- <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][1]/*[local-name() = 'title']/@depth)"/>
12428
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause' or local-name() = 'terms'][1]/*[local-name() = 'title']/@depth)"/>
12357
12429
  <xsl:choose>
12358
12430
  <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
12359
12431
  <xsl:value-of select="number($upper_clause_depth + 1)"/>
@@ -12670,9 +12742,10 @@
12670
12742
  <xsl:template name="insertBackgroundPageImage">
12671
12743
  <xsl:param name="number">1</xsl:param>
12672
12744
  <xsl:param name="name">coverpage-image</xsl:param>
12745
+ <xsl:param name="suffix"/>
12673
12746
  <xsl:variable name="num" select="number($number)"/>
12674
12747
  <!-- background image -->
12675
- <fo:block-container absolute-position="fixed" left="0mm" top="0mm" font-size="0" id="__internal_layout__coverpage_{$name}_{$number}_{generate-id()}">
12748
+ <fo:block-container absolute-position="fixed" left="0mm" top="0mm" font-size="0" id="__internal_layout__coverpage{$suffix}_{$name}_{$number}_{generate-id()}">
12676
12749
  <fo:block>
12677
12750
  <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]">
12678
12751
  <xsl:choose>
@@ -12738,16 +12811,29 @@
12738
12811
 
12739
12812
  <!-- END: insert cover page image -->
12740
12813
 
12814
+ <xsl:variable name="regex_ja_spec">[\uFF08\uFF09]</xsl:variable>
12741
12815
  <xsl:template name="insertVerticalChar">
12742
12816
  <xsl:param name="str"/>
12817
+ <xsl:param name="writing-mode">lr-tb</xsl:param>
12818
+ <xsl:param name="reference-orientation">90</xsl:param>
12743
12819
  <xsl:if test="string-length($str) &gt; 0">
12744
- <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">
12820
+ <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">
12821
+ <xsl:if test="normalize-space($writing-mode) != ''">
12822
+ <xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
12823
+ <xsl:attribute name="reference-orientation">90</xsl:attribute>
12824
+ </xsl:if>
12825
+ <xsl:variable name="char" select="substring($str,1,1)"/>
12826
+ <xsl:if test="normalize-space(java:matches(java:java.lang.String.new($char), concat('(', $regex_ja_spec, '{1,})'))) = 'true'">
12827
+ <xsl:attribute name="reference-orientation">0</xsl:attribute>
12828
+ </xsl:if>
12745
12829
  <fo:block-container width="1em">
12746
- <fo:block line-height="1em"><xsl:value-of select="substring($str,1,1)"/></fo:block>
12830
+ <fo:block line-height="1em"><xsl:value-of select="$char"/></fo:block>
12747
12831
  </fo:block-container>
12748
12832
  </fo:inline-container>
12749
12833
  <xsl:call-template name="insertVerticalChar">
12750
12834
  <xsl:with-param name="str" select="substring($str, 2)"/>
12835
+ <xsl:with-param name="writing-mode" select="$writing-mode"/>
12836
+ <xsl:with-param name="reference-orientation" select="$reference-orientation"/>
12751
12837
  </xsl:call-template>
12752
12838
  </xsl:if>
12753
12839
  </xsl:template>
@@ -72,6 +72,9 @@ standards defining organization, and that is rendered in a distinct manner</a:do
72
72
  from other documents in the same doctype</a:documentation>
73
73
  </ref>
74
74
  </optional>
75
+ <ref name="flavor">
76
+ <a:documentation>Flavour of Metanorma used to process this document</a:documentation>
77
+ </ref>
75
78
  <optional>
76
79
  <ref name="editorialgroup">
77
80
  <a:documentation>Groups associated with the production of the standards document, typically within
@@ -113,6 +116,16 @@ a standards definition organization</a:documentation>
113
116
  <define name="DocumentSubtype">
114
117
  <text/>
115
118
  </define>
119
+ <define name="flavor">
120
+ <element name="flavor">
121
+ <ref name="MetanormaFlavor"/>
122
+ </element>
123
+ </define>
124
+ <define name="MetanormaFlavor">
125
+ <a:documentation>This is in fact an enum, as of this writing: standoc iso generic ietf ieee itu nist ogc csa cc iho ribose jis iec bsi bipm plateau.
126
+ However we prefer not to hardcode it, given ongoing extension.</a:documentation>
127
+ <text/>
128
+ </define>
116
129
  <define name="editorialgroup">
117
130
  <a:documentation>A group associated with the production of the standards document, typically within
118
131
  a standards definition organization</a:documentation>
@@ -1382,18 +1382,7 @@ Applies whether the resource has already been created or not, and whether it is
1382
1382
  <define name="bdate">
1383
1383
  <a:documentation>Significant date in the lifecycle of the bibliographic item, including its production and its access</a:documentation>
1384
1384
  <element name="date">
1385
- <attribute name="type">
1386
- <a:documentation>The phase of the production of or access to a bibliographic item</a:documentation>
1387
- <choice>
1388
- <ref name="BibliographicDateType"/>
1389
- <text/>
1390
- </choice>
1391
- </attribute>
1392
- <optional>
1393
- <attribute name="text">
1394
- <a:documentation>An optional textual description of the date, especially when a Gregorian date is not applicable</a:documentation>
1395
- </attribute>
1396
- </optional>
1385
+ <ref name="bDateAttributes"/>
1397
1386
  <optional>
1398
1387
  <choice>
1399
1388
  <group>
@@ -1416,6 +1405,20 @@ Applies whether the resource has already been created or not, and whether it is
1416
1405
  </optional>
1417
1406
  </element>
1418
1407
  </define>
1408
+ <define name="bDateAttributes">
1409
+ <attribute name="type">
1410
+ <a:documentation>The phase of the production of or access to a bibliographic item</a:documentation>
1411
+ <choice>
1412
+ <ref name="BibliographicDateType"/>
1413
+ <text/>
1414
+ </choice>
1415
+ </attribute>
1416
+ <optional>
1417
+ <attribute name="text">
1418
+ <a:documentation>An optional textual description of the date, especially when a Gregorian date is not applicable</a:documentation>
1419
+ </attribute>
1420
+ </optional>
1421
+ </define>
1419
1422
  <define name="docidentifier">
1420
1423
  <a:documentation>An identifier of a bibliographic item in an international standard scheme</a:documentation>
1421
1424
  <element name="docidentifier">
@@ -1884,6 +1887,10 @@ Detailed in https://www.relaton.org/model/relations/</a:documentation>
1884
1887
  <value>hasAnnotation</value>
1885
1888
  <value>draftOf</value>
1886
1889
  <value>hasDraft</value>
1890
+ <value>preliminaryDraftOf</value>
1891
+ <value>hasPreliminaryDraft</value>
1892
+ <value>revisionDraftOf</value>
1893
+ <value>hasRevisionDraft</value>
1887
1894
  <value>editionOf</value>
1888
1895
  <value>hasEdition</value>
1889
1896
  <value>updates</value>
@@ -24,6 +24,7 @@
24
24
  <optional>
25
25
  <ref name="docsubtype"/>
26
26
  </optional>
27
+ <ref name="flavor"/>
27
28
  <ref name="editorialgroup"/>
28
29
  <zeroOrMore>
29
30
  <ref name="ics"/>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Csa
3
- VERSION = "2.5.3".freeze
3
+ VERSION = "2.5.5".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-csa
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.3
4
+ version: 2.5.5
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-09-30 00:00:00.000000000 Z
11
+ date: 2024-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic