metanorma-csa 2.5.3 → 2.5.4

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: 8360063811ebb744998ac0a3649a8a8ba9b4a7cac02cdbf456820fe5f02601d1
4
+ data.tar.gz: 8ff5935509555602938f4884f0d9342e647c826faab7ec897fb423f1ba578c31
5
5
  SHA512:
6
- metadata.gz: a1dab799436d4f3094be42faecb1293ca5c181c4694cc1e86e5bd3a9d51862c6e7f0156071482eb74258b3e0b481f730a30cfa4fc4d81158637aa5617599a511
7
- data.tar.gz: 77149266b62dd042f42b091158d0b2b4a415d8e4d4dac68a15a76d2b794c34205e6c2f39ce7ab4b5d6833f6fee24166503b881b09771c2b02e909acbe11c6608
6
+ metadata.gz: e1b138147e1f6326ee440d2ab98bdd96bbe0d9d9f1af270634a1669a41ba07967c7652fb9760b11528d6ae7345166ed3b8835da1149a211a7e87d0c80127234b
7
+ data.tar.gz: 772bf908991c5010c66c693d4705c13b31b5b67b5cd237e02e68a378cbd2d4b1cd331123f754f27f80ce56c0cf5183723caec702ebab9913f57ba823c5081ce6
@@ -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
 
@@ -4010,8 +4011,10 @@
4010
4011
 
4011
4012
  <xsl:call-template name="insert_basic_link">
4012
4013
  <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"/>
4014
+ <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 -->
4015
+ <fo:inline role="Lbl"> <!-- need for https://github.com/metanorma/metanorma-iso/issues/1003 -->
4016
+ <xsl:copy-of select="$current_fn_number_text"/>
4017
+ </fo:inline>
4015
4018
  </fo:basic-link>
4016
4019
  </xsl:with-param>
4017
4020
  </xsl:call-template>
@@ -4292,7 +4295,7 @@
4292
4295
 
4293
4296
  <xsl:call-template name="refine_fn-reference-style"/>
4294
4297
 
4295
- <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
4298
+ <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="footnote {@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
4296
4299
  <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> <!-- for footnotes in tables -->
4297
4300
  <xsl:attribute name="internal-destination">
4298
4301
  <xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
@@ -5292,9 +5295,19 @@
5292
5295
  </fo:inline>
5293
5296
  </xsl:template>
5294
5297
 
5295
- <xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
5298
+ <xsl:template match="text()[ancestor::*[local-name()='smallcap']]" name="smallcaps">
5299
+ <xsl:param name="txt"/>
5296
5300
  <!-- <xsl:variable name="text" select="normalize-space(.)"/> --> <!-- https://github.com/metanorma/metanorma-iso/issues/1115 -->
5297
- <xsl:variable name="text" select="."/>
5301
+ <xsl:variable name="text">
5302
+ <xsl:choose>
5303
+ <xsl:when test="$txt != ''">
5304
+ <xsl:value-of select="$txt"/>
5305
+ </xsl:when>
5306
+ <xsl:otherwise>
5307
+ <xsl:value-of select="."/>
5308
+ </xsl:otherwise>
5309
+ </xsl:choose>
5310
+ </xsl:variable>
5298
5311
  <xsl:variable name="ratio_">
5299
5312
  0.75
5300
5313
  </xsl:variable>
@@ -6740,9 +6753,12 @@
6740
6753
  <xsl:apply-templates/>
6741
6754
  </xsl:when>
6742
6755
  <xsl:otherwise>
6756
+ <xsl:variable name="alt_text">
6757
+ <xsl:call-template name="getAltText"/>
6758
+ </xsl:variable>
6743
6759
  <xsl:call-template name="insert_basic_link">
6744
6760
  <xsl:with-param name="element">
6745
- <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
6761
+ <fo:basic-link external-destination="{$target}" fox:alt-text="{$alt_text}">
6746
6762
  <xsl:if test="$isLinkToEmbeddedFile = 'true'">
6747
6763
  <xsl:attribute name="role">Annot</xsl:attribute>
6748
6764
  </xsl:if>
@@ -6769,6 +6785,14 @@
6769
6785
  </fo:inline>
6770
6786
  </xsl:template> <!-- link -->
6771
6787
 
6788
+ <xsl:template name="getAltText">
6789
+ <xsl:choose>
6790
+ <xsl:when test="normalize-space(.) = ''"><xsl:value-of select="@target"/></xsl:when>
6791
+ <xsl:otherwise><xsl:value-of select="normalize-space(translate(normalize-space(), ' —', ' -'))"/></xsl:otherwise>
6792
+ <!-- <xsl:otherwise><xsl:value-of select="@target"/></xsl:otherwise> -->
6793
+ </xsl:choose>
6794
+ </xsl:template>
6795
+
6772
6796
  <!-- ======================== -->
