metanorma-ogc 2.6.2 → 2.6.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -5246,6 +5246,7 @@
5246
5246
 
5247
5247
  <fo:block role="SKIP">
5248
5248
  <xsl:apply-templates/>
5249
+ <xsl:if test="$isGenerateTableIF = 'false' and count(node()) = 0"> </xsl:if>
5249
5250
  </fo:block>
5250
5251
  </fo:table-cell>
5251
5252
  </xsl:template> <!-- cell in table header row - 'th' -->
@@ -5309,6 +5310,8 @@
5309
5310
 
5310
5311
  <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"/> -->
5311
5312
 
5313
+ <xsl:if test="$isGenerateTableIF = 'false' and count(node()) = 0"> </xsl:if>
5314
+
5312
5315
  </fo:block>
5313
5316
  </fo:table-cell>
5314
5317
  </xsl:template> <!-- td -->
@@ -8115,14 +8118,16 @@
8115
8118
  <xsl:template match="*[local-name()='link']" name="link">
8116
8119
  <xsl:variable name="target_normalized" select="translate(@target, '\', '/')"/>
8117
8120
  <xsl:variable name="target_attachment_name" select="substring-after($target_normalized, '_attachments/')"/>
8121
+ <xsl:variable name="isLinkToEmbeddedFile" select="normalize-space(@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target])"/>
8118
8122
  <xsl:variable name="target">
8119
8123
  <xsl:choose>
8120
8124
  <xsl:when test="@updatetype = 'true'">
8121
8125
  <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
8122
8126
  </xsl:when>
8123
8127
  <!-- link to the PDF attachment -->
8124
- <xsl:when test="@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target]">
8125
- <xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
8128
+ <xsl:when test="$isLinkToEmbeddedFile = 'true'">
8129
+ <xsl:variable name="target_file" select="java:org.metanorma.fop.Util.getFilenameFromPath(@target)"/>
8130
+ <xsl:value-of select="concat('url(embedded-file:', $target_file, ')')"/>
8126
8131
  </xsl:when>
8127
8132
  <!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
8128
8133
  <xsl:value-of select="concat('url(embedded-file:', $target_attachment_name, ')')"/>
@@ -8153,6 +8158,11 @@
8153
8158
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
8154
8159
  </xsl:if>
8155
8160
 
8161
+ <xsl:if test="$isLinkToEmbeddedFile = 'true'">
8162
+ <xsl:attribute name="color">inherit</xsl:attribute>
8163
+ <xsl:attribute name="text-decoration">none</xsl:attribute>
8164
+ </xsl:if>
8165
+
8156
8166
  <xsl:call-template name="refine_link-style"/>
8157
8167
 
8158
8168
  <xsl:choose>
@@ -8163,6 +8173,9 @@
8163
8173
  <xsl:call-template name="insert_basic_link">
8164
8174
  <xsl:with-param name="element">
8165
8175
  <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
8176
+ <xsl:if test="$isLinkToEmbeddedFile = 'true'">
8177
+ <xsl:attribute name="role">Annot</xsl:attribute>
8178
+ </xsl:if>
8166
8179
  <xsl:choose>
8167
8180
  <xsl:when test="normalize-space(.) = ''">
8168
8181
  <xsl:call-template name="add-zero-spaces-link-java">
@@ -8175,6 +8188,10 @@
8175
8188
  </xsl:otherwise>
8176
8189
  </xsl:choose>
8177
8190
  </fo:basic-link>
8191
+ <xsl:if test="$isLinkToEmbeddedFile = 'true'">
8192
+ <!-- reserve space at right for PaperClip icon -->
8193
+ <fo:inline keep-with-previous.within-line="always">        </fo:inline>
8194
+ </xsl:if>
8178
8195
  </xsl:with-param>
8179
8196
  </xsl:call-template>
8180
8197
  </xsl:otherwise>
@@ -13745,9 +13762,14 @@
13745
13762
  </x:xmpmeta>
13746
13763
  <!-- add attachments -->
13747
13764
  <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
13748
- <xsl:variable name="description" select="normalize-space(//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]/*[local-name() = 'formattedref'])"/>
13749
-
13750
- <pdf:embedded-file filename="{@name}">
13765
+ <xsl:variable name="bibitem_attachment_" select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]"/>
13766
+ <xsl:variable name="bibitem_attachment" select="xalan:nodeset($bibitem_attachment_)"/>
13767
+ <xsl:variable name="description" select="normalize-space($bibitem_attachment/*[local-name() = 'formattedref'])"/>
13768
+ <xsl:variable name="filename" select="java:org.metanorma.fop.Util.getFilenameFromPath(@name)"/>
13769
+ <!-- Todo: need update -->
13770
+ <xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
13771
+
13772
+ <pdf:embedded-file filename="{$filename}" link-as-file-annotation="true">
13751
13773
  <xsl:attribute name="src">
