VirtualBox

source: vbox/trunk/src/libs/dita-ot-1.8.5/docsrc/dev_ref/plugin-messages.dita@ 99507

最後變更 在這個檔案從99507是 98584,由 vboxsync 提交於 2 年 前

Docs: bugref:10302. Setting svn properties of DITA-OT library.

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 2.1 KB
 
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
9to the set of messages supplied by the DITA-OT. These messages can
10then 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
17the new messages in an XML file such as <filepath>myMessages.xml</filepath>:</p><codeblock>&lt;dummy>
18 &lt;!-- See resource/messages.xml for the details. -->
19 &lt;message id="DOTXmy-msg-numW" type="WARN">
20 &lt;reason>Message text&lt;/reason>
21 &lt;response>How to resolve&lt;/response>
22 &lt;/message>
23&lt;/dummy></codeblock><p>There are three components to the message
24ID:<ol>
25<li>The prefix DOTX is used by all DITA-OT XSLT transforms, and must
26be 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
30one 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
37this extension: </p><codeblock>&lt;plugin id="com.example.newmsg">
38 &lt;feature extension="dita.xsl.messages" file="myMessages.xml"/>
39&lt;/plugin></codeblock><p>XSLT modules can then generate the message
40using the following call: </p><?Pub Caret 67?><codeblock>&lt;xsl:call-template name="output-message">
41 &lt;xsl:with-param name="msgnum">my-msg-num&lt;/xsl:with-param>
42 &lt;xsl:with-param name="msgsev">W&lt;/xsl:with-param>
43&lt;/xsl:call-template>
44</codeblock></example>
45</refbody>
46</reference>
47<?Pub *0000002093?>
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette