metanorma-csa 2.5.2 → 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: 59fc6bb20c36f092138dea577abe66a6e1e63604316f806028487e6668aab801
4
- data.tar.gz: 67b871bae162e214b5d3431bd588d3db240d1a82f7952fefdb54a87c1c8a38c4
3
+ metadata.gz: 8360063811ebb744998ac0a3649a8a8ba9b4a7cac02cdbf456820fe5f02601d1
4
+ data.tar.gz: 8ff5935509555602938f4884f0d9342e647c826faab7ec897fb423f1ba578c31
5
5
  SHA512:
6
- metadata.gz: 9c3596a2d9c2d0f3ee08277e4a11d4d952336e0bcca4cdadd4ede530b057caf00d188c6afcb6712ed8f671629df94866f4655eb4942adec3fd2e55ce6d7677f9
7
- data.tar.gz: 72a05f08024dd308f2afd68a381295e270802c7620a90111500ac5f86abb4f4a54a36a60bb9561824b98acd6bf28f88554ea1226fb79bc890d9100764cfdaf2a
6
+ metadata.gz: e1b138147e1f6326ee440d2ab98bdd96bbe0d9d9f1af270634a1669a41ba07967c7652fb9760b11528d6ae7345166ed3b8835da1149a211a7e87d0c80127234b
7
+ data.tar.gz: 772bf908991c5010c66c693d4705c13b31b5b67b5cd237e02e68a378cbd2d4b1cd331123f754f27f80ce56c0cf5183723caec702ebab9913f57ba823c5081ce6
@@ -3837,6 +3837,7 @@
3837
3837
 
3838
3838
  <fo:block role="SKIP">
3839
3839
  <xsl:apply-templates/>
3840
+ <xsl:if test="$isGenerateTableIF = 'false' and count(node()) = 0"> </xsl:if>
3840
3841
  </fo:block>
3841
3842
  </fo:table-cell>
3842
3843
  </xsl:template> <!-- cell in table header row - 'th' -->
@@ -3900,6 +3901,8 @@
3900
3901
 
3901
3902
  <xsl:if test="$isGenerateTableIF = 'true'"> <fo:inline id="{@id}_end">end</fo:inline></xsl:if> <!-- to determine width of text --> <!-- <xsl:value-of select="$hair_space"/> -->
3902
3903
 
3904
+ <xsl:if test="$isGenerateTableIF = 'false' and count(node()) = 0"> </xsl:if>
3905
+
3903
3906
  </fo:block>
3904
3907
  </fo:table-cell>
3905
3908
  </xsl:template> <!-- td -->
@@ -3971,7 +3974,8 @@
3971
3974
  </xsl:choose>
3972
3975
  </xsl:variable>
3973
3976
  <xsl:variable name="current_fn_number_text">
3974
- <xsl:value-of select="$current_fn_number"/>
3977
+
3978
+ <xsl:value-of select="$current_fn_number"/>
3975
3979
 
3976
3980
  </xsl:variable>
3977
3981
 
@@ -4007,8 +4011,10 @@
4007
4011
 
4008
4012
  <xsl:call-template name="insert_basic_link">
4009
4013
  <xsl:with-param name="element">
4010
- <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}" role="Lbl">
4011
- <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>
4012
4018
  </fo:basic-link>
4013
4019
  </xsl:with-param>
4014
4020
  </xsl:call-template>
@@ -4289,7 +4295,7 @@
4289
4295
 
4290
4296
  <xsl:call-template name="refine_fn-reference-style"/>
4291
4297
 
4292
- <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-->
4293
4299
  <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> <!-- for footnotes in tables -->
4294
4300
  <xsl:attribute name="internal-destination">
4295
4301
  <xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
@@ -5289,9 +5295,19 @@
5289
5295
  </fo:inline>
5290
5296
  </xsl:template>
5291
5297
 
