| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <!DOCTYPE html
- SYSTEM "about:legacy-compat">
- <html lang="en-us"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="UTF-8"><meta name="copyright" content="(C) Copyright 2016"><meta name="DC.rights.owner" content="(C) Copyright 2016"><meta name="DC.Type" content="task"><meta name="description" content="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."><meta name="DC.Relation" scheme="URI" content="../dev_ref/plugin-creating.html"><meta name="DC.Relation" scheme="URI" content="../dev_ref/plugin-extension-points-general.html"><meta name="DC.Relation" scheme="URI" content="../dev_ref/plugins-installing.html"><meta name="DC.Format" content="XHTML"><meta name="DC.Identifier" content="plugin-messages"><meta name="DC.Language" content="en-US"><link rel="stylesheet" type="text/css" href="../css/commonltr.css"><link rel="stylesheet" type="text/css" href="../css/dita-ot-doc.css"><title>Adding new diagnostic messages</title></head><body id="plugin-messages"><header role="banner"><div class="header">
- <p>DITA Open Toolkit</p>
- <hr>
- </div></header><nav role="toc"><ul><li><a href="../index.html">DITA Open Toolkit 2.3</a></li><li><a href="../release-notes/index.html">Release Notes</a></li><li><a href="../getting-started/index.html">Getting Started</a></li><li><a href="../user-guide/index.html">User Guide</a></li><li><a href="../parameters/index.html">Parameter Reference</a></li><li><a href="../dev_ref/index.html">Developer Reference</a><ul><li><a href="../dev_ref/DITA-OTArchitecture.html">DITA-OT Architecture</a></li><li><a href="../dev_ref/extending-the-ot.html">Extending the DITA-OT</a></li><li><a href="../dev_ref/plugin-creating.html">Creating plug-ins</a><ul><li><a href="../dev_ref/plugins-overview.html">Overview of plug-ins</a></li><li><a href="../dev_ref/plugin-xmlcatalog.html">Extending an XML catalog file</a></li><li><a href="../dev_ref/plugin-anttarget.html">Adding a new target to the Ant build process</a></li><li><a href="../dev_ref/plugin-antpreprocess.html">Adding an Ant target to the pre-processing pipeline</a></li><li><a href="../dev_ref/plugin-newtranstype.html">Adding a new transformation type</a></li><li><a href="../dev_ref/plugin-overridestyle.html">Overriding an XSLT-processing step</a></li><li><a href="../dev_ref/using-plugin-URI-extension.html">Referencing files from other plug-ins</a></li><li><a href="../dev_ref/plugin-addgeneratedtext.html">Modifying or adding generated text</a></li><li><a href="../dev_ref/plugin-xsltparams.html">Adding parameters to existing XSLT steps</a></li><li><a href="../dev_ref/plugin-javalib.html">Adding a Java library to the DITA-OT classpath parameter</a></li><li class="active"><a href="../dev_ref/plugin-messages.html">Adding new diagnostic messages</a></li><li><a href="../dev_ref/plugin-newextensions.html">Creating a new plug-in extension point</a></li><li><a href="../dev_ref/plugin-sample.html">Example plugin.xml file</a></li></ul></li><li><a href="../dev_ref/plugin-extension-points.html">Extension points</a></li><li><a href="../dev_ref/pdf-customization.html">Customizing PDF output</a></li><li><a href="../dev_ref/migration.html">Migrating customizations</a></li></ul></li><li><a href="../user-guide/dita-and-dita-ot-resources.html">DITA Resources</a></li></ul></nav><main role="main"><article role="article" aria-labelledby="ariaid-title1">
- <h1 class="title topictitle1" id="ariaid-title1">Adding new diagnostic messages</h1>
-
- <div class="body taskbody"><p class="shortdesc">Use the <code class="ph codeph">dita.xsl.messages</code> 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.</p>
- <div class="tasklabel"><h2 class="sectiontitle tasklabel">Procedure</h2></div><ol class="ol steps"><li class="li step stepexpand">
- <span class="ph cmd">Create an XML file that contains the messages that you want to add. Be sure to use the following format for
- the XML file:</span>
- <div class="itemgroup info"><pre class="pre codeblock"><code><dummy>
- <!-- See resources/messages.xml for the details. -->
- <message id="DOTX<var class="keyword varname">number</var><var class="keyword varname">letter</var>" type="<var class="keyword varname">error-severity</var>">
- <reason>Message text</reason>
- <response>How to resolve</response>
- </message>
- </dummy></code></pre>where:
- <ul class="ul">
- <li class="li"><var class="keyword varname">number</var> is a three-digit integer.</li>
- <li class="li"><var class="keyword varname">letter</var> is one of the following upper-case letters: I, W, E, F. It should match the
- value that is specified for the <code class="keyword markupname xmlatt">@type</code> attribute.</li>
- <li class="li"><var class="keyword varname">error-severity</var> specifies the severity of the error. It must be one of the following values:
- <ul class="ul">
- <li class="li">INFO</li>
- <li class="li">WARN</li>
- <li class="li">ERROR</li>
- <li class="li">FATAL</li>
- </ul></li>
- </ul></div>
- </li><li class="li step stepexpand">
- <span class="ph cmd">Create a <span class="ph filepath">plug-in.xml</span> file that contains the following content:</span>
- <div class="itemgroup info">
- <pre class="pre codeblock"><code><plugin id="<var class="keyword varname">plugin-id</var>">
- <feature extension="dita.xsl.messages" file="<var class="keyword varname">file</var>"/>
- </plugin></code></pre>
- <p class="p">where:</p>
- <ul class="ul">
- <li class="li"><var class="keyword varname">plugin-id</var> is the plug-in identifier, for example,
- <code class="ph codeph">com.example.newmsg</code>.</li>
- <li class="li"><var class="keyword varname">file</var> is the name of the new messages file, for example,
- <span class="ph filepath">myMessages.xml</span>. </li>
- </ul>
- </div>
- </li><li class="li step stepexpand">
- <span class="ph cmd">Install the plug-in.</span>
- </li></ol>
- <section class="section postreq"><div class="tasklabel"><h2 class="sectiontitle tasklabel">What to do next</h2></div>
- <p class="p">You now can use the following call in XSLT modules to generate a message when a specific condition occurs:</p>
- <pre class="pre codeblock"><code><xsl:call-template name="output-message">
- <xsl:with-param name="msgnum"><var class="keyword varname">number</var><var class="keyword varname">letter</var></xsl:with-param>
- <xsl:with-param name="msgsev"><var class="keyword varname">letter</var></xsl:with-param>
- </xsl:call-template>
- </code></pre>
- </section>
- </div>
- <nav role="navigation" class="related-links"><div class="familylinks"><div class="parentlink"><strong>Parent topic:</strong> <a class="link" href="../dev_ref/plugin-creating.html" title="You can use DITA-OT plug-ins to extend the DITA Open Toolkit.">Creating plug-ins</a></div></div><div class="linklist linklist relinfo reltasks"><strong>Related tasks</strong><br><div><a class="link" href="../dev_ref/plugins-installing.html" title="Use the dita command to install a plug-in.">Installing plug-ins</a></div></div><div class="linklist linklist relinfo relref"><strong>Related reference</strong><br><div><a class="link" href="../dev_ref/plugin-extension-points-general.html" title="These extension points enable you to extend the DITA-OT. You can add Ant targets or imports; add a Java library to the classpath parameter; add a new transformation type; extend a catalog file; add new diagnostic messages, and more.">General extension points</a></div></div></nav></article></main></body></html>
|