Debian Codegraph @

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