metanorma-bipm 2.5.2 → 2.5.3

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: 383bf45f87ea65566e738977584c76a596ce22c419a58aa571f4bffab61c06ae
4
- data.tar.gz: dcf5f78ced811ad1bf65ac8fd41c6c35bfe71310baa1d922ed587694d29ddaa7
3
+ metadata.gz: 2c52281fc98b996d70d44bd915b20da1df312c9419cd33817b39a912cd0aa0ca
4
+ data.tar.gz: ca09e324aeaf02933d6c3a8643943798a7197330ff2e63ab6ef3c8ddd45c24d1
5
5
  SHA512:
6
- metadata.gz: b74015cf3c36fbba63afb772b18898cdb5f6c44176f8ceaba504f8966e3be23d58c5a68e5fe048dcad41773d38bb605f74dd676c70a99ac8c3a016b9635c67f3
7
- data.tar.gz: 3b11a266828af1d89b41cd261f4c1270430067b4b62f700ac952598900c4610646251c3586c98371cd2f6f37cc8d5334829413168483c4498724e291f6fd3a40
6
+ metadata.gz: 94d9053fb4294784ccb083df5d4c29af549d95deed8dfddcb718477c029d2ca0b6ff51dff984d9e95527c1acdde85ddca108f451fdf1ebc619433ab571b5fed3
7
+ data.tar.gz: d77102ed026ef15fca586f611571f3d7deb75c77004823ff2a78d62d2f326f0a26b9dc8316f43ceca5dfd20ab7df69b07a7e2dfe967168e509a0772129295bc4
@@ -7137,6 +7137,7 @@
7137
7137
 
7138
7138
  <fo:block role="SKIP">
7139
7139
  <xsl:apply-templates/>
7140
+ <xsl:if test="$isGenerateTableIF = 'false' and count(node()) = 0"> </xsl:if>
7140
7141
  </fo:block>
7141
7142
  </fo:table-cell>
7142
7143
  </xsl:template> <!-- cell in table header row - 'th' -->
@@ -7209,6 +7210,8 @@
7209
7210
 
7210
7211
  <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"/> -->
7211
7212
 
7213
+ <xsl:if test="$isGenerateTableIF = 'false' and count(node()) = 0"> </xsl:if>
7214
+
7212
7215
  </fo:block>
7213
7216
  </fo:table-cell>
7214
7217
  </xsl:template> <!-- td -->
@@ -10037,14 +10040,16 @@
10037
10040
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name()='link']" name="link">
10038
10041
  <xsl:variable name="target_normalized" select="translate(@target, '\', '/')"/>
10039
10042
  <xsl:variable name="target_attachment_name" select="substring-after($target_normalized, '_attachments/')"/>
10043
+ <xsl:variable name="isLinkToEmbeddedFile" select="normalize-space(@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target])"/>
10040
10044
  <xsl:variable name="target">
10041
10045
  <xsl:choose>
10042
10046
  <xsl:when test="@updatetype = 'true'">
10043
10047
  <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
10044
10048
  </xsl:when>
10045
10049
  <!-- link to the PDF attachment -->
10046
- <xsl:when test="@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target]">
10047
- <xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
10050
+ <xsl:when test="$isLinkToEmbeddedFile = 'true'">
10051
+ <xsl:variable name="target_file" select="java:org.metanorma.fop.Util.getFilenameFromPath(@target)"/>
10052
+ <xsl:value-of select="concat('url(embedded-file:', $target_file, ')')"/>
10048
10053
  </xsl:when>
10049
10054
  <!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
10050
10055
  <xsl:value-of select="concat('url(embedded-file:', $target_attachment_name, ')')"/>
@@ -10075,6 +10080,11 @@
10075
10080
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
10076
10081
  </xsl:if>
10077
10082
 
10083
+ <xsl:if test="$isLinkToEmbeddedFile = 'true'">
10084
+ <xsl:attribute name="color">inherit</xsl:attribute>
10085
+ <xsl:attribute name="text-decoration">none</xsl:attribute>
10086
+ </xsl:if>
10087
+
10078
10088
  <xsl:call-template name="refine_link-style"/>
10079
10089
 
10080
10090
  <xsl:choose>
@@ -10085,6 +10095,9 @@
10085
10095
  <xsl:call-template name="insert_basic_link">
10086
10096
  <xsl:with-param name="element">
10087
10097
  <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
10098
+ <xsl:if test="$isLinkToEmbeddedFile = 'true'">
10099
+ <xsl:attribute name="role">Annot</xsl:attribute>
10100
+ </xsl:if>
10088
10101
  <xsl:choose>
10089
10102
  <xsl:when test="normalize-space(.) = ''">
10090
10103
  <xsl:call-template name="add-zero-spaces-link-java">
@@ -10097,6 +10110,10 @@
10097
10110
  </xsl:otherwise>
10098
10111
  </xsl:choose>
10099
10112
  </fo:basic-link>
10113
+ <xsl:if test="$isLinkToEmbeddedFile = 'true'">
10114
+ <!-- reserve space at right for PaperClip icon -->
10115
+ <fo:inline keep-with-previous.within-line="always">        </fo:inline>
10116
+ </xsl:if>
10100
10117
  </xsl:with-param>
10101
10118
  </xsl:call-template>
10102
10119
  </xsl:otherwise>
@@ -15642,9 +15659,14 @@
15642
15659
  </x:xmpmeta>
15643
15660
  <!-- add attachments -->
15644
15661
  <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
15645
- <xsl:variable name="description" select="normalize-space(//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]/*[local-name() = 'formattedref'])"/>
15646
-
15647
- <pdf:embedded-file filename="{@name}">
15662
+ <xsl:variable name="bibitem_attachment_" select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]"/>
15663
+ <xsl:variable name="bibitem_attachment" select="xalan:nodeset($bibitem_attachment_)"/>
15664
+ <xsl:variable name="description" select="normalize-space($bibitem_attachment/*[local-name() = 'formattedref'])"/>
15665
+ <xsl:variable name="filename" select="java:org.metanorma.fop.Util.getFilenameFromPath(@name)"/>
15666
+ <!-- Todo: need update -->
15667
+ <xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
15668
+
15669
+ <pdf:embedded-file filename="{$filename}" link-as-file-annotation="true">
15648
15670
  <xsl:attribute name="src">
15649
15671
  <xsl:choose>
15650
15672
  <xsl:when test="normalize-space() != ''">
@@ -15660,18 +15682,27 @@
15660
15682
  <xsl:if test="$description != ''">
15661
15683
  <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
15662
15684
  </xsl:if>
15685
+ <xsl:if test="$afrelationship != ''">
15686
+ <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
15687
+ </xsl:if>
15663
15688
  </pdf:embedded-file>
15664
15689
  </xsl:for-each>
15665
15690
  <!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
15666
15691
  <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
15667
15692
  <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
15668
15693
  <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
15694
+ <xsl:variable name="attachment_name" select="java:org.metanorma.fop.Util.getFilenameFromPath($attachment_path)"/>
15669
15695
  <xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
15670
15696
  <xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
