Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal message should terminate XSL #2894

Merged
merged 1 commit into from Feb 22, 2018
Merged

Conversation

robander
Copy link
Member

@robander robander commented Feb 9, 2018

Description

Updates the output-message routine so that if a message is defined with type="FATAL", the XSL will terminate.

Motivation and Context

I was trying to add a fatal-severity message to a custom XSL file, and noticed that it was generated (with [FATAL] in the message) but that the build continued to the normal end. A few years back, this would have stopped the build

Cause: messages used to be generated by passing in a message ID, a message, and a severity, which were combined with a hard-coded prefix. If the severity was F, the message was generated in a way that terminated the process.

This method of calling messages was deprecated some releases ago; now you just pass in the ID and optional parameters. When a message is fatal, the message definition should specify type="FATAL". We do not ship any fatal messages intended for XSL but it should be possible to create them; here's the syntax of another fatal message:
<message id="DOTA001F" type="FATAL">

This code update fixes the code so that in addition to checking the old param for $msgsev='F', it reads the message and checks for @type='FATAL'.

How Has This Been Tested?

  1. Created a section with two <title> elements
  2. Verify it generates the message DOTX041W
  3. Change the message definition to fatal: <message id="DOTX041W" type="FATAL">
  4. Rebuild, and processing of that topic now quits with:
     [xslt] file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/docsrc/samples/concepts/lawnmower.xml:14:10: [DOTX041W][FATAL]: Found more than one title element in a section element. Using the first one for the section's title.
     [xslt] Failed to transform document: Processing terminated by xsl:message at line 99 in output-message.xsl

Type of Changes

Bug fix - restores a simple feature that was broken / unavailable unless using deprecated code.

Signed-off-by: Robert D Anderson <robander@us.ibm.com>
@robander robander added bug priority/medium Medium (or unknown) priority issue labels Feb 9, 2018
@robander robander modified the milestone: 3.0.3 Feb 9, 2018
@jelovirt jelovirt merged commit d303fdc into dita-ot:hotfix/3.0.3 Feb 22, 2018
@jelovirt jelovirt added this to the 3.0.3 milestone Feb 22, 2018
@robander robander deleted the fatalxsl branch February 22, 2018 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug priority/medium Medium (or unknown) priority issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants