metanorma-ogc 2.6.3 → 2.6.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
 
@@ -5419,8 +5420,10 @@
5419
5420
 
5420
5421
  <xsl:call-template name="insert_basic_link">
5421
5422
  <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"/>
5423
+ <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 -->
5424
+ <fo:inline role="Lbl"> <!-- need for https://github.com/metanorma/metanorma-iso/issues/1003 -->
5425
+ <xsl:copy-of select="$current_fn_number_text"/>
5426
+ </fo:inline>
5424
5427
  </fo:basic-link>
5425
5428
  </xsl:with-param>
5426
5429
  </xsl:call-template>
@@ -5707,7 +5710,7 @@
5707
5710
 
5708
5711
  <xsl:call-template name="refine_fn-reference-style"/>
5709
5712
 
5710
- <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
5713
+ <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="footnote {@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
5711
5714
  <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> <!-- for footnotes in tables -->
5712
5715
  <xsl:attribute name="internal-destination">
5713
5716
  <xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
@@ -6722,9 +6725,19 @@
6722
6725
  </fo:inline>
6723
6726
  </xsl:template>
6724
6727
 
6725
- <xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
6728
+ <xsl:template match="text()[ancestor::*[local-name()='smallcap']]" name="smallcaps">
6729
+ <xsl:param name="txt"/>
6726
6730
  <!-- <xsl:variable name="text" select="normalize-space(.)"/> --> <!-- https://github.com/metanorma/metanorma-iso/issues/1115 -->
6727
- <xsl:variable name="text" select="."/>
6731
+ <xsl:variable name="text">
6732
+ <xsl:choose>
6733
+ <xsl:when test="$txt != ''">
6734
+ <xsl:value-of select="$txt"/>
6735
+ </xsl:when>
6736
+ <xsl:otherwise>
6737
+ <xsl:value-of select="."/>
6738
+ </xsl:otherwise>
6739
+ </xsl:choose>
6740
+ </xsl:variable>
6728
6741
  <xsl:variable name="ratio_">
6729
6742
  0.75
6730
6743
  </xsl:variable>
@@ -8170,9 +8183,12 @@
8170
8183
  <xsl:apply-templates/>
8171
8184
  </xsl:when>
8172
8185
  <xsl:otherwise>
8186
+ <xsl:variable name="alt_text">
8187
+ <xsl:call-template name="getAltText"/>
8188
+ </xsl:variable>
8173
8189
  <xsl:call-template name="insert_basic_link">
8174
8190
  <xsl:with-param name="element">
8175
- <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
8191
+ <fo:basic-link external-destination="{$target}" fox:alt-text="{$alt_text}">
8176
8192
  <xsl:if test="$isLinkToEmbeddedFile = 'true'">
8177
8193
  <xsl:attribute name="role">Annot</xsl:attribute>
8178
8194
  </xsl:if>
@@ -8199,6 +8215,14 @@
8199
8215
  </fo:inline>
8200
8216
  </xsl:template> <!-- link -->
8201
8217
 
8218
+ <xsl:template name="getAltText">
8219
+ <xsl:choose>
8220
+ <xsl:when test="normalize-space(.) = ''"><xsl:value-of select="@target"/></xsl:when>
8221
+ <xsl:otherwise><xsl:value-of select="normalize-space(translate(normalize-space(), ' —', ' -'))"/></xsl:otherwise>
8222
+ <!-- <xsl:otherwise><xsl:value-of select="@target"/></xsl:otherwise> -->
8223
+ </xsl:choose>
8224
+ </xsl:template>
8225
+
8202
8226
  <!-- ======================== -->
8203
8227
  <!-- Appendix processing -->
8204
8228
  <!-- ======================== -->
@@ -8229,7 +8253,7 @@
8229
8253
  <xsl:template match="*[local-name() = 'callout']">
8230
8254
  <xsl:choose>
8231
8255
  <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>
8256
+ <xsl:otherwise><fo:basic-link internal-destination="{@target}" fox:alt-text="{normalize-space()}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link></xsl:otherwise>
8233
8257
  </xsl:choose>
8234
8258
  </xsl:template>
8235
8259
 
