Skip to content

Commit

Permalink
Merge pull request #1170 from metanorma/feature/xslt-update
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored May 27, 2024
2 parents ee67ce4 + 08844f4 commit ef42836
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
19 changes: 19 additions & 0 deletions lib/isodoc/iso/iso.amendment.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -16086,6 +16086,25 @@
</xsl:copy>
</xsl:template>

<xsl:template 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 match="*[local-name() = 'xref']" mode="linear_xml">
Expand Down
19 changes: 19 additions & 0 deletions lib/isodoc/iso/iso.international-standard.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -16086,6 +16086,25 @@
</xsl:copy>
</xsl:template>

<xsl:template 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 match="*[local-name() = 'xref']" mode="linear_xml">
Expand Down

0 comments on commit ef42836

Please sign in to comment.