6773
6797
  <!-- Appendix processing -->
6774
6798
  <!-- ======================== -->
@@ -6799,7 +6823,7 @@
6799
6823
  <xsl:template match="*[local-name() = 'callout']">
6800
6824
  <xsl:choose>
6801
6825
  <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>
6826
+ <xsl:otherwise><fo:basic-link internal-destination="{@target}" fox:alt-text="{normalize-space()}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link></xsl:otherwise>
6803
6827
  </xsl:choose>
6804
6828
  </xsl:template>
6805
6829
 
@@ -6828,7 +6852,10 @@
6828
6852
  <xsl:template match="*[local-name() = 'xref']">
6829
6853
  <xsl:call-template name="insert_basic_link">
6830
6854
  <xsl:with-param name="element">
6831
- <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
6855
+ <xsl:variable name="alt_text">
6856
+ <xsl:call-template name="getAltText"/>
6857
+ </xsl:variable>
6858
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="{$alt_text}" xsl:use-attribute-sets="xref-style">
6832
6859
  <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
6860
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
6834
6861
  </xsl:if>
@@ -9312,12 +9339,14 @@
9312
9339
 
9313
9340
  <xsl:when test="contains(normalize-space($fo_element), 'list')">
9314
9341
 
9315
- <xsl:variable name="provisional_distance_between_starts">
9342
+ <xsl:variable name="provisional_distance_between_starts_">
9316
9343
  7
9317
9344
  </xsl:variable>
9318
- <xsl:variable name="indent">
9345
+ <xsl:variable name="provisional_distance_between_starts" select="normalize-space($provisional_distance_between_starts_)"/>
9346
+ <xsl:variable name="indent_">
9319
9347
  0
9320
9348
  </xsl:variable>
9349
+ <xsl:variable name="indent" select="normalize-space($indent_)"/>
9321
9350
 
9322
9351
  <fo:list-block provisional-distance-between-starts="{$provisional_distance_between_starts}mm">
9323
9352
  <fo:list-item>
@@ -10042,14 +10071,17 @@
10042
10071
  </xsl:when>
10043
10072
  <xsl:when test="local-name(..) = 'ol' and @label"> <!-- for ordered lists 'ol', and if there is @label, for instance label="1.1.2" -->
10044
10073
 
10045
- <xsl:variable name="label">
10074
+ <xsl:variable name="type" select="../@type"/>
10046
10075
 
10047
- <xsl:variable name="type" select="../@type"/>
10076
+ <xsl:variable name="label">
10048
10077
 
10049
10078
  <xsl:variable name="style_prefix_">
10050
10079
  <xsl:if test="$type = 'roman'">
10051
10080
  <!-- Example: (i) -->
10052
10081
  </xsl:if>
10082
+ <xsl:if test="$type = 'alphabet'">
10083
+
10084
+ </xsl:if>
10053
10085
  </xsl:variable>
10054
10086
  <xsl:variable name="style_prefix" select="normalize-space($style_prefix_)"/>
10055
10087
 
@@ -10075,13 +10107,15 @@
10075
10107
  <xsl:if test="$style_prefix != '' and not(starts-with(@label, $style_prefix))">
10076
10108
  <xsl:value-of select="$style_prefix"/>
10077
10109
  </xsl:if>
10110
+
10078
10111
  <xsl:value-of select="@label"/>
10112
+
10079
10113
  <xsl:if test="not(java:endsWith(java:java.lang.String.new(@label),$style_suffix))">
10080
10114
  <xsl:value-of select="$style_suffix"/>
10081
10115
  </xsl:if>
10082
10116
  </xsl:variable>
10083
10117
 
10084
- <xsl:value-of select="normalize-space($label)"/>
10118
+ <xsl:value-of select="normalize-space($label)"/>
10085
10119
 
10086
10120
  </xsl:when>
10087
10121
  <xsl:otherwise> <!-- for ordered lists 'ol' -->
@@ -12257,7 +12291,8 @@
12257
12291
  <xsl:variable name="description" select="normalize-space($bibitem_attachment/*[local-name() = 'formattedref'])"/>
12258
12292
  <xsl:variable name="filename" select="java:org.metanorma.fop.Util.getFilenameFromPath(@name)"/>
12259
12293
  <!-- Todo: need update -->
12260
- <xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
12294
+ <xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = 'classification'][@type = 'pdf-AFRelationship'])"/>
12295
+ <xsl:variable name="volatile" select="normalize-space($bibitem_attachment//*[local-name() = 'classification'][@type = 'pdf-volatile'])"/>
12261
12296
 
12262
12297
  <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" filename="{$filename}" link-as-file-annotation="true">
12263
12298
  <xsl:attribute name="src">
@@ -12278,6 +12313,9 @@
12278
12313
  <xsl:if test="$afrelationship != ''">