@@ -8262,7 +8286,10 @@
8262
8286
  <xsl:template match="*[local-name() = 'xref']">
8263
8287
  <xsl:call-template name="insert_basic_link">
8264
8288
  <xsl:with-param name="element">
8265
- <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
8289
+ <xsl:variable name="alt_text">
8290
+ <xsl:call-template name="getAltText"/>
8291
+ </xsl:variable>
8292
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="{$alt_text}" xsl:use-attribute-sets="xref-style">
8266
8293
  <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
8294
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
8268
8295
  </xsl:if>
@@ -10797,12 +10824,14 @@
10797
10824
 
10798
10825
  <xsl:when test="contains(normalize-space($fo_element), 'list')">
10799
10826
 
10800
- <xsl:variable name="provisional_distance_between_starts">
10827
+ <xsl:variable name="provisional_distance_between_starts_">
10801
10828
  7
10802
10829
  </xsl:variable>
10803
- <xsl:variable name="indent">
10830
+ <xsl:variable name="provisional_distance_between_starts" select="normalize-space($provisional_distance_between_starts_)"/>
10831
+ <xsl:variable name="indent_">
10804
10832
  0
10805
10833
  </xsl:variable>
10834
+ <xsl:variable name="indent" select="normalize-space($indent_)"/>
10806
10835
 
10807
10836
  <fo:list-block provisional-distance-between-starts="{$provisional_distance_between_starts}mm">
10808
10837
  <fo:list-item>
@@ -11524,14 +11553,17 @@
11524
11553
  </xsl:when>
11525
11554
  <xsl:when test="local-name(..) = 'ol' and @label"> <!-- for ordered lists 'ol', and if there is @label, for instance label="1.1.2" -->
11526
11555
 
11527
- <xsl:variable name="label">
11556
+ <xsl:variable name="type" select="../@type"/>
11528
11557
 
11529
- <xsl:variable name="type" select="../@type"/>
11558
+ <xsl:variable name="label">
11530
11559
 
11531
11560
  <xsl:variable name="style_prefix_">
11532
11561
  <xsl:if test="$type = 'roman'">
11533
11562
  <!-- Example: (i) -->
11534
11563
  </xsl:if>
11564
+ <xsl:if test="$type = 'alphabet'">
11565
+
11566
+ </xsl:if>
11535
11567
  </xsl:variable>
11536
11568
  <xsl:variable name="style_prefix" select="normalize-space($style_prefix_)"/>
11537
11569
 
@@ -11557,13 +11589,15 @@
11557
11589
  <xsl:if test="$style_prefix != '' and not(starts-with(@label, $style_prefix))">
11558
11590
  <xsl:value-of select="$style_prefix"/>
11559
11591
  </xsl:if>
11592
+
11560
11593
  <xsl:value-of select="@label"/>
11594
+
11561
11595
  <xsl:if test="not(java:endsWith(java:java.lang.String.new(@label),$style_suffix))">
11562
11596
  <xsl:value-of select="$style_suffix"/>
11563
11597
  </xsl:if>
11564
11598
  </xsl:variable>
11565
11599
 
11566
- <xsl:value-of select="normalize-space($label)"/>
11600
+ <xsl:value-of select="normalize-space($label)"/>
11567
11601
 
11568
11602
  </xsl:when>
11569
11603
  <xsl:otherwise> <!-- for ordered lists 'ol' -->
@@ -13767,7 +13801,8 @@
13767
13801
  <xsl:variable name="description" select="normalize-space($bibitem_attachment/*[local-name() = 'formattedref'])"/>
13768
13802
  <xsl:variable name="filename" select="java:org.metanorma.fop.Util.getFilenameFromPath(@name)"/>
13769
13803
  <!-- Todo: need update -->
13770
- <xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
13804
+ <xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = 'classification'][@type = 'pdf-AFRelationship'])"/>
13805
+ <xsl:variable name="volatile" select="normalize-space($bibitem_attachment//*[local-name() = 'classification'][@type = 'pdf-volatile'])"/>
13771
13806
 
13772
13807
  <pdf:embedded-file filename="{$filename}" link-as-file-annotation="true">
13773
13808
  <xsl:attribute name="src">
@@ -13788,6 +13823,9 @@
13788
13823
  <xsl:if test="$afrelationship != ''">
