[sword-devel] Pre-verse text handling in OSIS-based Sword modules

DM Smith dmsmith555 at yahoo.com
Tue May 1 11:31:57 MST 2007

Kahunapule Michael Johnson wrote:
> DM Smith wrote:
>> If a title does not have the type of main or chapter, then it is 
>> understood as a preverse title. There is no special tagging needed.
> Cool.
>> Titles which are part of the Bible (e.g. psalm titles) should have the 
>> attribute canonical="true". This will prevent Sword from hiding them 
>> when headings are hidden.
> OK.
>> Note, Sword has some bugs with regard to rich content within a title. 
>> Currently, notes don't work well and for some reason <divineName> is odd.
> Hmmm... is this something that is going to be fixed, or should I strip
> out such rich content?
Either sword will be fixed or osis2mod will strip it out. At this point, 
I think the consensus is that sword should be fixed.

>> With regard to tags between verses, there is some reordering that 
>> happens. The following empty elements are appended to the prior verse:
>> p, div, lg, l, lb and q.
> Is that only when needed to balance the OSIS fragment that results from
> extracting one verse or a range of verses, or are these things stuffed
> between every verse? (I would think that the latter approach would wreak
> havoc on the formatting of the text.) Or do you mean that when those
> tags immediately follow a verse start marker, they are moved before the
> verse start marker?

In OSIS it is valid to have tags between the end of one verse and the 
start of another.

A Sword module only contains verses, with Chapter 0, verse 0 being a 
book intro and Chapter n, verse 0 being a chapter intro.

So osis2mod needs to figure out where the in between stuff needs to go.

So stuff that is before verse 1 either is attached to Chapter n, verse 0 
or prepended to verse 1.
<chapter osisID="Matt.1">
    <title type="chapter">Matthew</title>
    <p> Basic chapter intro</p>
    <title>Section title</title>
    <verse osisID="Matt.1.1">...</verse>
With this example <p> Basic chapter intro</p> will go with the prior 
verse, Matt.1.0.
And <title>Section title</title> will become preverse.

If it were:
<chapter osisID="Matt.1">
    <title type="chapter">Matthew</title>
    <title>Section title</title>
    <p> Basic chapter intro</p>
    <verse osisID="Matt.1.1">...</verse>
The result would be the same. Osis2mod will only put preverse titles 
with the following verse, pulling it out of order if necessary.

And stuff between verse n and n+1 is attached to n or n + 1.
    <verse osisID="Matt.1.6">...</verse>
    <title>Section title</title>
    <verse osisID="Matt.1.7">...</verse>

Likewise this will reorder to become:
<verse osisID="Matt.1.6">...<lb type="x-end-paragraph"/><lb 
<verse osisID="Matt.1.7"><title type="section" 
subType="x-preverse">Section title</title>....</verse>

Stuff after the last verse m and the chapter end, is appended to that verse.

Stuff between a book start and a chapter start is a chapter intro.
Stuff between chapters is appended to the last verse of the just 
finished chapter.
<verse osisID="Rom.16.26">....</verse>
<div type="colophon" osisID="Rom.c">Written to the Romans from 
Corinthus, <transChange type="added">and sent</transChange> by Phebe 
servant of the church at Cenchrea.</div>

This becomes:
<verse osisID="Rom.16.26">....<div type="colophon" 
osisID="Rom.c">Written to the Romans from Corinthus, <transChange 
type="added">and sent</transChange> by Phebe servant of the church at 

More information about the sword-devel mailing list