Chapter 6. Predefined document types

A document type is associated to an XML file according to its defined rules and it specifies many settings used to improve editing the category of XML files it applies for. These settings include specifying a default grammar used for validation and content completion, default scenarios used for transformation, specifying directories with file templates, specifying catalogs and a lot of settings which can be used to improve editing in the Tagless editor.

The tagless editor comes with some predefined document types already configured when the application is installed on the computer. These document types describe well-known XML frameworks largely used today for authoring XML documents. Editing a document which conforms to one of these types is as easy as opening it or creating it from one of the predefined document templates which also come with the application.

 

Figure 6.1. Document Type preferences page

Document Type preferences page

 The DocBook V4 document type

DocBook is a very popular set of tags for describing books, articles, and other prose documents, particularly technical documentation.

 Association rules

A file is considered to be a DocBook document when either of the following occurs:

  • root element name is a book or article;

  • public id of the document is -//OASIS//DTD DocBook XML V4.4//EN.

 Schema

The schema used for DocBook documents is in ${frameworks}/docbook/dtd/docbookx.dtd, where ${frameworks} is a subdirectory of the <oXygen/> install directory.

 Author extensions

The CSS file used for rendering DocBook content is located in ${frameworks}/docbook/css/docbook.css.

Specific actions for DocBook documents are:

  • Bold emphasized text - emphasizes the selected text by surrounding it with <emphasis role="bold"/> tag.

  • Italic emphasized text - emphasizes the selected text by surrounding it with <emphasis role="italic"/> tag.

  • Underline emphasized text - emphasizes the selected text by surrounding it with <emphasis role="italic"/> tag.

    [Note]Note

    For all of the above actions if there is no selection then a new 'emphasis' tag with specific role will be inserted. These actions are available in any document context.

    These actions are grouped under the Emphasize toolbar actions group.

  • link - inserts a hypertext link.

  • ulink - inserts a link that address its target by means of an URL (Universal Resource Locator).

  • olink - inserts a link that address its target indirectly, through an entity.

  • uri - inserts an URI element. The URI identifies a Uniform Resource Identifier (URI) in content.

  • xref - inserts a cross reference to another part of the document.

    [Note]Note

    These actions are grouped under the Link toolbar actions group.

  • Insert Section - inserts a new section/subsection in the document, depending on the current context. For example if the current context is sect1 then a sect2 will be inserted and so on.

  • Insert Paragraph - inserts a new paragraph depending on the current context. If current context is a paragraph context(one of the ancestors of the element at caret position is 'para') then a new paragraph will be inserted after the paragraph at caret. Otherwise a new paragraph is inserted at caret position.

  • Insert Graphic - inserts a graphic object at the caret position. This is done by inserting either <graphic> or <inlinegraphic> element depending on the current context. The following graphical formats are supported: GIF, JPG, JPEG, BMP, PNG and SVG.

  • Insert Ordered List - inserts an ordered list with one list item.

  • Insert Itemized List - inserts an itemized list with one list item.

  • Insert Variable List - inserts a DocBook variable list with one list item.

  • Insert List Item - inserts a new list item for in any of the above three list types.

  • Insert Table - opens a dialog that allows you to configure the table to be inserted.

     

    Figure 6.2. Insert Table Dialog

    Insert Table Dialog


    The dialog allows the user to configure the number of rows and columns of the table, if the header and footer will be generated and how the table will be framed. Also, CALS or HTML table model can be selected.

    [Note]Note

    Unchecking the Title checkbox an 'informaltable' element will be inserted.

  • Insert Row - inserts a new table row with empty cells. The action is available when the caret position is inside a table.

  • Insert Column - inserts a new table column with empty cells after the current column. The action is available when the caret position is inside a table.

  • Insert Cell - inserts a new empty cell depending on the current context. If the caret is positioned between two cells, a new one will be inserted at caret's position. If the caret is inside a cell, then the new one will be created after the current cell.

  • Delete Column - deletes the table column where the caret is located.

  • Delete Row - deletes the table row where the caret is located.

  • Join Row Cells - joins the content of the selected cells. The operation is available if the selected cells are from the same row and they have the same row span. The action is also available when the selection is missing, but the caret is positioned between two cells.

  • Join Cell Above - joins the content of cell from current caret position with that of the cell above it. Note that this action works only if both cells have the same column span.

  • Join Cell Below - joins the content of cell from current caret position with that of the cell below it. Note that this action works only if both cells have the same column span.

  • Split Cell To The Left - splits the cell from current caret position in two, inserting a new empty table cell to the left. Note that this action works only if the current cell spans over more than one column. The column span of the source cell will be decreased with one.

  • Split Cell To The Right - splits the cell from current caret position in two, inserting a new empty table cell to the right. Note that this action works only if the current cell spans over more than one column. The column span of the source cell will be decreased with one.

  • Split Cell Above - splits the cell from current caret position in two, inserting a new empty table cell above. Note that this action works only if the current cell spans over more than one row. The row span of the source cell will be decreased with one.

  • Split Cell Below - splits the cell from current caret position in two, inserting a new empty table cell below. Note that this action works only if the current cell spans over more than one row. The row span of the source cell will be decreased with one.

[Note]Note

DocBook v4 supports only CALS table model. HTML table model is supported in DocBook v5.

[Caution]Caution

Column specifications are required for table actions to work properly.

All actions described above are available in the contextual menu, main menu (Docbook4 submenu) and in the Author custom actions toolbar.

 Templates

Default templates are available for DocBook 4. They are stored in ${frameworksDir}/docbook/templates/Docbook 4 folder and they can be used for easily creating a book or article with or without XInclude.

These templates are available when creating new documents from templates.

Docbook 4 - Article

New Docbook 4 Article

Docbook 4 - Article with XInclude

New Docbook 4 XInclude-aware Article

Docbook 4 -Book

New Docbook 4 Book

Docbook 4 -Book with XInclude

New Docbook 4 XInclude-aware Book

 Catalogs

The default catalog is stored in ${frameworksDir}/docbook/catalog.xml.

 Transformation Scenarios

The following default transformation scenarios are available:

  • DocBook4 -> DocBook5 Conversion - converts a DocBook4-compliant document to DocBook5;

  • DocBook HTML - transforms a DocBook document into a HTML document;

  • DocBook PDF - transforms a DocBook document into a PDF document.