5292
- <xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
5298
+ <xsl:template match="text()[ancestor::*[local-name()='smallcap']]" name="smallcaps">
5299
+ <xsl:param name="txt"/>
5293
5300
  <!-- <xsl:variable name="text" select="normalize-space(.)"/> --> <!-- https://github.com/metanorma/metanorma-iso/issues/1115 -->
5294
- <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>
5295
5311
  <xsl:variable name="ratio_">
5296
5312
  0.75
5297
5313
  </xsl:variable>
@@ -6685,14 +6701,16 @@
6685
6701
  <xsl:template match="*[local-name()='link']" name="link">
6686
6702
  <xsl:variable name="target_normalized" select="translate(@target, '\', '/')"/>
6687
6703
  <xsl:variable name="target_attachment_name" select="substring-after($target_normalized, '_attachments/')"/>
6704
+ <xsl:variable name="isLinkToEmbeddedFile" select="normalize-space(@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target])"/>
6688
6705
  <xsl:variable name="target">
6689
6706
  <xsl:choose>
6690
6707
  <xsl:when test="@updatetype = 'true'">
6691
6708
  <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
6692
6709
  </xsl:when>
6693
6710
  <!-- link to the PDF attachment -->
6694
- <xsl:when test="@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target]">
6695
- <xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
6711
+ <xsl:when test="$isLinkToEmbeddedFile = 'true'">
6712
+ <xsl:variable name="target_file" select="java:org.metanorma.fop.Util.getFilenameFromPath(@target)"/>
6713
+ <xsl:value-of select="concat('url(embedded-file:', $target_file, ')')"/>
6696
6714
  </xsl:when>
6697
6715
  <!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
6698
6716
  <xsl:value-of select="concat('url(embedded-file:', $target_attachment_name, ')')"/>
@@ -6723,6 +6741,11 @@
6723
6741
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
6724
6742
  </xsl:if>
6725
6743
 
6744
+ <xsl:if test="$isLinkToEmbeddedFile = 'true'">
6745
+ <xsl:attribute name="color">inherit</xsl:attribute>
6746
+ <xsl:attribute name="text-decoration">none</xsl:attribute>
6747
+ </xsl:if>
6748
+
6726
6749
  <xsl:call-template name="refine_link-style"/>
6727
6750
 
6728
6751
  <xsl:choose>
@@ -6730,9 +6753,15 @@
6730
6753
  <xsl:apply-templates/>
6731
6754
  </xsl:when>
6732
6755
  <xsl:otherwise>
6756
+ <xsl:variable name="alt_text">
6757
+ <xsl:call-template name="getAltText"/>
6758
+ </xsl:variable>
6733
6759
  <xsl:call-template name="insert_basic_link">
6734
6760
  <xsl:with-param name="element">
6735
- <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
6761
+ <fo:basic-link external-destination="{$target}" fox:alt-text="{$alt_text}">
6762
+ <xsl:if test="$isLinkToEmbeddedFile = 'true'">
6763
+ <xsl:attribute name="role">Annot</xsl:attribute>
6764
+ </xsl:if>
6736
6765
  <xsl:choose>
6737
6766
  <xsl:when test="normalize-space(.) = ''">
6738
6767
  <xsl:call-template name="add-zero-spaces-link-java">
@@ -6745,6 +6774,10 @@
6745
6774
  </xsl:otherwise>
6746
6775
  </xsl:choose>
6747
6776
  </fo:basic-link>
6777
+ <xsl:if test="$isLinkToEmbeddedFile = 'true'">
6778
+ <!-- reserve space at right for PaperClip icon -->
6779
+ <fo:inline keep-with-previous.within-line="always">        </fo:inline>
6780
+ </xsl:if>
6748
6781
  </xsl:with-param>
6749
6782
  </xsl:call-template>
6750
6783
  </xsl:otherwise>
@@ -6752,6 +6785,14 @@
6752
6785
  </fo:inline>
6753
6786
  </xsl:template> <!-- link -->
6754
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
+
6755
6796
  <!-- ======================== -->
