Skip to content

Commit

Permalink
Merge pull request #2894 from robander/fatalxsl
Browse files Browse the repository at this point in the history
Fatal message should terminate XSL
  • Loading branch information
jelovirt committed Feb 22, 2018
2 parents a14c85b + f9b4e89 commit d303fdc
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/main/xsl/common/output-message.xsl
Expand Up @@ -47,19 +47,29 @@ See the accompanying LICENSE file for applicable license.
<xsl:value-of select="concat($msgcat, $msgnum, $msgsev)"/>
</xsl:param>

<xsl:variable name="msgdoc" select="document('plugin:org.dita.base:config/messages.xml')" as="document-node()?"/>
<xsl:variable name="msgcontent" as="xs:string*">
<xsl:choose>
<xsl:when test="$msg != '***'">
<xsl:value-of select="$msg"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="msgdoc" select="document('plugin:org.dita.base:config/messages.xml')"/>
<xsl:apply-templates select="$msgdoc/messages/message[@id = $id]" mode="get-message-content">
<xsl:with-param name="params" select="$msgparams"/>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="msgseverity" as="xs:string*">
<xsl:choose>
<xsl:when test="$msgsev != 'I'">
<xsl:value-of select="$msg"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$msgdoc/messages/message[@id = $id]/@type"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="localclass" select="$ctx/@class" as="attribute(class)?"/>
<xsl:variable name="xtrf" select="$ctx/@xtrf" as="attribute(xtrf)?"/>
<xsl:variable name="xtrc" select="$ctx/@xtrc" as="attribute(xtrc)?"/>
Expand All @@ -84,7 +94,7 @@ See the accompanying LICENSE file for applicable license.
<xsl:sequence select="$msgcontent"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="$msgsev = 'F'">
<xsl:when test="$msgsev = 'F' or $msgseverity='FATAL'">
<xsl:message terminate="yes">
<xsl:value-of select="$m" separator=""/>
</xsl:message>
Expand Down

0 comments on commit d303fdc

Please sign in to comment.