Mark up some literal text as such in order to make it easier

to tell the literal text from the surrounding body text.
This commit is contained in:
Yaroslav Tykhiy 2005-09-12 17:06:07 +00:00
parent 9e1d1c1566
commit bb532247a5
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=25616

View file

@ -946,14 +946,18 @@ nsgmls:example.sgml:6:8:E: end tag for "HEAD" which is not finished</screen>
document.</para>
<para>You can also use general entities to enter characters that you
could not otherwise include in an SGML document. For example, &lt;
and &amp; cannot normally appear in an SGML document. When the SGML
parser sees the &lt; symbol it assumes that a tag (either a start tag
or an end tag) is about to appear, and when it sees the &amp; symbol
could not otherwise include in an SGML document. For example,
<literal>&lt;</literal> and <literal>&amp;</literal> cannot
normally appear in an SGML document. When the SGML
parser sees the <literal>&lt;</literal>
symbol it assumes that a tag (either a start tag
or an end tag) is about to appear, and when it sees the
<literal>&amp;</literal> symbol
it assumes the next text will be the name of an entity.</para>
<para>Fortunately, you can use the two general entities &amp;lt; and
&amp;amp; whenever you need to include one or other of these.</para>
<para>Fortunately, you can use the two general entities
<literal>&amp;lt;</literal> and <literal>&amp;amp;</literal>
whenever you need to include one or other of these.</para>
<para>A general entity can only be defined within an SGML context.
Typically, this is done immediately after the DOCTYPE
@ -1369,22 +1373,28 @@ nsgmls:example.sgml:6:8:E: end tag for "HEAD" which is not finished</screen>
<para><literal>CDATA</literal> is for <quote>Character Data</quote>.
If the parser is in this content model then it is expecting to see
characters, and characters only. In this model the &lt; and &amp;
characters, and characters only. In this model the
<literal>&lt;</literal> and <literal>&amp;</literal>
symbols lose their special status, and will be treated as ordinary
characters.</para>
<para><literal>RCDATA</literal> is for <quote>Entity references and
character data</quote> If the parser is in this content model then it
is expecting to see characters <emphasis>and</emphasis> entities.
&lt; loses its special status, but &amp; will still be treated as
<literal>&lt;</literal> loses its special status, but
<literal>&amp;</literal> will still be treated as
starting the beginning of a general entity.</para>
<para>This is particularly useful if you are including some verbatim
text that contains lots of &lt; and &amp; characters. While you
could go through the text ensuring that every &lt; is converted to a
&amp;lt; and every &amp; is converted to a &amp;amp;, it can be
text that contains lots of <literal>&lt;</literal> and
<literal>&amp;</literal> characters. While you
could go through the text ensuring that every
<literal>&lt;</literal> is converted to a
<literal>&amp;lt;</literal> and every <literal>&amp;</literal>
is converted to a <literal>&amp;amp;</literal>, it can be
easier to mark the section as only containing CDATA. When the SGML
parser encounters this it will ignore the &lt; and &amp; symbols
parser encounters this it will ignore the
<literal>&lt;</literal> and <literal>&amp;</literal> symbols
embedded in the content.</para>
<note>
@ -1402,7 +1412,8 @@ nsgmls:example.sgml:6:8:E: end tag for "HEAD" which is not finished</screen>
<title>Using a CDATA marked section</title>
<programlisting>&lt;para>Here is an example of how you would include some text
that contained many &amp;lt; and &amp;amp; symbols. The sample
that contained many &lt;literal>&amp;lt;&lt;/literal>
and &lt;literal>&amp;amp;&lt;/literal> symbols. The sample
text is a fragment of HTML. The surrounding text (&lt;para> and
&lt;programlisting>) are from DocBook.&lt;/para>