13789
13824
  <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
13790
13825
  </xsl:if>
13826
+ <xsl:if test="$volatile != ''">
13827
+ <xsl:attribute name="volatile"><xsl:value-of select="$volatile"/></xsl:attribute>
13828
+ </xsl:if>
13791
13829
  </pdf:embedded-file>
13792
13830
  </xsl:for-each>
13793
13831
  <!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
@@ -13798,14 +13836,18 @@
13798
13836
  <xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
13799
13837
  <xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
13800
13838
  <!-- Todo: need update -->
13801
- <xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
13839
+ <xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'classification'][@type = 'pdf-AFRelationship'])"/>
13840
+ <xsl:variable name="volatile" select="normalize-space(.//*[local-name() = 'classification'][@type = 'pdf-volatile'])"/>
13802
13841
  <pdf:embedded-file src="{$url}" filename="{$attachment_name}" link-as-file-annotation="true">
13803
13842
  <xsl:if test="$description != ''">
13804
13843
  <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
13805
13844
  </xsl:if>
13806
13845
  <xsl:if test="$afrelationship != ''">
13807
- <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
13808
- </xsl:if>
13846
+ <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
13847
+ </xsl:if>
13848
+ <xsl:if test="$volatile != ''">
13849
+ <xsl:attribute name="volatile"><xsl:value-of select="$volatile"/></xsl:attribute>
13850
+ </xsl:if>
13809
13851
  </pdf:embedded-file>
13810
13852
  </xsl:for-each>
13811
13853
  </xsl:if>
@@ -13852,10 +13894,31 @@
13852
13894
  <xsl:value-of select="$level_total - 2"/>
13853
13895
  </xsl:when>
13854
13896
  <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)"/>
13897
+ <!-- determine 'depth' depends on upper clause with title/@depth -->
13898
+ <!-- <xsl:message>title=<xsl:value-of select="."/></xsl:message> -->
13899
+ <xsl:variable name="clause_with_depth_depth" select="ancestor::*[local-name() = 'clause'][*[local-name() = 'title']/@depth][1]/*[local-name() = 'title']/@depth"/>
13900
+ <!-- <xsl:message>clause_with_depth_depth=<xsl:value-of select="$clause_with_depth_depth"/></xsl:message> -->
13901
+ <xsl:variable name="clause_with_depth_level" select="count(ancestor::*[local-name() = 'clause'][*[local-name() = 'title']/@depth][1]/ancestor::*)"/>
13902
+ <!-- <xsl:message>clause_with_depth_level=<xsl:value-of select="$clause_with_depth_level"/></xsl:message> -->
13903
+ <xsl:variable name="curr_level" select="count(ancestor::*) - 1"/>
13904
+ <!-- <xsl:message>curr_level=<xsl:value-of select="$curr_level"/></xsl:message> -->
13905
+ <!-- <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/> -->
13906
+ <xsl:variable name="curr_clause_depth" select="number($clause_with_depth_depth) + (number($curr_level) - number($clause_with_depth_level)) "/>
13907
+ <!-- <xsl:message>curr_clause_depth=<xsl:value-of select="$curr_clause_depth"/></xsl:message> -->
13856
13908
  <xsl:choose>
13857
- <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
13858
- <xsl:value-of select="number($upper_clause_depth + 1)"/>
13909
+ <xsl:when test="string(number($curr_clause_depth)) != 'NaN'">
13910
+ <xsl:value-of select="number($curr_clause_depth)"/>
13911
+ </xsl:when>
13912
+ <xsl:otherwise>
13913
+ <xsl:value-of select="$level_total - 2"/>
13914
+ </xsl:otherwise>
13915
+ </xsl:choose>
13916
+ </xsl:when>
13917
+ <xsl:when test="ancestor::*[local-name() = 'sections'] and self::*[local-name() = 'name'] and parent::*[local-name() = 'term']">
13918
+ <xsl:variable name="upper_terms_depth" select="normalize-space(ancestor::*[local-name() = 'terms'][1]/*[local-name() = 'title']/@depth)"/>
13919
+ <xsl:choose>
13920
+ <xsl:when test="string(number($upper_terms_depth)) != 'NaN'">
13921
+ <xsl:value-of select="number($upper_terms_depth + 1)"/>
13859
13922
  </xsl:when>