6756
6797
  <!-- Appendix processing -->
6757
6798
  <!-- ======================== -->
@@ -6782,7 +6823,7 @@
6782
6823
  <xsl:template match="*[local-name() = 'callout']">
6783
6824
  <xsl:choose>
6784
6825
  <xsl:when test="normalize-space(@target) = ''">&lt;<xsl:apply-templates/>&gt;</xsl:when>
6785
- <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>
6786
6827
  </xsl:choose>
6787
6828
  </xsl:template>
6788
6829
 
@@ -6811,7 +6852,10 @@
6811
6852
  <xsl:template match="*[local-name() = 'xref']">
6812
6853
  <xsl:call-template name="insert_basic_link">
6813
6854
  <xsl:with-param name="element">
6814
- <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">
6815
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'])">
6816
6860
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
6817
6861
  </xsl:if>
@@ -9295,12 +9339,14 @@
9295
9339
 
9296
9340
  <xsl:when test="contains(normalize-space($fo_element), 'list')">
9297
9341
 
9298
- <xsl:variable name="provisional_distance_between_starts">
9342
+ <xsl:variable name="provisional_distance_between_starts_">
9299
9343
  7
9300
9344
  </xsl:variable>
9301
- <xsl:variable name="indent">
9345
+ <xsl:variable name="provisional_distance_between_starts" select="normalize-space($provisional_distance_between_starts_)"/>
9346
+ <xsl:variable name="indent_">
9302
9347
  0
9303
9348
  </xsl:variable>
9349
+ <xsl:variable name="indent" select="normalize-space($indent_)"/>
9304
9350
 
9305
9351
  <fo:list-block provisional-distance-between-starts="{$provisional_distance_between_starts}mm">
9306
9352
  <fo:list-item>
@@ -10025,14 +10071,17 @@
10025
10071
  </xsl:when>
10026
10072
  <xsl:when test="local-name(..) = 'ol' and @label"> <!-- for ordered lists 'ol', and if there is @label, for instance label="1.1.2" -->
10027
10073
 
10028
- <xsl:variable name="label">
10074
+ <xsl:variable name="type" select="../@type"/>
10029
10075
 
10030
- <xsl:variable name="type" select="../@type"/>
10076
+ <xsl:variable name="label">
10031
10077
 
10032
10078
  <xsl:variable name="style_prefix_">
10033
10079
  <xsl:if test="$type = 'roman'">
10034
10080
  <!-- Example: (i) -->
10035
10081
  </xsl:if>
10082
+ <xsl:if test="$type = 'alphabet'">
10083
+
10084
+ </xsl:if>
10036
10085
  </xsl:variable>
10037
10086
  <xsl:variable name="style_prefix" select="normalize-space($style_prefix_)"/>
10038
10087
 
@@ -10058,13 +10107,15 @@
10058
10107
  <xsl:if test="$style_prefix != '' and not(starts-with(@label, $style_prefix))">
10059
10108
  <xsl:value-of select="$style_prefix"/>
10060
10109
  </xsl:if>
10110
+
10061
10111
  <xsl:value-of select="@label"/>
10112
+
10062
10113
  <xsl:if test="not(java:endsWith(java:java.lang.String.new(@label),$style_suffix))">
10063
10114
  <xsl:value-of select="$style_suffix"/>
10064
10115
  </xsl:if>
10065
10116
  </xsl:variable>
10066
10117
 
10067
- <xsl:value-of select="normalize-space($label)"/>
10118
+ <xsl:value-of select="normalize-space($label)"/>
10068
10119
 
10069
10120
  </xsl:when>
10070
10121
  <xsl:otherwise> <!-- for ordered lists 'ol' -->
@@ -12235,9 +12286,15 @@
12235
12286
  </x:xmpmeta>
12236
12287
  <!-- add attachments -->
12237
12288
  <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
