Skip to content

Commit

Permalink
xslt update based on metanorma/mn-native-pdf@72ea970
Browse files Browse the repository at this point in the history
  • Loading branch information
Intelligent2013 authored May 27, 2024
1 parent 5362443 commit a79a85d
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
19 changes: 19 additions & 0 deletions lib/isodoc/m3aawg/m3aawg.policy.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -11368,6 +11368,25 @@
</xsl:copy>
</xsl:template>

<xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name() = 'li']" mode="linear_xml" priority="2">
<xsl:copy>
<xsl:apply-templates select="@*" mode="linear_xml"/>

<xsl:variable name="ancestor">
<xsl:choose>
<xsl:when test="ancestor::*[local-name() = 'preface']">preface</xsl:when>
<xsl:when test="ancestor::*[local-name() = 'sections']">sections</xsl:when>
<xsl:when test="ancestor::*[local-name() = 'annex']">annex</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:attribute name="ancestor">
<xsl:value-of select="$ancestor"/>
</xsl:attribute>

<xsl:apply-templates mode="linear_xml"/>
</xsl:copy>
</xsl:template>

<!-- add @to = figure, table, clause -->
<!-- add @depth = from -->
<xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name() = 'xref']" mode="linear_xml">
Expand Down
19 changes: 19 additions & 0 deletions lib/isodoc/m3aawg/m3aawg.report.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -11368,6 +11368,25 @@
</xsl:copy>
</xsl:template>

<xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name() = 'li']" mode="linear_xml" priority="2">
<xsl:copy>
<xsl:apply-templates select="@*" mode="linear_xml"/>

<xsl:variable name="ancestor">
<xsl:choose>
<xsl:when test="ancestor::*[local-name() = 'preface']">preface</xsl:when>
<xsl:when test="ancestor::*[local-name() = 'sections']">sections</xsl:when>
<xsl:when test="ancestor::*[local-name() = 'annex']">annex</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:attribute name="ancestor">
<xsl:value-of select="$ancestor"/>
</xsl:attribute>

<xsl:apply-templates mode="linear_xml"/>
</xsl:copy>
</xsl:template>

<!-- add @to = figure, table, clause -->
<!-- add @depth = from -->
<xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name() = 'xref']" mode="linear_xml">
Expand Down

0 comments on commit a79a85d

Please sign in to comment.