Skip to content

Commit

Permalink
Merge pull request #261 from metanorma/issue/213
Browse files Browse the repository at this point in the history
mn2xml.xsl updated for Warning, Important and Caution notes, #213
  • Loading branch information
Intelligent2013 authored Sep 19, 2022
2 parents 94ab2e9 + e56944e commit 4ace329
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/main/resources/mn2xml.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -4202,6 +4202,11 @@
<xsl:template match="admonition">
<non-normative-note>
<xsl:copy-of select="@id"/>
<xsl:if test="$metanorma_type = 'IEC' or $metanorma_type = 'ISO'">
<xsl:if test="@type = 'warning' or @type = 'important' or @type = 'caution'">
<xsl:attribute name="content-type"><xsl:value-of select="@type"/></xsl:attribute>
</xsl:if>
</xsl:if>
<label><xsl:value-of select="java:toUpperCase(java:java.lang.String.new(@type))"/></label>
<xsl:apply-templates />
</non-normative-note>
Expand Down
11 changes: 9 additions & 2 deletions src/main/resources/sts2mn.adoc.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -2573,8 +2573,15 @@
<xsl:text>&#xa;&#xa;</xsl:text>
</xsl:template> -->

<xsl:template match="non-normative-note[count(*[not(local-name() = 'label')]) &gt; 1]" priority="2">
<xsl:text>[NOTE]</xsl:text>
<xsl:template match="non-normative-note[count(*[not(local-name() = 'label')]) &gt; 1 or @content-type = 'warning' or @content-type = 'important' or @content-type = 'caution']" priority="2">
<xsl:choose>
<xsl:when test="@content-type = 'warning' or @content-type = 'important' or @content-type = 'caution'">
<xsl:text>[</xsl:text><xsl:value-of select="java:toUpperCase(java:java.lang.String.new(@content-type))"/><xsl:text>]</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>[NOTE]</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:text>&#xa;</xsl:text>
<xsl:text>====</xsl:text>
<xsl:text>&#xa;</xsl:text>
Expand Down

0 comments on commit 4ace329

Please sign in to comment.