Skip to content

Commit 0dce019

Browse files
common xslt code optimization for metanorma/mn2pdf#245
1 parent b5ed485 commit 0dce019

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

xslt_src/common.xsl

+18
Original file line numberDiff line numberDiff line change
@@ -17784,6 +17784,24 @@
1778417784
</xsl:if>
1778517785
</xsl:template>
1778617786

17787+
<!-- optimization: remove clause if table_only_with_id isn't empty and clause doesn't contain table or dl with table_only_with_id -->
17788+
<xsl:template match="*[local-name() = 'clause' or local-name() = 'p' or local-name() = 'definitions' or local-name() = 'annex']" mode="update_xml_step1">
17789+
<xsl:choose>
17790+
<xsl:when test="$table_only_with_id != '' and not(.//*[local-name() = 'table' or local-name() = 'dl'][@id = $table_only_with_id])">
17791+
<xsl:copy>
17792+
<xsl:copy-of select="@*"/>
17793+
</xsl:copy>
17794+
</xsl:when>
17795+
<xsl:otherwise>
17796+
<xsl:copy>
17797+
<xsl:copy-of select="@*"/>
17798+
<xsl:apply-templates mode="update_xml_step1"/>
17799+
</xsl:copy>
17800+
</xsl:otherwise>
17801+
</xsl:choose>
17802+
</xsl:template>
17803+
17804+
1778717805
<!-- =========================================================================== -->
1778817806
<!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
1778917807
<!-- =========================================================================== -->

0 commit comments

Comments
 (0)