Use the dita.xsl.messages
extension point to add plug-in-specific messages to the
diagnostic messages that are generated by the DITA-OT. These messages then can be used by any XSLT
override.
Procedure
-
Create an XML file that contains the messages that you want to add. Be sure to use the following format for
the XML file:
<dummy>
<!-- See resources/messages.xml for the details. -->
<message id="DOTXnumberletter" type="error-severity">
<reason>Message text</reason>
<response>How to resolve</response>
</message>
</dummy>
where:
- number is a three-digit integer.
- letter is one of the following upper-case letters: I, W, E, F. It should match the
value that is specified for the
@type
attribute.
- error-severity specifies the severity of the error. It must be one of the following values:
-
Create a plug-in.xml file that contains the following content:
<plugin id="plugin-id">
<feature extension="dita.xsl.messages" file="file"/>
</plugin>
where:
- plugin-id is the plug-in identifier, for example,
com.example.newmsg
.
- file is the name of the new messages file, for example,
myMessages.xml.
-
Install the plug-in.
What to do next
You now can use the following call in XSLT modules to generate a message when a specific condition occurs:
<xsl:call-template name="output-message">
<xsl:with-param name="msgnum">numberletter</xsl:with-param>
<xsl:with-param name="msgsev">letter</xsl:with-param>
</xsl:call-template>