12279
12314
  <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
12280
12315
  </xsl:if>
12316
+ <xsl:if test="$volatile != ''">
12317
+ <xsl:attribute name="volatile"><xsl:value-of select="$volatile"/></xsl:attribute>
12318
+ </xsl:if>
12281
12319
  </pdf:embedded-file>
12282
12320
  </xsl:for-each>
12283
12321
  <!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
@@ -12288,14 +12326,18 @@
12288
12326
  <xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
12289
12327
  <xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
12290
12328
  <!-- Todo: need update -->
12291
- <xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
12329
+ <xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'classification'][@type = 'pdf-AFRelationship'])"/>
12330
+ <xsl:variable name="volatile" select="normalize-space(.//*[local-name() = 'classification'][@type = 'pdf-volatile'])"/>
12292
12331
  <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{$attachment_name}" link-as-file-annotation="true">
12293
12332
  <xsl:if test="$description != ''">
12294
12333
  <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
12295
12334
  </xsl:if>
12296
12335
  <xsl:if test="$afrelationship != ''">
12297
- <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
12298
- </xsl:if>
12336
+ <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
12337
+ </xsl:if>
12338
+ <xsl:if test="$volatile != ''">
12339
+ <xsl:attribute name="volatile"><xsl:value-of select="$volatile"/></xsl:attribute>
12340
+ </xsl:if>
12299
12341
  </pdf:embedded-file>
12300
12342
  </xsl:for-each>
12301
12343
  </xsl:if>
@@ -12342,10 +12384,31 @@
12342
12384
  <xsl:value-of select="$level_total - 2"/>
12343
12385
  </xsl:when>
12344
12386
  <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)"/>
12387
+ <!-- determine 'depth' depends on upper clause with title/@depth -->
12388
+ <!-- <xsl:message>title=<xsl:value-of select="."/></xsl:message> -->
12389
+ <xsl:variable name="clause_with_depth_depth" select="ancestor::*[local-name() = 'clause'][*[local-name() = 'title']/@depth][1]/*[local-name() = 'title']/@depth"/>
12390
+ <!-- <xsl:message>clause_with_depth_depth=<xsl:value-of select="$clause_with_depth_depth"/></xsl:message> -->
12391
+ <xsl:variable name="clause_with_depth_level" select="count(ancestor::*[local-name() = 'clause'][*[local-name() = 'title']/@depth][1]/ancestor::*)"/>
12392
+ <!-- <xsl:message>clause_with_depth_level=<xsl:value-of select="$clause_with_depth_level"/></xsl:message> -->
12393
+ <xsl:variable name="curr_level" select="count(ancestor::*) - 1"/>
12394
+ <!-- <xsl:message>curr_level=<xsl:value-of select="$curr_level"/></xsl:message> -->
12395
+ <!-- <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/> -->
12396
+ <xsl:variable name="curr_clause_depth" select="number($clause_with_depth_depth) + (number($curr_level) - number($clause_with_depth_level)) "/>
12397
+ <!-- <xsl:message>curr_clause_depth=<xsl:value-of select="$curr_clause_depth"/></xsl:message> -->
12346
12398
  <xsl:choose>
12347
- <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
12348
- <xsl:value-of select="number($upper_clause_depth + 1)"/>
12399
+ <xsl:when test="string(number($curr_clause_depth)) != 'NaN'">
12400
+ <xsl:value-of select="number($curr_clause_depth)"/>
12401
+ </xsl:when>
12402
+ <xsl:otherwise>
12403
+ <xsl:value-of select="$level_total - 2"/>
12404
+ </xsl:otherwise>
12405
+ </xsl:choose>
12406
+ </xsl:when>
12407
+ <xsl:when test="ancestor::*[local-name() = 'sections'] and self::*[local-name() = 'name'] and parent::*[local-name() = 'term']">
12408
+ <xsl:variable name="upper_terms_depth" select="normalize-space(ancestor::*[local-name() = 'terms'][1]/*[local-name() = 'title']/@depth)"/>
12409
+ <xsl:choose>
12410
+ <xsl:when test="string(number($upper_terms_depth)) != 'NaN'">
12411
+ <xsl:value-of select="number($upper_terms_depth + 1)"/>
12349
12412
  </xsl:when>
12350
12413
  <xsl:otherwise>
12351
12414
  <xsl:value-of select="$level_total - 2"/>
@@ -12353,7 +12416,7 @@
12353
12416
  </xsl:choose>
12354
12417
  </xsl:when>
12355
12418
  <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)"/>
12419
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause' or local-name() = 'terms'][1]/*[local-name() = 'title']/@depth)"/>
12357
12420
  <xsl:choose>
12358
12421
  <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
12359
12422
  <xsl:value-of select="number($upper_clause_depth + 1)"/>
@@ -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.4".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.4
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-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic