[The HTML Writers Guild Logo]

The HTML Writers Guild

Project gutenberg
[Previous] [HWG Home page] [Gutenberg Index] [Next]

The 'bookbody' element

The body of many books can be marked up by just using three elements. The chapter, the title, and the para elements. However the book body element is designed to cater for quite complex chapter structure if this is what is required!

Top level structure of 'bookbody'

The body of a book can consist of several parts, or of several chapters. If the book is divided into parts then each part can have an optional title page as well as having several chapters.

The 'book' element

The top element in is the book element, and this is also the root element of the 'bookfrag' DTD when this is being used as a stand-alone DTD. The structure is illustrated graphically here. Note that the pipestem '|' stands for 'either/or' in the graphical depictions.

The parts of an e-text

The 'bookbody' ELEMENT declaration

Here is the 'bookbody' element declaration.

<!ELEMENT bookbody (part*|chapter*)>

The 'part' ELEMENT declaration

The 'part' element declaration is also given here for convenience.

<!ELEMENT part (titlepage?,chapter*)>

'chapter' content

Many chapters will consist of some title material, and several paragraphs. However chapters can contain all the block elements as is illustrated graphically below. The title can be further broken down into other devisions by using the chapheader element.

The parts of an e-text


Titles are used in several places in a book, from the cover of the book to titles of small subsections. Everyone knows what is mean by a title, and human readers will immediatly see the role of any title. Machines will have to deduce this role by looking at the immediate parent of the title element

The 'title' element

Here is the content model for a title element. It can contain #PCDATA or any of the inline class of elements.

The 'title' ELEMENT declaration

<!ELEMENT title (#PCDATA %inline.class;)*>

The inline class of elements was discussed in another page.

'chapheader' content

Some chapters have quite complex material at the head of the chapter, including subtitles, numbers summarys quotations etc. To accomodate this there is the chapheader element. Note that a chapter can contain either a title element or a chapheader element. Allowed content is illustrated graphically below.

The parts of an e-text

The 'chapheader' element

Here is the content model for a chapheader element. Note that although the content model allows several title and chapnumber elements, there is an additional validity constraint on this element that only one of each is allowed. (This could have been expressed syntactically, but the declaration would have become extremely complex!!)

The 'chapheader' ELEMENT declaration

<!--validity constraint. Only one title,chapnum and chapsummary -->
<!ELEMENT chapheader (title|subtitle|chapnum|chapsummary|blockquote|note)*>

The 'subtitle' ELEMENT declaration

<!ELEMENT subtitle (#PCDATA %inline.class;)*>

The 'chapnum' ELEMENT declaration

<!ELEMENT chapnum (#PCDATA %inline.class;)*>

The 'chapsummary' ELEMENT declaration

<!ELEMENT chapsummary (#PCDATA %inline.class;)*>

The declarations of the blockquote and note elements will be considered below when we look at the block.class elements.

The inline class of elements was discussed in another page.

'para' content

Paragraphs are the workhorse of any book DTD and they essentially contain all the content of the book. After some debate we decided to give a paragraph an optional title element. We thought that this would speed the markup process, as well as being grammatically correct. (Some purists will tell you that a paragraph cannot have a title. However in other languages it is clear that it can). Paragraph content is illustrated graphically here.

The parts of an e-text

The 'para' element

Note that the para element as declared can contain several titles, and they can occur anywhere in the paragraph content. However as a further validity constraint, a paragraph should only contain one title and this title,if present, should open the paragraph.

The 'para' ELEMENT declaration

<!--validity constraint. Only one opening title per paragraph-->
<!ELEMENT para (#PCDATA|title %inline.class;)*>

The inline class of elements was discussed in another page.


Some chapters are divided up into sections, and these sectiions can either be simple sections, or they can be nested one within the other. The bookfrag and gutbook1 DTDs allow for up to four levels of nesting sections. (We have not yet found a book (outside of the military!) that requires more levels of nesting). Here is an illustration of the allowed element content of a top level sect1 section.

The parts of an e-text

'sect*' content

The 'sect1' ELEMENT declaration

The sect1 section can contain a sect2 section plus the other block levekl elements.

<!ELEMENT sect1 (title,(sect2|simplesect|para %block.class;)*)>

Nesting sections

All the sect* elements can contain the next section down. sect4 of course cannot contain any section other than a simplesect element

The parts of an e-text

The %block.class; elements

The block.class elements are brought into several elements content by using an entity reference. Here is the entity declaration for block.class.

<!ENTITY % block.class "|blockquote|footnote|note|list|deflist|table|blockgraphic">

The 'blockquote' element

The blockquote element can have an optional title and attribution. Usually a blockquote is presented in a slightly different type, and is indented to the right and the left from the main text.

The 'blockquote' ELEMENT declaration

<ELEMENT blockquote (title?,para*,attrib?)>

The 'attrib' ELEMENT declaration

The author the quote is attributed to.

<!ELEMENT attrib (#PCDATA %inline.class;)*>

The 'footnote' element

Footnotes will include notes at the bottom of the page and side notes. If it is important to distinguish between the two use the role or type attributes. Note that this is not for use by the marker! It is to distinguish notes in the original text.

The 'footnote' ELEMENT declaration

<!ELEMENT footnote (#PCDATA %inline.class;)*>

The 'note' element

A note is usually some kind of brief aside that occurs in the body of the page.

The 'note' ELEMENT declaration

<!ELEMENT note (#PCDATA %inline.class;)*>

The 'list' element

Lists can nest

The 'list' ELEMENT declaration

<!ELEMENT list (list|item)*>

The 'item' ELEMENT declaration

Almost any element can be included in an item in a list!

<!ELEMENT item (#PCDATA|para|simplesect %block.class; %inline.class;)*>

The 'deflist' element

A definition list consists of several items, and each item has an optional description and up to several definitions.

The 'deflist' ELEMENT declaration

<<!ELEMENT deflist (item,desc?,def*)*>

The 'desc' ELEMENT declaration

An optional brief description of the item

<!ELEMENT desc (#PCDATA %inline.class;)*>

The 'def' ELEMENT declaration

Each item may have several definitions.

<!ELEMENT def (#PCDATA %inline.class;)*>

The 'table' element

if a book has numerous tables it may be better to bring in the XHTML 1.1 table module via a driver file. Note also that table properties in CSS style sheets are not well supported yet.(jan 2000)

The 'table' ELEMENT declaration

<!ELEMENT table (title?,row*,caption?)>

The 'row' ELEMENT declaration

<!ELEMENT row (cell)*>

The 'cell' ELEMENT declaration

<!ELEMENT cell (#PCDATA %block.class; %inline.class;)*>

The 'blockgraphic' element

The blockgraphic element is a stand alone graphic that can take both a title and a caption. It should be used where in the opinion of the marker the positioning of the graphic is not vital. If a graphic needs to be placed in the text, use graphic alone.

The 'blockgraphic' ELEMENT declaration

<!ELEMENT blockgraphic (title?,graphic,caption?)>

The 'graphic' ELEMENT declaration

The graphic element is an empty element that takes compulsory descand href atributes. By itself the graphic element is meant to be an 'inline' element.

<!ELEMENT graphic EMPTY >
<!ATTLIST graphic

The 'caption' ELEMENT declaration

The caption element is used with both tables and blockgraphics

<!ELEMENT caption (#PCDATA %inline.class;)*>

The Attributes of the elements

All the elements on this page take these attributes, where an element can take additional attributes e.g. the image element

an indication to that effect has been made.
<!ENTITY % stdatts 
 id    ID     #IMPLIED
[Previous] [HWG Home page] [Gutenberg Index] [Next]

[Valid XHTML 1.0]
This page is maintained by frank@hwg.org. Last updated on 16 January 2000.
Copyright © 2000 by the HTML Writers Guild, Inc.