13752
13774
  <xsl:choose>
13753
13775
  <xsl:when test="normalize-space() != ''">
@@ -13763,18 +13785,27 @@
13763
13785
  <xsl:if test="$description != ''">
13764
13786
  <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
13765
13787
  </xsl:if>
13788
+ <xsl:if test="$afrelationship != ''">
13789
+ <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
13790
+ </xsl:if>
13766
13791
  </pdf:embedded-file>
13767
13792
  </xsl:for-each>
13768
13793
  <!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
13769
13794
  <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
13770
13795
  <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
13771
13796
  <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
13797
+ <xsl:variable name="attachment_name" select="java:org.metanorma.fop.Util.getFilenameFromPath($attachment_path)"/>
13772
13798
  <xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
13773
13799
  <xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
13774
- <pdf:embedded-file src="{$url}" filename="{$attachment_path}">
13800
+ <!-- Todo: need update -->
13801
+ <xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
13802
+ <pdf:embedded-file src="{$url}" filename="{$attachment_name}" link-as-file-annotation="true">
13775
13803
  <xsl:if test="$description != ''">
13776
13804
  <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
13777
13805
  </xsl:if>
13806
+ <xsl:if test="$afrelationship != ''">
13807
+ <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
13808
+ </xsl:if>
13778
13809
  </pdf:embedded-file>
13779
13810
  </xsl:for-each>
13780
13811
  </xsl:if>
@@ -13794,6 +13825,12 @@
13794
13825
  <!-- Get or calculate depth of the element -->
13795
13826
  <xsl:template name="getLevel">
13796
13827
  <xsl:param name="depth"/>
13828
+ <!-- <xsl:message>
13829
+ <xsl:choose>
13830
+ <xsl:when test="local-name() = 'title'">title=<xsl:value-of select="."/></xsl:when>
13831
+ <xsl:when test="local-name() = 'clause'">clause/title=<xsl:value-of select="*[local-name() = 'title']"/></xsl:when>
13832
+ </xsl:choose>
13833
+ </xsl:message> -->
13797
13834
  <xsl:choose>
13798
13835
  <xsl:when test="normalize-space(@depth) != ''">
13799
13836
  <xsl:value-of select="@depth"/>
@@ -13814,8 +13851,27 @@
13814
13851
  <xsl:when test="ancestor::*[local-name() = 'preface']">
13815
13852
  <xsl:value-of select="$level_total - 2"/>
13816
13853
  </xsl:when>
13854
+ <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)"/>
13856
+ <xsl:choose>
13857
+ <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
13858
+ <xsl:value-of select="number($upper_clause_depth + 1)"/>
13859
+ </xsl:when>
13860
+ <xsl:otherwise>
13861
+ <xsl:value-of select="$level_total - 2"/>
13862
+ </xsl:otherwise>
13863
+ </xsl:choose>
13864
+ </xsl:when>
13817
13865
  <xsl:when test="ancestor::*[local-name() = 'sections']">
