Skip to content

Commit 5c92f21

Browse files
xslt update based on metanorma/mn-native-pdf@b8acbc3
1 parent 3e725a4 commit 5c92f21

File tree

1 file changed

+57
-1
lines changed

1 file changed

+57
-1
lines changed

lib/isodoc/plateau/plateau.international-standard.xsl

+57-1
Original file line numberDiff line numberDiff line change
@@ -5026,6 +5026,7 @@
50265026

50275027
<fo:block role="SKIP">
50285028
<xsl:apply-templates/>
5029+
<xsl:if test="$isGenerateTableIF = 'false' and count(node()) = 0"> </xsl:if>
50295030
</fo:block>
50305031
</fo:table-cell>
50315032
</xsl:template> <!-- cell in table header row - 'th' -->
@@ -5089,6 +5090,8 @@
50895090

50905091
<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"/> -->
50915092

5093+
<xsl:if test="$isGenerateTableIF = 'false' and count(node()) = 0"> </xsl:if>
5094+
50925095
</fo:block>
50935096
</fo:table-cell>
50945097
</xsl:template> <!-- td -->
@@ -7933,6 +7936,9 @@
79337936
<xsl:call-template name="insert_basic_link">
79347937
<xsl:with-param name="element">
79357938
<fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
7939+
<xsl:if test="$isLinkToEmbeddedFile = 'true'">
7940+
<xsl:attribute name="role">Annot</xsl:attribute>
7941+
</xsl:if>
79367942
<xsl:choose>
79377943
<xsl:when test="normalize-space(.) = ''">
79387944
<xsl:call-template name="add-zero-spaces-link-java">
@@ -13628,6 +13634,12 @@
1362813634
<!-- Get or calculate depth of the element -->
1362913635
<xsl:template name="getLevel">
1363013636
<xsl:param name="depth"/>
13637+
<!-- <xsl:message>
13638+
<xsl:choose>
13639+
<xsl:when test="local-name() = 'title'">title=<xsl:value-of select="."/></xsl:when>
13640+
<xsl:when test="local-name() = 'clause'">clause/title=<xsl:value-of select="*[local-name() = 'title']"/></xsl:when>
13641+
</xsl:choose>
13642+
</xsl:message> -->
1363113643
<xsl:choose>
1363213644
<xsl:when test="normalize-space(@depth) != ''">
1363313645
<xsl:value-of select="@depth"/>
@@ -13648,15 +13660,45 @@
1364813660
<xsl:when test="ancestor::*[local-name() = 'preface']">
1364913661
<xsl:value-of select="$level_total - 2"/>
1365013662
</xsl:when>
13663+
<xsl:when test="ancestor::*[local-name() = 'sections'] and self::*[local-name() = 'title']">
13664+
<xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/>
13665+
<xsl:choose>
13666+
<xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
13667+
<xsl:value-of select="number($upper_clause_depth + 1)"/>
13668+
</xsl:when>
13669+
<xsl:otherwise>
13670+
<xsl:value-of select="$level_total - 2"/>
13671+
</xsl:otherwise>
13672+
</xsl:choose>
13673+
</xsl:when>
1365113674
<xsl:when test="ancestor::*[local-name() = 'sections']">
13652-
<xsl:value-of select="$level_total - 1"/>
13675+
<xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][1]/*[local-name() = 'title']/@depth)"/>
13676+
<xsl:choose>
13677+
<xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
13678+
<xsl:value-of select="number($upper_clause_depth + 1)"/>
13679+
</xsl:when>
13680+
<xsl:otherwise>
13681+
<xsl:value-of select="$level_total - 1"/>
13682+
</xsl:otherwise>
13683+
</xsl:choose>
1365313684
</xsl:when>
1365413685
<xsl:when test="ancestor::*[local-name() = 'bibliography']">
1365513686
<xsl:value-of select="$level_total - 1"/>
1365613687
</xsl:when>
1365713688
<xsl:when test="parent::*[local-name() = 'annex']">
1365813689
<xsl:value-of select="$level_total - 1"/>
1365913690
</xsl:when>
13691+
<xsl:when test="ancestor::*[local-name() = 'annex'] and self::*[local-name() = 'title']">
13692+
<xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/>
13693+
<xsl:choose>
13694+
<xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
13695+
<xsl:value-of select="number($upper_clause_depth + 1)"/>
13696+
</xsl:when>
13697+
<xsl:otherwise>
13698+
<xsl:value-of select="$level_total - 1"/>
13699+
</xsl:otherwise>
13700+
</xsl:choose>
13701+
</xsl:when>
1366013702
<xsl:when test="ancestor::*[local-name() = 'annex']">
1366113703
<xsl:value-of select="$level_total"/>
1366213704
</xsl:when>
@@ -14314,4 +14356,18 @@
1431414356
</xsl:if>
1431514357
</xsl:template>
1431614358

14359+
<xsl:template match="@*|node()" mode="set_table_role_skip">
14360+
<xsl:copy>
14361+
<xsl:apply-templates select="@*|node()" mode="set_table_role_skip"/>
14362+
</xsl:copy>
14363+
</xsl:template>
14364+
14365+
<xsl:template match="*[starts-with(local-name(), 'table')]" mode="set_table_role_skip">
14366+
<xsl:copy>
14367+
<xsl:apply-templates select="@*" mode="set_table_role_skip"/>
14368+
<xsl:attribute name="role">SKIP</xsl:attribute>
14369+
<xsl:apply-templates select="node()" mode="set_table_role_skip"/>
14370+
</xsl:copy>
14371+
</xsl:template>
14372+
1431714373
</xsl:stylesheet>

0 commit comments

Comments
 (0)