2.2. DocBook

To explain what DocBook is, we must first take a look at what SGML and XML are, and their relationship to DocBook.

The Standard Generalized Markup Language (SGML) is a language that is based on embedding codes within a document. In this way, it is similar to HTML, but there is where any similarities end. The power of SGML is that unlike WYSIWYG (What You See Is What You Get), you don't define things like colors, or font sizes, or even some kinds of formatting. Instead, you define elements (paragraph, section, numbered list) and let the SGML processor and the end program worry about placement, colors, fonts, and so on. HTML does the same thing, and is actually a subset of SGML. SGML has really three parts that make it up. First is the Structure, which is what is commonly called the DTD, or Document Type Definition. The DTD defines the relationship between each of the elements (or tags). The DocBook DTD, used to create this document, is an example of this. The DTD lists the rules that the content must follow. Second is the DSSSL or Document Style Semantics and Specification Language. The DSSSL tells the program doing the rendering how to convert the SGML into something that a human can read. It tells the renderer to convert a title tag into 14 point bold if it is going to RTF format, or to turn it into a <h1> tag if it is going to HTML. Finally there is the Content, which is what gets rendered by the SGML processor and is eventually seen by the user. This paragraph is content, but so is a graphic image, a table, a numbered list, and so on. Content is surrounded by tags to separate each element.

The Extensible Markup Language (XML) has all the advantages of SGML, but is getting much more press and development time. For the purposes of writing documentation, the differences are minimal.

This brings us back to DocBook, which is a DTD available for both SGML and XML. Since the tags themselves do not change when moving from DocBook XML to DocBook SGML, much of this guide will apply to both versions of the DTD.