Introduction

Much of what follows applies to any OSIS file, but there are a few features unique to genbooks (mainly in structure). This document aims to provide a complete, though not exhaustive, account of how to encode an OSIS genbook to become a SWORD module.

Keep in mind that, as with any XML document, elements are arranged hierarchically. The root node ends with the </osis> element, so the rest of the document occurs within that container. Within that is the Work node. Within that is the Header and then the Body of the text, which are parallel to each other. For a complete OSIS XML file, see Example OSIS Genbook below.

Header

The Header should contain work elements for the current work and any other works to which this document links. In this example, the Bible is linked through Scripture references, and the KJV default reference scheme is used. More detailed information can be added, but the following is sufficient for a simple book with one author.

Body

Basic Structure

A <body> element is not used in OSIS. Instead, the body consists of <div> elements in a hierarchical structure. If you are encoding a collection of works by the same author, you can use the element <div type="bookGroup"> for the outer container. Otherwise start with <div type="book">. The following represents several levels of containers.

Of course you decide what is in the osisID (within the bounds of what the schema allows--basically you should stick to letters, numbers, and spaces), and the <title> element can be used to create titles for each chapter, etc. You may define your hierarchy to as much detail as you like. However, remember that readers of SWORD genbooks can only read one container at a time, so if you define lots of subsections it forces the reader to flip through them. If those parts are short, consider just adding section titles and limiting your containers to chapters for ease of reading.

Basic Formatting

Titles

Titles are defined using the <title> element:

<title>Title Name</title>

Paragraphs

Paragraphs are defined using the <p> element.

<p>Your paragraph goes here.</p>

Italic Text

For italics, use the <hi type="italic"> element.

<hi type="italic">Italic text</hi>

Bold Text

To make text display in bold type, use the <hi type="bold"> element.

<hi type="bold">Bold text</hi>

Superscript and Subscript

To make text superscript and subscript, just use the <hi> element with the type defined as "super" for superscript text and "sub" for subscript text.

Footnotes and Endnotes

Footnotes and endnotes are encoded in the same way except for their type name. Both use the <note> element. Using the "n" attribute you can define the number, letter, or symbol which you want to appear for the note, but not all front-ends will display that.

Scripture References and Other Links

Scripture References

Scripture references may be encoded as links which some front-ends will use to open that reference in a Bible window. This is done using the <reference> element with the attribute "osisRef" defining the target verse or passage. Note the variety of possibilities for these kinds of references below.

Bible book names are those abbreviations found in the OSIS manual (they basically follow the SBL abbreviations), and each portion of the reference is separated by a period. In a range of verses the book and chapter must be repeated and separated by a dash.

Internal Links

External Links

Images

You can easily place images in your books using the <figure/> element. This element is "milestoned," meaning it isn't a container. The forward slash near the end signals that fact. Use the "src" attribute to define the location of the image relative to the compiled module. In the example below, the image "crosswire.jpg" resides in a folder "images" in the same folder as the compiled module.

<figure src="images/crosswire.jpg"/>

Tables

Tables require a bit of work to get set up but can be useful for some purposes. The entire table is contained in a

element, and each row is then contained in a <row> element. For each column in each row a <cell> element contains the text of that cell. The following table creates column labels in bold type and includes two columns and two rows below the label row.

Foreign Languages

Sometimes you may have multiple languages in a work, and in that case you should use the <foreign> element. That way if you have different fonts defined for different languages you are able to make the display more appropriate for the reader. A Hebrew example looks like this:

<foreign xml:lang="he">עִבְרִי</foreign>

You have to define the language of the language that is foreign to the module's language using the "xml:lang" attribute.

Example OSIS Genbook

The following is the text of a valid OSIS XML file which serves as a template for an OSIS Genbook for SWORD. Not all possible features are demonstrated here, but the file serves as an example of how to encode a Genbook. You should be able to copy the contents to a text editor, save it to a file as *.xml, and validate it against the OSIS schema.