Debian Codegraph @

en/ch02.xml

raw symbols SCIP
1 <chapter id="ch-create">
2 <?dbhtml filename="ch02.html"?>
3 <chapterinfo>
4 <pubdate>$Date$</pubdate>
5 <releaseinfo>$Revision$</releaseinfo>
6 </chapterinfo>
7 <title>Creating DocBook Documents</title>
8 <para>
9 <indexterm id="DocBookDocch02" class='startofrange'>
10 <primary>DocBook DTD</primary>
11 <secondary>documents</secondary>
12 <tertiary>creating in SGML</tertiary>
13 </indexterm>
14 <indexterm id="documentsDocBookch02" class='startofrange'>
15 <primary>documents</primary>
16 <secondary>creating</secondary>
17 <tertiary>DocBook</tertiary>
18 </indexterm>This chapter explains in concrete, practical terms how to
19 make DocBook documents. It's an overview of all the kinds of markup
20 that are possible in DocBook documents. It explains how to create
21 several kinds of DocBook documents: books, sets of books, chapters,
22 articles, and reference manual entries. The idea is to give you enough
23 basic information to actually start writing. The information here is
24 intentionally skeletal; you can find &ldquo;the details&rdquo; in the
25 reference section of this book.
26 </para>
27 <para>
28 Before we can examine DocBook markup, we have to take a look at what
29 an &SGML; or &XML; system requires.
30 </para>
31 <sect1 id="ch02-makesgml"><title>Making an &SGML; Document</title>
32 <para>
33 <indexterm><primary>SGML</primary>
34 <secondary>documents, creating</secondary></indexterm>
35
36 <indexterm><primary>prologue</primary>
37 <secondary>SGML documents</secondary></indexterm>
38 &SGML; requires that your document have a specific prologue. The
39 following sections describe the features of the prologue.
40 </para>
41 <sect2><title>An &SGML; Declaration</title>
42 <para>
43 <indexterm><primary>SGML</primary>
44 <secondary>declarations</secondary></indexterm>
45 <indexterm><primary>declarations</primary>
46 <secondary>SGML documents</secondary></indexterm>
47
48 &SGML; documents begin with an optional &SGML; Declaration. The
49 declaration can precede the document instance, but generally it is
50 stored in a separate file that is associated with the &DTD;. The
51 &SGML; Declaration is a grab bag of &SGML; defaults. DocBook includes
52 an &SGML; Declaration that is appropriate for most DocBook documents,
53 so we won't go into a lot of detail here about the &SGML; Declaration.
54 </para>
55 <para>
56 <indexterm><primary>markup</primary>
57 <secondary>delimiters (characters)</secondary></indexterm>
58 <indexterm><primary>tags</primary>
59 <secondary>names</secondary>
60 <tertiary>SGML declaration</tertiary></indexterm>
61 <indexterm><primary>attributes</primary>
62 <secondary>names</secondary></indexterm>
63 <indexterm><primary>characters</primary>
64 <secondary>SGML declaration</secondary></indexterm>
65 <indexterm><primary>minimization</primary>
66 <secondary>markup</secondary></indexterm>
67 <indexterm><primary>markup</primary>
68 <secondary>minimization</secondary></indexterm>
69
70 In brief, the &SGML; Declaration describes, among other things, what
71 characters are markup delimiters (the default is angle brackets), what
72 characters can compose tag and attribute names (usually the
73 alphabetical and numeric characters plus the dash and the period),
74 what characters can legally occur within your document, how long
75 &SGML; &ldquo;names&rdquo; and &ldquo;numbers&rdquo; can be, what sort
76 of minimizations (abbreviation of markup) are allowed, and so
77 on. Changing the &SGML; Declaration is rarely necessary, and because
78 many tools only partially support changes to the declaration, changing
79 it is best avoided, if possible.
80 </para>
81 <para>
82 <indexterm><primary>tutorial, SGML Declaration</primary></indexterm>
83
84 Wayne Wholer has written an excellent tutorial on the &SGML;
85 Declaration; if you're interested in more details, see <ulink url="http://www.oasis-open.org/cover/wlw11.html">http://www.oasis-open.org/cover/wlw11.html</ulink>.
86 </para>
87 </sect2>
88 <sect2><title>A Document Type Declaration</title>
89 <para>
90 <indexterm><primary>SGML</primary>
91 <secondary>document type declaration</secondary></indexterm>
92 <indexterm><primary>document type declaration</primary>
93 <secondary>SGML documents</secondary></indexterm>
94 <indexterm><primary>declarations</primary>
95 <secondary>document type declaration</secondary></indexterm>
96 <indexterm><primary>declarations</primary>
97 <secondary>document type declaration</secondary>
98 <tertiary>SGML</tertiary></indexterm>
99
100 All &SGML; documents must begin with a document type declaration. This
101 identifies the &DTD; that will be used by the document and what the
102 root element of the document will be. A typical doctype declaration
103 for a DocBook document looks like this:
104 </para>
105 <screen>&lt;!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V3.1//EN"></screen>
106 <para>
107 <indexterm><primary>root element</primary>
108 <secondary>document type declaration</secondary></indexterm>
109 <indexterm><primary>elements</primary>
110 <secondary>root element</secondary></indexterm>
111 This declaration indicates that the <firstterm>root element</firstterm>,
112 which is the first element in the hierarchical structure of the
113 document, will be <sgmltag class="starttag">book</sgmltag> and that
114 the &DTD; used will be the one identified by the public identifier
115 <literal>-//OASIS//DTD DocBook V3.1//EN</literal>. See <xref linkend="ch.create.pubids"/>&rdquo; later in this chapter.
116 </para>
117 </sect2>
118 <sect2>
119 <title>An Internal Subset</title>
120 <para>
121 <indexterm><primary>internal subset</primary>
122 <secondary>SGML document declarations</secondary></indexterm>
123
124 It's also possible to provide additional declarations in a document
125 by placing them in the document type declaration:</para>
126 <screen>&lt;!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V3.1//EN" [
127 &lt;!ENTITY nwalsh "Norman Walsh">
128 &lt;!ENTITY chap1 SYSTEM "chap1.sgm">
129 &lt;!ENTITY chap2 SYSTEM "chap2.sgm">
130 ]></screen>
131
132 <para>
133 <indexterm><primary>external subset</primary>
134 <secondary>SGML document declarations</secondary></indexterm>
135 <indexterm><primary>public identifiers</primary>
136 <secondary>SGML</secondary></indexterm>
137 <indexterm><primary>system identifiers</primary>
138 <secondary>SGML</secondary></indexterm>
139
140 These declarations form what is known as the
141 <firstterm>internal subset</firstterm>. The declarations stored in the
142 file referenced by the public or system identifier in the
143 <literal>DOCTYPE</literal> declaration is called the <firstterm>external
144 subset</firstterm> and it is technically optional.
145 It is legal to put the &DTD; in the internal
146 subset and to have no external subset, but for a &DTD; as large
147 as DocBook that wouldn't make much sense.
148 </para>
149
150 <note>
151 <para>
152 <indexterm><primary>parsing</primary>
153 <secondary>order</secondary></indexterm>
154 The internal subset is parsed <emphasis>first</emphasis>
155 and, if multiple declarations for an entity occur, the first
156 declaration is used. Declarations in the internal subset
157 override declarations in the external subset.</para>
158 </note>
159 </sect2>
160 <sect2>
161 <title>The Document (or Root) Element</title>
162 <para>
163 <indexterm><primary>elements</primary>
164 <secondary>root element</secondary></indexterm>
165 <indexterm><primary>root element</primary>
166 <secondary>placement</secondary></indexterm>
167
168 Although comments and processing instructions may occur between the
169 document type declaration and the root element, the root element usually
170 immediately follows the document type declaration:</para>
171 <screen>&lt;!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V3.1//EN" [
172 &lt;!ENTITY nwalsh "Norman Walsh">
173 &lt;!ENTITY chap1 SYSTEM "chap1.sgm">
174 &lt;!ENTITY chap2 SYSTEM "chap2.sgm">
175 ]>
176 &lt;book>
177 &amp;chap1;
178 &amp;chap2;
179 &lt;/book></screen>
180 <para>You cannot place the root element of
181 the document in an external entity.</para>
182 </sect2>
183 <sect2 id="ch02-typexml"><title>Typing an &SGML; Document</title>
184 <para>
185 <indexterm><primary>Emacs text editor</primary></indexterm>
186 <indexterm><primary>vi text editor</primary></indexterm>
187 <indexterm><primary>SGML</primary>
188 <secondary>text editors, entering through</secondary></indexterm>
189 <indexterm><primary>text editors</primary>
190 <secondary>SGML, entering</secondary></indexterm>
191
192 If you are entering &SGML; using a text editor such as
193 <application>Emacs</application> or <application>vi</application>, there are a few things to
194 keep in mind.<footnote>
195 <para>
196 Many of these things are influenced by the &SGML; declaration in use.
197 For the purpose of this discussion, we assume you are using the
198 standard DocBook declaration.
199 </para>
200 </footnote>
201 Using a structured text editor designed for &SGML; hides most of these
202 issues.
203 </para>
204 <itemizedlist>
205 <listitem><para>
206 <indexterm><primary>elements</primary>
207 <secondary>case sensitivity (DocBook)</secondary></indexterm>
208 <indexterm><primary>case sensitivity</primary>
209 <secondary>elements (DocBook)</secondary></indexterm>
210 <indexterm><primary>attributes</primary>
211 <secondary>case sensitivity (DocBook)</secondary></indexterm>
212 <indexterm><primary>case sensitivity</primary>
213 <secondary>attributes (DocBook)</secondary></indexterm>
214
215 DocBook element and attribute names are not case-sensitive. There's
216 no difference between <sgmltag class='starttag'>Para</sgmltag> and <sgmltag class='starttag'>pArA</sgmltag>. Entity names are case-sensitive, however.
217 </para>
218 <para>
219 <indexterm><primary>SGML</primary>
220 <secondary>XML/SGML compatibility</secondary>
221 <tertiary>case sensitivity</tertiary></indexterm>
222
223 <indexterm><primary>XML</primary>
224 <secondary>SGML/XML compatibility</secondary>
225 <tertiary>case sensitivity, attributes and elements</tertiary></indexterm>
226 <indexterm><primary>compatibility, SGML/XML conversion</primary>
227 <secondary>case sensitivity, attribute and element names</secondary></indexterm>
228 If you are interested in future &XML; compatibility, input all
229 element and attribute names strictly in lowercase.
230 </para>
231 </listitem>
232 <listitem><para>
233 <indexterm><primary>SGML</primary>
234 <secondary>XML/SGML compatibility</secondary>
235 <tertiary>quotes, attribute values</tertiary></indexterm>
236 <indexterm><primary>XML</primary>
237 <secondary>SGML/XML compatibility</secondary>
238 <tertiary>quotes, attribute values</tertiary></indexterm>
239 <indexterm><primary>quotes</primary>
240 <secondary>attribute values</secondary>
241 <tertiary>spaces and punctuation characters</tertiary></indexterm>
242 <indexterm><primary>attributes</primary>
243 <secondary>values</secondary>
244 <tertiary>quoting</tertiary></indexterm>
245 <indexterm><primary>spaces, quoting (attribute values)</primary></indexterm>
246 <indexterm><primary>punctuation characters, quoting (attribue values)</primary></indexterm>
247
248 If attribute values contain spaces or punctuation characters, you must
249 quote them. You are not required to quote attribute values if they
250 consist of a single word or number, although it is not wrong to do so.
251 </para>
252 <para>
253 <indexterm><primary>straight single quotes (attribute values)</primary></indexterm>
254 <indexterm><primary>straight double quotes (attribute values)</primary></indexterm>
255 <indexterm><primary>curly quotes (attribute values)</primary></indexterm>
256 When quoting attribute values, you can use either a straight single
257 quote (&apos;), or a straight double quote (&quot;). Don't use the
258 &ldquo;curly&rdquo; quotes (&ldquo; and &rdquo;) in your editing tool.
259 </para>
260 <para>
261 <indexterm><primary>compatibility, SGML/XML conversion</primary>
262 <secondary>attribute values, quoting</secondary></indexterm>
263 If you are interested in future &XML; compatibility, always
264 quote all attribute values.
265 </para>
266 </listitem>
267 <listitem><para>
268
269 <indexterm><primary>SGML</primary>
270 <secondary>XML/SGML compatibility</secondary>
271 <tertiary>empty tags</tertiary></indexterm>
272 <indexterm><primary>XML</primary>
273 <secondary>SGML/XML compatibility</secondary>
274 <tertiary>empty tags</tertiary></indexterm>
275 <indexterm><primary>compatibility, SGML/XML conversion</primary>
276 <secondary>empty tags</secondary></indexterm>
277 <indexterm><primary>tags</primary>
278 <secondary>empty</secondary></indexterm>
279 <indexterm><primary>empty tags</primary></indexterm>
280 Several forms of markup minimization are allowed, including empty
281 tags. Instead of typing the entire end tag for an element, you can
282 type simply <literal>&lt;/></literal>. For example:
283 </para>
284 <screen>
285 <![CDATA[
286 <para>
287 This is <emphasis>important</>: never stick the tines of a fork
288 in an electrical outlet.
289 </para>
290 ]]>
291 </screen>
292 <para>
293 You can use this technique for any and every tag, but it will make
294 your documents very hard to understand and difficult to debug if you
295 introduce errors. It is best to use this technique
296 only for inline elements containing a short string of text.
297 </para>
298 <para>
299 <indexterm><primary>start tags</primary>
300 <secondary>empty, using (SGML documents)</secondary></indexterm>
301 <indexterm><primary>parsing</primary>
302 <secondary>empty start tags, problems with</secondary></indexterm>
303 Empty start tags are also possible, but may be even more confusing.
304 For the record, if you encounter an empty start tag, the &SGML; parser uses
305 the element that ended last:
306 </para>
307 <screen>
308 <![CDATA[
309 <para>
310 This is <emphasis>important</emphasis>. So is <>this</emphasis>.
311 </para>
312 ]]>
313 </screen>
314 <para>
315 Both <quote>important</quote> and <quote>this</quote> are emphasized.
316 </para>
317 <para>
318 <indexterm><primary>markup</primary>
319 <secondary>minimization</secondary>
320 <tertiary>SGML/XML conversion problems</tertiary></indexterm>
321 <indexterm><primary>minimization</primary>
322 <secondary>markup</secondary>
323 <tertiary>SGML/XML conversion problems</tertiary></indexterm>
324 If you are interested in future &XML; compatibility, don't use any
325 of these tricks.
326 </para>
327 </listitem>
328 <listitem>
329 <para>
330 The null end tag (net) minimization feature allows constructions like this:
331 </para>
332 <screen>
333 <![CDATA[
334 <para>
335 This is <emphasis/important/: never stick the tines of a fork
336 in an electrical outlet.
337 </para>
338 ]]>
339 </screen>
340 <para>
341 <indexterm><primary>start tags</primary>
342 <secondary>minimization</secondary></indexterm>
343 If, instead of ending a start tag with <literal>></literal>, you end
344 it with a slash, then the next occurrence of a slash ends the element.
345 </para>
346 <para>
347 <indexterm><primary>minimization</primary>
348 <secondary>markup</secondary>
349 <tertiary>net tag minimization</tertiary></indexterm>
350 <indexterm><primary>XML</primary>
351 <secondary>SGML/XML compatibility</secondary>
352 <tertiary>net tag minimization</tertiary></indexterm>
353 <indexterm><primary>SGML</primary>
354 <secondary>XML/SGML compatibility</secondary>
355 <tertiary>net tag minimization</tertiary></indexterm>
356
357 If you are interested in future &XML; compatibility, don't use
358 net tag minimization either.
359 </para>
360 </listitem>
361 </itemizedlist>
362 <para>
363 If you are willing to modify both the declaration and the &DTD;, even more
364 dramatic minimizations are possible, including completely omitted tags
365 and <quote>shortcut</quote> markup.
366 </para>
367
368 <note><title>Removing Minimizations</title>
369 <para>
370 <indexterm><primary>markup</primary>
371 <secondary>minimization</secondary>
372 <tertiary>removing</tertiary></indexterm>
373 <indexterm><primary>minimization</primary>
374 <secondary>removing</secondary></indexterm>
375
376 Although we've made a point of reminding you about which of these
377 minimization features are not valid in &XML;, that's not really a
378 sufficient reason to avoid using them. (The fact that many of the
379 minimization features can lead to confusing, difficult-to-author
380 documents might be.)
381 </para>
382 <para>
383 <indexterm><primary>SGML</primary>
384 <secondary>XML/SGML compatibility</secondary>
385 <tertiary>markup minimizations, removing</tertiary></indexterm>
386 <indexterm><primary>XML</primary>
387 <secondary>SGML/XML compatibility</secondary>
388 <tertiary>markup minimizations, removing</tertiary></indexterm>
389 <indexterm><primary>sgmlnorm (SGML to XML conversion)</primary></indexterm>
390 If you want to convert one of these documents to &XML; at some point
391 in the future, you can run it through a program like
392 <command>sgmlnorm</command>, which will remove all the minimizations and
393 insert the correct, verbose markup. The <command>sgmlnorm</command> program
394 is part of the <ulink url="http://www.jclark.com/">SP and Jade
395 distributions</ulink>, which are on <link linkend="app-cdrom">the
396 <acronym>CD-ROM</acronym></link>.
397 </para>
398 </note>
399
400 </sect2>
401 </sect1>
402 <sect1 id="ch02-makexml">
403 <title>Making an &XML; Document</title>
404 <para>
405 <indexterm><primary>XML</primary>
406 <secondary>DocBook documents, creating</secondary></indexterm>
407 <indexterm><primary>DocBook DTD</primary>
408 <secondary>documents</secondary>
409 <tertiary>creating in XML</tertiary></indexterm>
410 <indexterm><primary>documents</primary>
411 <secondary>creating</secondary>
412 <tertiary >in XML (DocBook)</tertiary></indexterm>
413
414 In order to create DocBook documents in &XML;, you'll need an &XML;
415 version of DocBook. We've included one on the <acronym>CD</acronym>, but it hasn't
416 been officially adopted by the <acronym>OASIS</acronym> DocBook Technical Committee yet.
417 If you're interested in the technical details, <xref linkend="app-xml"/>, describes the specific differences between
418 &SGML; and &XML; versions of DocBook.
419 </para>
420 <para>
421 <indexterm><primary>prologue</primary>
422 <secondary>XML documents</secondary></indexterm>
423
424 &XML;, like &SGML;, requires a specific prologue in your document.
425 The following sections describe the features of the &XML; prologue.
426 </para>
427 <sect2>
428 <title>An &XML; Declaration</title>
429 <para>
430 <indexterm><primary>declarations</primary>
431 <secondary>XML</secondary></indexterm>
432 <indexterm><primary>XML</primary>
433 <secondary>declarations</secondary></indexterm>
434 <indexterm><primary>versions</primary>
435 <secondary>XML, identifying</secondary></indexterm>
436 &XML; documents should begin with an &XML; declaration. Unlike the
437 &SGML; declaration, which is a grab bag of features, the &XML;
438 declaration identifies a few simple aspects of the document:</para>
439 <screen>&lt;?xml version="1.0" standalone="no"?></screen>
440 <para>Identifying the version of &XML; ensures that future changes to
441 the &XML; specification will not alter the semantics of this
442 document. The standalone declaration simply makes explicit the fact
443 that this document cannot &ldquo;stand alone,&rdquo; and that it
444 relies on an external &DTD;. The complete details of the &XML;
445 declaration are described in the <ulink url="http://www.w3.org/TR/REC-xml">&XML; specification</ulink>.
446 </para>
447 </sect2>
448 <sect2>
449 <title>A Document Type Declaration</title>
450 <para>
451 <indexterm><primary>declarations</primary>
452 <secondary>document type declaration</secondary>
453 <tertiary>XML</tertiary></indexterm>
454 <indexterm><primary>XML</primary>
455 <secondary>document type declaration</secondary></indexterm>
456 <indexterm><primary>document type declaration</primary>
457 <secondary>XML documents</secondary></indexterm>
458 <indexterm><primary>DocBook DTD</primary>
459 <secondary>XML</secondary>
460 <tertiary>document type declaration</tertiary></indexterm>
461 Strictly speaking, &XML; documents don't require a
462 &DTD;. Realistically, DocBook &XML; documents will have one.
463 </para>
464 <para>
465 <indexterm><primary>elements</primary>
466 <secondary>root element</secondary></indexterm>
467 <indexterm><primary>root element</primary>
468 <secondary>document type declaration</secondary></indexterm>
469 The document type declaration identifies the &DTD; that will be used
470 by the document and what the root element of the document will be. A
471 typical doctype declaration for a DocBook document looks like
472 this:
473 </para>
474 <screen>&lt;?xml version='1.0'?>
475 &lt;!DOCTYPE book PUBLIC "-//Norman Walsh//DTD DocBk XML V3.1.4//EN"
476 "http://nwalsh.com/docbook/xml/3.1.4/db3xml.dtd">
477 </screen>
478 <para>
479 <indexterm><primary>external declarations (XML)</primary></indexterm>
480 <indexterm><primary>public identifiers</primary>
481 <secondary>XML documents</secondary></indexterm>
482 <indexterm><primary>system identifiers</primary>
483 <secondary>XML</secondary></indexterm>
484 This declaration indicates that the root element will be <sgmltag class="starttag">book</sgmltag> and that the &DTD; used will be the
485 one indentified by the public identifier <literal>-//Norman Walsh//DTD
486 DocBk XML V3.1.4//EN</literal>. External declarations in &XML; must
487 include a system identifier (the public identifier is optional). In
488 this example, the &DTD; is stored on a web server.
489 </para>
490 <para>
491 <indexterm><primary>URI</primary>
492 <secondary>XML system identifiers</secondary></indexterm>
493 System identifiers in &XML; must be <acronym>URI</acronym>s. Many
494 systems may accept filenames and interpret them locally as
495 <literal>file:</literal> <acronym>URL</acronym>s, but it's always
496 correct to fully qualify them.
497 </para>
498 </sect2>
499 <sect2>
500 <title>An Internal Subset</title>
501 <para>
502 <indexterm><primary>declarations</primary>
503 <secondary>document type declaration</secondary>
504 <tertiary>XML</tertiary></indexterm>
505 <indexterm><primary>document type declaration</primary>
506 <secondary>internal subset</secondary></indexterm>
507 <indexterm><primary>internal subset</primary>
508 <secondary>XML document type declarations</secondary></indexterm>
509 <indexterm><primary>XML</primary>
510 <secondary>document type declarations</secondary>
511 <tertiary>internal subset</tertiary></indexterm>
512 It's also possible to provide additional declarations in a document by
513 placing them in the document type declaration:
514 </para>
515 <screen>&lt;?xml version='1.0'?>
516 &lt;!DOCTYPE book PUBLIC "-//Norman Walsh//DTD DocBk XML V3.1.4/EN"
517 "http://nwalsh.com/docbook/xml/3.1.4/db3xml.dtd" [
518 &lt;!ENTITY nwalsh "Norman Walsh">
519 &lt;!ENTITY chap1 SYSTEM "chap1.sgm">
520 &lt;!ENTITY chap2 SYSTEM "chap2.sgm">
521 ]></screen>
522 <para>
523 These declarations form what is known as the internal subset. The
524 declarations stored in the file referenced by the public or system
525 identifier in the <literal>DOCTYPE</literal> declaration is called the
526 external subset, which is technically optional. It is legal to put
527 the &DTD; in the internal subset and to have no external subset, but
528 for a &DTD; as large as DocBook, that would make very little sense.
529 </para>
530 <note>
531 <para>
532 <indexterm><primary>parsing</primary>
533 <secondary>order</secondary>
534 <tertiary>XML document declarations</tertiary></indexterm>
535
536 The internal subset is parsed <emphasis>first</emphasis> in &XML; and,
537 if multiple declarations for an entity occur, the first declaration is used.
538 Declarations in the internal subset override declarations in the external
539 subset.</para>
540 </note>
541 </sect2>
542 <sect2>
543 <title>The Document (or Root) Element</title>
544 <para>
545 <indexterm><primary>root element</primary></indexterm>
546 <indexterm><primary>elements</primary>
547 <secondary>root element</secondary></indexterm>
548 Although comments and processing instructions may occur between the
549 document type declaration and the root element, the root element usually
550 immediately follows the document type declaration:</para>
551 <screen>&lt;?xml version='1.0'?>
552 &lt;!DOCTYPE book PUBLIC "-//Norman Walsh//DTD DocBk XML V3.1.4//EN"
553 "http://nwalsh.com/docbook/xml/3.1.4/db3xml.dtd" [
554 &lt;!ENTITY nwalsh "Norman Walsh">
555 &lt;!ENTITY chap1 SYSTEM "chap1.sgm">
556 &lt;!ENTITY chap2 SYSTEM "chap2.sgm">
557 ]>
558 &lt;book>...&lt;/book></screen>
559 <para>The important point is that the root element must be physically
560 present immediately
561 after the document type declaration. You cannot place the root element of
562 the document in an external entity.</para>
563 </sect2>
564
565 <sect2><title>Typing an &XML; Document</title>
566 <para>
567 <indexterm><primary>text editors</primary></indexterm>
568
569 If you are entering &SGML; using a text editor such as <application>Emacs</application>
570 or <application>vi</application>, there are a few things to keep in mind.
571 Using a structured text editor designed for
572 &XML; hides most of these issues.
573 </para>
574 <itemizedlist>
575 <listitem><para>
576 <indexterm><primary>case sensitivity</primary>
577 <secondary>markup</secondary></indexterm>
578 <indexterm><primary>markup</primary>
579 <secondary>case sensitivity</secondary></indexterm>
580 <indexterm><primary>compatibility, SGML/XML conversion</primary>
581 <secondary>XML markup, case-sensitivity</secondary></indexterm>
582
583 In &XML;, all markup is case-sensitive. In the &XML; version of DocBook,
584 you must always type all element,
585 attribute, and entity names in lowercase.
586 </para>
587 </listitem>
588 <listitem><para>
589 You are required to quote all attribute values in &XML;.
590 </para>
591 <para>
592 <indexterm><primary>quotes</primary>
593 <secondary>attribute values</secondary></indexterm>
594
595 When quoting attribute values, you can use either a straight single
596 quote (&apos;), or a straight double quote (&quot;). Don't use the
597 &ldquo;curly&rdquo; quotes (&ldquo; and &rdquo;) in your editing tool.
598 </para>
599 </listitem>
600 <listitem>
601 <para>
602 <indexterm><primary>empty elements</primary>
603 <secondary>markup syntax</secondary></indexterm>
604
605 Empty elements in &XML; are marked with a distinctive syntax:
606 <literal>&lt;xref/></literal>.
607 </para>
608 </listitem>
609 <listitem>
610 <indexterm><primary>XML</primary>
611 <secondary>question marks (?), processing instructions</secondary></indexterm>
612 <para>Processing instructions in &XML; begin and end with a question mark:
613 <literal>&lt;?pitarget data?></literal>.
614 </para>
615 </listitem>
616 <listitem><para>
617 <indexterm><primary>XML</primary>
618 <secondary>interoperability, SGML and XML</secondary></indexterm>
619
620 &XML; was designed to be served, received, and processed over the
621 Web. Two of its most important design principles are ease of
622 implementation and interoperability with both &SGML; and &HTML;.
623 </para>
624 <para>
625 <indexterm><primary>SGML</primary>
626 <secondary>XML/SGML compatibility</secondary>
627 <tertiary>markup minimization, problems</tertiary></indexterm>
628
629 <indexterm><primary>SGML</primary>
630 <secondary>markup minimization</secondary><see>XML/SGML compatibility</see></indexterm>
631 <indexterm><primary>XML</primary>
632 <secondary>markup minimization</secondary><see>SGML/XML compatibility</see></indexterm>
633 <indexterm><primary>XML</primary>
634 <secondary>SGML/XML compatibility</secondary>
635 <tertiary>markup minization, problems</tertiary></indexterm>
636
637 The markup minimization features in &SGML; documents make it more
638 difficult to process, and harder to write a parser to interpret it; these
639 minimization features also run counter to the &XML; design principles
640 named above. As a result, &XML; does not support them.
641 </para>
642 <para>
643 Luckily, a good authoring environment can offer all of the features of
644 markup minimization without interfering with the interoperability of
645 documents. And because &XML; tools are easier to write, it's likely
646 that good, inexpensive &XML; authoring environments will be available
647 eventually.
648 </para>
649 </listitem>
650 </itemizedlist>
651 </sect2>
652 <sect2>
653 <title>&XML; and &SGML; Markup Considerations in This Book</title>
654 <para>
655 <indexterm><primary>DocBook DTD</primary>
656 <secondary>markup considerations, SGML vs. XML</secondary></indexterm>
657
658 Conceptually, almost everything in this book applies equally to &SGML;
659 and &XML;. But because DocBook V3.1 is an &SGML; &DTD;, we naturally
660 tend to use &SGML; conventions in our writing. If you're primarily
661 interested in &XML;, there are just a few small details to keep in
662 mind.
663 </para>
664 <itemizedlist>
665 <listitem>
666 <para>
667 <indexterm><primary>case sensitivity</primary>
668 <secondary>XML vs. SGML</secondary></indexterm>
669 <indexterm><primary>SGML</primary>
670 <secondary>case sensitivity</secondary></indexterm>
671 <indexterm><primary>elements</primary>
672 <secondary>case sensitivity (XML)</secondary></indexterm>
673 &XML; is case-sensitive, while the &SGML; version of DocBook is
674 not. In this book, we've chosen to present the element names using
675 mixed case (<sgmltag>Book</sgmltag>, <sgmltag>indexterm</sgmltag>,
676 <sgmltag>XRef</sgmltag>, and so on), but in the DocBook &XML; &DTD;,
677 all element, attribute, and entity names are strictly
678 lowercase.</para>
679 </listitem>
680 <listitem>
681 <para>
682 <indexterm><primary>empty elements</primary>
683 <secondary>start tags, XML vs. SGML</secondary></indexterm>
684 <indexterm><primary>start tags</primary>
685 <secondary>empty element</secondary></indexterm>
686 Empty element start tags in &XML; are marked with a distinctive
687 syntax: <literal>&lt;xref/></literal>. In &SGML;, the trailing slash
688 is not present, so some of our examples need slight revisions to be
689 valid &XML; elements.
690 </para>
691 </listitem>
692 <listitem>
693 <para>
694 <indexterm><primary>question marks (?), processing instructions (XML)</primary></indexterm>
695 <indexterm><primary>processing instructions</primary>
696 <secondary>XML documents</secondary></indexterm>
697 <indexterm><primary>XML</primary>
698 <secondary>processing instructions</secondary></indexterm>
699
700 Processing instructions in &XML; begin and end with a question
701 mark: <literal>&lt;?pitarget data?></literal>. In &SGML;, the
702 trailing question mark is not present, so some of our examples need
703 slight revisions to be valid &XML; elements.
704 </para>
705 </listitem>
706 <listitem>
707 <para>
708 <indexterm><primary>system identifiers</primary>
709 <secondary>XML</secondary>
710 <tertiary>URI requirement</tertiary></indexterm>
711 <indexterm><primary>Uniform Resource Indicators</primary><see>URI</see></indexterm>
712 <indexterm><primary>public identifiers</primary>
713 <secondary>DocBook DTD</secondary>
714 <tertiary>examples</tertiary></indexterm>
715 Generally we use public identifiers in examples, but whenever system
716 identifiers are used, don't forget that &XML; system identifiers must
717 be Uniform Resource Indicators (<acronym>URI</acronym>s), in which
718 &SGML; system identifiers are usually simple filenames.
719 </para>
720 </listitem>
721 </itemizedlist>
722 <para>
723 For a more detailed discussion of DocBook and &XML;, see
724 <xref linkend="app-xml"/>.
725 </para>
726 </sect2>
727 </sect1>
728 <sect1 id="s-pid-sid-catalogs">
729 <title>Public Identifiers, System Identifiers, and Catalog Files</title>
730 <para>
731 <indexterm><primary>files</primary>
732 <secondary>external, referencing</secondary></indexterm>
733 <indexterm><primary>XML</primary>
734 <secondary>external file references, id</secondary></indexterm>
735
736 When a &DTD; or other external file is referenced from a document, the
737 reference can be specified in three ways: using a <firstterm>public
738 identifier</firstterm>, a <firstterm>system identifier</firstterm>, or
739 both. In &XML;, the system identifier is <emphasis>generally</emphasis>
740 required and the public identifier is optional. In &SGML;, neither is
741 required, but at least one must be present.<footnote>
742 <para>
743 This is not absolutely true. &SGML; allows for the possibility that
744 the reference could be implied by the application, but this is very
745 rarely the case.
746 </para>
747 </footnote>
748 </para>
749 <para>
750 <indexterm><primary>public identifiers</primary>
751 <secondary>names, requirements</secondary></indexterm>
752 A public identifier is a globally unique, abstract
753 name, such as the following, which is the official public identifier
754 for DocBook <acronym>V3.1</acronym>:
755 <screen>-//OASIS//DTD DocBook V3.1//EN</screen>
756 </para>
757 <para>
758 <indexterm><primary>SGML</primary>
759 <secondary>system identifiers</secondary></indexterm>
760 <indexterm><primary>URI</primary>
761 <secondary>XML system identifiers</secondary></indexterm>
762 <indexterm><primary>URL</primary>
763 <secondary>SGML system identifers, similarity to</secondary></indexterm>
764 <indexterm><primary>Uniform Resource Locator</primary><see>URL</see></indexterm>
765 <indexterm><primary>Uniform Resource Names</primary><see>URN</see></indexterm>
766 <indexterm><primary>URN</primary>
767 <secondary>XML system identifiers, future</secondary></indexterm>
768 The introduction of &XML; has added some small complications to system
769 identifiers. In &SGML;, a system identifier generally points to a
770 single, local version of a file using local system conventions. In
771 &XML;, it must point with a Uniform Resource Indicator
772 (<acronym>URI</acronym>). The most common <acronym>URI</acronym>
773 today is the Uniform Resource Locator (<acronym>URL</acronym>), which
774 is familiar to anyone who browses the Web. <acronym>URL</acronym>s
775 are a lot like &SGML; system identifiers, because they generally point
776 to a single version of a file on a particular machine. In the future,
777 Uniform Resource Names (<acronym>URN</acronym>), another form of
778 <acronym>URI</acronym>, will allow &XML; system identifiers to have
779 the abstract characteristics of public identifiers.
780 </para>
781 <para>
782 <indexterm><primary>SGML</primary>
783 <secondary>system identifiers</secondary>
784 <tertiary>example</tertiary></indexterm>
785 <indexterm><primary>system identifiers</primary>
786 <secondary>SGML</secondary>
787 <tertiary>example</tertiary></indexterm>
788
789 The following filename is an example of an &SGML; system identifier:
790 <screen>/usr/local/sgml/docbook/3.1/docbook.dtd
791 </screen>
792 An equivalent &XML; system identifier might be:
793 <screen>file:///usr/local/sgml/docbook/3.1/docbook.dtd
794 </screen>
795 </para>
796 <para>
797 The advantage of using the public identifier is that it makes your
798 documents more portable. For any system on which DocBook is installed,
799 the public identifier will resolve to the appropriate local version of
800 the &DTD; (if public identifiers can be resolved at all).
801 </para>
802 <para>
803 Public identifiers have two disadvantages:
804 <itemizedlist>
805 <listitem>
806 <para>Because &XML; does not require them, and because system
807 identifiers are required, developing &XML; tools may not provide
808 adequate support for public identifiers. To work with these systems
809 you must use system identifiers.</para>
810 </listitem>
811 <listitem>
812 <para>
813 <indexterm><primary>public identifiers</primary>
814 <secondary>resolution, mapping to system identifiers</secondary></indexterm>
815 <indexterm><primary>OASIS</primary>
816 <secondary>public identifiers, resolution mechanism</secondary></indexterm>
817
818 Public identifiers aren't magical. They're simply a method of
819 indirection. For them to work, there must be a resolution mechanism
820 for public identifiers. Luckily, several years ago, &SGML; Open (now
821 <ulink url="http://www.oasis-open.org/"><acronym>OASIS</acronym></ulink>)
822 described a standard mechanism for mapping public identifiers to
823 system identifers using catalog files.</para>
824 <para>
825 See <ulink url="http://www.oasis-open.org/html/a401.htm"><acronym>OASIS</acronym>
826 Technical Resolution 9401:1997 (Amendment 2 to <acronym>TR</acronym>
827 9401).</ulink>
828 </para>
829 </listitem>
830 </itemizedlist></para>
831 <sect2 id="ch.create.pubids">
832 <title>Public Identifiers</title>
833 <para>
834 <indexterm><primary>uniqueness</primary>
835 <secondary>public identifiers</secondary></indexterm>
836 An important characteristic of public identifiers is that they are
837 <emphasis>globally unique</emphasis>. Referring to a document with a
838 public identifier should mean that the identifier will resolve to the
839 same actual document on any system even though the location of that
840 document on each system may vary. As a rule, you should never reuse
841 public identifiers, and a published revision should have a new public
842 identifier. Not following these rules defeats one purpose of the
843 public identifier.
844 </para>
845 <para>
846 <indexterm><primary>public identifiers</primary>
847 <secondary>syntax, examples</secondary></indexterm>
848 A public identifier can be any string of upper- and lowercase letters,
849 digits, any of the following symbols: &ldquo;'&rdquo;,
850 &ldquo;(&ldquo;, &ldquo;)&rdquo;, &ldquo;+&rdquo;, &ldquo;,&rdquo;,
851 &ldquo;-&rdquo;, &ldquo;.&rdquo;, &ldquo;/&rdquo;, &ldquo;:&rdquo;,
852 &ldquo;=&rdquo;, &ldquo;?&rdquo;, and white space, including line
853 breaks.
854 </para>
855 <sect3>
856 <title>Formal public identifiers</title>
857 <para>
858 <indexterm><primary>ISO standards</primary>
859 <secondary>formal public identifiers</secondary></indexterm>
860 <indexterm><primary>formal public identifier</primary><see>FPI</see></indexterm>
861 <indexterm><primary>FPI</primary>
862 <secondary>format, standard</secondary></indexterm>
863 Most public identifiers conform to the <acronym>ISO</acronym> 8879
864 standard that defines <firstterm>formal public
865 identifiers</firstterm>. Formal public identifiers, frequently referred
866 to as <acronym>FPI</acronym>, have a prescribed format that can ensure
867 uniqueness:<footnote>
868 <para>
869 Essentially, it can ensure that two different owners won't
870 accidentally tread on each other. Nothing can prevent a given owner
871 from reusing public identifiers, except maybe common sense.
872 </para>
873 </footnote>
874 </para>
875 <screen><replaceable>prefix</replaceable>//<replaceable>owner-identifier</replaceable>//<replaceable>
876 text-class</replaceable> <replaceable>text-description</replaceable>//<replaceable>
877 language</replaceable>//<replaceable>display-version</replaceable></screen>
878 <para>
879 Here are descriptions of the identifiers in this string:
880 <variablelist>
881 <varlistentry>
882 <term><replaceable>prefix</replaceable></term>
883 <listitem>
884 <para>
885 <indexterm><primary>prefix (registered and unregistered public identifiers)</primary></indexterm>
886 <indexterm><primary>registered public identifiers</primary></indexterm>
887 <indexterm><primary>unregistered public identifiers</primary></indexterm>
888 <indexterm><primary>ISO standards</primary>
889 <secondary>formal public identifiers</secondary></indexterm>
890 The <replaceable>prefix</replaceable> is either a
891 &ldquo;<literal>+</literal>&rdquo; or a &ldquo;<literal>-</literal>&rdquo;
892 Registered public identifiers begin with
893 &ldquo;<literal>+</literal>&rdquo;; unregistered identifiers begin
894 with &ldquo;<literal>-</literal>&rdquo;.</para>
895 <para>
896 (<acronym>ISO</acronym> standards sometimes use a third form beginning
897 with <literal>ISO</literal> and the standard number, but this form is
898 only available to <acronym>ISO</acronym>.)
899 </para>
900 <para>
901 <indexterm><primary>owner-identifiers</primary>
902 <secondary>registered public identifers</secondary>
903 <tertiary>uniqueness, guaranteeing</tertiary></indexterm>
904
905 The purpose of registration is to guarantee a unique owner-identifier.
906 There are few authorities with the power to issue registered public
907 identifiers, so in practice unregistered identifiers are more common.
908 </para>
909 <para>
910 <indexterm><primary>public identifiers</primary>
911 <secondary>registered, assigning authority</secondary></indexterm>
912 <indexterm><primary>Graphics Communication Association (GCA)</primary>
913 <secondary>registered public identifiers, assigning</secondary></indexterm>
914 <indexterm><primary>GCA (Graphics Communication Association)</primary></indexterm>
915 <indexterm><primary>Graphics Communication Association (GCA)</primary></indexterm>
916
917 The <ulink url="http://www.gca.org/">Graphics Communication
918 Association</ulink> (<acronym>GCA</acronym>) can assign registered
919 public identifiers. They do this by issuing the applicant a unique
920 string and declaring the format of the owner identifier. For example,
921 the Davenport Group was issued the string &ldquo;A00002&rdquo; and
922 could have published DocBook using an <acronym>FPI</acronym> of the
923 following form:
924 <screen>
925 +//ISO/IEC 9070/RA::A00002//<replaceable>...</replaceable>
926 </screen>
927 </para>
928 <para>
929 <indexterm><primary>Internet domain names format (registered public identifiers)</primary></indexterm>
930 Another way to use a registered public identifier is to use the format
931 reserved for internet domain names. For example, O'Reilly can issue
932 documents using an <acronym>FPI</acronym> of the following form:
933 <screen>
934 +//IDN oreilly.com//<replaceable>...</replaceable>
935 </screen>
936 </para>
937 <para>
938 As of DocBook V3.1, the <acronym>OASIS</acronym> Technical Committee
939 responsible for DocBook has elected to use the unregistered owner
940 identifier, <literal>OASIS</literal>, thus its prefix is
941 <literal>-</literal>.
942 <screen>
943 -//OASIS//<replaceable>...</replaceable>
944 </screen>
945 </para>
946 </listitem>
947 </varlistentry>
948 <varlistentry>
949 <term><replaceable>owner-identifier</replaceable></term>
950 <listitem>
951 <para>
952 <indexterm><primary>names</primary>
953 <secondary>individuals as owner-identifiers</secondary></indexterm>
954 Identifies the person or organization that owns the identifier.
955 Registration guarantees a unique owner identifier. Short of
956 registration, some effort should be made to ensure that the owner
957 identifier is globally unique. A company name, for example, is a
958 reasonable choice as are Internet domain names. It's also not uncommon
959 to see the names of individuals used as the owner-identifier, although
960 clearly this may introduce collisions over time.
961 </para>
962 <para>
963 <indexterm><primary>DocBook DTD</primary>
964 <secondary>owner-identifier, version 3.1</secondary></indexterm>
965
966 The owner-identifier for DocBook V3.1 is
967 <literal>OASIS</literal>. Earlier versions used the owner-identifier
968 <literal>Davenport</literal>.
969 </para>
970 </listitem>
971 </varlistentry>
972 <varlistentry>
973 <term><replaceable>text-class</replaceable></term>
974 <listitem>
975 <para>
976 <indexterm><primary>text</primary>
977 <secondary>text class</secondary></indexterm>
978 <indexterm><primary>DOCUMENT text class</primary></indexterm>
979 <indexterm><primary>DTDs</primary>
980 <secondary>text class</secondary></indexterm>
981 <indexterm><primary>ELEMENTS text class</primary></indexterm>
982 <indexterm><primary>ENTITIES text class</primary></indexterm>
983 <indexterm><primary>NONSGML text class</primary></indexterm>
984
985 The text class identifies the kind of document that is
986 associated with this public identifier. Common text classes
987 are
988 <variablelist>
989 <varlistentry>
990 <term>DOCUMENT</term>
991 <listitem>
992 <para>An &SGML; or &XML; document.</para>
993 </listitem>
994 </varlistentry>
995 <varlistentry>
996 <term>DTD</term>
997 <listitem>
998 <para>A &DTD; or part of a &DTD;.</para>
999 </listitem>
1000 </varlistentry>
1001 <varlistentry>
1002 <term>ELEMENTS</term>
1003 <listitem>
1004 <para>A collection of element declarations.</para>
1005 </listitem>
1006 </varlistentry>
1007 <varlistentry>
1008 <term>ENTITIES</term>
1009 <listitem>
1010 <para>A collection of entity declarations.</para>
1011 </listitem>
1012 </varlistentry>
1013 <varlistentry>
1014 <term>NONSGML</term>
1015 <listitem>
1016 <para>Data that is not in &SGML; or &XML;.</para>
1017 </listitem>
1018 </varlistentry>
1019 </variablelist>
1020 </para>
1021 <para>
1022 DocBook is a &DTD;, thus its text class is DTD.
1023 </para>
1024 </listitem>
1025 </varlistentry>
1026 <varlistentry>
1027 <term><replaceable>text-description</replaceable></term>
1028 <listitem>
1029 <para>
1030 <indexterm><primary>text</primary>
1031 <secondary>text description</secondary></indexterm>
1032 <indexterm><primary>DocBook DTD</primary>
1033 <secondary>text description</secondary></indexterm>
1034
1035 This field provides a description of the document. The text description is
1036 free-form, but cannot include the string //.
1037 </para>
1038 <para>
1039 The text description of DocBook is <literal>DocBook V3.1</literal>.
1040 </para>
1041 <para>
1042 <indexterm><primary>proprietary DTDs, unavailable public texts</primary></indexterm>
1043 <indexterm><primary>DTDs</primary>
1044 <secondary>proprietary</secondary></indexterm>
1045 In the uncommon case of unavailable public texts
1046 (<acronym>FPI</acronym>s for proprietary &DTD;s, for example), there
1047 are a few other options available (technically in front of or in place
1048 of the text description), but they're rarely used.
1049 <footnote>
1050 <para>
1051 See Appendix A of <xref linkend="maler96"/>, for more details.
1052 </para>
1053 </footnote>
1054 </para>
1055 </listitem>
1056 </varlistentry>
1057 <varlistentry>
1058 <term><replaceable>language</replaceable></term>
1059 <listitem>
1060 <para>
1061 <indexterm><primary>languages</primary>
1062 <secondary>document texts</secondary></indexterm>
1063 <indexterm><primary>ISO standards</primary>
1064 <secondary>language codes</secondary></indexterm>
1065
1066 Indicates the language in which the document is written. It is
1067 recommended that the <acronym>ISO</acronym> standard two-letter
1068 language codes be used if possible.
1069 </para>
1070 <para>
1071 DocBook is an English-language &DTD;, thus its language is
1072 <literal>EN</literal>.
1073 </para>
1074 </listitem>
1075 </varlistentry>
1076 <varlistentry>
1077 <term><replaceable>display-version</replaceable></term>
1078 <listitem>
1079 <para>
1080 <indexterm><primary>display version</primary></indexterm>
1081
1082 This field, which is not frequently used, distinguishes between
1083 public texts that are the same except for the display device or system
1084 to which they apply.
1085 </para>
1086 <para>
1087 <indexterm><primary>FPI</primary>
1088 <secondary>ISO Latin 1 character set, examples</secondary></indexterm>
1089
1090 For example, the <acronym>FPI</acronym> for the <acronym>ISO</acronym>
1091 Latin 1 character set is:
1092 <screen>-//ISO 8879-1986//ENTITIES Added Latin 1//EN</screen>
1093 </para>
1094 <para>
1095 A reasonable <acronym>FPI</acronym> for an &XML; version of this
1096 character set is:
1097 <screen>-//ISO 8879-1986//ENTITIES Added Latin 1//EN//XML</screen>
1098 </para>
1099 </listitem>
1100 </varlistentry>
1101 </variablelist>
1102 </para>
1103 </sect3>
1104 </sect2>
1105 <sect2>
1106 <title>System Identifiers</title>
1107 <para>
1108 <indexterm><primary>system identifiers</primary></indexterm>
1109 <indexterm><primary>URI</primary>
1110 <secondary>XML system identifiers</secondary></indexterm>
1111 System identifiers are usually filenames on the local system. In
1112 &SGML;, there's no constraint on what they can be. Anything that your
1113 &SGML; processing system recognizes is allowed. In &XML;, system
1114 identifiers must be <acronym>URI</acronym>s (Uniform Resource
1115 Identifiers).
1116 </para>
1117 <para>
1118 The use of <acronym>URI</acronym>s as system identifiers introduces
1119 the possibility that a system identifier can be a
1120 <acronym>URN</acronym>. This allows the system identifier to benefit
1121 from the same global uniqueness benefit as the public identifier. It
1122 seems likely that &XML; system identifiers will eventually move in
1123 this direction.
1124 </para>
1125 </sect2>
1126 <sect2 id="s-catalog-files">
1127 <title>Catalog Files</title>
1128 <para>
1129 <indexterm><primary>catalog files</primary>
1130 <secondary>pubic identifiers, resolving to system</secondary></indexterm>
1131
1132 <firstterm>Catalog files</firstterm> are the standard mechanism for
1133 resolving public identifiers into system identifiers. Some resolution
1134 mechanism is necessary because DocBook refers to its component modules
1135 with public identifiers, and those must be mapped to actual files on
1136 the system before any piece of software can actually load them.
1137 </para>
1138 <para>
1139 <indexterm><primary>OASIS</primary>
1140 <secondary>catalog file format</secondary></indexterm>
1141 <indexterm><primary>keywords</primary>
1142 <secondary>catalog files</secondary></indexterm>
1143
1144 The catalog file format was defined in 1994 by &SGML; Open (now
1145 <acronym>OASIS</acronym>). The formal specification is contained in
1146 <acronym>OASIS</acronym> Technical Resolution 9401:1997.
1147 </para>
1148 <para>
1149 Informally, a catalog is a text file that contains a number of
1150 keyword/value pairs. The most frequently used keywords are
1151 <literal>PUBLIC</literal>, <literal>SYSTEM</literal>,
1152 <literal>SGMLDECL</literal>, <literal>DTDDECL</literal>,
1153 <literal>CATALOG</literal>, <literal>OVERRIDE</literal>,
1154 <literal>DELEGATE</literal>, and <literal>DOCTYPE</literal>.
1155 </para>
1156 <variablelist>
1157 <varlistentry><term><literal>PUBLIC</literal></term>
1158 <listitem>
1159 <para>
1160 <indexterm><primary>PUBLIC keyword</primary></indexterm>
1161
1162 The <literal>PUBLIC</literal> keyword maps public identifiers to
1163 system identifiers:</para>
1164 <screen>
1165 PUBLIC "-//OASIS//DTD DocBook V3.1//EN" "docbook/3.1/docbook.dtd"
1166 </screen>
1167 </listitem>
1168 </varlistentry>
1169 <varlistentry><term><literal>SYSTEM</literal></term>
1170 <listitem>
1171 <para>
1172 <indexterm><primary>SYSTEM keyword</primary></indexterm>
1173
1174 The <literal>SYSTEM</literal> keyword maps system identifiers to
1175 system identifiers:</para>
1176 <screen>
1177 SYSTEM "http://nwalsh.com/docbook/xml/1.3/db3xml.dtd"
1178 "docbook/xml/1.3/db3xml.dtd"
1179 </screen>
1180 </listitem>
1181 </varlistentry>
1182 <varlistentry><term><literal>SGMLDECL</literal></term>
1183 <listitem>
1184 <para>
1185 <indexterm><primary>SGMLDECL keyword</primary></indexterm>
1186
1187 The <literal>SGMLDECL</literal> keyword identifies the system
1188 identifier of the &SGML; Declaration that should be used:</para>
1189 <screen>
1190 SGMLDECL "docbook/3.1/docbook.dcl"
1191 </screen>
1192 </listitem>
1193 </varlistentry>
1194 <varlistentry><term><literal>DTDDECL</literal></term>
1195 <listitem>
1196 <para>
1197 <indexterm><primary>DTDDECL</primary></indexterm>
1198
1199 Like <literal>SGMLDECL</literal>, <literal>DTDDECL</literal>
1200 identifies the &SGML; Declaration that should be
1201 used. <literal>DTDDECL</literal> associates a declaration with a
1202 particular public identifier for a &DTD;:
1203 </para>
1204 <screen>DTDDECL "-//OASIS//DTD DocBook V3.1//EN" "docbook/3.1/docbook.dcl"
1205 </screen>
1206 <para>Unfortunately, it is not supported by the free tools that are
1207 available. The practical benefit of <literal>DTDDECL</literal> can
1208 usually be achieved, albeit in a slightly cumbersome way, with
1209 multiple catalog files.
1210 </para>
1211 </listitem>
1212 </varlistentry>
1213 <varlistentry><term><literal>CATALOG</literal></term>
1214 <listitem>
1215 <para>
1216 <indexterm><primary>CATALOG keyword</primary></indexterm>
1217
1218 The <literal>CATALOG</literal> keyword allows one catalog to
1219 include the content of another. This can make maintenance somewhat
1220 easier and allows a system to directly use the catalog files included
1221 in &DTD; distributions. For example, the DocBook distribution includes
1222 a catalog file. Rather than copying each of the declarations in that
1223 catalog into your system catalog, you can simply include the contents
1224 of the DocBook catalog:
1225 </para>
1226 <screen>CATALOG "docbook/3.1/catalog"</screen>
1227 </listitem>
1228 </varlistentry>
1229 <varlistentry><term><literal>OVERRIDE</literal></term>
1230 <listitem>
1231 <para>
1232 <indexterm><primary>OVERRIDE keyword</primary></indexterm>
1233
1234 The <literal>OVERRIDE</literal> keyword indicates whether or not
1235 public identifiers override system identifiers. If a given declaration
1236 includes both a system identifer and a public identifier, most systems
1237 attempt to process the document referenced by the system identifier,
1238 and consequently ignore the public identifier. Specifying
1239 <screen>OVERRIDE YES</screen> in the catalog informs the processing
1240 system that resolution should be attempted first with the public
1241 identifier.</para>
1242 </listitem>
1243 </varlistentry>
1244 <varlistentry><term><literal>DELEGATE</literal></term>
1245 <listitem>
1246 <para>
1247 <indexterm><primary>DELEGATE keyword</primary></indexterm>
1248
1249 The <literal>DELEGATE</literal> keyword allows you to specify
1250 that some set of public identifiers should be resolved by another
1251 catalog. Unlike the <literal>CATALOG</literal> keyword, which loads
1252 the referenced catalog, <literal>DELEGATE</literal> does nothing until
1253 an attempt is made to resolve a public identifier.</para> <para>The
1254 <literal>DELEGATE</literal> entry specifies a partial public
1255 identifier and an alternate catalog:
1256 <screen>DELEGATE "-//OASIS" "/usr/sgml/oasis/catalog"</screen>
1257 </para>
1258 <para>
1259 <indexterm><primary>initial substring matches (public identifiers)</primary></indexterm>
1260 <indexterm><primary>public identifiers</primary>
1261 <secondary>partial (initial substring matches)</secondary></indexterm>
1262
1263 Partial public identifers are simply initial substring
1264 matches. Given the preceding entry, if an attempt is made to match any
1265 public identifier that begins with the string
1266 <literal>-//OASIS</literal>, the alternate catalog
1267 <filename>/usr/sgml/oasis/catalog</filename> will be used&nbsp;instead
1268 of the current catalog.
1269 </para>
1270 </listitem>
1271 </varlistentry>
1272 <varlistentry><term><literal>DOCTYPE</literal></term>
1273 <listitem>
1274 <para>
1275 <indexterm><primary>DOCTYPE keyword</primary></indexterm>
1276 <indexterm><primary>system identifiers</primary>
1277 <secondary>default, specifying</secondary></indexterm>
1278 <indexterm><primary>declarations</primary>
1279 <secondary>system identifier, default (SGML)</secondary></indexterm>
1280
1281 The <literal>DOCTYPE</literal> keyword allows you to specify a default
1282 system identifier. If an &SGML; document begins with a
1283 <literal>DOCTYPE</literal> declaration that specifies neither a public
1284 identifier nor a system identifier (or is missing a
1285 <literal>DOCTYPE</literal> declaration altogether), the
1286 <literal>DOCTYPE</literal> declaration may provide a default:
1287 </para>
1288 <screen>
1289 DOCTYPE BOOK n:/share/sgml/docbook/3.1/docbook.dtd
1290 </screen>
1291 </listitem>
1292 </varlistentry>
1293 </variablelist>
1294 <para>
1295 <indexterm><primary>catalog files</primary>
1296 <secondary>sample</secondary></indexterm>
1297 A small fragment of an actual catalog file is shown in <xref linkend="ex-catalog"/>.
1298 </para>
1299 <example id="ex-catalog"><title>A Sample Catalog</title>
1300 <programlistingco>
1301 <areaspec>
1302 <area id="cat-comment" coords="1 60" units="linecolumn"/>
1303 <area id="cat-override" coords="4 60" units="linecolumn"/>
1304 <area id="cat-sgmldecl" coords="6 60" units="linecolumn"/>
1305 <area id="cat-doctype" coords="8 60" units="linecolumn"/>
1306 <area id="cat-public" coords="10 60" units="linecolumn"/>
1307 <area id="cat-system" coords="13 60" units="linecolumn"/>
1308 </areaspec>
1309 <programlisting>
1310 -- Comments are delimited by pairs of double-hyphens,
1311 as in SGML and XML comments. --
1312
1313 OVERRIDE YES
1314
1315 SGMLDECL "n:/share/sgml/docbook/3.1/docbook.dcl"
1316
1317 DOCTYPE BOOK n:/share/sgml/docbook/3.1/docbook.dtd
1318
1319 PUBLIC "-//OASIS//DTD DocBook V3.1//EN"
1320 n:/share/sgml/docbook/3.1/docbook.dtd
1321
1322 SYSTEM "http://nwalsh.com/docbook/xml/1.3/db3xml.dtd"
1323 n:/share/sgml/Norman_Walsh/db3xml/db3xml.dtd
1324 </programlisting>
1325 </programlistingco>
1326 </example>
1327
1328 <calloutlist>
1329 <callout arearefs="cat-comment"><para>
1330 <indexterm><primary>comments</primary>
1331 <secondary>catalog files</secondary></indexterm>
1332 Catalog files may also include comments.
1333 </para></callout>
1334 <callout arearefs="cat-override"><para>
1335 This catalog specifies that public identifiers should be used in favor
1336 of system identifiers, if both are present.
1337 </para></callout>
1338 <callout arearefs="cat-sgmldecl"><para>
1339 The default declaration specified by this catalog is the DocBook
1340 declaration.
1341 </para></callout>
1342 <callout arearefs="cat-doctype"><para>
1343 Given an explicit (or implied) &SGML; <literal>DOCTYPE</literal> of
1344 <screen>
1345 <![CDATA[
1346 <!DOCTYPE BOOK SYSTEM>
1347 ]]>
1348 </screen>
1349 use <filename>n:/share/sgml/docbook/3.1/docbook.dtd</filename> as the default
1350 system identifier. Note that this can only apply to &SGML; documents
1351 because the DOCTYPE declaration above is not a valid &XML; element.
1352 </para></callout>
1353 <callout arearefs="cat-public"><para>
1354 Map the <acronym>OASIS</acronym> public identifer to the local copy of
1355 the DocBook <acronym>V3.1</acronym> &DTD;.
1356 </para></callout>
1357 <callout arearefs="cat-system"><para>
1358 Map a system identifer for the &XML; version of DocBook to a local
1359 version.
1360 </para></callout>
1361 </calloutlist>
1362 <para>A few notes:</para>
1363 <itemizedlist>
1364 <listitem><para>It's not uncommon to have several catalog files. See below,
1365 <xref linkend="s-loc-cat"/>&rdquo;.</para>
1366 </listitem>
1367 <listitem><para>
1368 <indexterm><primary>quotes</primary>
1369 <secondary>public and system identifiers</secondary></indexterm>
1370 <indexterm><primary>public identifiers</primary>
1371 <secondary>quotes</secondary></indexterm>
1372 <indexterm><primary>system identifiers</primary>
1373 <secondary>quotes</secondary></indexterm>
1374
1375 Like attributes on elements you can quote, the public
1376 identifier and system identifier are surrounded by either single or double
1377 quotes.</para>
1378 </listitem>
1379 <listitem><para>
1380 <indexterm><primary>whitespace</primary>
1381 <secondary>catalog files</secondary></indexterm>
1382 <indexterm><primary>catalog files</primary>
1383 <secondary>whitespace</secondary></indexterm>
1384
1385 White space in the catalog file is generally
1386 irrelevant. You can use spaces, tabs, or new lines between keywords
1387 and their arguments.</para>
1388 </listitem>
1389 <listitem><para>
1390 <indexterm><primary>relative system identifiers</primary></indexterm>
1391
1392 When a relative system identifier is used, it is
1393 considered to be relative to the location of the catalog file, not the
1394 document being processed.</para>
1395 </listitem>
1396 </itemizedlist>
1397 <sect3 id="s-loc-cat">
1398 <title>Locating catalog files</title>
1399 <para>
1400 <indexterm><primary>catalog files</primary>
1401 <secondary>locating</secondary></indexterm>
1402 <indexterm><primary>locating catalog files</primary></indexterm>
1403 <indexterm><primary>files</primary>
1404 <secondary>catalog</secondary></indexterm>
1405
1406 Catalog files go a long way towards making documents more portable by
1407 introducing a level of indirection. A problem still remains, however:
1408 how does a processor locate the appropriate catalog file(s)?
1409 <acronym>OASIS</acronym> outlines a complete interchange packaging
1410 scheme, but for most applications the answer is simply that the
1411 processor looks for a file called <filename>catalog</filename> or
1412 <filename>CATALOG</filename>.
1413 </para>
1414 <para>
1415 <indexterm><primary>directories, specifying (catalog file location)</primary></indexterm>
1416
1417 Some applications allow you to specify a list of directories that
1418 should be examined for catalog files. Other tools allow you to specify
1419 the actual files.
1420 </para>
1421 <para>
1422 Note that even if a list of directories or catalog files is provided,
1423 applications may still load catalog files that occur in directories in
1424 which other documents are found. For example, <acronym>SP</acronym>
1425 and Jade always load the catalog file that occurs in the directory in
1426 which a &DTD; or document resides, even if that directory is not on
1427 the catalog file list.
1428 </para>
1429 </sect3>
1430 </sect2>
1431 </sect1>
1432 <sect1 id="ch02-physdiv">
1433 <title>Physical Divisions: Breaking a Document into Physical Chunks</title>
1434 <para>
1435 <indexterm><primary>documents</primary>
1436 <secondary>dividing</secondary></indexterm>
1437 <indexterm><primary>divisions</primary>
1438 <secondary>documents (DocBook)</secondary></indexterm>
1439 The rest of this chapter describes how you can break documents into
1440 logical chunks, such as books, chapters, sections, and so on. Before
1441 we begin, and while the subject of the internal subset is fresh in
1442 your mind, let's take a quick look at how to break documents into
1443 separate physical chunks.
1444 </para>
1445 <para>
1446 Actually, we've already told you how to do it. If you recall, in the
1447 preceding sections we had declarations of the form:
1448 <screen>&lt;!ENTITY <replaceable>name</replaceable> SYSTEM "<replaceable>filename</replaceable>">
1449 </screen>
1450 <indexterm><primary>entities</primary>
1451 <secondary>inserting files</secondary></indexterm>
1452
1453 If you refer to the entity <replaceable>name</replaceable> in your
1454 document after this declaration, the system will insert the contents
1455 of the file <replaceable>filename</replaceable> into your document at that
1456 point. So, if you've got a book that consists of three chapters and
1457 two appendixes, you might create a file called
1458 <filename>book.sgm</filename>, which looks like this:
1459 </para>
1460 <screen>&lt;!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V3.1//EN" [
1461 &lt;!ENTITY chap1 SYSTEM "chap1.sgm">
1462 &lt;!ENTITY chap2 SYSTEM "chap2.sgm">
1463 &lt;!ENTITY chap3 SYSTEM "chap3.sgm">
1464 &lt;!ENTITY appa SYSTEM "appa.sgm">
1465 &lt;!ENTITY appb SYSTEM "appb.sgm">
1466 ]>
1467 &lt;book>&lt;title>My First Book&lt;/title>
1468 &amp;chap1;
1469 &amp;chap2;
1470 &amp;chap3;
1471 &amp;appa;
1472 &amp;appb;
1473 &lt;/book>
1474 </screen>
1475 <para>
1476 <indexterm><primary>declarations</primary>
1477 <secondary>document type declaration</secondary></indexterm>
1478 <indexterm><primary>document type declaration</primary>
1479 <secondary>divisions of documents</secondary></indexterm>
1480
1481 You can then write the chapters and appendixes conveniently in
1482 separate files. Note that these files do not and must not have
1483 document type declarations.
1484 </para>
1485 <para>
1486 For example, Chapter 1 might begin like this:
1487 </para>
1488 <screen>
1489 <![CDATA[
1490 <chapter id="ch1"><title>My First Chapter</title>
1491 <para>My first paragraph.</para>
1492 ...
1493 ]]>
1494 </screen>
1495 <para>
1496 But it should not begin with its own document type declaration:
1497 </para>
1498 <screen>
1499 <![CDATA[
1500 <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook V3.1//EN">
1501 <chapter id="ch1"><title>My First Chapter</title>
1502 <para>My first paragraph.</para>
1503 ...
1504 ]]>
1505 </screen>
1506 </sect1>
1507 <sect1 id="ch02-logdiv">
1508 <title>Logical Divisions: The Categories of Elements in DocBook</title>
1509 <para>
1510 <indexterm><primary>divisions</primary>
1511 <secondary>elements, categories of (DocBook)</secondary></indexterm>
1512 <indexterm><primary>elements</primary>
1513 <secondary>categories, DocBook divisions</secondary></indexterm>
1514
1515 DocBook elements can be divided broadly into these categories:
1516 <simplelist type="vert">
1517 <member>Sets</member>
1518 <member>Books</member>
1519 <member>Divisions, which divide books into parts</member>
1520 <member>Components, which divide books or divisions into chapters</member>
1521 <member>Sections, which subdivide components</member>
1522 <member>Meta-information elements</member>
1523 <member>Block elements</member>
1524 <member>Inline elements</member>
1525 </simplelist>
1526 </para>
1527 <para>
1528 In the rest of this section, we'll describe briefly the elements that
1529 make up these categories. This section is designed to give you an
1530 overview. It is not an exhaustive list of every element in DocBook.
1531 </para>
1532 <para>
1533 For more information about any specific element and the elements that
1534 it may contain, consult the reference page for the element in
1535 question.
1536 </para>
1537 <sect2>
1538 <title>Sets</title>
1539 <para>
1540 <indexterm><primary>Sets</primary></indexterm>
1541
1542 A <sgmltag>Set</sgmltag> contains two or more
1543 <sgmltag>Book</sgmltag>s. It's the hierarchical top of DocBook. You
1544 use the <sgmltag>Set</sgmltag> tag, for example, for a series of books
1545 on a single subject that you want to access and maintain as a single
1546 unit, such as the manuals for an airplane engine or the documentation
1547 for a programming language.
1548 </para>
1549 </sect2>
1550 <sect2>
1551 <title>Books</title>
1552 <para>
1553 <indexterm><primary>customizing</primary>
1554 <secondary>DocBook DTD</secondary>
1555 <tertiary>book organization</tertiary></indexterm>
1556 <indexterm><primary>Book element</primary>
1557 <secondary>elements, ordering</secondary></indexterm>
1558 A <sgmltag>Book</sgmltag> is probably the most common top-level
1559 element in a document. The DocBook definition of a book is very loose
1560 and general. Given the variety of books authored with DocBook and the
1561 number of different conventions for book organization used in
1562 countries around the world, attempting to impose a strict ordering of
1563 elements can make the content model extremely complex. But DocBook
1564 gives you free reign. It's very reasonable to use a local <link linkend="app-customizing">customization layer</link> to impose a more
1565 strict ordering for your applications.
1566 </para>
1567 <para>
1568 <sgmltag>Book</sgmltag>s consist of a mixture of the following elements:
1569 </para>
1570 <variablelist>
1571 <varlistentry><term>Dedication</term>
1572 <listitem>
1573 <para><sgmltag>Dedication</sgmltag> pages almost always occur at the front of
1574 a book.
1575 <indexterm><primary>Dedication element</primary></indexterm>
1576
1577 </para>
1578 </listitem>
1579 </varlistentry>
1580 <varlistentry><term>Navigational Components</term>
1581 <listitem>
1582 <para>
1583 <indexterm><primary>navigation, component-level elements</primary></indexterm>
1584 <indexterm><primary>elements</primary>
1585 <secondary>components, navigation</secondary></indexterm>
1586 <indexterm><primary>ToC</primary></indexterm>
1587 <indexterm><primary>LoT</primary></indexterm>
1588 <indexterm><primary>Lists of Titles</primary><see>LoT</see></indexterm>
1589 <indexterm><primary>Index element</primary></indexterm>
1590 <indexterm><primary>tables of contents</primary><seealso>ToC</seealso></indexterm>
1591 There are a few component-level elements designed for
1592 navigation: <sgmltag>ToC</sgmltag>, for Tables of Contents;
1593 <sgmltag>LoT</sgmltag>, for Lists of Titles (for lists of figures,
1594 tables, examples, and so on); and <sgmltag>Index</sgmltag>, for
1595 indexes.</para>
1596 </listitem>
1597 </varlistentry>
1598 <varlistentry><term>Divisions</term>
1599 <listitem>
1600 <para>
1601 <indexterm><primary>divisions</primary>
1602 <secondary>Book</secondary></indexterm>
1603 <indexterm><primary>Part element</primary></indexterm>
1604 <indexterm><primary>Reference element</primary></indexterm>
1605 <indexterm><primary>RefEntry element</primary></indexterm>
1606 <indexterm><primary>components</primary></indexterm>
1607
1608 Divisions are the first hierarchical level below <sgmltag>Book</sgmltag>.
1609 They contain <sgmltag>Part</sgmltag>s and <sgmltag>Reference</sgmltag>s.
1610 <sgmltag>Part</sgmltag>s, in turn, contain components.
1611 <sgmltag>Reference</sgmltag>s contain <sgmltag>RefEntry</sgmltag>s. These are
1612 discussed more thoroughly in <xref linkend="making-refentry"/>&rdquo;.
1613 </para>
1614 <para>
1615 Books can contain components directly and are not required to contain
1616 divisions.
1617 </para>
1618 </listitem>
1619 </varlistentry>
1620 <varlistentry><term>Components</term>
1621 <listitem>
1622 <para>
1623 <indexterm><primary>Chapter element</primary>
1624 <secondary>components, similarity to</secondary></indexterm>
1625
1626 These are the chapter-like elements of a <sgmltag>Book</sgmltag>.
1627 </para>
1628 </listitem>
1629 </varlistentry>
1630 </variablelist>
1631 </sect2>
1632 <sect2>
1633 <title>Components</title>
1634 <para>
1635 <indexterm><primary>books</primary>
1636 <secondary>components</secondary></indexterm>
1637 <indexterm><primary>Part element</primary></indexterm>
1638
1639 <indexterm><primary>Preface element</primary></indexterm>
1640 <indexterm><primary>Chapter element</primary></indexterm>
1641 <indexterm><primary>Appendix element</primary></indexterm>
1642 <indexterm><primary>Glossary element</primary></indexterm>
1643 <indexterm><primary>Bibliography element</primary></indexterm>
1644 <indexterm><primary>Article element</primary></indexterm>
1645 <indexterm><primary>block elements</primary></indexterm>
1646 <indexterm><primary>sections</primary>
1647 <secondary>elements</secondary></indexterm>
1648 Components are the chapter-like elements of a <sgmltag>Book</sgmltag> or
1649 <sgmltag>Part</sgmltag>: <sgmltag>Preface</sgmltag>,
1650 <sgmltag>Chapter</sgmltag>, <sgmltag>Appendix</sgmltag>,
1651 <sgmltag>Glossary</sgmltag>, and
1652 <sgmltag>Bibliography</sgmltag>. <sgmltag>Article</sgmltag>s can also
1653 occur at the component level. We describe <sgmltag>Article</sgmltag>s
1654 in more detail in the section titled <xref linkend="making-article"/>&rdquo;. Components generally
1655 contain block elements and/or sections, and some can contain
1656 navigational components and <sgmltag>RefEntry</sgmltag>s.
1657 </para>
1658 </sect2>
1659 <sect2>
1660 <title>Sections</title>
1661 <para>
1662 <indexterm><primary>nesting</primary>
1663 <secondary>section elements</secondary></indexterm>
1664 <indexterm><primary>numbered sections, levels</primary></indexterm>
1665 <indexterm><primary>elements</primary>
1666 <secondary>sections</secondary></indexterm>
1667
1668 There are several flavors of sectioning elements in DocBook:</para>
1669 <variablelist>
1670 <varlistentry><term><sgmltag>Sect1</sgmltag>&hellip;<sgmltag>Sect5</sgmltag> elements</term>
1671 <listitem>
1672 <para>The <sgmltag>Sect1</sgmltag>&hellip;<sgmltag>Sect5</sgmltag>
1673 elements are the most common sectioning elements. They can occur in
1674 most component-level elements. These numbered section elements must be
1675 properly nested (<sgmltag>Sect2</sgmltag>s can only occur inside
1676 <sgmltag>Sect1</sgmltag>s, <sgmltag>Sect3</sgmltag>s can only occur inside
1677 <sgmltag>Sect2</sgmltag>s, and so on). There are five levels of numbered
1678 sections.</para>
1679 </listitem>
1680 </varlistentry>
1681 <varlistentry><term><sgmltag>Section</sgmltag> element</term>
1682 <listitem>
1683 <para>
1684 <indexterm><primary>Section element</primary></indexterm>
1685
1686 The <sgmltag>Section</sgmltag> element, introduced in DocBook V3.1, is
1687 an alternative to numbered sections. <sgmltag>Section</sgmltag>s are
1688 recursive, meaning that you can nest them to any depth desired.
1689 </para>
1690 </listitem>
1691 </varlistentry>
1692 <varlistentry><term><sgmltag>SimpleSect</sgmltag> element</term>
1693 <listitem>
1694 <para>
1695 <indexterm><primary>SimpleSect element</primary></indexterm>
1696
1697 In addition to numbered sections, there's the
1698 <sgmltag>SimpleSect</sgmltag> element. It is a terminal section that
1699 can occur at any level, but it cannot have any other sectioning
1700 element nested within it.</para>
1701 </listitem>
1702 </varlistentry>
1703 <varlistentry><term><sgmltag>BridgeHead</sgmltag></term>
1704 <listitem>
1705 <para>
1706 <indexterm><primary>BridgeHead element</primary></indexterm>
1707
1708 A <sgmltag>BridgeHead</sgmltag> provides a section title without
1709 any containing section.</para>
1710 </listitem>
1711 </varlistentry>
1712 <varlistentry><term><sgmltag>RefSect1</sgmltag>&hellip;<sgmltag>RefSect3</sgmltag> elements</term>
1713 <listitem>
1714 <para>
1715 <indexterm><primary>RefEntry element</primary></indexterm>
1716 These elements, which occur only in <sgmltag>RefEntry</sgmltag>s, are
1717 analogous to the numbered section elements in components. There are
1718 only three levels of numbered section elements in a
1719 <sgmltag>RefEntry</sgmltag>.</para>
1720 </listitem>
1721 </varlistentry>
1722 <varlistentry><term><sgmltag>GlossDiv</sgmltag>, <sgmltag>BiblioDiv</sgmltag>, and
1723 <sgmltag>IndexDiv</sgmltag></term>
1724 <listitem>
1725 <para>
1726 <indexterm><primary>GlossDiv element</primary></indexterm>
1727 <indexterm><primary>BiblioDiv element</primary></indexterm>
1728
1729 <indexterm><primary>Glossary element</primary></indexterm>
1730 <indexterm><primary>Bibliography element</primary></indexterm>
1731 <indexterm><primary>Index element</primary></indexterm>
1732
1733 <sgmltag>Glossary</sgmltag>s, <sgmltag>Bibliography</sgmltag>s,
1734 and <sgmltag>Index</sgmltag>es can be broken into top-level
1735 divisions, but not sections. Unlike sections, these elements do not
1736 nest.</para>
1737 </listitem>
1738 </varlistentry>
1739 </variablelist>
1740 </sect2>
1741 <sect2><title>Meta-Information</title>
1742 <para>
1743 <indexterm><primary>meta-information</primary>
1744 <secondary>elements, section-level and above</secondary></indexterm>
1745 <indexterm><primary>wrappers</primary>
1746 <secondary>meta-information, elements</secondary></indexterm>
1747 All of the elements at the section level and above include a wrapper
1748 for meta-information about the content. See, for example,
1749 <sgmltag>BookInfo</sgmltag>.
1750 </para>
1751 <para>
1752 <indexterm><primary>Author element</primary></indexterm>
1753 <indexterm><primary>Title element</primary></indexterm>
1754 <indexterm><primary>Publisher element</primary></indexterm>
1755 <indexterm><primary>revision histories</primary></indexterm>
1756 <indexterm><primary>keywords</primary>
1757 <secondary>keyword sets (meta-information)</secondary></indexterm>
1758 <indexterm><primary>indexes</primary>
1759 <secondary>metainformation</secondary></indexterm>
1760 The meta-information wrapper is designed to contain bibliographic
1761 information about the content (<sgmltag>Author</sgmltag>, <sgmltag>Title</sgmltag>,
1762 <sgmltag>Publisher</sgmltag>, and so on) as well as other meta-information
1763 such as revision histories, keyword sets, and index terms.
1764 </para>
1765 </sect2>
1766 <sect2>
1767 <title>Block Elements</title>
1768 <para>
1769 <indexterm><primary>block elements</primary></indexterm>
1770 <indexterm><primary>paragraphs</primary>
1771 <secondary>paragraph-level elements</secondary></indexterm>
1772 <indexterm><primary>lists</primary></indexterm>
1773 <indexterm><primary>examples</primary></indexterm>
1774 <indexterm><primary>figures</primary></indexterm>
1775 <indexterm><primary>tables</primary></indexterm>
1776 <indexterm><primary>synopses</primary></indexterm>
1777 <indexterm><primary>admonitions</primary></indexterm>
1778 <indexterm><primary>line-specific environments</primary></indexterm>
1779
1780 The block elements occur immediately below the component and
1781 sectioning elements. These are the (roughly) paragraph-level elements
1782 in DocBook. They can be divided into a number of categories: lists,
1783 admonitions, line-specific environments, synopses of several sorts,
1784 tables, figures, examples, and a dozen or more miscellaneous elements.
1785 </para>
1786 <sidebar><title>Block vs. Inline Elements</title>
1787 <para>
1788 <indexterm><primary>block elements</primary>
1789 <secondary>inline elements vs.</secondary></indexterm>
1790 <indexterm><primary>inline elements</primary>
1791 <secondary>block elements vs.</secondary></indexterm>
1792
1793 At the paragraph-level, it's convenient to divide elements into two
1794 classes, <firstterm>block</firstterm> and <firstterm>inline</firstterm>.
1795 From a structural point of view, this distinction is based loosely on
1796 their relative size, but it's easiest to describe the difference in
1797 terms of their presentation.
1798 </para>
1799 <para>
1800 <indexterm><primary>sidebars</primary></indexterm>
1801 <indexterm><primary>block quotations</primary></indexterm>
1802 <indexterm><primary>quotations (block)</primary></indexterm>
1803 Block elements are usually presented with a paragraph (or larger)
1804 break before and after them. Most can contain other block elements,
1805 and many can contain character data and inline elements. Paragraphs,
1806 lists, sidebars, tables, and block quotations are all common examples
1807 of block elements.
1808 </para>
1809 <para>
1810 <indexterm><primary>fonts</primary>
1811 <secondary>changes (inline elements)</secondary></indexterm>
1812 <indexterm><primary>characters</primary>
1813 <secondary>inline elements</secondary></indexterm>
1814 <indexterm><primary>cross references</primary></indexterm>
1815 <indexterm><primary>filenames</primary></indexterm>
1816 <indexterm><primary>commands</primary></indexterm>
1817 <indexterm><primary>options</primary></indexterm>
1818 <indexterm><primary>subscripts and superscripts</primary></indexterm>
1819 <indexterm><primary>glossaries</primary>
1820 <secondary>glossary terms</secondary></indexterm>
1821 Inline elements are generally represented without any obvious breaks.
1822 The most common distinguishing mark of inline elements is a font
1823 change, but inline elements may present no visual distinction at all.
1824 Inline elements contain character data and possibly other inline
1825 elements, but they never contain block elements. Inline elements are
1826 used to mark up data such as cross references, filenames, commands,
1827 options, subscripts and superscripts, and glossary terms.
1828 </para>
1829 </sidebar>
1830 <sect3><title>Lists</title>
1831 <para>
1832 <indexterm><primary>lists</primary>
1833 <secondary>elements</secondary></indexterm>
1834 <indexterm><primary>elements</primary>
1835 <secondary>lists</secondary></indexterm>
1836
1837 There are seven list elements in DocBook:</para>
1838 <variablelist>
1839 <varlistentry>
1840 <term><sgmltag>CalloutList</sgmltag></term>
1841 <listitem>
1842 <para>
1843 <indexterm><primary>CallOut element</primary></indexterm>
1844 <indexterm><primary>CalloutList element</primary></indexterm>
1845
1846 A list of <sgmltag>CallOut</sgmltag>s and their descriptions.
1847 <sgmltag>CallOut</sgmltag>s are
1848 marks, frequently numbered and typically on a graphic or verbatim environment,
1849 that are described in a <sgmltag>CalloutList</sgmltag>, outside the element
1850 in which they occur.</para>
1851 </listitem>
1852 </varlistentry>
1853 <varlistentry><term><sgmltag>GlossList</sgmltag></term>
1854 <listitem>
1855 <para>
1856 <indexterm><primary>GlossList element</primary></indexterm>
1857
1858 A list of glossary terms and their definitions.</para>
1859 </listitem>
1860 </varlistentry>
1861 <varlistentry><term><sgmltag>ItemizedList</sgmltag></term>
1862 <listitem>
1863 <para>
1864 <indexterm><primary>ItemizedList element</primary></indexterm>
1865
1866 An unordered (bulleted) list. There are attributes to control
1867 the marks used.</para>
1868 </listitem>
1869 </varlistentry>
1870 <varlistentry><term><sgmltag>OrderedList</sgmltag></term>
1871 <listitem>
1872 <para>
1873 <indexterm><primary>OrderedList element</primary></indexterm>
1874
1875 A numbered list. There are attributes to control the type of
1876 enumeration.</para>
1877 </listitem>
1878 </varlistentry>
1879 <varlistentry><term><sgmltag>SegmentedList</sgmltag></term>
1880 <listitem>
1881 <para>
1882 <indexterm><primary>SegmentedList element</primary></indexterm>
1883
1884 A repeating set of named items. For example, a list of states
1885 and their capitals might be represented as a
1886 <sgmltag>SegmentedList</sgmltag>.</para>
1887 </listitem>
1888 </varlistentry>
1889 <varlistentry><term><sgmltag>SimpleList</sgmltag></term>
1890 <listitem>
1891 <para>
1892 <indexterm><primary>SimpleList element</primary></indexterm>
1893
1894 An unadorned list of items. <sgmltag>SimpleList</sgmltag>s can
1895 be inline or arranged in columns.</para>
1896 </listitem>
1897 </varlistentry>
1898 <varlistentry><term><sgmltag>VariableList</sgmltag></term>
1899 <listitem>
1900 <para>
1901 <indexterm><primary>VariableList element</primary></indexterm>
1902
1903 A list of terms and definitions or descriptions. (This list of
1904 list types is a <sgmltag>VariableList</sgmltag>.)</para>
1905 </listitem>
1906 </varlistentry>
1907 </variablelist>
1908 </sect3>
1909 <sect3><title>Admonitions</title>
1910 <para>
1911 <indexterm><primary>admonitions</primary>
1912 <secondary>DocBook types</secondary></indexterm>
1913 <indexterm><primary>Caution element</primary></indexterm>
1914 <indexterm><primary>Important element</primary></indexterm>
1915 <indexterm><primary>Note element</primary></indexterm>
1916 <indexterm><primary>Tip element</primary></indexterm>
1917 <indexterm><primary>Warning element</primary></indexterm>
1918
1919 There are five types of admonitions in DocBook:
1920 <sgmltag>Caution</sgmltag>, <sgmltag>Important</sgmltag>,
1921 <sgmltag>Note</sgmltag>, <sgmltag>Tip</sgmltag>, and
1922 <sgmltag>Warning</sgmltag>.
1923 </para>
1924 <para>
1925 All of the admonitions have the same structure: an optional <sgmltag>
1926 Title</sgmltag> followed by paragraph-level elements. The DocBook
1927 &DTD; does not impose any specific semantics on the individual
1928 admonitions. For example, DocBook does not mandate that
1929 <sgmltag>Warning</sgmltag>s be reserved for cases where bodily harm
1930 can result.
1931 </para>
1932 </sect3>
1933 <sect3><title>Line-specific environments</title>
1934 <para>
1935 <indexterm><primary>line-specific environments</primary></indexterm>
1936 <indexterm><primary>whitespace</primary>
1937 <secondary>preserving in source text</secondary></indexterm>
1938 <indexterm><primary>line breaks, preserving</primary></indexterm>
1939
1940 These environments preserve whitespace and line breaks in the source
1941 text. DocBook does not provide the equivalent of &HTML;'s
1942 <sgmltag>BR</sgmltag> tag, so there's no way to interject a line break
1943 into normal running text.
1944 </para>
1945 <variablelist>
1946 <varlistentry>
1947 <term><sgmltag>Address</sgmltag></term>
1948 <listitem>
1949 <para>
1950 <indexterm><primary>Address element</primary></indexterm>
1951
1952 The <sgmltag>Address</sgmltag> element is intended for postal
1953 addresses. In addition to being line-specific, <sgmltag>Address</sgmltag>
1954 contains additional elements suitable for marking up names and
1955 addresses.</para>
1956 </listitem>
1957 </varlistentry>
1958 <varlistentry>
1959 <term><sgmltag>LiteralLayout</sgmltag></term>
1960 <listitem>
1961 <para>
1962 <indexterm><primary>LiteralLayout element</primary></indexterm>
1963
1964 A <sgmltag>LiteralLayout</sgmltag> does not have any semantic
1965 association beyond the preservation of whitespace and line breaks. In
1966 particular, while <sgmltag>ProgramListing</sgmltag> and
1967 <sgmltag>Screen</sgmltag> are frequently presented in a fixed-width
1968 font, a change of fonts is not necessarily implied by <sgmltag>LiteralLayout
1969 </sgmltag>.</para>
1970 </listitem>
1971 </varlistentry>
1972 <varlistentry>
1973 <term><sgmltag>ProgramListing</sgmltag></term>
1974 <listitem>
1975 <para>
1976 <indexterm><primary>ProgramListing element</primary></indexterm>
1977 <indexterm><primary>fonts</primary>
1978 <secondary>fixed-width, programs and code</secondary></indexterm>
1979
1980 A <sgmltag>ProgramListing</sgmltag> is a verbatim environment, usually
1981 presented in Courier or some other fixed-width font, for program
1982 sources, code fragments, and similar listings.</para>
1983 </listitem>
1984 </varlistentry>
1985 <varlistentry>
1986 <term><sgmltag>Screen</sgmltag></term>
1987 <listitem>
1988 <para>
1989 <indexterm><primary>Screen element</primary></indexterm>
1990 <indexterm><primary>text screen-captures </primary></indexterm>
1991
1992 A <sgmltag>Screen</sgmltag> is a verbatim or literal environment
1993 for text screen-captures, other fragments of an
1994 <acronym>ASCII</acronym> display, and similar things. <sgmltag>
1995 Screen</sgmltag> is also a frequent catch-all for any verbatim
1996 text.</para>
1997 </listitem>
1998 </varlistentry>
1999 <varlistentry>
2000 <term><sgmltag>ScreenShot</sgmltag></term>
2001 <listitem>
2002 <para>
2003 <indexterm><primary>ScreenShot element</primary></indexterm>
2004
2005 <sgmltag>ScreenShot</sgmltag> is actually a wrapper for a
2006 <sgmltag>Graphic</sgmltag> intended for screen shots of a
2007 <acronym>GUI</acronym> for example.</para>
2008 </listitem>
2009 </varlistentry>
2010 <varlistentry>
2011 <term><sgmltag>Synopsis</sgmltag></term>
2012 <listitem>
2013 <para>
2014 <indexterm><primary>Synopsis element</primary></indexterm>
2015
2016 A <sgmltag>Synopsis</sgmltag> is a verbatim environment for command
2017 and function synopsis.</para>
2018 </listitem>
2019 </varlistentry>
2020 </variablelist>
2021 </sect3>
2022 <sect3><title>Examples, figures, and tables</title>
2023 <para>
2024 <indexterm><primary>block elements</primary>
2025 <secondary>formal and informal elements</secondary></indexterm>
2026 <indexterm><primary>formal elements</primary></indexterm>
2027 <indexterm><primary>informal elements</primary></indexterm>
2028 <indexterm><primary>Example element</primary></indexterm>
2029 <indexterm><primary>Figure element</primary></indexterm>
2030 <indexterm><primary>Table element</primary></indexterm>
2031 <indexterm><primary>InformalExample element</primary></indexterm>
2032 <indexterm><primary>InformalExample element</primary></indexterm>
2033 <indexterm><primary>InformalTable element</primary></indexterm>
2034
2035 Examples, Figures, and Tables are common block-level elements:
2036 <sgmltag>Example</sgmltag>, <sgmltag>InformalExample</sgmltag>,
2037 <sgmltag>Figure</sgmltag>, <sgmltag>InformalFigure</sgmltag>,
2038 <sgmltag>Table</sgmltag>, and <sgmltag>InformalTable</sgmltag>.
2039 </para>
2040 <para>
2041 <indexterm><primary>titles</primary>
2042 <secondary>formal elements</secondary></indexterm>
2043
2044 The distinction between formal and informal elements is that formal
2045 elements have titles while informal ones do not. The
2046 <sgmltag>InformalFigure</sgmltag> element was introduced in DocBook
2047 <acronym>V3.1</acronym>. In prior versions of DocBook, you could only
2048 achieve the effect of an informal figure by placing its content,
2049 unwrapped, at the location where the informal figure was desired.
2050 </para>
2051 </sect3>
2052 <sect3><title>Paragraphs</title>
2053 <para>
2054 <indexterm><primary>Para element</primary></indexterm>
2055
2056 There are three paragraph elements: <sgmltag>Para</sgmltag>, <sgmltag>
2057 SimPara</sgmltag> (simple paragraphs may not contain other block-level
2058 elements), and <sgmltag>FormalPara</sgmltag> (formal paragraphs have
2059 titles).
2060 </para>
2061 </sect3>
2062 <sect3><title>Equations</title>
2063 <para>
2064 <indexterm><primary>Equation element</primary></indexterm>
2065 <indexterm><primary>titles</primary>
2066 <secondary>equation elements</secondary></indexterm>
2067 <indexterm><primary>InlineEquation element</primary></indexterm>
2068 There are two block-equation elements, <sgmltag>Equation</sgmltag> and
2069 <sgmltag>InformalEquation</sgmltag> (for inline equations, use
2070 <sgmltag>InlineEquation</sgmltag>).
2071 </para>
2072 <para>
2073 Informal equations don't have titles. For reasons of
2074 backward-compatibility, <sgmltag>Equation</sgmltag>s are not required
2075 to have titles. However, it may be more difficult for some stylesheet
2076 languages to properly enumerate <sgmltag>Equation</sgmltag>s if they
2077 lack titles.
2078 </para>
2079 </sect3>
2080 <sect3><title>Graphics</title>
2081 <para>
2082 <indexterm><primary>graphics</primary></indexterm>
2083 <indexterm><primary>Figure element</primary></indexterm>
2084 <indexterm><primary>ScreenShot element</primary></indexterm>
2085 <indexterm><primary>block elements</primary>
2086 <secondary>Graphic</secondary></indexterm>
2087 <indexterm><primary>InlineGraphic element</primary></indexterm>
2088
2089 Graphics occur most frequently in <sgmltag>Figure</sgmltag>s and
2090 <sgmltag>ScreenShot</sgmltag>s, but they can also occur without a
2091 wrapper. DocBook considers a <sgmltag>Graphic</sgmltag> a block
2092 element, even if it appears to occur inline. For graphics that you
2093 want to be represented inline, use <sgmltag>InlineGraphic</sgmltag>.
2094 </para>
2095 <para>
2096 <indexterm><primary>MediaObject elements</primary></indexterm>
2097 <indexterm><primary>InlineMediaObject element</primary></indexterm>
2098
2099 DocBook <acronym>V3.1</acronym> introduced a new element to contain
2100 graphics and other media types: <sgmltag>MediaObject</sgmltag> and its inline
2101 cousin, <sgmltag>InlineMediaObject</sgmltag>. These elements may contain
2102 video, audio, image, and text data. A single media object can contain
2103 several alternative forms from which the presentation system can
2104 select the most appropriate object.
2105 </para>
2106 </sect3>
2107 <sect3><title>Questions and answers</title>
2108 <para>
2109 <indexterm><primary>QandASet element</primary></indexterm>
2110 <indexterm><primary>FAQ element</primary></indexterm>
2111 <indexterm><primary>frequently asked questions (FAQ)</primary></indexterm>
2112 <indexterm><primary>Question element</primary></indexterm>
2113 <indexterm><primary>Answer element</primary></indexterm>
2114
2115 DocBook <acronym>V3.1</acronym> introduced the <sgmltag>QandASet</sgmltag>
2116 element, which is suitable for <acronym>FAQ</acronym>s (Frequently
2117 Asked Questions) and other similar collections of
2118 <sgmltag>Question</sgmltag>s and <sgmltag>Answer</sgmltag>s.
2119 </para>
2120 </sect3>
2121 <sect3><title>Miscellaneous block elements</title>
2122 <para>
2123 The following block elements are also available:
2124 </para>
2125 <variablelist>
2126 <varlistentry>
2127 <term><sgmltag>BlockQuote</sgmltag></term>
2128 <listitem><para>
2129 <indexterm><primary>BlockQuote element</primary></indexterm>
2130 <indexterm><primary>Attribution element</primary></indexterm>
2131
2132 A block quotation. Block quotations may have
2133 <sgmltag>Attribution</sgmltag>s.</para></listitem>
2134 </varlistentry>
2135 <varlistentry>
2136 <term><sgmltag>CmdSynopsis</sgmltag></term>
2137 <listitem><para>
2138 <indexterm><primary>CmdSynopsis element</primary></indexterm>
2139 <indexterm><primary>parameters (commands), markup</primary></indexterm>
2140 <indexterm><primary>options</primary>
2141 <secondary>commands, marking up</secondary></indexterm>
2142 <indexterm><primary>commands</primary></indexterm>
2143
2144 An environment for marking up all the parameters and options of a command.
2145 </para></listitem>
2146 </varlistentry>
2147 <varlistentry>
2148 <term><sgmltag>Epigraph</sgmltag></term>
2149 <listitem><para>
2150 <indexterm><primary>Epigraph element</primary></indexterm>
2151
2152 A short introduction, typically a quotation, at the beginning of a document.
2153 <sgmltag>Epigraph</sgmltag>s may have <sgmltag>Attribution</sgmltag>s.
2154 </para></listitem>
2155 </varlistentry>
2156 <varlistentry>
2157 <term><sgmltag>FuncSynopsis</sgmltag></term>
2158 <listitem><para>
2159 <indexterm><primary>FuncSynopsis element</primary></indexterm>
2160 <indexterm><primary>MsgSet element</primary></indexterm>
2161
2162 An environment for marking up the return value and arguments of a function.
2163 </para></listitem>
2164 </varlistentry>
2165 <varlistentry>
2166 <term><sgmltag>Highlights</sgmltag></term>
2167 <listitem><para>
2168 <indexterm><primary>Highlights element</primary></indexterm>
2169
2170 A summary of the main points discussed in a book component (chapter,
2171 section, and so on).
2172 </para></listitem>
2173 </varlistentry>
2174 <varlistentry>
2175 <term><sgmltag>MsgSet</sgmltag></term>
2176 <listitem><para>
2177 <indexterm><primary>error messages</primary>
2178 <secondary>sets of related</secondary></indexterm>
2179
2180 A set of related error messages.</para></listitem>
2181 </varlistentry>
2182 <varlistentry>
2183 <term><sgmltag>Procedure</sgmltag></term>
2184 <listitem><para>
2185 <indexterm><primary>Procedure element</primary></indexterm>
2186 <indexterm><primary>Step element</primary></indexterm>
2187 <indexterm><primary>SubStep element</primary></indexterm>
2188
2189 A procedure. Procedures contain <sgmltag>Step</sgmltag>s, which
2190 may contain <sgmltag>SubStep</sgmltag>s.</para></listitem>
2191 </varlistentry>
2192 <varlistentry>
2193 <term><sgmltag>Sidebar</sgmltag></term>
2194 <listitem><para>A sidebar.</para></listitem>
2195 </varlistentry>
2196 </variablelist>
2197 </sect3>
2198 </sect2>
2199 <sect2><title>Inline Elements</title>
2200 <para>
2201 <indexterm><primary>inline elements</primary></indexterm>
2202 <indexterm><primary>text</primary>
2203 <secondary>inline elements</secondary></indexterm>
2204
2205 Users of DocBook are provided with a surfeit of inline elements.
2206 Inline elements are used to mark up running text. In published
2207 documents, inline elements often cause a font change or other small
2208 change, but they do not cause line or paragraph breaks.
2209 </para>
2210 <para>
2211 In practice, writers generally settle on the tagging of inline elements that
2212 suits their time and subject matter. This may be a large number of
2213 elements or only a handful. What is important is that you choose to mark up
2214 not every possible item, but only those for which distinctive tagging will
2215 be useful in the production of the finished document for the readers who
2216 will search through it.
2217 </para>
2218 <para>
2219 The following comprehensive list may be a useful tool for the process
2220 of narrowing down the elements that you will choose to mark up; it is
2221 not intended to overwhelm you by its sheer length. For convenience,
2222 we've divided the inlines into several subcategories.
2223 </para>
2224 <para>
2225 The classification used here is not meant to be authoritative, only
2226 helpful in providing a feel for the nature of the inlines. Several
2227 elements appear in more than one category, and arguments could be made
2228 to support the placement of additional elements in other categories or
2229 entirely new categories.
2230 </para>
2231 <sect3><title>Traditional publishing inlines</title>
2232 <para>
2233 <indexterm><primary>general writing (traditional publishing inlines)</primary></indexterm>
2234 <indexterm><primary>traditional publishing, inline elements</primary></indexterm>
2235
2236 These inlines identify things that commonly occur in general writing:
2237 </para>
2238 <variablelist>
2239 <varlistentry>
2240 <term><sgmltag>Abbrev</sgmltag></term>
2241 <listitem><para>&abbrev.purpose;.
2242 <indexterm><primary>Abbrev element</primary></indexterm>
2243 </para></listitem>
2244 </varlistentry>
2245 <varlistentry>
2246 <term><sgmltag>Acronym</sgmltag></term>
2247 <listitem><para>&acronym.purpose;.
2248 <indexterm><primary>Acronym element</primary></indexterm>
2249 </para></listitem>
2250 </varlistentry>
2251 <varlistentry>
2252 <term><sgmltag>Emphasis</sgmltag></term>
2253 <listitem><para>&emphasis.purpose;.<indexterm><primary>Emphasis element</primary></indexterm>
2254 </para></listitem>
2255 </varlistentry>
2256 <varlistentry>
2257 <term><sgmltag>Footnote</sgmltag></term>
2258 <listitem>
2259 <para>&footnote.purpose;. The location of the <sgmltag>Footnote</sgmltag>
2260 element identifies the location of the first reference to the
2261 footnote. Additional references to the same footnote can be inserted with
2262 <sgmltag>FootnoteRef</sgmltag>.
2263 <indexterm><primary>FootnoteRef element</primary></indexterm>
2264 <indexterm><primary>Footnote element</primary></indexterm>
2265 </para>
2266 </listitem>
2267 </varlistentry>
2268 <varlistentry>
2269 <term><sgmltag>Phrase</sgmltag></term>
2270 <listitem><para>&phrase.purpose;.<indexterm><primary>Phrase element</primary></indexterm>
2271 </para></listitem>
2272 </varlistentry>
2273 <varlistentry>
2274 <term><sgmltag>Quote</sgmltag></term>
2275 <listitem><para>&quote.purpose;.<indexterm><primary>Quote element</primary></indexterm>
2276 </para></listitem>
2277 </varlistentry>
2278 <varlistentry>
2279 <term><sgmltag>Trademark</sgmltag></term>
2280 <listitem><para>&trademark.purpose;.<indexterm><primary>Trademark element</primary></indexterm>
2281 </para></listitem>
2282 </varlistentry>
2283 </variablelist>
2284 </sect3>
2285 <sect3><title>Cross references</title>
2286 <para>
2287 <indexterm><primary>cross references</primary></indexterm>
2288 <indexterm><primary>Link element</primary></indexterm>
2289 <indexterm><primary>GlossTerm element</primary></indexterm>
2290 <indexterm><primary>LinkEnd attribute</primary></indexterm>
2291
2292 The cross reference inlines identify both explicit cross references,
2293 such as <sgmltag>Link</sgmltag>, and implicit cross references like
2294 <sgmltag>GlossTerm</sgmltag>. You can make the most of the implicit
2295 references explicit with a <sgmltag class='attribute'>LinkEnd</sgmltag>
2296 attribute.
2297 </para>
2298 <variablelist>
2299 <varlistentry>
2300 <term><sgmltag>Anchor</sgmltag></term>
2301 <listitem><para>&anchor.purpose;.<indexterm><primary>Anchor element</primary></indexterm>
2302 </para></listitem>
2303 </varlistentry>
2304 <varlistentry>
2305 <term><sgmltag>Citation</sgmltag></term>
2306 <listitem><para>&citation.purpose;.<indexterm><primary>Citation element</primary></indexterm>
2307 </para></listitem>
2308 </varlistentry>
2309 <varlistentry>
2310 <term><sgmltag>CiteRefEntry</sgmltag></term>
2311 <listitem><para>&citerefentry.purpose;.<indexterm><primary>CiteRefEntry element</primary></indexterm>
2312 </para></listitem>
2313 </varlistentry>
2314 <varlistentry>
2315 <term><sgmltag>CiteTitle</sgmltag></term>
2316 <listitem><para>&citetitle.purpose;.<indexterm><primary>CiteTitle element</primary></indexterm>
2317 </para></listitem>
2318 </varlistentry>
2319 <varlistentry>
2320 <term><sgmltag>FirstTerm</sgmltag></term>
2321 <listitem><para>&firstterm.purpose;.<indexterm><primary>FirstTerm element</primary></indexterm>
2322 </para></listitem>
2323 </varlistentry>
2324 <varlistentry>
2325 <term><sgmltag>GlossTerm</sgmltag></term>
2326 <listitem><para>&glossterm.purpose;.<indexterm><primary>GlossTerm element</primary></indexterm>
2327 </para></listitem>
2328 </varlistentry>
2329 <varlistentry>
2330 <term><sgmltag>Link</sgmltag></term>
2331 <listitem><para>&link.purpose;.<indexterm><primary>Link element</primary></indexterm>
2332 </para></listitem>
2333 </varlistentry>
2334 <varlistentry>
2335 <term><sgmltag>OLink</sgmltag></term>
2336 <listitem><para>&olink.purpose;.<indexterm><primary>OLink element</primary></indexterm>
2337 </para></listitem>
2338 </varlistentry>
2339 <varlistentry>
2340 <term><sgmltag>ULink</sgmltag></term>
2341 <listitem><para>&ulink.purpose;.<indexterm><primary>ULink element</primary></indexterm>
2342 </para></listitem>
2343 </varlistentry>
2344 <varlistentry>
2345 <term><sgmltag>XRef</sgmltag></term>
2346 <listitem><para>&xref.purpose;.<indexterm><primary>XRef element</primary></indexterm>
2347 </para></listitem>
2348 </varlistentry>
2349 </variablelist>
2350 </sect3>
2351 <sect3><title>Markup</title>
2352 <para>
2353 <indexterm><primary>markup</primary>
2354 <secondary>elements</secondary></indexterm>
2355
2356 These inlines are used to mark up text for special presentation:
2357 </para>
2358 <variablelist>
2359 <varlistentry>
2360 <term><sgmltag>ForeignPhrase</sgmltag></term>
2361 <listitem><para>&foreignphrase.purpose;.<indexterm><primary>ForeignPhrase element</primary></indexterm>
2362 </para></listitem>
2363 </varlistentry>
2364 <varlistentry>
2365 <term><sgmltag>WordAsWord</sgmltag></term>
2366 <listitem><para>&wordasword.purpose;.<indexterm><primary>WordAsWord element</primary></indexterm>
2367 </para></listitem>
2368 </varlistentry>
2369 <varlistentry>
2370 <term><sgmltag>ComputerOutput</sgmltag></term>
2371 <listitem><para>&computeroutput.purpose;.<indexterm><primary>ComputerOutput element</primary></indexterm>
2372 </para></listitem>
2373 </varlistentry>
2374 <varlistentry>
2375 <term><sgmltag>Literal</sgmltag></term>
2376 <listitem><para>&literal.purpose;.<indexterm><primary>Literal element</primary></indexterm>
2377 </para></listitem>
2378 </varlistentry>
2379 <varlistentry>
2380 <term><sgmltag>Markup</sgmltag></term>
2381 <listitem><para>&markup.purpose;.<indexterm><primary>Markup element</primary></indexterm>
2382 </para></listitem>
2383 </varlistentry>
2384 <varlistentry>
2385 <term><sgmltag>Prompt</sgmltag></term>
2386 <listitem><para>&prompt.purpose;.<indexterm><primary>Prompt element</primary></indexterm>
2387 </para></listitem>
2388 </varlistentry>
2389 <varlistentry>
2390 <term><sgmltag>Replaceable</sgmltag></term>
2391 <listitem><para>&replaceable.purpose;.<indexterm><primary>Replaceable element</primary></indexterm>
2392 </para></listitem>
2393 </varlistentry>
2394 <varlistentry>
2395 <term><sgmltag>SGMLTag</sgmltag></term>
2396 <listitem><para>&sgmltag.purpose;.<indexterm><primary>SGMLTag element</primary></indexterm>
2397 </para></listitem>
2398 </varlistentry>
2399 <varlistentry>
2400 <term><sgmltag>UserInput</sgmltag></term>
2401 <listitem><para>&userinput.purpose;.<indexterm><primary>UserInput element</primary></indexterm>
2402 </para></listitem>
2403 </varlistentry>
2404 </variablelist>
2405 </sect3>
2406
2407 <sect3><title>Mathematics</title>
2408 <para><indexterm><primary>elements</primary>
2409 <secondary>mathematics</secondary>
2410 </indexterm><indexterm><primary>mathematics (DocBook)</primary>
2411 </indexterm><indexterm><primary>equations (elements)</primary>
2412 </indexterm><indexterm><primary>MathML, incorporating</primary>
2413 </indexterm><indexterm><primary>namespaces</primary>
2414 </indexterm>DocBook does not define a complete set of elements for
2415 representing equations. No one has ever pressed the DocBook
2416 maintainers to add this functionality, and the prevailing opinion is
2417 that incorporating
2418 <ulink url="http://www.w3.org/TR/REC-MathML/">MathML</ulink> using a
2419 mechanism like
2420 <ulink url="http://www.w3.org/TR/REC-xml-names/">namespaces</ulink>
2421 is probably the best long-term solution.</para>
2422 <para>DocBook V4.5 added a <sgmltag>mathphrase</sgmltag> element to support
2423 simple, textual mathematics that doesn't require extensive markup.</para>
2424 <variablelist>
2425 <varlistentry>
2426 <term><sgmltag>InlineEquation</sgmltag></term>
2427 <listitem><para>&inlineequation.purpose;.<indexterm><primary>InlineEquation element</primary></indexterm>
2428 </para></listitem>
2429 </varlistentry>
2430 <varlistentry>
2431 <term><sgmltag>mathphrase</sgmltag></term>
2432 <listitem><para>&mathphrase.purpose;.<indexterm><primary>mathphrase element</primary></indexterm>
2433 </para></listitem>
2434 </varlistentry>
2435 <varlistentry>
2436 <term><sgmltag>Subscript</sgmltag></term>
2437 <listitem><para>&subscript.purpose;.<indexterm><primary>Subscript element</primary></indexterm>
2438 </para></listitem>
2439 </varlistentry>
2440 <varlistentry>
2441 <term><sgmltag>Superscript</sgmltag></term>
2442 <listitem><para>&superscript.purpose;.<indexterm><primary>Superscript element</primary></indexterm>
2443 </para></listitem>
2444 </varlistentry>
2445 </variablelist>
2446 </sect3>
2447 <sect3><title>User interfaces</title>
2448 <para>
2449 These elements describe aspects of a user interface:
2450 <indexterm><primary>user interfaces, describing (elements)</primary></indexterm>
2451 <indexterm><primary>elements</primary>
2452 <secondary>user interfaces, describing</secondary></indexterm>
2453
2454 </para>
2455 <variablelist>
2456 <varlistentry>
2457 <term><sgmltag>Accel</sgmltag></term>
2458 <listitem><para>&accel.purpose;.<indexterm><primary>Accel element</primary></indexterm>
2459 </para></listitem>
2460 </varlistentry>
2461 <varlistentry>
2462 <term><sgmltag>GUIButton</sgmltag></term>
2463 <listitem><para>&guibutton.purpose;.<indexterm><primary>GuIButton element</primary></indexterm>
2464 </para></listitem>
2465 </varlistentry>
2466 <varlistentry>
2467 <term><sgmltag>GUIIcon</sgmltag></term>
2468 <listitem><para>&guiicon.purpose;.<indexterm><primary>GUIIcon element</primary></indexterm>
2469 </para></listitem>
2470 </varlistentry>
2471 <varlistentry>
2472 <term><sgmltag>GUILabel</sgmltag></term>
2473 <listitem><para>&guilabel.purpose;.</para></listitem>
2474 </varlistentry>
2475 <varlistentry>
2476 <term><sgmltag>GUIMenu</sgmltag></term>
2477 <listitem><para>&guimenu.purpose;.<indexterm><primary>GUIMenu element</primary></indexterm>
2478 </para></listitem>
2479 </varlistentry>
2480 <varlistentry>
2481 <term><sgmltag>GUIMenuItem</sgmltag></term>
2482 <listitem><para>&guimenuitem.purpose;.<indexterm><primary>GUIMenuItem element</primary></indexterm>
2483 </para></listitem>
2484 </varlistentry>
2485 <varlistentry>
2486 <term><sgmltag>GUISubmenu</sgmltag></term>
2487 <listitem><para>&guisubmenu.purpose;.<indexterm><primary>GUISubmenu element</primary></indexterm>
2488 </para></listitem>
2489 </varlistentry>
2490 <varlistentry>
2491 <term><sgmltag>KeyCap</sgmltag></term>
2492 <listitem><para>&keycap.purpose;.<indexterm><primary>KeyCap element</primary></indexterm>
2493 </para></listitem>
2494 </varlistentry>
2495 <varlistentry>
2496 <term><sgmltag>KeyCode</sgmltag></term>
2497 <listitem><para>&keycode.purpose;.<indexterm><primary>KeyCode class</primary></indexterm>
2498 </para></listitem>
2499 </varlistentry>
2500 <varlistentry>
2501 <term><sgmltag>KeyCombo</sgmltag></term>
2502 <listitem><para>&keycombo.purpose;.<indexterm><primary>KeyCombo element</primary></indexterm>
2503 </para></listitem>
2504 </varlistentry>
2505 <varlistentry>
2506 <term><sgmltag>KeySym</sgmltag></term>
2507 <listitem><para>&keysym.purpose;.<indexterm><primary>KeySym element</primary></indexterm>
2508 </para></listitem>
2509 </varlistentry>
2510 <varlistentry>
2511 <term><sgmltag>MenuChoice</sgmltag></term>
2512 <listitem><para>&menuchoice.purpose;.<indexterm><primary>MenuChoice element</primary></indexterm>
2513 </para></listitem>
2514 </varlistentry>
2515 <varlistentry>
2516 <term><sgmltag>MouseButton</sgmltag></term>
2517 <listitem><para>&mousebutton.purpose;.<indexterm><primary>MouseButton element</primary></indexterm>
2518 </para></listitem>
2519 </varlistentry>
2520 <varlistentry>
2521 <term><sgmltag>Shortcut</sgmltag></term>
2522 <listitem><para>&shortcut.purpose;.<indexterm><primary>Shortcut element</primary></indexterm>
2523 </para></listitem>
2524 </varlistentry>
2525 </variablelist>
2526 </sect3>
2527 <sect3><title>Programming languages and constructs</title>
2528 <para>
2529 <indexterm><primary>programming languages (elements)</primary></indexterm>
2530 <indexterm><primary>constructs (programming), elements</primary></indexterm>
2531 <indexterm><primary>inline elements</primary>
2532 <secondary>programming languages and constructs</secondary></indexterm>
2533 <indexterm><primary>elements</primary>
2534 <secondary>programming languages and constructs</secondary></indexterm>
2535 <indexterm><primary>inline elements</primary>
2536 <secondary>technical</secondary></indexterm>
2537
2538 Many of the technical inlines in DocBook are related to programming.
2539 </para>
2540 <variablelist>
2541 <varlistentry>
2542 <term><sgmltag>Action</sgmltag></term>
2543 <listitem><para>&action.purpose;.<indexterm><primary>Action element</primary></indexterm>
2544 </para></listitem>
2545 </varlistentry>
2546 <varlistentry>
2547 <term><sgmltag>ClassName</sgmltag></term>
2548 <listitem><para>&classname.purpose;.<indexterm><primary>ClassName element</primary></indexterm>
2549 </para></listitem>
2550 </varlistentry>
2551 <varlistentry>
2552 <term><sgmltag>Constant</sgmltag></term>
2553 <listitem><para>&constant.purpose;.<indexterm><primary>Constant element</primary></indexterm>
2554 </para></listitem>
2555 </varlistentry>
2556 <varlistentry>
2557 <term><sgmltag>ErrorCode</sgmltag></term>
2558 <listitem><para>&errorcode.purpose;.<indexterm><primary>ErrorCode element</primary></indexterm>
2559 </para></listitem>
2560 </varlistentry>
2561 <varlistentry>
2562 <term><sgmltag>ErrorName</sgmltag></term>
2563 <listitem><para>&errorname.purpose;.<indexterm><primary>ErrorName element</primary></indexterm>
2564 </para></listitem>
2565 </varlistentry>
2566 <varlistentry>
2567 <term><sgmltag>ErrorType</sgmltag></term>
2568 <listitem><para>&errortype.purpose;.<indexterm><primary>ErrorType element</primary></indexterm>
2569 </para></listitem>
2570 </varlistentry>
2571 <varlistentry>
2572 <term><sgmltag>Function</sgmltag></term>
2573 <listitem><para>&function.purpose;.<indexterm><primary>Function element</primary></indexterm>
2574 </para></listitem>
2575 </varlistentry>
2576 <varlistentry>
2577 <term><sgmltag>Interface</sgmltag></term>
2578 <listitem><para>&interface.purpose;.<indexterm><primary>Interface element</primary></indexterm>
2579 </para></listitem>
2580 </varlistentry>
2581 <varlistentry>
2582 <term><sgmltag>InterfaceDefinition</sgmltag></term>
2583 <listitem><para>&interfacedefinition.purpose;.<indexterm><primary>InterfaceDefinition element</primary></indexterm>
2584 </para></listitem>
2585 </varlistentry>
2586 <varlistentry>
2587 <term><sgmltag>Literal</sgmltag></term>
2588 <listitem><para>&literal.purpose;.<indexterm><primary>Literal element</primary></indexterm>
2589 </para></listitem>
2590 </varlistentry>
2591 <varlistentry>
2592 <term><sgmltag>MsgText</sgmltag></term>
2593 <listitem><para>&msgtext.purpose;.<indexterm><primary>MsgText element</primary></indexterm>
2594 </para></listitem>
2595 </varlistentry>
2596 <varlistentry>
2597 <term><sgmltag>Parameter</sgmltag></term>
2598 <listitem><para>&parameter.purpose;.<indexterm><primary>Parameter element</primary></indexterm>
2599 </para></listitem>
2600 </varlistentry>
2601 <varlistentry>
2602 <term><sgmltag>Property</sgmltag></term>
2603 <listitem><para>&property.purpose;.<indexterm><primary>Property element</primary></indexterm>
2604 </para></listitem>
2605 </varlistentry>
2606 <varlistentry>
2607 <term><sgmltag>Replaceable</sgmltag></term>
2608 <listitem><para>&replaceable.purpose;.<indexterm><primary>Replaceable element</primary></indexterm>
2609 </para></listitem>
2610 </varlistentry>
2611 <varlistentry>
2612 <term><sgmltag>ReturnValue</sgmltag></term>
2613 <listitem><para>&returnvalue.purpose;.<indexterm><primary>ReturnValue element</primary></indexterm>
2614 </para></listitem>
2615 </varlistentry>
2616 <varlistentry>
2617 <term><sgmltag>StructField</sgmltag></term>
2618 <listitem><para>&structfield.purpose;.<indexterm><primary>StructField element</primary></indexterm>
2619 </para></listitem>
2620 </varlistentry>
2621 <varlistentry>
2622 <term><sgmltag>StructName</sgmltag></term>
2623 <listitem><para>&structname.purpose;.<indexterm><primary>StructName element</primary></indexterm>
2624 </para></listitem>
2625 </varlistentry>
2626 <varlistentry>
2627 <term><sgmltag>Symbol</sgmltag></term>
2628 <listitem><para>&symbol.purpose;.<indexterm><primary>Symbol element</primary></indexterm>
2629 </para></listitem>
2630 </varlistentry>
2631 <varlistentry>
2632 <term><sgmltag>Token</sgmltag></term>
2633 <listitem><para>&token.purpose;.<indexterm><primary>Token element</primary></indexterm>
2634 </para></listitem>
2635 </varlistentry>
2636 <varlistentry>
2637 <term><sgmltag>Type</sgmltag></term>
2638 <listitem><para>&type.purpose;.<indexterm><primary>Type element</primary></indexterm>
2639 </para></listitem>
2640 </varlistentry>
2641 <varlistentry>
2642 <term><sgmltag>VarName</sgmltag></term>
2643 <listitem><para>&varname.purpose;.<indexterm><primary>VarName element</primary></indexterm>
2644 </para></listitem>
2645 </varlistentry>
2646 </variablelist>
2647 </sect3>
2648 <sect3><title>Operating systems</title>
2649 <para>
2650 <indexterm><primary>operating systems</primary>
2651 <secondary>inline elements</secondary></indexterm>
2652
2653 These inlines identify parts of an operating system, or an
2654 operating environment:
2655 </para>
2656 <variablelist>
2657 <varlistentry>
2658 <term><sgmltag>Application</sgmltag></term>
2659 <listitem><para>&application.purpose;.<indexterm><primary>Application element</primary></indexterm>
2660 </para></listitem>
2661 </varlistentry>
2662 <varlistentry>
2663 <term><sgmltag>Command</sgmltag></term>
2664 <listitem><para>&command.purpose;.<indexterm><primary>Command element</primary></indexterm>
2665 </para></listitem>
2666 </varlistentry>
2667 <varlistentry>
2668 <term><sgmltag>EnVar</sgmltag></term>
2669 <listitem><para>&envar.purpose;.<indexterm><primary>EnVar element</primary></indexterm>
2670 </para></listitem>
2671 </varlistentry>
2672 <varlistentry>
2673 <term><sgmltag>Filename</sgmltag></term>
2674 <listitem><para>&filename.purpose;.<indexterm><primary>Filename element</primary></indexterm>
2675 </para></listitem>
2676 </varlistentry>
2677 <varlistentry>
2678 <term><sgmltag>MediaLabel</sgmltag></term>
2679 <listitem><para>&medialabel.purpose;.<indexterm><primary>MediaLabel element</primary></indexterm>
2680 </para></listitem>
2681 </varlistentry>
2682 <varlistentry>
2683 <term><sgmltag>MsgText</sgmltag></term>
2684 <listitem><para>&msgtext.purpose;.<indexterm><primary>MsgText element</primary></indexterm>
2685 </para></listitem>
2686 </varlistentry>
2687 <varlistentry>
2688 <term><sgmltag>Option</sgmltag></term>
2689 <listitem><para>&option.purpose;.<indexterm><primary>Option element</primary></indexterm>
2690 </para></listitem>
2691 </varlistentry>
2692 <varlistentry>
2693 <term><sgmltag>Parameter</sgmltag></term>
2694 <listitem><para>&parameter.purpose;.<indexterm><primary>Parameter element</primary></indexterm>
2695 </para></listitem>
2696 </varlistentry>
2697 <varlistentry>
2698 <term><sgmltag>Prompt</sgmltag></term>
2699 <listitem><para>&prompt.purpose;.<indexterm><primary>Prompt element</primary></indexterm>
2700 </para></listitem>
2701 </varlistentry>
2702 <varlistentry>
2703 <term><sgmltag>SystemItem</sgmltag></term>
2704 <listitem><para>&systemitem.purpose;.<indexterm><primary>SystemItem element</primary></indexterm>
2705 </para></listitem>
2706 </varlistentry>
2707 </variablelist>
2708 </sect3>
2709 <sect3><title>General purpose</title>
2710 <para>
2711 <indexterm><primary>general-purpose technical inline elements</primary></indexterm>
2712 <indexterm><primary>inline elements</primary>
2713 <secondary>technical (general-purpose)</secondary></indexterm>
2714
2715 There are also a number of general-purpose technical inlines.
2716 </para>
2717 <variablelist>
2718 <varlistentry>
2719 <term><sgmltag>Application</sgmltag></term>
2720 <listitem><para>&application.purpose;.<indexterm><primary>Application element</primary></indexterm>
2721 </para></listitem>
2722 </varlistentry>
2723 <varlistentry>
2724 <term><sgmltag>Database</sgmltag></term>
2725 <listitem><para>&database.purpose;.<indexterm><primary>Database element</primary></indexterm>
2726 </para></listitem>
2727 </varlistentry>
2728 <varlistentry>
2729 <term><sgmltag>Email</sgmltag></term>
2730 <listitem><para>&email.purpose;.<indexterm><primary>Email element</primary></indexterm>
2731 </para></listitem>
2732 </varlistentry>
2733 <varlistentry>
2734 <term><sgmltag>Filename</sgmltag></term>
2735 <listitem><para>&filename.purpose;.<indexterm><primary>Filename element</primary></indexterm>
2736 </para></listitem>
2737 </varlistentry>
2738 <varlistentry>
2739 <term><sgmltag>Hardware</sgmltag></term>
2740 <listitem><para>&hardware.purpose;.<indexterm><primary>Hardware element</primary></indexterm>
2741 </para></listitem>
2742 </varlistentry>
2743 <varlistentry>
2744 <term><sgmltag>InlineGraphic</sgmltag></term>
2745 <listitem><para>&inlinegraphic.purpose;.<indexterm><primary>InlineGraphic element</primary></indexterm>
2746 </para></listitem>
2747 </varlistentry>
2748 <varlistentry>
2749 <term><sgmltag>Literal</sgmltag></term>
2750 <listitem><para>&literal.purpose;.<indexterm><primary>Literal element</primary></indexterm>
2751 </para></listitem>
2752 </varlistentry>
2753 <varlistentry>
2754 <term><sgmltag>MediaLabel</sgmltag></term>
2755 <listitem><para>&medialabel.purpose;.<indexterm><primary>MediaLabel element</primary></indexterm>
2756 </para></listitem>
2757 </varlistentry>
2758 <varlistentry>
2759 <term><sgmltag>Option</sgmltag></term>
2760 <listitem><para>&option.purpose;.<indexterm><primary>Option element</primary></indexterm>
2761 </para></listitem>
2762 </varlistentry>
2763 <varlistentry>
2764 <term><sgmltag>Optional</sgmltag></term>
2765 <listitem><para>&optional.purpose;.<indexterm><primary>Optional element</primary></indexterm>
2766 </para></listitem>
2767 </varlistentry>
2768 <varlistentry>
2769 <term><sgmltag>Replaceable</sgmltag></term>
2770 <listitem><para>&replaceable.purpose;.<indexterm><primary>Replaceable element</primary></indexterm>
2771 </para></listitem>
2772 </varlistentry>
2773 <varlistentry>
2774 <term><sgmltag>Symbol</sgmltag></term>
2775 <listitem><para>&symbol.purpose;.<indexterm><primary>Symbol element</primary></indexterm>
2776 </para></listitem>
2777 </varlistentry>
2778 <varlistentry>
2779 <term><sgmltag>Token</sgmltag></term>
2780 <listitem><para>&token.purpose;.<indexterm><primary>Token element</primary></indexterm>
2781 </para></listitem>
2782 </varlistentry>
2783 <varlistentry>
2784 <term><sgmltag>Type</sgmltag></term>
2785 <listitem><para>&type.purpose;.<indexterm><primary>Type element</primary></indexterm>
2786 </para></listitem>
2787 </varlistentry>
2788 </variablelist>
2789 </sect3>
2790 </sect2>
2791 </sect1>
2792 <sect1 id="ch02-makebook"><title>Making a DocBook Book</title>
2793 <para>
2794 <indexterm><primary>DocBook DTD</primary>
2795 <secondary>Book, making</secondary></indexterm>
2796 <indexterm><primary>books</primary>
2797 <secondary>DocBook, making</secondary></indexterm>
2798 <indexterm><primary>meta-information</primary>
2799 <secondary>DocBook Book</secondary></indexterm>
2800
2801 A typical <sgmltag>Book</sgmltag>, in English at least, consists of
2802 some meta-information in a <sgmltag>BookInfo</sgmltag>
2803 (<sgmltag>Title</sgmltag>, <sgmltag>Author</sgmltag>,
2804 <sgmltag>Copyright</sgmltag>, and so on), one or more <sgmltag>
2805 Preface</sgmltag>s, several <sgmltag>Chapter</sgmltag>s, and perhaps a
2806 few <sgmltag>Appendix</sgmltag>es. A <sgmltag>Book</sgmltag> may also
2807 contain <sgmltag>Bibliography</sgmltag>s,
2808 <sgmltag>Glossary</sgmltag>s, <sgmltag>Index</sgmltag>es and a
2809 <sgmltag>Colophon</sgmltag>.
2810 </para>
2811 <para>
2812 <xref linkend="ex-typicalbook"/> shows the structure of a typical book.
2813 Additional content is required where the ellipses occur.
2814 <indexterm><primary>books</primary>
2815 <secondary>typical structure</secondary></indexterm>
2816
2817 </para>
2818 <example id="ex-typicalbook">
2819 <title>A Typical Book</title>
2820 <programlisting>&lt;!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V3.1//EN">
2821 &lt;book>
2822 &lt;bookinfo>
2823 &lt;title>My First Book&lt;/title>
2824 &lt;author>&lt;firstname>Jane&lt;/firstname>&lt;surname>Doe&lt;/surname>&lt;/author>
2825 &lt;copyright>&lt;year>1998&lt;/year>&lt;holder>Jane Doe&lt;/holder>&lt;/copyright>
2826 &lt;/bookinfo>
2827 &lt;preface>&lt;title>Foreword&lt;/title> ... &lt;/preface>
2828 &lt;chapter> ... &lt;/chapter>
2829 &lt;chapter> ... &lt;/chapter>
2830 &lt;chapter> ... &lt;/chapter>
2831 &lt;appendix> ... &lt;/appendix>
2832 &lt;appendix> ... &lt;/appendix>
2833 &lt;index> ... &lt;/index>
2834 &lt;/book></programlisting>
2835 </example>
2836 </sect1>
2837 <sect1 id="ch02-makechap"><title>Making a Chapter</title>
2838 <para>
2839 <indexterm><primary>Chapter element</primary>
2840 <secondary>typical chapter, structure</secondary></indexterm>
2841 <indexterm><primary>Preface element</primary>
2842 <secondary>typical structure</secondary></indexterm>
2843 <indexterm><primary>Appendix element</primary>
2844 <secondary>typical structure</secondary></indexterm>
2845
2846 <sgmltag>Chapter</sgmltag>s, <sgmltag>Preface</sgmltag>s, and
2847 <sgmltag>Appendix</sgmltag>es all have a similar structure. They
2848 consist of a <sgmltag>Title</sgmltag>, possibly some additional
2849 meta-information, and any number of block-level elements followed by
2850 any number of top-level sections. Each section may in turn contain any
2851 number of block-level elements followed by any number from the next
2852 section level, as shown in <xref linkend="ex-typicalchap"/>.
2853 </para>
2854 <example id="ex-typicalchap">
2855 <title>A Typical Chapter</title>
2856 <programlisting>&lt;!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook V3.1//EN">
2857 &lt;chapter>&lt;title>My Chapter&lt;/title>
2858 &lt;para> ... &lt;/para>
2859 &lt;sect1>&lt;title>First Section&lt;/title>
2860 &lt;para> ... &lt;/para>
2861 &lt;example> ... &lt;/example>
2862 &lt;/sect1>
2863 &lt;/chapter>
2864 </programlisting>
2865 </example>
2866 </sect1>
2867 <sect1 id="making-article">
2868 <title>Making an Article</title>
2869 <para>
2870 <indexterm><primary>articles</primary>
2871 <secondary>creating</secondary></indexterm>
2872 <indexterm><primary>elements</primary>
2873 <secondary>component-level</secondary></indexterm>
2874 <indexterm><primary>components</primary>
2875 <secondary>elements</secondary></indexterm>
2876 <indexterm><primary>journal articles</primary></indexterm>
2877 <indexterm><primary>white papers, creating</primary></indexterm>
2878
2879 For documents smaller than a book, such as: journal articles, white
2880 papers, or technical notes, <sgmltag>Article</sgmltag> is frequently
2881 the most logical starting point. The body of an
2882 <sgmltag>Article</sgmltag> is essentially the same as the body of a
2883 <sgmltag>Chapter</sgmltag> or any other component-level element, as
2884 shown in <xref linkend="ex-typicalart"/>
2885 </para>
2886 <para>
2887 <sgmltag>Article</sgmltag>s may include
2888 <sgmltag>Appendix</sgmltag>es, <sgmltag>Bibliography</sgmltag>s,
2889 <sgmltag>Index</sgmltag>es and <sgmltag>Glossary</sgmltag>s.
2890 </para>
2891 <example id="ex-typicalart">
2892 <title>A Typical Article</title>
2893 <programlisting>&lt;!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V3.1//EN">
2894 &lt;article>
2895 &lt;artheader>
2896 &lt;title>My Article&lt;/title>
2897 &lt;author>&lt;honorific>Dr&lt;/honorific>&lt;firstname>Emilio&lt;/firstname>
2898 &lt;surname>Lizardo&lt;/surname>&lt;/author>
2899 &lt;/artheader>
2900 &lt;para> ... &lt;/para>
2901 &lt;sect1>&lt;title>On the Possibility of Going Home&lt;/title>
2902 &lt;para> ... &lt;/para>
2903 &lt;/sect1>
2904 &lt;bibliography> ... &lt;/bibliography>
2905 &lt;/article>
2906 </programlisting>
2907 </example>
2908 </sect1>
2909 <sect1 id="making-refentry"><title>Making a Reference Page</title>
2910 <para>
2911 <indexterm><primary>reference pages</primary>
2912 <secondary>creating</secondary></indexterm>
2913 <indexterm><primary>manual page, creating</primary></indexterm>
2914 <indexterm><primary>UNIX</primary>
2915 <secondary>manpage</secondary></indexterm>
2916 <indexterm><primary>manpage (UNIX)</primary></indexterm>
2917
2918 The reference page or manual page in DocBook was inspired by, and in
2919 fact designed to reproduce, the common &UNIX; &ldquo;manpage&rdquo;
2920 concept. (We use the word "page" loosely here to mean a document of
2921 variable length containing reference material on a specific topic.)
2922 DocBook is rich in markup tailored for such documents, which often
2923 vary greatly in content, however well-structured they may be. To
2924 reflect both the structure and the variability of such texts, DocBook
2925 specifies that reference pages have a strict sequence of parts, even
2926 though several of them are actually optional.
2927 </para>
2928 <para>
2929 <indexterm><primary>RefEntry element</primary>
2930 <secondary>elements, obligatory</secondary></indexterm>
2931 <indexterm><primary>RefNameDiv element</primary></indexterm>
2932 <indexterm><primary>RefSect1 element</primary></indexterm>
2933
2934 Of the following sequence of elements that may appear in a <sgmltag class="element">RefEntry</sgmltag>, only two are obligatory: <sgmltag class="element">RefNameDiv</sgmltag> and <sgmltag class="element">RefSect1</sgmltag>.
2935 <variablelist>
2936 <varlistentry>
2937 <term><sgmltag class="element">DocInfo</sgmltag></term>
2938 <listitem>
2939 <para>
2940 <indexterm><primary>DocInfo element</primary>
2941 <secondary>reference page, meta-information</secondary></indexterm>
2942 <indexterm><primary>meta-information</primary>
2943 <secondary>reference page</secondary></indexterm>
2944
2945 The <sgmltag class="element">DocInfo</sgmltag> element contains
2946 meta-information about the reference page (which should not be
2947 confused with <sgmltag class="element">RefMeta</sgmltag>, which it
2948 precedes). It marks up information about the author of the document,
2949 or the product to which it pertains, or the document's revision
2950 history, or other such information.</para>
2951 </listitem>
2952 </varlistentry>
2953 <varlistentry>
2954 <term><sgmltag class="element">RefMeta</sgmltag></term>
2955 <listitem>
2956 <para>
2957 <indexterm><primary>RefMeta element</primary></indexterm>
2958 <indexterm><primary>titles</primary>
2959 <secondary>reference pages</secondary></indexterm>
2960 <indexterm><primary>volume number (reference page)</primary></indexterm>
2961 <indexterm><primary>ManVolNum</primary></indexterm>
2962 <indexterm><primary>UNIX</primary>
2963 <secondary>ManVolNum</secondary></indexterm>
2964 <indexterm><primary>uname command and uname function, distinguishing</primary></indexterm>
2965
2966 <sgmltag class="element">RefMeta</sgmltag> contains a title for
2967 the reference page (which may be inferred if the
2968 <sgmltag>RefMeta</sgmltag> element is not present) and an indication
2969 of the volume number in which this reference page occurs. The
2970 <sgmltag>ManVolNum</sgmltag> is a very &UNIX;-centric concept. In
2971 traditional &UNIX; documentation, the subject of a reference page is
2972 typically identified by name and volume number; this allows you to
2973 distinguish between the <command>uname</command> command,
2974 <quote>uname(1)</quote> in volume 1 of the documentation and the
2975 <function>uname</function> function, <quote>uname(3)</quote> in
2976 volume 3.
2977 </para>
2978 <para>
2979 <indexterm><primary>RefMiscInfo element</primary></indexterm>
2980 <indexterm><primary>miscellaneous information, reference pages</primary></indexterm>
2981
2982 Additional information of this sort such as conformance or
2983 vendor information specific to the particular environment you are
2984 working in, may be stored in <sgmltag>RefMiscInfo</sgmltag>.
2985 </para>
2986 </listitem>
2987 </varlistentry>
2988 <varlistentry>
2989 <term><sgmltag class="element">RefNameDiv</sgmltag></term>
2990 <listitem>
2991 <para>
2992 <indexterm><primary>RefNameDiv element</primary></indexterm>
2993 <indexterm><primary>RefDescriptor element</primary></indexterm>
2994 <indexterm><primary>RefName element</primary></indexterm>
2995 <indexterm><primary>RefPurpose element</primary></indexterm>
2996 <indexterm><primary>purpose (reference pages)</primary></indexterm>
2997 <indexterm><primary>RefClass element</primary></indexterm>
2998 <indexterm><primary>operating systems</primary>
2999 <secondary>configurations, software support</secondary></indexterm>
3000
3001 The first obligatory element is <sgmltag class="element">RefNameDiv</sgmltag>, which is a wrapper for
3002 information about whatever you're documenting, rather than the
3003 document itself. It can begin with a <sgmltag class="element">RefDescriptor</sgmltag> if several items are being
3004 documented as a group and the group has a name. The <sgmltag class="element">RefNameDiv</sgmltag> must contain at least one
3005 <sgmltag class="element">RefName</sgmltag>, that is, the name of
3006 whatever you're documenting, and a single short statement that sums up
3007 the use or function of the item(s) at a glance: their <sgmltag class="element">RefPurpose</sgmltag>. Also available is the <sgmltag class="element">RefClass</sgmltag>, intended to detail the
3008 operating system configurations that the software element in question
3009 supports.
3010 </para>
3011 <para>
3012 <indexterm><primary>titles</primary>
3013 <secondary>reference pages</secondary></indexterm>
3014 <indexterm><primary>RefEntryTitle element</primary></indexterm>
3015
3016 If no <sgmltag>RefEntryTitle</sgmltag> is given in the
3017 <sgmltag>RefMeta</sgmltag>, the title of the reference page is the
3018 <sgmltag>RefDescriptor</sgmltag>, if present, or the first
3019 <sgmltag>RefName</sgmltag>.
3020 </para>
3021 </listitem>
3022 </varlistentry>
3023 <varlistentry>
3024 <term><sgmltag class="element">RefSynopsisDiv</sgmltag></term>
3025 <listitem>
3026 <para>
3027 <indexterm><primary>RefSynopsisDiv element</primary></indexterm>
3028 <indexterm><primary>synopses</primary>
3029 <secondary>reference topics</secondary></indexterm>
3030 <indexterm><primary>commands</primary>
3031 <secondary>syntax summary</secondary></indexterm>
3032 <indexterm><primary>functions</primary>
3033 <secondary>function prototype</secondary></indexterm>
3034 <indexterm><primary>Title element</primary></indexterm>
3035
3036 A <sgmltag class="element">RefSynopsisDiv</sgmltag> is intended
3037 to provide a quick synopsis of the topic covered by the reference
3038 page. For commands, this is generally a syntax summary of the command,
3039 and for functions, the function prototype, but other options are
3040 possible. A <sgmltag class="element">Title</sgmltag> is allowed, but
3041 not required, presumably because the application that processes
3042 reference pages will generate the appropriate title if it is not
3043 given. In traditional &UNIX; documentation, its title is always
3044 &ldquo;Synopsis&rdquo;.
3045 </para>
3046 </listitem>
3047 </varlistentry>
3048 <varlistentry>
3049 <term><sgmltag>RefSect1</sgmltag>&hellip;<sgmltag>RefSect3</sgmltag></term>
3050 <listitem>
3051 <para>
3052 <indexterm><primary>sections</primary>
3053 <secondary>RefEntry, levels</secondary></indexterm>
3054 <indexterm><primary>RefSect1&hellip;RefSect3</primary></indexterm>
3055
3056 Within <sgmltag>RefEntry</sgmltag>s, there are only three levels
3057 of sectioning elements: <sgmltag>RefSect1</sgmltag>,
3058 <sgmltag>RefSect2</sgmltag>, and <sgmltag>RefSect3</sgmltag>.</para>
3059 </listitem>
3060 </varlistentry>
3061 </variablelist>
3062 </para>
3063 <para>
3064 <xref linkend="ex-samprefpage"/> shows the beginning of a <sgmltag class="element">RefEntry</sgmltag> that illustrates one possible
3065 reference page:
3066 <indexterm><primary>reference pages</primary>
3067 <secondary>sample page</secondary></indexterm>
3068 </para>
3069 <example id="ex-samprefpage">
3070 <title>A Sample Reference Page</title>
3071 <programlisting>
3072 <![CDATA[
3073 <refentry id="printf">
3074
3075 <refmeta>
3076 <refentrytitle>printf</refentrytitle>
3077 <manvolnum>3S</manvolnum>
3078 </refmeta>
3079
3080 <refnamediv>
3081 <refname>printf</refname>
3082 <refname>fprintf</refname>
3083 <refname>sprintf</refname>
3084 <refpurpose>print formatted output</refpurpose>
3085 </refnamediv>
3086
3087 <refsynopsisdiv>
3088
3089 <funcsynopsis>
3090 <funcsynopsisinfo>
3091 #include &lt;stdio.h&gt;
3092 </funcsynopsisinfo>
3093 <funcprototype>
3094 <funcdef>int <function>printf</function></funcdef>
3095 <paramdef>const char *<parameter>format</parameter></paramdef>
3096 <paramdef>...</paramdef>
3097 </funcprototype>
3098
3099 <funcprototype>
3100 <funcdef>int <function>fprintf</function></funcdef>
3101 <paramdef>FILE *<parameter>strm</parameter></paramdef>
3102 <paramdef>const char *<parameter>format</parameter></paramdef>
3103 <paramdef>...</paramdef>
3104 </funcprototype>
3105
3106 <funcprototype>
3107 <funcdef>int <function>sprintf</function></funcdef>
3108 <paramdef>char *<parameter>s</parameter></paramdef>
3109 <paramdef>const char *<parameter>format</parameter></paramdef>
3110 <paramdef>...</paramdef>
3111 </funcprototype>
3112 </funcsynopsis>
3113
3114 </refsynopsisdiv>
3115
3116 <refsect1><title>Description</title>
3117 <para>
3118 <indexterm><primary>functions</primary>
3119 <secondary>printf</secondary></indexterm>
3120 <indexterm><primary>printing function</primary></indexterm>
3121
3122 <function>printf</function> places output on the standard
3123 output stream stdout.
3124 &hellip;
3125 </para>
3126 </refsect1>
3127 </refentry>]]></programlisting>
3128 </example>
3129 </sect1>
3130 <sect1 id="ch02-makefrontback"><title>Making Front- and Backmatter</title>
3131 <para>
3132 <indexterm><primary>frontmatter, books and articles</primary></indexterm>
3133 <indexterm><primary>backmatter, books and articles</primary></indexterm>
3134 <indexterm><primary>indexes</primary>
3135 <secondary>creating, books and articles</secondary></indexterm>
3136 <indexterm><primary>glossaries</primary>
3137 <secondary>creating</secondary></indexterm>
3138 <indexterm><primary>tables of contents</primary>
3139 <secondary>creating, books and articles</secondary></indexterm>
3140
3141 DocBook contains markup for the usual variety of front- and backmatter
3142 necessary for books and articles: indexes, glossaries, bibliographies,
3143 and tables of contents. In many cases, these components are generated
3144 automatically, at least in part, from your document by an external
3145 processor, but you can create them by hand, and in either case, store
3146 them in DocBook.
3147 </para>
3148 <para>
3149 <indexterm><primary>markup</primary>
3150 <secondary>backmatter, books and articles</secondary></indexterm>
3151
3152 Some forms of backmatter, like indexes and glossaries, usually require
3153 additional markup <emphasis>in the document</emphasis> to make
3154 generation by an application possible. Bibliographies are usually
3155 composed by hand like the rest of your text, unless you are
3156 automatically selecting bibliographic entries out of some larger
3157 database. Our principal concern here is to acquaint you with the kind
3158 of markup you need to include in your documents if you want to
3159 construct these components.
3160 </para>
3161 <para>
3162 Frontmatter, like the table of contents, is almost always generated
3163 automatically from the text of a document by the processing
3164 application. If you need information about how to mark up a table of
3165 contents in DocBook, please consult the reference page for
3166 <sgmltag>ToC</sgmltag>.
3167 </para>
3168 <sect2 id="makeindex"><title>Making an Index</title>
3169 <para>
3170 <indexterm><primary>indexes</primary>
3171 <secondary>marking index terms</secondary></indexterm>
3172 In some highly-structured documents such as reference manuals, you can
3173 automate the whole process of generating an index successfully without
3174 altering or adding to the original source. You can design a processing
3175 application to select the information and compile it into an adequate
3176 index. But this is rare.
3177 </para>
3178 <para>
3179 In most cases&mdash;and even in the case of some reference
3180 manuals&mdash;a useful index still requires human intervention to mark
3181 occurrences of words or concepts that will appear in the text of the
3182 index.
3183 </para>
3184 <sect3><title>Marking index terms</title>
3185 <para>
3186 <indexterm><primary>singular index markers</primary></indexterm>
3187 <indexterm><primary>ranges, index entries</primary></indexterm>
3188
3189 Docbook distinguishes two kinds of index markers: those that are
3190 singular and result in a single page entry in the index itself, and
3191 those that are multiple and refer to a range of pages.
3192 </para>
3193 <para>You put a singular index marker where the subject it refers to
3194 actually occurs in your text:
3195 <screen>
3196 &lt;para>
3197 The tiger&lt;indexterm>
3198 &lt;primary>Big Cats&lt;/primary>
3199 &lt;secondary>Tigers&lt;/secondary>&lt;/indexterm>
3200 is a very large cat indeed.
3201 &lt;/para>
3202 </screen>
3203 <indexterm><primary>primary level index entries</primary></indexterm>
3204 <indexterm><primary>secondary level index entries</primary></indexterm>
3205 <indexterm><primary>tertiary level index entries</primary></indexterm>
3206 This index term has two levels, <sgmltag>primary</sgmltag> and
3207 <sgmltag>secondary</sgmltag>. They correspond to an increasing amount
3208 of indented text in the resultant index. DocBook allows for three
3209 levels of index terms, with the third labeled
3210 <sgmltag>tertiary</sgmltag>.
3211 </para>
3212 <para>
3213 <indexterm><primary>starting index terms (ranges)</primary></indexterm>
3214 <indexterm><primary>ending index terms (ranges)</primary></indexterm>
3215
3216 There are two ways that you can index a range of text. The first is to
3217 put index marks at both the beginning and end of the discussion. The
3218 mark at the beginning asserts that it is the start of a range, and the
3219 mark at the end refers back to the beginning. In this way, the
3220 processing application can determine what range of text is
3221 indexed. Here's the previous tiger example recast as starting and
3222 ending index terms:
3223 </para>
3224 <screen>
3225 &lt;para>
3226 The tiger&lt;indexterm id="tiger-desc" class="startofrange">
3227 &lt;primary>Big Cats&lt;/primary>
3228 &lt;secondary>Tigers&lt;/secondary>&lt;/indexterm>
3229 is a very large cat indeed&hellip;
3230 &lt;/para>
3231 &vellip;
3232 &lt;para>
3233 So much for tigers&lt;indexterm startref="tiger-desc" class="endofrange">. Let's talk about
3234 leopards.
3235 &lt;/para>
3236 </screen>
3237 <para>
3238 <indexterm><primary>ID attribute</primary>
3239 <secondary>index entries, ranges</secondary></indexterm>
3240 <indexterm><primary>Class attribute</primary>
3241 <secondary>index entries, ranges</secondary></indexterm>
3242
3243 Note that the mark at the start of the range identifies itself as the
3244 start of a range with the <sgmltag class="attribute">Class</sgmltag>
3245 attribute, and provides an <sgmltag class="attribute">ID</sgmltag>.
3246 The mark at the end of the range points back to the start.
3247 </para>
3248 <para>
3249 <indexterm><primary>IndexTerm element</primary>
3250 <secondary>Zone attribute</secondary></indexterm>
3251 <indexterm><primary>Zone attribute (indexterm)</primary></indexterm>
3252
3253 Another way to mark up a range of text is to specify that the entire
3254 content of an element, such as a chapter or section, is the complete
3255 range. In this case, all you need is for the index term to point to
3256 the <sgmltag class="attribute">ID</sgmltag> of the element that
3257 contains the content in question. The <sgmltag class="attribute">Zone</sgmltag> attribute of <sgmltag>indexterm</sgmltag>
3258 provides this functionality.
3259 </para>
3260 <para>
3261 One of the interesting features of this method is that the actual
3262 index marks do not have to occur anywhere near the text being
3263 indexed. It is possible to collect all of them together, for example,
3264 in one file, but it is not invalid to have the index marker occur near
3265 the element it indexes.
3266 </para>
3267 <para>
3268 Suppose the discussion of tigers in your document comprises a
3269 whole text object (like a <sgmltag class="element">Sect1</sgmltag>
3270 or a <sgmltag class="element">Chapter</sgmltag>) with an
3271 <sgmltag class="attribute">ID</sgmltag> value of
3272 <literal>tiger-desc</literal>. You can put the following
3273 tag anywhere in your document to index that range of text:
3274 <screen>
3275 &lt;indexterm zone="tiger-desc">
3276 &lt;primary>Big Cats&lt;/primary>
3277 &lt;secondary>Tigers&lt;/secondary>&lt;/indexterm>
3278 </screen>
3279 </para>
3280 <para>
3281 <indexterm><primary>see and see also index entries</primary></indexterm>
3282 DocBook also contains markup for index hits that point to other index
3283 hits (of the same type such as "See Cats, big" or "See also
3284 Lions"). See the reference pages for <sgmltag>See</sgmltag> and
3285 <sgmltag>SeeAlso</sgmltag>.
3286 </para>
3287 </sect3>
3288 <sect3><title>Printing an index</title>
3289 <para>
3290 <indexterm><primary>indexes</primary>
3291 <secondary>printing</secondary></indexterm>
3292
3293 After you have added the appropriate markup to your document, an
3294 external application can use this information to build an index. The
3295 resulting index must have information about the page numbers on which
3296 the concepts appear. It's usually the document formatter that builds
3297 the index. In this case, it may never be instantiated in DocBook.
3298 </para>
3299 <para>
3300 <indexterm><primary>indexes</primary>
3301 <secondary>index marked up in DocBook (example)</secondary></indexterm>
3302
3303 However, there are applications that can produce an index marked up in
3304 DocBook. The following example includes some one- and two-level
3305 <sgmltag class="element">IndexEntry</sgmltag> elements (which
3306 correspond to the primary and secondary levels in the
3307 <sgmltag>indexterm</sgmltag>s themselves) that begin with the letter D:
3308 <screen>
3309 &lt;!DOCTYPE index PUBLIC "-//OASIS//DTD DocBook V3.1//EN">
3310 &lt;index>&lt;title>Index&lt;/title>
3311 &lt;indexdiv>&lt;title>D&lt;/title>
3312 &lt;indexentry>
3313 &lt;primaryie>database (bibliographic), 253, 255&lt;/primaryie>
3314 &lt;secondaryie>structure, 255&lt;/secondaryie>
3315 &lt;secondaryie>tools, 259&lt;/secondaryie>
3316 &lt;/indexentry>
3317 &lt;indexentry>
3318 &lt;primaryie>dates (language specific), 179&lt;/primaryie>
3319 &lt;/indexentry>
3320 &lt;indexentry>
3321 &lt;primaryie>DC fonts, &lt;emphasis>172&lt;/emphasis>, 177&lt;/primaryie>
3322 &lt;secondaryie>Math fonts, 177&lt;/secondaryie>
3323 &lt;/indexentry>
3324 &lt;/indexdiv>
3325 &lt;/index>
3326 </screen>
3327 </para>
3328 </sect3>
3329 </sect2>
3330 <sect2><title>Making a Glossary</title>
3331 <para>
3332 <indexterm><primary>glossaries</primary>
3333 <secondary>creating</secondary></indexterm>
3334
3335 <sgmltag>Glossary</sgmltag>s, like <sgmltag>Bibliography</sgmltag>s, are often
3336 constructed by hand. However, some applications are capable of
3337 building a skeletal index from glossary term markup in the document.
3338 If all of your terms are defined in some glossary database, it may
3339 even be possible to construct the complete glossary automatically.
3340 </para>
3341 <para>
3342 <indexterm><primary>markup</primary>
3343 <secondary>glossaries</secondary></indexterm>
3344 <indexterm><primary>GlossTerm element</primary></indexterm>
3345 <indexterm><primary>LinkEnd attribute</primary>
3346 <secondary>GlossTerm tag</secondary></indexterm>
3347 <indexterm><primary>ID attribute</primary>
3348 <secondary>glossary entries</secondary></indexterm>
3349 <indexterm><primary>links</primary>
3350 <secondary>glossary terms (text) to glossary entries</secondary></indexterm>
3351
3352 To enable automatic glossary generation, or simply automatic linking
3353 from glossary terms in the text to glossary entries, you must add
3354 markup to your documents. In the text, you markup a term for
3355 compilation later with the inline <sgmltag>GlossTerm</sgmltag>
3356 tag. This tag can have a <sgmltag class="attribute">LinkEnd</sgmltag>
3357 attribute whose value is the ID of the actual entry in the
3358 glossary.<footnote>
3359 <para>
3360 Some sophisticated formatters might even be able to establish the link
3361 simply by examining the content of the terms and the glossary. In that
3362 case, the author is not required to make explicit links.
3363 </para>
3364 </footnote>
3365 </para>
3366 <para>
3367 For instance, if you have this markup in your document:
3368 </para>
3369 <screen>
3370 &lt;glossterm linkend="xml">Extensible Markup Language&lt;/glossterm> is a new standard&hellip;
3371 </screen>
3372 <para>
3373 <indexterm><primary>glossaries</primary>
3374 <secondary>example</secondary></indexterm>
3375
3376 your glossary might look like this:
3377 </para>
3378 <screen>
3379 &lt;!DOCTYPE glossary PUBLIC "-//OASIS//DTD DocBook V3.1//EN">
3380 &lt;glossary>&lt;title>Example Glossary&lt;/title>
3381 &vellip;
3382 &lt;glossdiv>&lt;title>E&lt;/title>
3383
3384 &lt;glossentry id="xml">&lt;glossterm>Extensible Markup Language&lt;/glossterm>
3385 &lt;acronym>XML&lt;/acronym>
3386 &lt;glossdef>
3387 &lt;para>Some reasonable definition here.&lt;/para>
3388 &lt;glossseealso otherterm="sgml">
3389 &lt;/glossdef>
3390 &lt;/glossentry>
3391
3392 &lt;/glossdiv>
3393 </screen>
3394 <para>
3395 Note that the <sgmltag class="element">GlossTerm</sgmltag> tag
3396 reappears in the glossary to mark up the term and distinguish it from
3397 its definition within the <sgmltag class="element">
3398 GlossEntry</sgmltag>. The <sgmltag class="attribute">ID</sgmltag> that
3399 the <sgmltag class="element"> GlossEntry</sgmltag> referenced in the
3400 text is the <acronym>ID</acronym> of the <sgmltag class="element">GlossEntry</sgmltag> in the <sgmltag>Glossary</sgmltag>
3401 itself. You can use the link between source and glossary to create a
3402 link in the online form of your document, as we have done with the
3403 online form of the glossary in this book.
3404 </para>
3405 </sect2>
3406 <sect2><title>Making a Bibliography</title>
3407 <para>
3408 <indexterm><primary>bibliographies, creating</primary></indexterm>
3409 <indexterm><primary>raw data</primary>
3410 <secondary>bibliographies</secondary></indexterm>
3411 <indexterm><primary>cooked data</primary>
3412 <secondary>bibliographies</secondary></indexterm>
3413 <indexterm><primary>BiblioEntry element</primary></indexterm>
3414
3415 There are two ways to set up a bibliography in DocBook: you can have
3416 the data <emphasis>raw</emphasis> or
3417 <emphasis>cooked</emphasis>. Here's an example of a raw
3418 bibliographical item, wrapped in the <sgmltag class="element">Biblioentry</sgmltag> element:
3419 </para>
3420 <screen>
3421 &lt;biblioentry xreflabel="Kites75">
3422 &lt;authorgroup>
3423 &lt;author>&lt;firstname>Andrea&lt;/firstname>&lt;surname>Bahadur&lt;/surname>&lt;/author>
3424 &lt;author>&lt;firstname>Mark&lt;/>&lt;surname>Shwarek&lt;/>&lt;/author>
3425 &lt;/authorgroup>
3426 &lt;copyright>&lt;year>1974&lt;/year>&lt;year>1975&lt;/year>
3427 &lt;holder>Product Development International Holding N. V.&lt;/holder>
3428 &lt;/copyright>
3429 &lt;isbn>0-88459-021-6&lt;/isbn>
3430 &lt;publisher>
3431 &lt;publishername>Plenary Publications International, Inc.&lt;/publishername>
3432 &lt;/publisher>
3433 &lt;title>Kites&lt;/title>
3434 &lt;subtitle>Ancient Craft to Modern Sport&lt;/subtitle>
3435 &lt;pagenums>988-999&lt;/pagenums>
3436 &lt;seriesinfo>
3437 &lt;title>The Family Creative Workshop&lt;/title>
3438 &lt;seriesvolnums>1-22&lt;/seriesvolnums>
3439 &lt;editor>
3440 &lt;firstname>Allen&lt;/firstname>
3441 &lt;othername role=middle>Davenport&lt;/othername>
3442 &lt;surname>Bragdon&lt;/surname>
3443 &lt;contrib>Editor in Chief&lt;/contrib>
3444 &lt;/editor>
3445 &lt;/seriesinfo>
3446 &lt;/biblioentry>
3447 </screen>
3448 <para>
3449 The &ldquo;raw&rdquo; data in a <sgmltag class="element">Biblioentry</sgmltag> is comprehensive to a
3450 fault&mdash;there are enough fields to suit a host of different
3451 bibliographical styles, and that is the point. An abundance of data
3452 requires processing applications to select, punctuate, order, and
3453 format the bibliographical data, and it is unlikely that all the
3454 information provided will actually be output.
3455 </para>
3456 <para>
3457 <indexterm><primary>Bibliomixed element</primary></indexterm>
3458
3459 All the &ldquo;cooked&rdquo; data in a <sgmltag class="element">Bibliomixed</sgmltag> entry in a bibliography, on the
3460 other hand, is intended to be presented to the reader in the form and
3461 sequence in which it is provided. It even includes punctuation between
3462 the fields of data:
3463 </para>
3464 <screen>
3465 &lt;bibliomixed>
3466 &lt;bibliomset relation=article>
3467 &lt;surname>Walsh&lt;/surname>, &lt;firstname>Norman&lt;/firstname>.
3468 &lt;title role=article>Introduction to Cascading Style Sheets&lt;/title>.
3469 &lt;/bibliomset>
3470 &lt;bibliomset relation=journal>
3471 &lt;title>The World Wide Web Journal&lt;/title>
3472 &lt;volumenum>2&lt;/volumenum>&lt;issuenum>1&lt;/issuenum>.
3473 &lt;publishername>O'Reilly &amp; Associates, Inc.&lt;/publishername> and
3474 &lt;corpname>The World Wide Web Consortium&lt;/corpname>.
3475 &lt;pubdate>Winter, 1996&lt;/pubdate>&lt;/bibliomset>.
3476 &lt;/bibliomixed>
3477 </screen>
3478 <para>
3479 Clearly, these two ways of marking up bibliographical entries are
3480 suited to different circumstances. You should use one or the other
3481 for your bibliography, not both. Strictly speaking, mingling the raw
3482 and the cooked may be &ldquo;kosher&rdquo; as far as the &DTD; is
3483 concerned, but it will almost certainly cause problems for most
3484 processing applications.
3485 <indexterm startref="DocBookDocch02" class="endofrange"/>
3486 <indexterm startref="documentsDocBookch02" class='endofrange'/>
3487
3488 </para>
3489 </sect2>
3490 </sect1>
3491 </chapter>