15671
- <pdf:embedded-file src="{$url}" filename="{$attachment_path}">
15697
+ <!-- Todo: need update -->
15698
+ <xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
15699
+ <pdf:embedded-file src="{$url}" filename="{$attachment_name}" link-as-file-annotation="true">
15672
15700
  <xsl:if test="$description != ''">
15673
15701
  <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
15674
15702
  </xsl:if>
15703
+ <xsl:if test="$afrelationship != ''">
15704
+ <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
15705
+ </xsl:if>
15675
15706
  </pdf:embedded-file>
15676
15707
  </xsl:for-each>
15677
15708
  </xsl:if>
@@ -15691,6 +15722,12 @@
15691
15722
  <!-- Get or calculate depth of the element -->
15692
15723
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="getLevel">
15693
15724
  <xsl:param name="depth"/>
15725
+ <!-- <xsl:message>
15726
+ <xsl:choose>
15727
+ <xsl:when test="local-name() = 'title'">title=<xsl:value-of select="."/></xsl:when>
15728
+ <xsl:when test="local-name() = 'clause'">clause/title=<xsl:value-of select="*[local-name() = 'title']"/></xsl:when>
15729
+ </xsl:choose>
15730
+ </xsl:message> -->
15694
15731
  <xsl:choose>
15695
15732
  <xsl:when test="normalize-space(@depth) != ''">
15696
15733
  <xsl:value-of select="@depth"/>
@@ -15711,8 +15748,27 @@
15711
15748
  <xsl:when test="ancestor::*[local-name() = 'preface']">
15712
15749
  <xsl:value-of select="$level_total - 2"/>
15713
15750
  </xsl:when>
15751
+ <xsl:when test="ancestor::*[local-name() = 'sections'] and self::*[local-name() = 'title']">
15752
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/>
15753
+ <xsl:choose>
15754
+ <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
15755
+ <xsl:value-of select="number($upper_clause_depth + 1)"/>
15756
+ </xsl:when>
15757
+ <xsl:otherwise>
15758
+ <xsl:value-of select="$level_total - 2"/>
15759
+ </xsl:otherwise>
15760
+ </xsl:choose>
15761
+ </xsl:when>
15714
15762
  <xsl:when test="ancestor::*[local-name() = 'sections']">