13860
13923
  <xsl:otherwise>
13861
13924
  <xsl:value-of select="$level_total - 2"/>
@@ -13863,7 +13926,7 @@
13863
13926
  </xsl:choose>
13864
13927
  </xsl:when>
13865
13928
  <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)"/>
13929
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause' or local-name() = 'terms'][1]/*[local-name() = 'title']/@depth)"/>
13867
13930
  <xsl:choose>
13868
13931
  <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
13869
13932
  <xsl:value-of select="number($upper_clause_depth + 1)"/>
@@ -4184,7 +4184,8 @@
4184
4184
  </xsl:choose>
4185
4185
  </xsl:variable>
4186
4186
  <xsl:variable name="current_fn_number_text">
4187
- <xsl:value-of select="$current_fn_number"/>
4187
+
4188
+ <xsl:value-of select="$current_fn_number"/>
4188
4189
 
4189
4190
  </xsl:variable>
4190
4191
 
@@ -4220,8 +4221,10 @@
4220
4221
 
4221
4222
  <xsl:call-template name="insert_basic_link">
4222
4223
  <xsl:with-param name="element">
4223
- <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}" role="Lbl">
4224
- <xsl:copy-of select="$current_fn_number_text"/>
4224
+ <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 -->
4225
+ <fo:inline role="Lbl"> <!-- need for https://github.com/metanorma/metanorma-iso/issues/1003 -->
4226
+ <xsl:copy-of select="$current_fn_number_text"/>
4227
+ </fo:inline>
4225
4228
  </fo:basic-link>
4226
4229
  </xsl:with-param>
4227
4230
  </xsl:call-template>
@@ -4508,7 +4511,7 @@
4508
4511
 
4509
4512
  <xsl:call-template name="refine_fn-reference-style"/>
4510
4513
 
4511
- <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
4514
+ <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="footnote {@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
4512
4515
  <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> <!-- for footnotes in tables -->
4513
4516
  <xsl:attribute name="internal-destination">
4514
4517
  <xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
@@ -5516,9 +5519,19 @@
5516
5519
  </fo:inline>
5517
5520
  </xsl:template>
5518
5521
 
5519
- <xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
5522
+ <xsl:template match="text()[ancestor::*[local-name()='smallcap']]" name="smallcaps">
5523
+ <xsl:param name="txt"/>
5520
5524
  <!-- <xsl:variable name="text" select="normalize-space(.)"/> --> <!-- https://github.com/metanorma/metanorma-iso/issues/1115 -->
5521
- <xsl:variable name="text" select="."/>
5525
+ <xsl:variable name="text">
5526
+ <xsl:choose>
5527
+ <xsl:when test="$txt != ''">
5528
+ <xsl:value-of select="$txt"/>
5529
+ </xsl:when>
5530
+ <xsl:otherwise>
5531
+ <xsl:value-of select="."/>
5532
+ </xsl:otherwise>
5533
+ </xsl:choose>
5534
+ </xsl:variable>
5522
5535
  <xsl:variable name="ratio_">
5523
5536
  0.75
5524
5537
  </xsl:variable>
@@ -6964,9 +6977,12 @@
6964
6977
  <xsl:apply-templates/>
6965
6978
  </xsl:when>
6966
6979
  <xsl:otherwise>
6980
+ <xsl:variable name="alt_text">
6981
+ <xsl:call-template name="getAltText"/>
6982
+ </xsl:variable>
6967
6983
  <xsl:call-template name="insert_basic_link">
6968
6984
  <xsl:with-param name="element">
6969
- <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
6985
+ <fo:basic-link external-destination="{$target}" fox:alt-text="{$alt_text}">
6970
6986
  <xsl:if test="$isLinkToEmbeddedFile = 'true'">
6971
6987
  <xsl:attribute name="role">Annot</xsl:attribute>
6972
6988
  </xsl:if>
@@ -6993,6 +7009,14 @@
6993
7009
  </fo:inline>
6994
7010
  </xsl:template> <!-- link -->
6995
7011
 