12238
- <xsl:variable name="description" select="normalize-space(//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]/*[local-name() = 'formattedref'])"/>
12239
-
12240
- <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" filename="{@name}">
12289
+ <xsl:variable name="bibitem_attachment_" select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]"/>
12290
+ <xsl:variable name="bibitem_attachment" select="xalan:nodeset($bibitem_attachment_)"/>
12291
+ <xsl:variable name="description" select="normalize-space($bibitem_attachment/*[local-name() = 'formattedref'])"/>
12292
+ <xsl:variable name="filename" select="java:org.metanorma.fop.Util.getFilenameFromPath(@name)"/>
12293
+ <!-- Todo: need update -->
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'])"/>
12296
+
12297
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" filename="{$filename}" link-as-file-annotation="true">
12241
12298
  <xsl:attribute name="src">
12242
12299
  <xsl:choose>
12243
12300
  <xsl:when test="normalize-space() != ''">
@@ -12253,18 +12310,34 @@
12253
12310
  <xsl:if test="$description != ''">
12254
12311
  <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
12255
12312
  </xsl:if>
12313
+ <xsl:if test="$afrelationship != ''">
12314
+ <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
12315
+ </xsl:if>
12316
+ <xsl:if test="$volatile != ''">
12317
+ <xsl:attribute name="volatile"><xsl:value-of select="$volatile"/></xsl:attribute>
12318
+ </xsl:if>
12256
12319
  </pdf:embedded-file>
12257
12320
  </xsl:for-each>
12258
12321
  <!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
12259
12322
  <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
12260
12323
  <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
12261
12324
  <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
12325
+ <xsl:variable name="attachment_name" select="java:org.metanorma.fop.Util.getFilenameFromPath($attachment_path)"/>
12262
12326
  <xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
12263
12327
  <xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
12264
- <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{$attachment_path}">
12328
+ <!-- Todo: need update -->
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'])"/>
12331
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{$attachment_name}" link-as-file-annotation="true">
12265
12332
  <xsl:if test="$description != ''">
12266
12333
  <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
12267
12334
  </xsl:if>
12335
+ <xsl:if test="$afrelationship != ''">
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>
12268
12341
  </pdf:embedded-file>
12269
12342
  </xsl:for-each>
12270
12343
  </xsl:if>
@@ -12284,6 +12357,12 @@
12284
12357
  <!-- Get or calculate depth of the element -->
12285
12358
  <xsl:template name="getLevel">
12286
12359
  <xsl:param name="depth"/>
12360
+ <!-- <xsl:message>
12361
+ <xsl:choose>
12362
+ <xsl:when test="local-name() = 'title'">title=<xsl:value-of select="."/></xsl:when>
12363
+ <xsl:when test="local-name() = 'clause'">clause/title=<xsl:value-of select="*[local-name() = 'title']"/></xsl:when>
12364
+ </xsl:choose>
12365
+ </xsl:message> -->
12287
12366
  <xsl:choose>
12288
12367
  <xsl:when test="normalize-space(@depth) != ''">
12289
12368
  <xsl:value-of select="@depth"/>
@@ -12304,8 +12383,48 @@
12304
12383
  <xsl:when test="ancestor::*[local-name() = 'preface']">
12305
12384
  <xsl:value-of select="$level_total - 2"/>
12306
12385
  </xsl:when>
12386
+ <xsl:when test="ancestor::*[local-name() = 'sections'] and self::*[local-name() = 'title']">
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> -->
12398
+ <xsl:choose>
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)"/>
12412
+ </xsl:when>
12413
+ <xsl:otherwise>
12414
+ <xsl:value-of select="$level_total - 2"/>
12415
+ </xsl:otherwise>
12416
+ </xsl:choose>
12417
+ </xsl:when>
12307
12418
  <xsl:when test="ancestor::*[local-name() = 'sections']">