15715
- <xsl:value-of select="$level_total - 1"/>
15763
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][1]/*[local-name() = 'title']/@depth)"/>
15764
+ <xsl:choose>
15765
+ <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
15766
+ <xsl:value-of select="number($upper_clause_depth + 1)"/>
15767
+ </xsl:when>
15768
+ <xsl:otherwise>
15769
+ <xsl:value-of select="$level_total - 1"/>
15770
+ </xsl:otherwise>
15771
+ </xsl:choose>
15716
15772
  </xsl:when>
15717
15773
  <xsl:when test="ancestor::*[local-name() = 'bibliography']">
15718
15774
  <xsl:value-of select="$level_total - 1"/>
@@ -15720,6 +15776,17 @@
15720
15776
  <xsl:when test="parent::*[local-name() = 'annex']">
15721
15777
  <xsl:value-of select="$level_total - 1"/>
15722
15778
  </xsl:when>
15779
+ <xsl:when test="ancestor::*[local-name() = 'annex'] and self::*[local-name() = 'title']">
15780
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/>
15781
+ <xsl:choose>
15782
+ <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
15783
+ <xsl:value-of select="number($upper_clause_depth + 1)"/>
15784
+ </xsl:when>
15785
+ <xsl:otherwise>
15786
+ <xsl:value-of select="$level_total - 1"/>
15787
+ </xsl:otherwise>
15788
+ </xsl:choose>
15789
+ </xsl:when>
15723
15790
  <xsl:when test="ancestor::*[local-name() = 'annex']">
15724
15791
  <xsl:value-of select="$level_total"/>
15725
15792
  </xsl:when>
@@ -16078,6 +16145,20 @@
16078
16145
 
16079
16146
  <!-- END: insert cover page image -->
16080
16147
 
16148
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="insertVerticalChar">
16149
+ <xsl:param name="str"/>
16150
+ <xsl:if test="string-length($str) &gt; 0">
16151
+ <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">
16152
+ <fo:block-container width="1em">
16153
+ <fo:block line-height="1em"><xsl:value-of select="substring($str,1,1)"/></fo:block>
16154
+ </fo:block-container>
16155
+ </fo:inline-container>
16156
+ <xsl:call-template name="insertVerticalChar">
16157
+ <xsl:with-param name="str" select="substring($str, 2)"/>
16158
+ </xsl:call-template>
16159
+ </xsl:if>
16160
+ </xsl:template>
16161
+
16081
16162
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="number-to-words">
16082
16163
  <xsl:param name="number"/>
16083
16164
  <xsl:param name="first"/>
@@ -16365,4 +16446,18 @@
16365
16446
  </xsl:if>
16366
16447
  </xsl:template>
16367
16448
 
16449
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="@*|node()" mode="set_table_role_skip">
16450
+ <xsl:copy>
16451
+ <xsl:apply-templates select="@*|node()" mode="set_table_role_skip"/>
16452
+ </xsl:copy>
16453
+ </xsl:template>
16454
+
16455
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[starts-with(local-name(), 'table')]" mode="set_table_role_skip">
16456
+ <xsl:copy>
16457
+ <xsl:apply-templates select="@*" mode="set_table_role_skip"/>
16458
+ <xsl:attribute name="role">SKIP</xsl:attribute>
16459
+ <xsl:apply-templates select="node()" mode="set_table_role_skip"/>
16460
+ </xsl:copy>
16461
+ </xsl:template>
16462
+
16368
16463
  </xsl:stylesheet>
@@ -7137,6 +7137,7 @@
7137
7137
 
7138
7138
  <fo:block role="SKIP">
7139
7139
  <xsl:apply-templates/>
7140
+ <xsl:if test="$isGenerateTableIF = 'false' and count(node()) = 0"> </xsl:if>
7140
7141
  </fo:block>
7141
7142
  </fo:table-cell>
7142
7143
  </xsl:template> <!-- cell in table header row - 'th' -->
@@ -7209,6 +7210,8 @@
7209
7210
 
7210
7211
  <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"/> -->
7211
7212
 
7213
+ <xsl:if test="$isGenerateTableIF = 'false' and count(node()) = 0"> </xsl:if>
7214
+
7212
7215
  </fo:block>
7213
7216
  </fo:table-cell>
7214
7217
  </xsl:template> <!-- td -->
@@ -10037,14 +10040,16 @@
10037
10040
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name()='link']" name="link">
10038
10041
  <xsl:variable name="target_normalized" select="translate(@target, '\', '/')"/>
10039
10042
  <xsl:variable name="target_attachment_name" select="substring-after($target_normalized, '_attachments/')"/>
10043
+ <xsl:variable name="isLinkToEmbeddedFile" select="normalize-space(@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target])"/>
10040
10044
  <xsl:variable name="target">
10041
10045
  <xsl:choose>
10042
10046
  <xsl:when test="@updatetype = 'true'">
10043
10047
  <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
10044
10048
  </xsl:when>
10045
10049
  <!-- link to the PDF attachment -->
10046
- <xsl:when test="@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target]">
10047
- <xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
10050
+ <xsl:when test="$isLinkToEmbeddedFile = 'true'">
10051
+ <xsl:variable name="target_file" select="java:org.metanorma.fop.Util.getFilenameFromPath(@target)"/>
10052
+ <xsl:value-of select="concat('url(embedded-file:', $target_file, ')')"/>
10048
10053
  </xsl:when>
10049
10054
  <!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
10050
10055
  <xsl:value-of select="concat('url(embedded-file:', $target_attachment_name, ')')"/>
@@ -10075,6 +10080,11 @@
10075
10080
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
10076
10081
  </xsl:if>
10077
10082
 
10083
+ <xsl:if test="$isLinkToEmbeddedFile = 'true'">
10084
+ <xsl:attribute name="color">inherit</xsl:attribute>
10085
+ <xsl:attribute name="text-decoration">none</xsl:attribute>
10086
+ </xsl:if>
10087
+
10078
10088
  <xsl:call-template name="refine_link-style"/>
10079
10089
 
10080
10090
  <xsl:choose>
@@ -10085,6 +10095,9 @@
10085
10095
  <xsl:call-template name="insert_basic_link">
10086
10096
  <xsl:with-param name="element">
10087
10097
  <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
10098
+ <xsl:if test="$isLinkToEmbeddedFile = 'true'">
10099
+ <xsl:attribute name="role">Annot</xsl:attribute>
10100
+ </xsl:if>
10088
10101
  <xsl:choose>
10089
10102
  <xsl:when test="normalize-space(.) = ''">
10090
10103
  <xsl:call-template name="add-zero-spaces-link-java">
@@ -10097,6 +10110,10 @@
10097
10110
  </xsl:otherwise>
10098
10111
  </xsl:choose>
10099
10112
  </fo:basic-link>
10113
+ <xsl:if test="$isLinkToEmbeddedFile = 'true'">
10114
+ <!-- reserve space at right for PaperClip icon -->
10115
+ <fo:inline keep-with-previous.within-line="always">        </fo:inline>
10116
+ </xsl:if>
10100
10117
  </xsl:with-param>
10101
10118
  </xsl:call-template>
10102
10119
  </xsl:otherwise>
@@ -15642,9 +15659,14 @@
15642
15659
  </x:xmpmeta>
15643
15660
  <!-- add attachments -->
15644
15661
  <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
15645
- <xsl:variable name="description" select="normalize-space(//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]/*[local-name() = 'formattedref'])"/>
15646
-
15647
- <pdf:embedded-file filename="{@name}">
15662
+ <xsl:variable name="bibitem_attachment_" select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]"/>
15663
+ <xsl:variable name="bibitem_attachment" select="xalan:nodeset($bibitem_attachment_)"/>
15664
+ <xsl:variable name="description" select="normalize-space($bibitem_attachment/*[local-name() = 'formattedref'])"/>
15665
+ <xsl:variable name="filename" select="java:org.metanorma.fop.Util.getFilenameFromPath(@name)"/>
15666
+ <!-- Todo: need update -->
15667
+ <xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
15668
+
15669
+ <pdf:embedded-file filename="{$filename}" link-as-file-annotation="true">
15648
15670
  <xsl:attribute name="src">
15649
15671
  <xsl:choose>
15650
15672
  <xsl:when test="normalize-space() != ''">
@@ -15660,18 +15682,27 @@
15660
15682
  <xsl:if test="$description != ''">
15661
15683
  <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
15662
15684
  </xsl:if>
15685
+ <xsl:if test="$afrelationship != ''">
15686
+ <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
15687
+ </xsl:if>
15663
15688
  </pdf:embedded-file>
15664
15689
  </xsl:for-each>
15665
15690
  <!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
15666
15691
  <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
15667
15692
  <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
15668
15693
  <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
15694
+ <xsl:variable name="attachment_name" select="java:org.metanorma.fop.Util.getFilenameFromPath($attachment_path)"/>
15669
15695
  <xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
15670
15696
  <xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
15671
- <pdf:embedded-file src="{$url}" filename="{$attachment_path}">
15697
+ <!-- Todo: need update -->
15698
+ <xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
15699
+ <pdf:embedded-file src="{$url}" filename="{$attachment_name}" link-as-file-annotation="true">
15672
15700
  <xsl:if test="$description != ''">
15673
15701
  <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
15674
15702
  </xsl:if>
15703
+ <xsl:if test="$afrelationship != ''">
15704
+ <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
15705
+ </xsl:if>
15675
15706
  </pdf:embedded-file>
15676
15707
  </xsl:for-each>
15677
15708
  </xsl:if>
@@ -15691,6 +15722,12 @@
15691
15722
  <!-- Get or calculate depth of the element -->
15692
15723
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="getLevel">
15693
15724
  <xsl:param name="depth"/>
15725
+ <!-- <xsl:message>
15726
+ <xsl:choose>
15727
+ <xsl:when test="local-name() = 'title'">title=<xsl:value-of select="."/></xsl:when>
15728
+ <xsl:when test="local-name() = 'clause'">clause/title=<xsl:value-of select="*[local-name() = 'title']"/></xsl:when>
15729
+ </xsl:choose>
15730
+ </xsl:message> -->
15694
15731
  <xsl:choose>
15695
15732
  <xsl:when test="normalize-space(@depth) != ''">
15696
15733
  <xsl:value-of select="@depth"/>
@@ -15711,8 +15748,27 @@
15711
15748
  <xsl:when test="ancestor::*[local-name() = 'preface']">
15712
15749
  <xsl:value-of select="$level_total - 2"/>
15713
15750
  </xsl:when>
15751
+ <xsl:when test="ancestor::*[local-name() = 'sections'] and self::*[local-name() = 'title']">
15752
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/>
15753
+ <xsl:choose>
15754
+ <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
15755
+ <xsl:value-of select="number($upper_clause_depth + 1)"/>
15756
+ </xsl:when>
15757
+ <xsl:otherwise>
15758
+ <xsl:value-of select="$level_total - 2"/>
15759
+ </xsl:otherwise>
15760
+ </xsl:choose>
15761
+ </xsl:when>
15714
15762
  <xsl:when test="ancestor::*[local-name() = 'sections']">
15715
- <xsl:value-of select="$level_total - 1"/>
15763
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][1]/*[local-name() = 'title']/@depth)"/>
15764
+ <xsl:choose>
15765
+ <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
15766
+ <xsl:value-of select="number($upper_clause_depth + 1)"/>
15767
+ </xsl:when>
15768
+ <xsl:otherwise>
15769
+ <xsl:value-of select="$level_total - 1"/>
15770
+ </xsl:otherwise>
15771
+ </xsl:choose>
15716
15772
  </xsl:when>
15717
15773
  <xsl:when test="ancestor::*[local-name() = 'bibliography']">
15718
15774
  <xsl:value-of select="$level_total - 1"/>
@@ -15720,6 +15776,17 @@
15720
15776
  <xsl:when test="parent::*[local-name() = 'annex']">
15721
15777
  <xsl:value-of select="$level_total - 1"/>
15722
15778
  </xsl:when>
15779
+ <xsl:when test="ancestor::*[local-name() = 'annex'] and self::*[local-name() = 'title']">
15780
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/>
15781
+ <xsl:choose>
15782
+ <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
15783
+ <xsl:value-of select="number($upper_clause_depth + 1)"/>
15784
+ </xsl:when>
15785
+ <xsl:otherwise>
15786
+ <xsl:value-of select="$level_total - 1"/>
15787
+ </xsl:otherwise>
15788
+ </xsl:choose>
15789
+ </xsl:when>
15723
15790
  <xsl:when test="ancestor::*[local-name() = 'annex']">
15724
15791
  <xsl:value-of select="$level_total"/>
15725
15792
  </xsl:when>
@@ -16078,6 +16145,20 @@
16078
16145
 
16079
16146
  <!-- END: insert cover page image -->
16080
16147
 
16148
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="insertVerticalChar">
16149
+ <xsl:param name="str"/>
16150
+ <xsl:if test="string-length($str) &gt; 0">
16151
+ <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">
16152
+ <fo:block-container width="1em">
16153
+ <fo:block line-height="1em"><xsl:value-of select="substring($str,1,1)"/></fo:block>
16154
+ </fo:block-container>
16155
+ </fo:inline-container>
16156
+ <xsl:call-template name="insertVerticalChar">
16157
+ <xsl:with-param name="str" select="substring($str, 2)"/>
16158
+ </xsl:call-template>
16159
+ </xsl:if>
16160
+ </xsl:template>
16161
+
16081
16162
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="number-to-words">
16082
16163
  <xsl:param name="number"/>
16083
16164
  <xsl:param name="first"/>
@@ -16365,4 +16446,18 @@
16365
16446
  </xsl:if>
16366
16447
  </xsl:template>
16367
16448
 
16449
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="@*|node()" mode="set_table_role_skip">
16450
+ <xsl:copy>
16451
+ <xsl:apply-templates select="@*|node()" mode="set_table_role_skip"/>
16452
+ </xsl:copy>
16453
+ </xsl:template>
16454
+
16455
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[starts-with(local-name(), 'table')]" mode="set_table_role_skip">
16456
+ <xsl:copy>
16457
+ <xsl:apply-templates select="@*" mode="set_table_role_skip"/>
16458
+ <xsl:attribute name="role">SKIP</xsl:attribute>
16459
+ <xsl:apply-templates select="node()" mode="set_table_role_skip"/>
16460
+ </xsl:copy>
16461
+ </xsl:template>
16462
+
16368
16463
  </xsl:stylesheet>
@@ -7137,6 +7137,7 @@
7137
7137
 
7138
7138
  <fo:block role="SKIP">
7139
7139
  <xsl:apply-templates/>
7140
+ <xsl:if test="$isGenerateTableIF = 'false' and count(node()) = 0"> </xsl:if>
7140
7141
  </fo:block>
7141
7142
  </fo:table-cell>
7142
7143
  </xsl:template> <!-- cell in table header row - 'th' -->
@@ -7209,6 +7210,8 @@
7209
7210
 
7210
7211
  <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"/> -->
7211
7212
 
7213
+ <xsl:if test="$isGenerateTableIF = 'false' and count(node()) = 0"> </xsl:if>
7214
+
7212
7215
  </fo:block>
7213
7216
  </fo:table-cell>
7214
7217
  </xsl:template> <!-- td -->
@@ -10037,14 +10040,16 @@
10037
10040
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name()='link']" name="link">
10038
10041
  <xsl:variable name="target_normalized" select="translate(@target, '\', '/')"/>
10039
10042
  <xsl:variable name="target_attachment_name" select="substring-after($target_normalized, '_attachments/')"/>
10043
+ <xsl:variable name="isLinkToEmbeddedFile" select="normalize-space(@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target])"/>
10040
10044
  <xsl:variable name="target">
10041
10045
  <xsl:choose>
10042
10046
  <xsl:when test="@updatetype = 'true'">
10043
10047
  <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
10044
10048
  </xsl:when>
10045
10049
  <!-- link to the PDF attachment -->
10046
- <xsl:when test="@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target]">
10047
- <xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
10050
+ <xsl:when test="$isLinkToEmbeddedFile = 'true'">
10051
+ <xsl:variable name="target_file" select="java:org.metanorma.fop.Util.getFilenameFromPath(@target)"/>
10052
+ <xsl:value-of select="concat('url(embedded-file:', $target_file, ')')"/>
10048
10053
  </xsl:when>
10049
10054
  <!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
10050
10055
  <xsl:value-of select="concat('url(embedded-file:', $target_attachment_name, ')')"/>
@@ -10075,6 +10080,11 @@
10075
10080
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
10076
10081
  </xsl:if>
10077
10082
 
10083
+ <xsl:if test="$isLinkToEmbeddedFile = 'true'">
10084
+ <xsl:attribute name="color">inherit</xsl:attribute>
10085
+ <xsl:attribute name="text-decoration">none</xsl:attribute>
10086
+ </xsl:if>
10087
+
10078
10088
  <xsl:call-template name="refine_link-style"/>
10079
10089
 
10080
10090
  <xsl:choose>
@@ -10085,6 +10095,9 @@
10085
10095
  <xsl:call-template name="insert_basic_link">
10086
10096
  <xsl:with-param name="element">
10087
10097
  <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
10098
+ <xsl:if test="$isLinkToEmbeddedFile = 'true'">
10099
+ <xsl:attribute name="role">Annot</xsl:attribute>
10100
+ </xsl:if>
10088
10101
  <xsl:choose>
10089
10102
  <xsl:when test="normalize-space(.) = ''">
10090
10103
  <xsl:call-template name="add-zero-spaces-link-java">
@@ -10097,6 +10110,10 @@
10097
10110
  </xsl:otherwise>
10098
10111
  </xsl:choose>
10099
10112
  </fo:basic-link>
10113
+ <xsl:if test="$isLinkToEmbeddedFile = 'true'">
10114
+ <!-- reserve space at right for PaperClip icon -->
10115
+ <fo:inline keep-with-previous.within-line="always">        </fo:inline>
10116
+ </xsl:if>
10100
10117
  </xsl:with-param>
10101
10118
  </xsl:call-template>
10102
10119
  </xsl:otherwise>
@@ -15642,9 +15659,14 @@
15642
15659
  </x:xmpmeta>
15643
15660
  <!-- add attachments -->
15644
15661
  <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
15645
- <xsl:variable name="description" select="normalize-space(//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]/*[local-name() = 'formattedref'])"/>
15646
-
15647
- <pdf:embedded-file filename="{@name}">
15662
+ <xsl:variable name="bibitem_attachment_" select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]"/>
15663
+ <xsl:variable name="bibitem_attachment" select="xalan:nodeset($bibitem_attachment_)"/>
15664
+ <xsl:variable name="description" select="normalize-space($bibitem_attachment/*[local-name() = 'formattedref'])"/>
15665
+ <xsl:variable name="filename" select="java:org.metanorma.fop.Util.getFilenameFromPath(@name)"/>
15666
+ <!-- Todo: need update -->
15667
+ <xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
15668
+
15669
+ <pdf:embedded-file filename="{$filename}" link-as-file-annotation="true">
15648
15670
  <xsl:attribute name="src">
15649
15671
  <xsl:choose>
15650
15672
  <xsl:when test="normalize-space() != ''">
@@ -15660,18 +15682,27 @@
15660
15682
  <xsl:if test="$description != ''">
15661
15683
  <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
15662
15684
  </xsl:if>
15685
+ <xsl:if test="$afrelationship != ''">
15686
+ <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
15687
+ </xsl:if>
15663
15688
  </pdf:embedded-file>
15664
15689
  </xsl:for-each>
15665
15690
  <!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
15666
15691
  <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
15667
15692
  <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
15668
15693
  <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
15694
+ <xsl:variable name="attachment_name" select="java:org.metanorma.fop.Util.getFilenameFromPath($attachment_path)"/>
15669
15695
  <xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
15670
15696
  <xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
15671
- <pdf:embedded-file src="{$url}" filename="{$attachment_path}">
15697
+ <!-- Todo: need update -->
15698
+ <xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
15699
+ <pdf:embedded-file src="{$url}" filename="{$attachment_name}" link-as-file-annotation="true">
15672
15700
  <xsl:if test="$description != ''">
15673
15701
  <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
15674
15702
  </xsl:if>
15703
+ <xsl:if test="$afrelationship != ''">
15704
+ <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
15705
+ </xsl:if>
15675
15706
  </pdf:embedded-file>
15676
15707
  </xsl:for-each>
15677
15708
  </xsl:if>
@@ -15691,6 +15722,12 @@
15691
15722
  <!-- Get or calculate depth of the element -->
15692
15723
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="getLevel">
15693
15724
  <xsl:param name="depth"/>
15725
+ <!-- <xsl:message>
15726
+ <xsl:choose>
15727
+ <xsl:when test="local-name() = 'title'">title=<xsl:value-of select="."/></xsl:when>
15728
+ <xsl:when test="local-name() = 'clause'">clause/title=<xsl:value-of select="*[local-name() = 'title']"/></xsl:when>
15729
+ </xsl:choose>
15730
+ </xsl:message> -->
15694
15731
  <xsl:choose>
15695
15732
  <xsl:when test="normalize-space(@depth) != ''">
15696
15733
  <xsl:value-of select="@depth"/>
@@ -15711,8 +15748,27 @@
15711
15748
  <xsl:when test="ancestor::*[local-name() = 'preface']">
15712
15749
  <xsl:value-of select="$level_total - 2"/>
15713
15750
  </xsl:when>
15751
+ <xsl:when test="ancestor::*[local-name() = 'sections'] and self::*[local-name() = 'title']">
15752
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/>
15753
+ <xsl:choose>
15754
+ <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
15755
+ <xsl:value-of select="number($upper_clause_depth + 1)"/>
15756
+ </xsl:when>
15757
+ <xsl:otherwise>
15758
+ <xsl:value-of select="$level_total - 2"/>
15759
+ </xsl:otherwise>
15760
+ </xsl:choose>
15761
+ </xsl:when>
15714
15762
  <xsl:when test="ancestor::*[local-name() = 'sections']">
15715
- <xsl:value-of select="$level_total - 1"/>
15763
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][1]/*[local-name() = 'title']/@depth)"/>
15764
+ <xsl:choose>
15765
+ <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
15766
+ <xsl:value-of select="number($upper_clause_depth + 1)"/>
15767
+ </xsl:when>
15768
+ <xsl:otherwise>
15769
+ <xsl:value-of select="$level_total - 1"/>
15770
+ </xsl:otherwise>
15771
+ </xsl:choose>
15716
15772
  </xsl:when>
15717
15773
  <xsl:when test="ancestor::*[local-name() = 'bibliography']">
15718
15774
  <xsl:value-of select="$level_total - 1"/>
@@ -15720,6 +15776,17 @@
15720
15776
  <xsl:when test="parent::*[local-name() = 'annex']">
15721
15777
  <xsl:value-of select="$level_total - 1"/>
15722
15778
  </xsl:when>
15779
+ <xsl:when test="ancestor::*[local-name() = 'annex'] and self::*[local-name() = 'title']">
15780
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/>
15781
+ <xsl:choose>
15782
+ <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
15783
+ <xsl:value-of select="number($upper_clause_depth + 1)"/>
15784
+ </xsl:when>
15785
+ <xsl:otherwise>
15786
+ <xsl:value-of select="$level_total - 1"/>
15787
+ </xsl:otherwise>
15788
+ </xsl:choose>
15789
+ </xsl:when>
15723
15790
  <xsl:when test="ancestor::*[local-name() = 'annex']">
15724
15791
  <xsl:value-of select="$level_total"/>
15725
15792
  </xsl:when>
@@ -16078,6 +16145,20 @@
16078
16145
 
16079
16146
  <!-- END: insert cover page image -->
16080
16147
 
16148
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="insertVerticalChar">
16149
+ <xsl:param name="str"/>
16150
+ <xsl:if test="string-length($str) &gt; 0">
16151
+ <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">
16152
+ <fo:block-container width="1em">
16153
+ <fo:block line-height="1em"><xsl:value-of select="substring($str,1,1)"/></fo:block>
16154
+ </fo:block-container>
16155
+ </fo:inline-container>
16156
+ <xsl:call-template name="insertVerticalChar">
16157
+ <xsl:with-param name="str" select="substring($str, 2)"/>
16158
+ </xsl:call-template>
16159
+ </xsl:if>
16160
+ </xsl:template>
16161
+
16081
16162
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="number-to-words">
16082
16163
  <xsl:param name="number"/>
16083
16164
  <xsl:param name="first"/>
@@ -16365,4 +16446,18 @@
16365
16446
  </xsl:if>
16366
16447
  </xsl:template>
16367
16448
 
16449
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="@*|node()" mode="set_table_role_skip">
16450
+ <xsl:copy>
16451
+ <xsl:apply-templates select="@*|node()" mode="set_table_role_skip"/>
16452
+ </xsl:copy>
16453
+ </xsl:template>
16454
+
16455
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[starts-with(local-name(), 'table')]" mode="set_table_role_skip">
16456
+ <xsl:copy>
16457
+ <xsl:apply-templates select="@*" mode="set_table_role_skip"/>
16458
+ <xsl:attribute name="role">SKIP</xsl:attribute>
16459
+ <xsl:apply-templates select="node()" mode="set_table_role_skip"/>
16460
+ </xsl:copy>
16461
+ </xsl:template>
16462
+
16368
16463
  </xsl:stylesheet>
@@ -7137,6 +7137,7 @@
7137
7137
 
7138
7138
  <fo:block role="SKIP">
7139
7139
  <xsl:apply-templates/>
7140
+ <xsl:if test="$isGenerateTableIF = 'false' and count(node()) = 0"> </xsl:if>
7140
7141
  </fo:block>
7141
7142
  </fo:table-cell>
7142
7143
  </xsl:template> <!-- cell in table header row - 'th' -->
@@ -7209,6 +7210,8 @@
7209
7210
 
7210
7211
  <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"/> -->
7211
7212
 
7213
+ <xsl:if test="$isGenerateTableIF = 'false' and count(node()) = 0"> </xsl:if>
7214
+
7212
7215
  </fo:block>
7213
7216
  </fo:table-cell>
7214
7217
  </xsl:template> <!-- td -->
@@ -10037,14 +10040,16 @@
10037
10040
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name()='link']" name="link">
10038
10041
  <xsl:variable name="target_normalized" select="translate(@target, '\', '/')"/>
10039
10042
  <xsl:variable name="target_attachment_name" select="substring-after($target_normalized, '_attachments/')"/>
10043
+ <xsl:variable name="isLinkToEmbeddedFile" select="normalize-space(@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target])"/>
10040
10044
  <xsl:variable name="target">
10041
10045
  <xsl:choose>
10042
10046
  <xsl:when test="@updatetype = 'true'">
10043
10047
  <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
10044
10048
  </xsl:when>
10045
10049
  <!-- link to the PDF attachment -->
10046
- <xsl:when test="@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target]">
10047
- <xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
10050
+ <xsl:when test="$isLinkToEmbeddedFile = 'true'">
10051
+ <xsl:variable name="target_file" select="java:org.metanorma.fop.Util.getFilenameFromPath(@target)"/>
10052
+ <xsl:value-of select="concat('url(embedded-file:', $target_file, ')')"/>
10048
10053
  </xsl:when>
10049
10054
  <!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
10050
10055
  <xsl:value-of select="concat('url(embedded-file:', $target_attachment_name, ')')"/>
@@ -10075,6 +10080,11 @@
10075
10080
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
10076
10081
  </xsl:if>
10077
10082
 
10083
+ <xsl:if test="$isLinkToEmbeddedFile = 'true'">
10084
+ <xsl:attribute name="color">inherit</xsl:attribute>
10085
+ <xsl:attribute name="text-decoration">none</xsl:attribute>
10086
+ </xsl:if>
10087
+
10078
10088
  <xsl:call-template name="refine_link-style"/>
10079
10089
 
10080
10090
  <xsl:choose>
@@ -10085,6 +10095,9 @@
10085
10095
  <xsl:call-template name="insert_basic_link">
10086
10096
  <xsl:with-param name="element">
10087
10097
  <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
10098
+ <xsl:if test="$isLinkToEmbeddedFile = 'true'">
10099
+ <xsl:attribute name="role">Annot</xsl:attribute>
10100
+ </xsl:if>
10088
10101
  <xsl:choose>
10089
10102
  <xsl:when test="normalize-space(.) = ''">
10090
10103
  <xsl:call-template name="add-zero-spaces-link-java">
@@ -10097,6 +10110,10 @@
10097
10110
  </xsl:otherwise>
10098
10111
  </xsl:choose>
10099
10112
  </fo:basic-link>
10113
+ <xsl:if test="$isLinkToEmbeddedFile = 'true'">
10114
+ <!-- reserve space at right for PaperClip icon -->
10115
+ <fo:inline keep-with-previous.within-line="always">        </fo:inline>
10116
+ </xsl:if>
10100
10117
  </xsl:with-param>
10101
10118
  </xsl:call-template>
10102
10119
  </xsl:otherwise>
@@ -15642,9 +15659,14 @@
15642
15659
  </x:xmpmeta>
15643
15660
  <!-- add attachments -->
15644
15661
  <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
15645
- <xsl:variable name="description" select="normalize-space(//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]/*[local-name() = 'formattedref'])"/>
15646
-
15647
- <pdf:embedded-file filename="{@name}">
15662
+ <xsl:variable name="bibitem_attachment_" select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]"/>
15663
+ <xsl:variable name="bibitem_attachment" select="xalan:nodeset($bibitem_attachment_)"/>
15664
+ <xsl:variable name="description" select="normalize-space($bibitem_attachment/*[local-name() = 'formattedref'])"/>
15665
+ <xsl:variable name="filename" select="java:org.metanorma.fop.Util.getFilenameFromPath(@name)"/>
15666
+ <!-- Todo: need update -->
15667
+ <xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
15668
+
15669
+ <pdf:embedded-file filename="{$filename}" link-as-file-annotation="true">
15648
15670
  <xsl:attribute name="src">
15649
15671
  <xsl:choose>
15650
15672
  <xsl:when test="normalize-space() != ''">
@@ -15660,18 +15682,27 @@
15660
15682
  <xsl:if test="$description != ''">
15661
15683
  <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
15662
15684
  </xsl:if>
15685
+ <xsl:if test="$afrelationship != ''">
15686
+ <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
15687
+ </xsl:if>
15663
15688
  </pdf:embedded-file>
15664
15689
  </xsl:for-each>
15665
15690
  <!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
15666
15691
  <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
15667
15692
  <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
15668
15693
  <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
15694
+ <xsl:variable name="attachment_name" select="java:org.metanorma.fop.Util.getFilenameFromPath($attachment_path)"/>
15669
15695
  <xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
15670
15696
  <xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
15671
- <pdf:embedded-file src="{$url}" filename="{$attachment_path}">
15697
+ <!-- Todo: need update -->
15698
+ <xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
15699
+ <pdf:embedded-file src="{$url}" filename="{$attachment_name}" link-as-file-annotation="true">
15672
15700
  <xsl:if test="$description != ''">
15673
15701
  <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
15674
15702
  </xsl:if>
15703
+ <xsl:if test="$afrelationship != ''">
15704
+ <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
15705
+ </xsl:if>
15675
15706
  </pdf:embedded-file>
15676
15707
  </xsl:for-each>
15677
15708
  </xsl:if>
@@ -15691,6 +15722,12 @@
15691
15722
  <!-- Get or calculate depth of the element -->
15692
15723
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="getLevel">
15693
15724
  <xsl:param name="depth"/>
15725
+ <!-- <xsl:message>
15726
+ <xsl:choose>
15727
+ <xsl:when test="local-name() = 'title'">title=<xsl:value-of select="."/></xsl:when>
15728
+ <xsl:when test="local-name() = 'clause'">clause/title=<xsl:value-of select="*[local-name() = 'title']"/></xsl:when>
15729
+ </xsl:choose>
15730
+ </xsl:message> -->
15694
15731
  <xsl:choose>
15695
15732
  <xsl:when test="normalize-space(@depth) != ''">
15696
15733
  <xsl:value-of select="@depth"/>
@@ -15711,8 +15748,27 @@
15711
15748
  <xsl:when test="ancestor::*[local-name() = 'preface']">
15712
15749
  <xsl:value-of select="$level_total - 2"/>
15713
15750
  </xsl:when>
15751
+ <xsl:when test="ancestor::*[local-name() = 'sections'] and self::*[local-name() = 'title']">
15752
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/>
15753
+ <xsl:choose>
15754
+ <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
15755
+ <xsl:value-of select="number($upper_clause_depth + 1)"/>
15756
+ </xsl:when>
15757
+ <xsl:otherwise>
15758
+ <xsl:value-of select="$level_total - 2"/>
15759
+ </xsl:otherwise>
15760
+ </xsl:choose>
15761
+ </xsl:when>
15714
15762
  <xsl:when test="ancestor::*[local-name() = 'sections']">
15715
- <xsl:value-of select="$level_total - 1"/>
15763
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][1]/*[local-name() = 'title']/@depth)"/>
15764
+ <xsl:choose>
15765
+ <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
15766
+ <xsl:value-of select="number($upper_clause_depth + 1)"/>
15767
+ </xsl:when>
15768
+ <xsl:otherwise>
15769
+ <xsl:value-of select="$level_total - 1"/>
15770
+ </xsl:otherwise>
15771
+ </xsl:choose>
15716
15772
  </xsl:when>
15717
15773
  <xsl:when test="ancestor::*[local-name() = 'bibliography']">
15718
15774
  <xsl:value-of select="$level_total - 1"/>
@@ -15720,6 +15776,17 @@
15720
15776
  <xsl:when test="parent::*[local-name() = 'annex']">
15721
15777
  <xsl:value-of select="$level_total - 1"/>
15722
15778
  </xsl:when>
15779
+ <xsl:when test="ancestor::*[local-name() = 'annex'] and self::*[local-name() = 'title']">
15780
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/>
15781
+ <xsl:choose>
15782
+ <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
15783
+ <xsl:value-of select="number($upper_clause_depth + 1)"/>
15784
+ </xsl:when>
15785
+ <xsl:otherwise>
15786
+ <xsl:value-of select="$level_total - 1"/>
15787
+ </xsl:otherwise>
15788
+ </xsl:choose>
15789
+ </xsl:when>
15723
15790
  <xsl:when test="ancestor::*[local-name() = 'annex']">
15724
15791
  <xsl:value-of select="$level_total"/>
15725
15792
  </xsl:when>
@@ -16078,6 +16145,20 @@
16078
16145
 
16079
16146
  <!-- END: insert cover page image -->
16080
16147
 
16148
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="insertVerticalChar">
16149
+ <xsl:param name="str"/>
16150
+ <xsl:if test="string-length($str) &gt; 0">
16151
+ <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">
16152
+ <fo:block-container width="1em">
16153
+ <fo:block line-height="1em"><xsl:value-of select="substring($str,1,1)"/></fo:block>
16154
+ </fo:block-container>
16155
+ </fo:inline-container>
16156
+ <xsl:call-template name="insertVerticalChar">
16157
+ <xsl:with-param name="str" select="substring($str, 2)"/>
16158
+ </xsl:call-template>
16159
+ </xsl:if>
16160
+ </xsl:template>
16161
+
16081
16162
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="number-to-words">
16082
16163
  <xsl:param name="number"/>
16083
16164
  <xsl:param name="first"/>
@@ -16365,4 +16446,18 @@
16365
16446
  </xsl:if>
16366
16447
  </xsl:template>
16367
16448
 
16449
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="@*|node()" mode="set_table_role_skip">
16450
+ <xsl:copy>
16451
+ <xsl:apply-templates select="@*|node()" mode="set_table_role_skip"/>
16452
+ </xsl:copy>
16453
+ </xsl:template>
16454
+
16455
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[starts-with(local-name(), 'table')]" mode="set_table_role_skip">
16456
+ <xsl:copy>
16457
+ <xsl:apply-templates select="@*" mode="set_table_role_skip"/>
16458
+ <xsl:attribute name="role">SKIP</xsl:attribute>
16459
+ <xsl:apply-templates select="node()" mode="set_table_role_skip"/>
16460
+ </xsl:copy>
16461
+ </xsl:template>
16462
+
16368
16463
  </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; }
@@ -5076,6 +5076,7 @@
5076
5076
 
5077
5077
  <fo:block role="SKIP">
5078
5078
  <xsl:apply-templates/>
5079
+ <xsl:if test="$isGenerateTableIF = 'false' and count(node()) = 0"> </xsl:if>
5079
5080
  </fo:block>
5080
5081
  </fo:table-cell>
5081
5082
  </xsl:template> <!-- cell in table header row - 'th' -->
@@ -5139,6 +5140,8 @@
5139
5140
 
5140
5141
  <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"/> -->
5141
5142
 
5143
+ <xsl:if test="$isGenerateTableIF = 'false' and count(node()) = 0"> </xsl:if>
5144
+
5142
5145
  </fo:block>
5143
5146
  </fo:table-cell>
5144
5147
  </xsl:template> <!-- td -->
@@ -7946,14 +7949,16 @@
7946
7949
  <xsl:template match="*[local-name()='link']" name="link">
7947
7950
  <xsl:variable name="target_normalized" select="translate(@target, '\', '/')"/>
7948
7951
  <xsl:variable name="target_attachment_name" select="substring-after($target_normalized, '_attachments/')"/>
7952
+ <xsl:variable name="isLinkToEmbeddedFile" select="normalize-space(@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target])"/>
7949
7953
  <xsl:variable name="target">
7950
7954
  <xsl:choose>
7951
7955
  <xsl:when test="@updatetype = 'true'">
7952
7956
  <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
7953
7957
  </xsl:when>
7954
7958
  <!-- link to the PDF attachment -->
7955
- <xsl:when test="@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target]">
7956
- <xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
7959
+ <xsl:when test="$isLinkToEmbeddedFile = 'true'">
7960
+ <xsl:variable name="target_file" select="java:org.metanorma.fop.Util.getFilenameFromPath(@target)"/>
7961
+ <xsl:value-of select="concat('url(embedded-file:', $target_file, ')')"/>
7957
7962
  </xsl:when>
7958
7963
  <!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
7959
7964
  <xsl:value-of select="concat('url(embedded-file:', $target_attachment_name, ')')"/>
@@ -7984,6 +7989,11 @@
7984
7989
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
7985
7990
  </xsl:if>
7986
7991
 
7992
+ <xsl:if test="$isLinkToEmbeddedFile = 'true'">
7993
+ <xsl:attribute name="color">inherit</xsl:attribute>
7994
+ <xsl:attribute name="text-decoration">none</xsl:attribute>
7995
+ </xsl:if>
7996
+
7987
7997
  <xsl:call-template name="refine_link-style"/>
7988
7998
 
7989
7999
  <xsl:choose>
@@ -7994,6 +8004,9 @@
7994
8004
  <xsl:call-template name="insert_basic_link">
7995
8005
  <xsl:with-param name="element">
7996
8006
  <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
8007
+ <xsl:if test="$isLinkToEmbeddedFile = 'true'">
8008
+ <xsl:attribute name="role">Annot</xsl:attribute>
8009
+ </xsl:if>
7997
8010
  <xsl:choose>
7998
8011
  <xsl:when test="normalize-space(.) = ''">
7999
8012
  <xsl:call-template name="add-zero-spaces-link-java">
@@ -8006,6 +8019,10 @@
8006
8019
  </xsl:otherwise>
8007
8020
  </xsl:choose>
8008
8021
  </fo:basic-link>
8022
+ <xsl:if test="$isLinkToEmbeddedFile = 'true'">
8023
+ <!-- reserve space at right for PaperClip icon -->
8024
+ <fo:inline keep-with-previous.within-line="always">        </fo:inline>
8025
+ </xsl:if>
8009
8026
  </xsl:with-param>
8010
8027
  </xsl:call-template>
8011
8028
  </xsl:otherwise>
@@ -13531,9 +13548,14 @@
13531
13548
  </x:xmpmeta>
13532
13549
  <!-- add attachments -->
13533
13550
  <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
13534
- <xsl:variable name="description" select="normalize-space(//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]/*[local-name() = 'formattedref'])"/>
13535
-
13536
- <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" filename="{@name}">
13551
+ <xsl:variable name="bibitem_attachment_" select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]"/>
13552
+ <xsl:variable name="bibitem_attachment" select="xalan:nodeset($bibitem_attachment_)"/>
13553
+ <xsl:variable name="description" select="normalize-space($bibitem_attachment/*[local-name() = 'formattedref'])"/>
13554
+ <xsl:variable name="filename" select="java:org.metanorma.fop.Util.getFilenameFromPath(@name)"/>
13555
+ <!-- Todo: need update -->
13556
+ <xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
13557
+
13558
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" filename="{$filename}" link-as-file-annotation="true">
13537
13559
  <xsl:attribute name="src">
13538
13560
  <xsl:choose>
13539
13561
  <xsl:when test="normalize-space() != ''">
@@ -13549,18 +13571,27 @@
13549
13571
  <xsl:if test="$description != ''">
13550
13572
  <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
13551
13573
  </xsl:if>
13574
+ <xsl:if test="$afrelationship != ''">
13575
+ <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
13576
+ </xsl:if>
13552
13577
  </pdf:embedded-file>
13553
13578
  </xsl:for-each>
13554
13579
  <!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
13555
13580
  <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
13556
13581
  <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
13557
13582
  <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
13583
+ <xsl:variable name="attachment_name" select="java:org.metanorma.fop.Util.getFilenameFromPath($attachment_path)"/>
13558
13584
  <xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
13559
13585
  <xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
13560
- <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{$attachment_path}">
13586
+ <!-- Todo: need update -->
13587
+ <xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
13588
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{$attachment_name}" link-as-file-annotation="true">
13561
13589
  <xsl:if test="$description != ''">
13562
13590
  <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
13563
13591
  </xsl:if>
13592
+ <xsl:if test="$afrelationship != ''">
13593
+ <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
13594
+ </xsl:if>
13564
13595
  </pdf:embedded-file>
13565
13596
  </xsl:for-each>
13566
13597
  </xsl:if>
@@ -13580,6 +13611,12 @@
13580
13611
  <!-- Get or calculate depth of the element -->
13581
13612
  <xsl:template name="getLevel">
13582
13613
  <xsl:param name="depth"/>
13614
+ <!-- <xsl:message>
13615
+ <xsl:choose>
13616
+ <xsl:when test="local-name() = 'title'">title=<xsl:value-of select="."/></xsl:when>
13617
+ <xsl:when test="local-name() = 'clause'">clause/title=<xsl:value-of select="*[local-name() = 'title']"/></xsl:when>
13618
+ </xsl:choose>
13619
+ </xsl:message> -->
13583
13620
  <xsl:choose>
13584
13621
  <xsl:when test="normalize-space(@depth) != ''">
13585
13622
  <xsl:value-of select="@depth"/>
@@ -13600,8 +13637,27 @@
13600
13637
  <xsl:when test="ancestor::*[local-name() = 'preface']">
13601
13638
  <xsl:value-of select="$level_total - 2"/>
13602
13639
  </xsl:when>
13640
+ <xsl:when test="ancestor::*[local-name() = 'sections'] and self::*[local-name() = 'title']">
13641
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/>
13642
+ <xsl:choose>
13643
+ <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
13644
+ <xsl:value-of select="number($upper_clause_depth + 1)"/>
13645
+ </xsl:when>
13646
+ <xsl:otherwise>
13647
+ <xsl:value-of select="$level_total - 2"/>
13648
+ </xsl:otherwise>
13649
+ </xsl:choose>
13650
+ </xsl:when>
13603
13651
  <xsl:when test="ancestor::*[local-name() = 'sections']">
13604
- <xsl:value-of select="$level_total - 1"/>
13652
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][1]/*[local-name() = 'title']/@depth)"/>
13653
+ <xsl:choose>
13654
+ <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
13655
+ <xsl:value-of select="number($upper_clause_depth + 1)"/>
13656
+ </xsl:when>
13657
+ <xsl:otherwise>
13658
+ <xsl:value-of select="$level_total - 1"/>
13659
+ </xsl:otherwise>
13660
+ </xsl:choose>
13605
13661
  </xsl:when>
13606
13662
  <xsl:when test="ancestor::*[local-name() = 'bibliography']">
13607
13663
  <xsl:value-of select="$level_total - 1"/>
@@ -13609,6 +13665,17 @@
13609
13665
  <xsl:when test="parent::*[local-name() = 'annex']">
13610
13666
  <xsl:value-of select="$level_total - 1"/>
13611
13667
  </xsl:when>
13668
+ <xsl:when test="ancestor::*[local-name() = 'annex'] and self::*[local-name() = 'title']">
13669
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/>
13670
+ <xsl:choose>
13671
+ <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
13672
+ <xsl:value-of select="number($upper_clause_depth + 1)"/>
13673
+ </xsl:when>
13674
+ <xsl:otherwise>
13675
+ <xsl:value-of select="$level_total - 1"/>
13676
+ </xsl:otherwise>
13677
+ </xsl:choose>
13678
+ </xsl:when>
13612
13679
  <xsl:when test="ancestor::*[local-name() = 'annex']">
13613
13680
  <xsl:value-of select="$level_total"/>
13614
13681
  </xsl:when>
@@ -13967,6 +14034,20 @@
13967
14034
 
13968
14035
  <!-- END: insert cover page image -->
13969
14036
 
14037
+ <xsl:template name="insertVerticalChar">
14038
+ <xsl:param name="str"/>
14039
+ <xsl:if test="string-length($str) &gt; 0">
14040
+ <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">
14041
+ <fo:block-container width="1em">
14042
+ <fo:block line-height="1em"><xsl:value-of select="substring($str,1,1)"/></fo:block>
14043
+ </fo:block-container>
14044
+ </fo:inline-container>
14045
+ <xsl:call-template name="insertVerticalChar">
14046
+ <xsl:with-param name="str" select="substring($str, 2)"/>
14047
+ </xsl:call-template>
14048
+ </xsl:if>
14049
+ </xsl:template>
14050
+
13970
14051
  <xsl:template name="number-to-words">
13971
14052
  <xsl:param name="number"/>
13972
14053
  <xsl:param name="first"/>
@@ -14254,4 +14335,18 @@
14254
14335
  </xsl:if>
14255
14336
  </xsl:template>
14256
14337
 
14338
+ <xsl:template match="@*|node()" mode="set_table_role_skip">
14339
+ <xsl:copy>
14340
+ <xsl:apply-templates select="@*|node()" mode="set_table_role_skip"/>
14341
+ </xsl:copy>
14342
+ </xsl:template>
14343
+
14344
+ <xsl:template match="*[starts-with(local-name(), 'table')]" mode="set_table_role_skip">
14345
+ <xsl:copy>
14346
+ <xsl:apply-templates select="@*" mode="set_table_role_skip"/>
14347
+ <xsl:attribute name="role">SKIP</xsl:attribute>
14348
+ <xsl:apply-templates select="node()" mode="set_table_role_skip"/>
14349
+ </xsl:copy>
14350
+ </xsl:template>
14351
+
14257
14352
  </xsl:stylesheet>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module BIPM
3
- VERSION = "2.5.2".freeze
3
+ VERSION = "2.5.3".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-bipm
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.2
4
+ version: 2.5.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: metanorma-generic