7012
+ <xsl:template name="getAltText">
7013
+ <xsl:choose>
7014
+ <xsl:when test="normalize-space(.) = ''"><xsl:value-of select="@target"/></xsl:when>
7015
+ <xsl:otherwise><xsl:value-of select="normalize-space(translate(normalize-space(), ' —', ' -'))"/></xsl:otherwise>
7016
+ <!-- <xsl:otherwise><xsl:value-of select="@target"/></xsl:otherwise> -->
7017
+ </xsl:choose>
7018
+ </xsl:template>
7019
+
6996
7020
  <!-- ======================== -->
6997
7021
  <!-- Appendix processing -->
6998
7022
  <!-- ======================== -->
@@ -7023,7 +7047,7 @@
7023
7047
  <xsl:template match="*[local-name() = 'callout']">
7024
7048
  <xsl:choose>
7025
7049
  <xsl:when test="normalize-space(@target) = ''">&lt;<xsl:apply-templates/>&gt;</xsl:when>
7026
- <xsl:otherwise><fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link></xsl:otherwise>
7050
+ <xsl:otherwise><fo:basic-link internal-destination="{@target}" fox:alt-text="{normalize-space()}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link></xsl:otherwise>
7027
7051
  </xsl:choose>
7028
7052
  </xsl:template>
7029
7053
 
@@ -7052,7 +7076,10 @@
7052
7076
  <xsl:template match="*[local-name() = 'xref']">
7053
7077
  <xsl:call-template name="insert_basic_link">
7054
7078
  <xsl:with-param name="element">
7055
- <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
7079
+ <xsl:variable name="alt_text">
7080
+ <xsl:call-template name="getAltText"/>
7081
+ </xsl:variable>
7082
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="{$alt_text}" xsl:use-attribute-sets="xref-style">
7056
7083
  <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'])">
7057
7084
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
7058
7085
  </xsl:if>
@@ -9554,12 +9581,14 @@
9554
9581
 
9555
9582
  <xsl:when test="contains(normalize-space($fo_element), 'list')">
9556
9583
 
9557
- <xsl:variable name="provisional_distance_between_starts">
9584
+ <xsl:variable name="provisional_distance_between_starts_">
9558
9585
  7
9559
9586
  </xsl:variable>
9560
- <xsl:variable name="indent">
9587
+ <xsl:variable name="provisional_distance_between_starts" select="normalize-space($provisional_distance_between_starts_)"/>
9588
+ <xsl:variable name="indent_">
9561
9589
  0
9562
9590
  </xsl:variable>
9591
+ <xsl:variable name="indent" select="normalize-space($indent_)"/>
9563
9592
 
9564
9593
  <fo:list-block provisional-distance-between-starts="{$provisional_distance_between_starts}mm">
9565
9594
  <fo:list-item>
@@ -10293,14 +10322,17 @@
10293
10322
  </xsl:when>
10294
10323
  <xsl:when test="local-name(..) = 'ol' and @label"> <!-- for ordered lists 'ol', and if there is @label, for instance label="1.1.2" -->
10295
10324
 
10296
- <xsl:variable name="label">
10325
+ <xsl:variable name="type" select="../@type"/>
10297
10326
 
10298
- <xsl:variable name="type" select="../@type"/>
10327
+ <xsl:variable name="label">
10299
10328
 
10300
10329
  <xsl:variable name="style_prefix_">
10301
10330
  <xsl:if test="$type = 'roman'">
10302
10331
  <!-- Example: (i) -->
10303
10332
  </xsl:if>
10333
+ <xsl:if test="$type = 'alphabet'">
10334
+
10335
+ </xsl:if>
10304
10336
  </xsl:variable>
10305
10337
  <xsl:variable name="style_prefix" select="normalize-space($style_prefix_)"/>
10306
10338
 
@@ -10326,13 +10358,15 @@
10326
10358
  <xsl:if test="$style_prefix != '' and not(starts-with(@label, $style_prefix))">
10327
10359
  <xsl:value-of select="$style_prefix"/>
10328
10360
  </xsl:if>
10361
+
10329
10362
  <xsl:value-of select="@label"/>
10363
+
10330
10364
  <xsl:if test="not(java:endsWith(java:java.lang.String.new(@label),$style_suffix))">