13818
- <xsl:value-of select="$level_total - 1"/>
13866
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][1]/*[local-name() = 'title']/@depth)"/>
13867
+ <xsl:choose>
13868
+ <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
13869
+ <xsl:value-of select="number($upper_clause_depth + 1)"/>
13870
+ </xsl:when>
13871
+ <xsl:otherwise>
13872
+ <xsl:value-of select="$level_total - 1"/>
13873
+ </xsl:otherwise>
13874
+ </xsl:choose>
13819
13875
  </xsl:when>
13820
13876
  <xsl:when test="ancestor::*[local-name() = 'bibliography']">
13821
13877
  <xsl:value-of select="$level_total - 1"/>
@@ -13823,6 +13879,17 @@
13823
13879
  <xsl:when test="parent::*[local-name() = 'annex']">
13824
13880
  <xsl:value-of select="$level_total - 1"/>
13825
13881
  </xsl:when>
13882
+ <xsl:when test="ancestor::*[local-name() = 'annex'] and self::*[local-name() = 'title']">
13883
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/>
13884
+ <xsl:choose>
13885
+ <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
13886
+ <xsl:value-of select="number($upper_clause_depth + 1)"/>
13887
+ </xsl:when>
13888
+ <xsl:otherwise>
13889
+ <xsl:value-of select="$level_total - 1"/>
13890
+ </xsl:otherwise>
13891
+ </xsl:choose>
13892
+ </xsl:when>
13826
13893
  <xsl:when test="ancestor::*[local-name() = 'annex']">
13827
13894
  <xsl:value-of select="$level_total"/>
13828
13895
  </xsl:when>
@@ -14181,6 +14248,20 @@
14181
14248
 
14182
14249
  <!-- END: insert cover page image -->
14183
14250
 
14251
+ <xsl:template name="insertVerticalChar">
14252
+ <xsl:param name="str"/>
14253
+ <xsl:if test="string-length($str) &gt; 0">
14254
+ <fo:inline-container writing-mode="lr-tb" text-align="center" alignment-baseline="central" reference-orientation="90" width="1em" margin="0" padding="0" text-indent="0mm" last-line-end-indent="0mm" start-indent="0mm" end-indent="0mm">
14255
+ <fo:block-container width="1em">
14256
+ <fo:block line-height="1em"><xsl:value-of select="substring($str,1,1)"/></fo:block>
14257
+ </fo:block-container>
14258
+ </fo:inline-container>
14259
+ <xsl:call-template name="insertVerticalChar">
14260
+ <xsl:with-param name="str" select="substring($str, 2)"/>
14261
+ </xsl:call-template>
14262
+ </xsl:if>
14263
+ </xsl:template>
14264
+
14184
14265
  <xsl:template name="number-to-words">
14185
14266
  <xsl:param name="number"/>
14186
14267
  <xsl:param name="first"/>
@@ -14468,4 +14549,18 @@
14468
14549
  </xsl:if>
14469
14550
  </xsl:template>
14470
14551
 
14552
+ <xsl:template match="@*|node()" mode="set_table_role_skip">
14553
+ <xsl:copy>
14554
+ <xsl:apply-templates select="@*|node()" mode="set_table_role_skip"/>
14555
+ </xsl:copy>
14556
+ </xsl:template>
14557
+
14558
+ <xsl:template match="*[starts-with(local-name(), 'table')]" mode="set_table_role_skip">
14559
+ <xsl:copy>
14560
+ <xsl:apply-templates select="@*" mode="set_table_role_skip"/>
14561
+ <xsl:attribute name="role">SKIP</xsl:attribute>
14562
+ <xsl:apply-templates select="node()" mode="set_table_role_skip"/>
14563
+ </xsl:copy>
14564
+ </xsl:template>
14565
+
14471
14566
  </xsl:stylesheet>
@@ -4047,6 +4047,7 @@
4047
4047
 
4048
4048
  <fo:block role="SKIP">
4049
4049
  <xsl:apply-templates/>
4050
+ <xsl:if test="$isGenerateTableIF = 'false' and count(node()) = 0"> </xsl:if>
4050
4051
  </fo:block>
4051
4052
  </fo:table-cell>
4052
4053
  </xsl:template> <!-- cell in table header row - 'th' -->
@@ -4110,6 +4111,8 @@
4110
4111
 
4111
4112
  <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"/> -->
4112
4113
 
4114
+ <xsl:if test="$isGenerateTableIF = 'false' and count(node()) = 0"> </xsl:if>
4115
+
4113
4116
  </fo:block>
4114
4117
  </fo:table-cell>
4115
4118
  </xsl:template> <!-- td -->
@@ -6909,14 +6912,16 @@
6909
6912
  <xsl:template match="*[local-name()='link']" name="link">
6910
6913
  <xsl:variable name="target_normalized" select="translate(@target, '\', '/')"/>
6911
6914
  <xsl:variable name="target_attachment_name" select="substring-after($target_normalized, '_attachments/')"/>
6915
+ <xsl:variable name="isLinkToEmbeddedFile" select="normalize-space(@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target])"/>
6912
6916
  <xsl:variable name="target">
6913
6917
  <xsl:choose>
6914
6918
  <xsl:when test="@updatetype = 'true'">
6915
6919
  <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
6916
6920
  </xsl:when>
6917
6921
  <!-- link to the PDF attachment -->
6918
- <xsl:when test="@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target]">
6919
- <xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
6922
+ <xsl:when test="$isLinkToEmbeddedFile = 'true'">
6923
+ <xsl:variable name="target_file" select="java:org.metanorma.fop.Util.getFilenameFromPath(@target)"/>
6924
+ <xsl:value-of select="concat('url(embedded-file:', $target_file, ')')"/>
6920
6925
  </xsl:when>
6921
6926
  <!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
6922
6927
  <xsl:value-of select="concat('url(embedded-file:', $target_attachment_name, ')')"/>
@@ -6947,6 +6952,11 @@
6947
6952
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
6948
6953
  </xsl:if>
6949
6954
 
6955
+ <xsl:if test="$isLinkToEmbeddedFile = 'true'">
6956
+ <xsl:attribute name="color">inherit</xsl:attribute>
6957
+ <xsl:attribute name="text-decoration">none</xsl:attribute>
6958
+ </xsl:if>
6959
+
6950
6960
  <xsl:call-template name="refine_link-style"/>
6951
6961
 
6952
6962
  <xsl:choose>
@@ -6957,6 +6967,9 @@
6957
6967
  <xsl:call-template name="insert_basic_link">
6958
6968
  <xsl:with-param name="element">
6959
6969
  <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
6970
+ <xsl:if test="$isLinkToEmbeddedFile = 'true'">
6971
+ <xsl:attribute name="role">Annot</xsl:attribute>
6972
+ </xsl:if>
6960
6973
  <xsl:choose>
6961
6974
  <xsl:when test="normalize-space(.) = ''">
6962
6975
  <xsl:call-template name="add-zero-spaces-link-java">
@@ -6969,6 +6982,10 @@
6969
6982
  </xsl:otherwise>
6970
6983
  </xsl:choose>
6971
6984
  </fo:basic-link>
6985
+ <xsl:if test="$isLinkToEmbeddedFile = 'true'">
6986
+ <!-- reserve space at right for PaperClip icon -->
6987
+ <fo:inline keep-with-previous.within-line="always">        </fo:inline>
6988
+ </xsl:if>
6972
6989
  </xsl:with-param>
6973
6990
  </xsl:call-template>
6974
6991
  </xsl:otherwise>
@@ -12514,9 +12531,14 @@
12514
12531
  </x:xmpmeta>
12515
12532
  <!-- add attachments -->
12516
12533
  <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
12517
- <xsl:variable name="description" select="normalize-space(//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]/*[local-name() = 'formattedref'])"/>
12518
-
12519
- <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" filename="{@name}">
12534
+ <xsl:variable name="bibitem_attachment_" select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]"/>
12535
+ <xsl:variable name="bibitem_attachment" select="xalan:nodeset($bibitem_attachment_)"/>
12536
+ <xsl:variable name="description" select="normalize-space($bibitem_attachment/*[local-name() = 'formattedref'])"/>
12537
+ <xsl:variable name="filename" select="java:org.metanorma.fop.Util.getFilenameFromPath(@name)"/>
12538
+ <!-- Todo: need update -->
12539
+ <xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
12540
+
12541
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" filename="{$filename}" link-as-file-annotation="true">
12520
12542
  <xsl:attribute name="src">
12521
12543
  <xsl:choose>
12522
12544
  <xsl:when test="normalize-space() != ''">
@@ -12532,18 +12554,27 @@
12532
12554
  <xsl:if test="$description != ''">
12533
12555
  <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
12534
12556
  </xsl:if>
12557
+ <xsl:if test="$afrelationship != ''">
12558
+ <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
12559
+ </xsl:if>
12535
12560
  </pdf:embedded-file>
12536
12561
  </xsl:for-each>
12537
12562
  <!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
12538
12563
  <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
12539
12564
  <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
12540
12565
  <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
12566
+ <xsl:variable name="attachment_name" select="java:org.metanorma.fop.Util.getFilenameFromPath($attachment_path)"/>
12541
12567
  <xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
12542
12568
  <xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
12543
- <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{$attachment_path}">
12569
+ <!-- Todo: need update -->
12570
+ <xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
12571
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{$attachment_name}" link-as-file-annotation="true">
12544
12572
  <xsl:if test="$description != ''">
12545
12573
  <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
12546
12574
  </xsl:if>
12575
+ <xsl:if test="$afrelationship != ''">
12576
+ <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
12577
+ </xsl:if>
12547
12578
  </pdf:embedded-file>
12548
12579
  </xsl:for-each>
12549
12580
  </xsl:if>
@@ -12563,6 +12594,12 @@
12563
12594
  <!-- Get or calculate depth of the element -->
12564
12595
  <xsl:template name="getLevel">
12565
12596
  <xsl:param name="depth"/>
12597
+ <!-- <xsl:message>
12598
+ <xsl:choose>
12599
+ <xsl:when test="local-name() = 'title'">title=<xsl:value-of select="."/></xsl:when>
12600
+ <xsl:when test="local-name() = 'clause'">clause/title=<xsl:value-of select="*[local-name() = 'title']"/></xsl:when>
12601
+ </xsl:choose>
12602
+ </xsl:message> -->
12566
12603
  <xsl:choose>
12567
12604
  <xsl:when test="normalize-space(@depth) != ''">
12568
12605
  <xsl:value-of select="@depth"/>
@@ -12583,8 +12620,27 @@
12583
12620
  <xsl:when test="ancestor::*[local-name() = 'preface']">
12584
12621
  <xsl:value-of select="$level_total - 2"/>
12585
12622
  </xsl:when>
12623
+ <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)"/>
12625
+ <xsl:choose>
12626
+ <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
12627
+ <xsl:value-of select="number($upper_clause_depth + 1)"/>
12628
+ </xsl:when>
12629
+ <xsl:otherwise>
12630
+ <xsl:value-of select="$level_total - 2"/>
12631
+ </xsl:otherwise>
12632
+ </xsl:choose>
12633
+ </xsl:when>
12586
12634
  <xsl:when test="ancestor::*[local-name() = 'sections']">
12587
- <xsl:value-of select="$level_total - 1"/>
12635
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][1]/*[local-name() = 'title']/@depth)"/>
12636
+ <xsl:choose>
12637
+ <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
12638
+ <xsl:value-of select="number($upper_clause_depth + 1)"/>
12639
+ </xsl:when>
12640
+ <xsl:otherwise>
12641
+ <xsl:value-of select="$level_total - 1"/>
12642
+ </xsl:otherwise>
12643
+ </xsl:choose>
12588
12644
  </xsl:when>
12589
12645
  <xsl:when test="ancestor::*[local-name() = 'bibliography']">
12590
12646
  <xsl:value-of select="$level_total - 1"/>
@@ -12592,6 +12648,17 @@
12592
12648
  <xsl:when test="parent::*[local-name() = 'annex']">
12593
12649
  <xsl:value-of select="$level_total - 1"/>
12594
12650
  </xsl:when>
12651
+ <xsl:when test="ancestor::*[local-name() = 'annex'] and self::*[local-name() = 'title']">
12652
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/>
12653
+ <xsl:choose>
12654
+ <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
12655
+ <xsl:value-of select="number($upper_clause_depth + 1)"/>
12656
+ </xsl:when>
12657
+ <xsl:otherwise>
12658
+ <xsl:value-of select="$level_total - 1"/>
12659
+ </xsl:otherwise>
12660
+ </xsl:choose>
12661
+ </xsl:when>
12595
12662
  <xsl:when test="ancestor::*[local-name() = 'annex']">
12596
12663
  <xsl:value-of select="$level_total"/>
12597
12664
  </xsl:when>
@@ -12950,6 +13017,20 @@
12950
13017
 
12951
13018
  <!-- END: insert cover page image -->
12952
13019
 
13020
+ <xsl:template name="insertVerticalChar">
13021
+ <xsl:param name="str"/>
13022
+ <xsl:if test="string-length($str) &gt; 0">
13023
+ <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">
13024
+ <fo:block-container width="1em">
13025
+ <fo:block line-height="1em"><xsl:value-of select="substring($str,1,1)"/></fo:block>
13026
+ </fo:block-container>
13027
+ </fo:inline-container>
13028
+ <xsl:call-template name="insertVerticalChar">
13029
+ <xsl:with-param name="str" select="substring($str, 2)"/>
13030
+ </xsl:call-template>
13031
+ </xsl:if>
13032
+ </xsl:template>
13033
+
12953
13034
  <xsl:template name="number-to-words">
12954
13035
  <xsl:param name="number"/>
12955
13036
  <xsl:param name="first"/>
@@ -13237,4 +13318,18 @@
13237
13318
  </xsl:if>
13238
13319
  </xsl:template>
13239
13320
 
13321
+ <xsl:template match="@*|node()" mode="set_table_role_skip">
13322
+ <xsl:copy>
13323
+ <xsl:apply-templates select="@*|node()" mode="set_table_role_skip"/>
13324
+ </xsl:copy>
13325
+ </xsl:template>
13326
+
13327
+ <xsl:template match="*[starts-with(local-name(), 'table')]" mode="set_table_role_skip">
13328
+ <xsl:copy>
13329
+ <xsl:apply-templates select="@*" mode="set_table_role_skip"/>
13330
+ <xsl:attribute name="role">SKIP</xsl:attribute>
13331
+ <xsl:apply-templates select="node()" mode="set_table_role_skip"/>
13332
+ </xsl:copy>
13333
+ </xsl:template>
13334
+
13240
13335
  </xsl:stylesheet>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ogc
3
- VERSION = "2.6.2".freeze
3
+ VERSION = "2.6.3".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.2
4
+ version: 2.6.3
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-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: iso-639