12308
- <xsl:value-of select="$level_total - 1"/>
12419
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause' or local-name() = 'terms'][1]/*[local-name() = 'title']/@depth)"/>
12420
+ <xsl:choose>
12421
+ <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
12422
+ <xsl:value-of select="number($upper_clause_depth + 1)"/>
12423
+ </xsl:when>
12424
+ <xsl:otherwise>
12425
+ <xsl:value-of select="$level_total - 1"/>
12426
+ </xsl:otherwise>
12427
+ </xsl:choose>
12309
12428
  </xsl:when>
12310
12429
  <xsl:when test="ancestor::*[local-name() = 'bibliography']">
12311
12430
  <xsl:value-of select="$level_total - 1"/>
@@ -12313,6 +12432,17 @@
12313
12432
  <xsl:when test="parent::*[local-name() = 'annex']">
12314
12433
  <xsl:value-of select="$level_total - 1"/>
12315
12434
  </xsl:when>
12435
+ <xsl:when test="ancestor::*[local-name() = 'annex'] and self::*[local-name() = 'title']">
12436
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/>
12437
+ <xsl:choose>
12438
+ <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
12439
+ <xsl:value-of select="number($upper_clause_depth + 1)"/>
12440
+ </xsl:when>
12441
+ <xsl:otherwise>
12442
+ <xsl:value-of select="$level_total - 1"/>
12443
+ </xsl:otherwise>
12444
+ </xsl:choose>
12445
+ </xsl:when>
12316
12446
  <xsl:when test="ancestor::*[local-name() = 'annex']">
12317
12447
  <xsl:value-of select="$level_total"/>
12318
12448
  </xsl:when>
@@ -12671,6 +12801,20 @@
12671
12801
 
12672
12802
  <!-- END: insert cover page image -->
12673
12803
 
12804
+ <xsl:template name="insertVerticalChar">
12805
+ <xsl:param name="str"/>
12806
+ <xsl:if test="string-length($str) &gt; 0">
12807
+ <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">
12808
+ <fo:block-container width="1em">
12809
+ <fo:block line-height="1em"><xsl:value-of select="substring($str,1,1)"/></fo:block>
12810
+ </fo:block-container>
12811
+ </fo:inline-container>
12812
+ <xsl:call-template name="insertVerticalChar">
12813
+ <xsl:with-param name="str" select="substring($str, 2)"/>
12814
+ </xsl:call-template>
12815
+ </xsl:if>
12816
+ </xsl:template>
12817
+
12674
12818
  <xsl:template name="number-to-words">
12675
12819
  <xsl:param name="number"/>
12676
12820
  <xsl:param name="first"/>
@@ -12958,4 +13102,18 @@
12958
13102
  </xsl:if>
12959
13103
  </xsl:template>
12960
13104
 
13105
+ <xsl:template match="@*|node()" mode="set_table_role_skip">
13106
+ <xsl:copy>
13107
+ <xsl:apply-templates select="@*|node()" mode="set_table_role_skip"/>
13108
+ </xsl:copy>
13109
+ </xsl:template>
13110
+
13111
+ <xsl:template match="*[starts-with(local-name(), 'table')]" mode="set_table_role_skip">
13112
+ <xsl:copy>
13113
+ <xsl:apply-templates select="@*" mode="set_table_role_skip"/>
13114
+ <xsl:attribute name="role">SKIP</xsl:attribute>
13115
+ <xsl:apply-templates select="node()" mode="set_table_role_skip"/>
13116
+ </xsl:copy>
13117
+ </xsl:template>
13118
+
12961
13119
  </xsl:stylesheet>
@@ -82,6 +82,9 @@ p kbd, dt kbd, li kbd, label kbd, legend kbd, caption kbd, th kbd, td kbd,
82
82
  p samp, dt samp, li samp, label samp, legend samp, caption samp, th samp, td samp {
83
83
  font-size: {{monospacefontsize}}; }
84
84
 
85
+ sub, sup {
86
+ font-size: 0.75em; }
87
+
85
88
  article, aside, details, figcaption, figure,
86
89
  footer, header, hgroup, menu, nav, section {
87
90
  display: block; }
@@ -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.2".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.2
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-16 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