5.2. A simple DocBook book

The following XML section shows a typical structure of a DocBook book.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
"../../common/docbook/dtd/docbookx.dtd">
<book lang="de">
 <title>Mein erstes DocBook Buch</title>
 <bookinfo>1 
     <author>
       <honorific>Dipl.-Ing</honorific>
       <firstname>Stefan</firstname>
       <surname>Rinke</surname>
     </author>
 </bookinfo>
 <preface>2 
     <title>Vorwort</title>
     <para>In einem Vorwort stehen Dinge über das Buch an sich.</para>
 </preface>
 <chapter>3 
     <title>Einführung</title>
     <para>Dies ist ein einfacher Artikel
       <indexterm>4 
         <primary>Artikel</primary>
         <secondary>DocBook-Artikel</secondary>
       </indexterm>.
     Das ist nur ein Beispielabsatz.</para>
 </chapter>
 <appendix>5 
     <title>Anhang 1</title>
     <para>Das ist ein Anhang.</para>
 </appendix>
 <glossary>6 
     <glossdiv>
       <title>Ein Glossar</title>
       <glossentry>
         <glossterm id="DocBook">DocBook</glossterm>
         <glosssee>DocBook ist ein Standard zur Erstellung...</glosssee>
       </glossentry>
     </glossdiv>
 </glossary>
 <index/>7 
</book>
1 The Bookinfo section is optional although you might want to be named as the author.
2 The Preface is also optional. But if the book becomes very large, the preface will have about this strucutre.
3 Here follow one or several chapters which start with a title <title> and are even more structured by paragraphs <para>.
4 With this an index entry is created. The secondary entry is optional.
5 Following tihs you will have one or more appendixes.
6 If you want to, you can also add a glossary.
7 This tag marks the position where the completed index is to be inserted.

To see how such a book might look in HTML[3], click hier.

Fussnoten

[3] this depends on the defined style sheets