10331
10365
  <xsl:value-of select="$style_suffix"/>
10332
10366
  </xsl:if>
10333
10367
  </xsl:variable>
10334
10368
 
10335
- <xsl:value-of select="normalize-space($label)"/>
10369
+ <xsl:value-of select="normalize-space($label)"/>
10336
10370
 
10337
10371
  </xsl:when>
10338
10372
  <xsl:otherwise> <!-- for ordered lists 'ol' -->
@@ -12536,7 +12570,8 @@
12536
12570
  <xsl:variable name="description" select="normalize-space($bibitem_attachment/*[local-name() = 'formattedref'])"/>
12537
12571
  <xsl:variable name="filename" select="java:org.metanorma.fop.Util.getFilenameFromPath(@name)"/>
12538
12572
  <!-- Todo: need update -->
12539
- <xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
12573
+ <xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = 'classification'][@type = 'pdf-AFRelationship'])"/>
12574
+ <xsl:variable name="volatile" select="normalize-space($bibitem_attachment//*[local-name() = 'classification'][@type = 'pdf-volatile'])"/>
12540
12575
 
12541
12576
  <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" filename="{$filename}" link-as-file-annotation="true">
12542
12577
  <xsl:attribute name="src">
@@ -12557,6 +12592,9 @@
12557
12592
  <xsl:if test="$afrelationship != ''">
12558
12593
  <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
12559
12594
  </xsl:if>
12595
+ <xsl:if test="$volatile != ''">
12596
+ <xsl:attribute name="volatile"><xsl:value-of select="$volatile"/></xsl:attribute>
12597
+ </xsl:if>
12560
12598
  </pdf:embedded-file>
12561
12599
  </xsl:for-each>
12562
12600
  <!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
@@ -12567,14 +12605,18 @@
12567
12605
  <xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
12568
12606
  <xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
12569
12607
  <!-- Todo: need update -->
12570
- <xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
12608
+ <xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'classification'][@type = 'pdf-AFRelationship'])"/>
12609
+ <xsl:variable name="volatile" select="normalize-space(.//*[local-name() = 'classification'][@type = 'pdf-volatile'])"/>
12571
12610
  <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{$attachment_name}" link-as-file-annotation="true">
12572
12611
  <xsl:if test="$description != ''">
12573
12612
  <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
12574
12613
  </xsl:if>
12575
12614
  <xsl:if test="$afrelationship != ''">
12576
- <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
12577
- </xsl:if>
12615
+ <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
12616
+ </xsl:if>
12617
+ <xsl:if test="$volatile != ''">
12618
+ <xsl:attribute name="volatile"><xsl:value-of select="$volatile"/></xsl:attribute>
12619
+ </xsl:if>
12578
12620
  </pdf:embedded-file>
12579
12621
  </xsl:for-each>
12580
12622
  </xsl:if>
@@ -12621,10 +12663,31 @@
12621
12663
  <xsl:value-of select="$level_total - 2"/>
12622
12664
  </xsl:when>
12623
12665
  <xsl:when test="ancestor::*[local-name() = 'sections'] and self::*[local-name() = 'title']">
12624
- <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/>
12666
+ <!-- determine 'depth' depends on upper clause with title/@depth -->
12667
+ <!-- <xsl:message>title=<xsl:value-of select="."/></xsl:message> -->
12668
+ <xsl:variable name="clause_with_depth_depth" select="ancestor::*[local-name() = 'clause'][*[local-name() = 'title']/@depth][1]/*[local-name() = 'title']/@depth"/>
12669
+ <!-- <xsl:message>clause_with_depth_depth=<xsl:value-of select="$clause_with_depth_depth"/></xsl:message> -->
12670
+ <xsl:variable name="clause_with_depth_level" select="count(ancestor::*[local-name() = 'clause'][*[local-name() = 'title']/@depth][1]/ancestor::*)"/>
12671
+ <!-- <xsl:message>clause_with_depth_level=<xsl:value-of select="$clause_with_depth_level"/></xsl:message> -->
12672
+ <xsl:variable name="curr_level" select="count(ancestor::*) - 1"/>
12673
+ <!-- <xsl:message>curr_level=<xsl:value-of select="$curr_level"/></xsl:message> -->
12674
+ <!-- <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/> -->
12675
+ <xsl:variable name="curr_clause_depth" select="number($clause_with_depth_depth) + (number($curr_level) - number($clause_with_depth_level)) "/>
12676
+ <!-- <xsl:message>curr_clause_depth=<xsl:value-of select="$curr_clause_depth"/></xsl:message> -->
12625
12677
  <xsl:choose>
