Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > bd5c3d824c3db63ffd9226c15941e6ad > files > 1602

mozart-1.4.0-1mdv2010.0.i586.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>6 Extending the DTD</TITLE><LINK href="ozdoc.css" rel="stylesheet" type="text/css"></HEAD><BODY><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="node5.html#chapter.description">&lt;&lt; Prev</A></TD><TD><A href="index.html">- Up -</A></TD><TD><A href="node7.html#chapter.editing">Next &gt;&gt;</A></TD></TR></TABLE><DIV id="chapter.extending"><H1><A name="chapter.extending">6 Extending the DTD</A></H1><P>For a particular document, it may be desirable to slightly modify or extend the DTD. You can do this by defining <CODE>input.local</CODE> as a <CODE>SYSTEM</CODE> entity referring to a file containg the required definitions. This file is read after the generic attribute entities have been declared, but before the remaining entities having to do with content models.</P><P>Thus the file can contain declarations for additional elements that can take advantage of the generic attribute entities, and it can override the content model parameter entities if necessary (this is because the 1st declaration of an entity wins, subsequent declarations for the same entity are ignored).</P><P>Normally, at the most, you should consider adding some phrasal elements. This can be done simply by defining parameter entity <CODE>p.mix.local</CODE>: </P><BLOCKQUOTE class="code"><CODE>&lt;<SPAN class="keyword">!ENTITY</SPAN>&nbsp;%&nbsp;p.mix.local&nbsp;<SPAN class="string">&quot;|&nbsp;foo&nbsp;|&nbsp;bar&quot;</SPAN>&gt;</CODE></BLOCKQUOTE><P> Note the leading vertical bar: it is required because <CODE>p.mix.local</CODE> is concatenated to the end of a disjunction of elements.</P><P>The typical way to extend the DTD is to place your declarations in a file, say <CODE>myaddons.sgml</CODE>, which may also contain a definition of <CODE>p.mix.local</CODE> as shown above. Then your document should use a <CODE>DOCTYPE</CODE> header of the form: </P><BLOCKQUOTE class="code"><CODE>&lt;<SPAN class="functionname">DOCTYPE</SPAN>&nbsp;BOOK&nbsp;SYSTEM&nbsp;<SPAN class="string">&quot;ozdoc.dtd&quot;</SPAN>&nbsp;[<BR>&lt;<SPAN class="keyword">!ENTITY</SPAN>&nbsp;%&nbsp;input.local&nbsp;SYSTEM&nbsp;<SPAN class="string">&quot;myaddons.sgml&quot;</SPAN>&gt;<BR>]&gt;</CODE></BLOCKQUOTE><P></P></DIV><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="node5.html#chapter.description">&lt;&lt; Prev</A></TD><TD><A href="index.html">- Up -</A></TD><TD><A href="node7.html#chapter.editing">Next &gt;&gt;</A></TD></TR></TABLE><HR><ADDRESS><A href="http://www.ps.uni-sb.de/~duchier/">Denys&nbsp;Duchier</A><BR><SPAN class="version">Version 1.4.0 (20090610)</SPAN></ADDRESS></BODY></HTML>