1 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
2 | <!--Arbortext, Inc., 1988-2011, v.4002-->
|
---|
3 | <!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN"
|
---|
4 | "reference.dtd">
|
---|
5 | <?Pub Inc?>
|
---|
6 | <reference id="plugin-messages" xml:lang="en-us">
|
---|
7 | <title>Adding diagnostic messages</title>
|
---|
8 | <shortdesc>Plug-in specific warning and error messages can be added
|
---|
9 | to the set of messages supplied by the DITA-OT. These messages can
|
---|
10 | then be used by any XSLT override.</shortdesc>
|
---|
11 | <refbody>
|
---|
12 | <section><dl><dlentry>
|
---|
13 | <dt><codeph>dita.xsl.messages</codeph></dt>
|
---|
14 | <dd>Add new messages to diagnostic message file.</dd>
|
---|
15 | </dlentry></dl></section>
|
---|
16 | <example><title>Example</title><p>To add your own messages, create
|
---|
17 | the new messages in an XML file such as <filepath>myMessages.xml</filepath>:</p><codeblock><dummy>
|
---|
18 | <!-- See resource/messages.xml for the details. -->
|
---|
19 | <message id="DOTXmy-msg-numW" type="WARN">
|
---|
20 | <reason>Message text</reason>
|
---|
21 | <response>How to resolve</response>
|
---|
22 | </message>
|
---|
23 | </dummy></codeblock><p>There are three components to the message
|
---|
24 | ID:<ol>
|
---|
25 | <li>The prefix DOTX is used by all DITA-OT XSLT transforms, and must
|
---|
26 | be part of the ID.</li>
|
---|
27 | <li>This is followed by the message number ("my-msg-num" in the sample above). By convention, this
|
---|
28 | should be a three digit integer.</li>
|
---|
29 | <li>Finally, a letter corresponds to the severity. This should be
|
---|
30 | one of:<ul>
|
---|
31 | <li>I = Informational, used with type="INFO"</li>
|
---|
32 | <li>W = Warning, used with type="WARN"</li>
|
---|
33 | <li>E = Error, used with type="ERROR"</li>
|
---|
34 | <li>F = Fatal, used with type="FATAL"</li>
|
---|
35 | </ul></li>
|
---|
36 | </ol></p><p>Once the message file is defined, it is incorporated with
|
---|
37 | this extension: </p><codeblock><plugin id="com.example.newmsg">
|
---|
38 | <feature extension="dita.xsl.messages" file="myMessages.xml"/>
|
---|
39 | </plugin></codeblock><p>XSLT modules can then generate the message
|
---|
40 | using the following call: </p><?Pub Caret 67?><codeblock><xsl:call-template name="output-message">
|
---|
41 | <xsl:with-param name="msgnum">my-msg-num</xsl:with-param>
|
---|
42 | <xsl:with-param name="msgsev">W</xsl:with-param>
|
---|
43 | </xsl:call-template>
|
---|
44 | </codeblock></example>
|
---|
45 | </refbody>
|
---|
46 | </reference>
|
---|
47 | <?Pub *0000002093?>
|
---|