12626
- <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
12627
- <xsl:value-of select="number($upper_clause_depth + 1)"/>
12678
+ <xsl:when test="string(number($curr_clause_depth)) != 'NaN'">
12679
+ <xsl:value-of select="number($curr_clause_depth)"/>
12680
+ </xsl:when>
12681
+ <xsl:otherwise>
12682
+ <xsl:value-of select="$level_total - 2"/>
12683
+ </xsl:otherwise>
12684
+ </xsl:choose>
12685
+ </xsl:when>
12686
+ <xsl:when test="ancestor::*[local-name() = 'sections'] and self::*[local-name() = 'name'] and parent::*[local-name() = 'term']">
12687
+ <xsl:variable name="upper_terms_depth" select="normalize-space(ancestor::*[local-name() = 'terms'][1]/*[local-name() = 'title']/@depth)"/>
12688
+ <xsl:choose>
12689
+ <xsl:when test="string(number($upper_terms_depth)) != 'NaN'">
12690
+ <xsl:value-of select="number($upper_terms_depth + 1)"/>
12628
12691
  </xsl:when>
12629
12692
  <xsl:otherwise>
12630
12693
  <xsl:value-of select="$level_total - 2"/>
@@ -12632,7 +12695,7 @@
12632
12695
  </xsl:choose>
12633
12696
  </xsl:when>
12634
12697
  <xsl:when test="ancestor::*[local-name() = 'sections']">
12635
- <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][1]/*[local-name() = 'title']/@depth)"/>
12698
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause' or local-name() = 'terms'][1]/*[local-name() = 'title']/@depth)"/>
12636
12699
  <xsl:choose>
12637
12700
  <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
12638
12701
  <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>
@@ -205,6 +205,7 @@ module Metanorma
205
205
  def metadata_ext(node, xml)
206
206
  metadata_doctype(node, xml)
207
207
  metadata_subdoctype(node, xml)
208
+ metadata_flavor(node, xml)
208
209
  metadata_committee(node, xml)
209
210
  end
210
211
  end
@@ -55,11 +55,17 @@
55
55
  <optional>
56
56
  <ref name="docsubtype"/>
57
57
  </optional>
58
+ <ref name="flavor"/>
58
59
  <ref name="editorialgroup"/>
59
60
  <zeroOrMore>
60
61
  <ref name="ics"/>
61
62
  </zeroOrMore>
62
63
  </define>
64
+ <define name="stage">
65
+ <element name="stage">
66
+ <ref name="StageType"/>
67
+ </element>
68
+ </define>
63
69
  </include>
64
70
  <define name="committee">
65
71
  <element name="committee">
@@ -80,4 +86,26 @@
80
86
  <ref name="IsoWorkgroup"/>
81
87
  </element>
82
88
  </define>
89
+ <define name="StageType">
90
+ <choice>
91
+ <value>rfc</value>
92
+ <value>candidate</value>
93
+ <value>published</value>
94
+ <value>deprecated</value>
95
+ <value>retired</value>
96
+ <value>legacy</value>
97
+ <value>rescinded</value>
98
+ <value>draft</value>
99
+ <value>work-item-draft</value>
100
+ <value>swg-draft</value>
101
+ <value>oab-review</value>
102
+ <value>public-ref</value>
103
+ <value>tc-vote</value>
104
+ <value>approved</value>
105
+ <value>deprecated</value>
106
+ <value>rescinded</value>
107
+ <value>retired</value>
108
+ <value>legacy</value>
109
+ </choice>
110
+ </define>
83
111
  </grammar>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ogc
3
- VERSION = "2.6.3".freeze
3
+ VERSION = "2.6.4".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-ogc
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.3
4
+ version: 2.6.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: iso-639