[sword-devel] osis2mod changes for Words of Christ and container elements

DM Smith dmsmith555 at yahoo.com
Thu Sep 11 11:57:08 MST 2008

I have just checked in changes to osis2mod that addresses two earlier 
osis2mod and WoC
osis2mod and container elements
The third posting will be addressed later (near the SWORD release of 1.5.12)
    osis2mod and preverse content

These changes will allow the building of a module compatible with SWORD 

Here are the changes:
plugged memory leak
    osis2mod uses stacks of XMLTag*, but does not call delete on them.
    The tag stacks have been changed to be object stacks.

misc changes
   currentVerse changed from pointer to object.
   writeEntry clears text (i.e. text = "";) rather than at several 
places in the main loop.
   removed unnecessary/invalid/wrong/outdated comments and commented code
   Ignored everything preceeding the first div
   Improved comments
   Added #define INCLUDE_TAGS to include all tags.
       Currently osis2mod preserves text and most tags.
       This would include all tags and their attributes, but it is 
turned off.

fixed some linking bugs
    1) The parsing of osisID="Matt.1.1 Matt.1.2 Matt.1.3" was handled badly
         and caused incomplete and in some cases wrong linking.
         This was a straightforward bug fix.
    2) Appending text to a linked range would break the linked range.
        There are two identified scenarios where this was happening.
        a) osis2mod will append non-title interverse material to the 
prior verse.
        b) osis2mod will append Non-KJV verses to the prior verse.
    There were two parts to the fix.
    i) Postpone linking until after these situations.
       Linking is now done after all verses have been written and appended.
    ii) because linking was postponed, appending needed to be to the 
first verse in a range.

fixed an intra-verse title bug
    It is legal to have a title within a verse. These should have been 
left alone,
    but they were being pulled out of place and put before the verse.

Words of Christ change
    osis2mod had left the markup of WoC to the OSIS author, requiring a 
complicated hack
    in order for the WoC to be highlighted (e.g. red-letter text) in all 
usages in all applications.
    This change allows the OSIS author to mark up WoC in a natural 
manner, and osis2mod
    will make the changes.
    The following is supported:
    1) The use of
        <q who="Jesus">...</q> (container form)
        <q sID="XXX" who="Jesus"/>...<q eID="XXX" who="Jesus"/> 
(milestone form)
        to mark where quotation marks should go.
        Note: <milestone type="cQuote"/> is still used to mark up 
continuation quotation marks.
    2) The marker attribute can still be used to specify the desired 
quotation marks.
    3) The quotation can span chapters. (For example, The sermon on the 

Here is what osis2mod will do:
    Split the functionality of quotation mark choice and placement
    from identification of the Words of Christ.
    Given <q sID="XXX" who="Jesus" marker="&#8220;">...<q eID="XXX" 
who="Jesus" marker="&#8221;"/>
    1) Quotation marks choice and placement with:
        <q sID="XXX" marker="&#8220;">...<q eID="XXX" marker="&#8221;"/>
       (Note, who="Jesus" is removed)
    2) All WoC highlighted text, including quotation marks is surrounded 
        <q who="Jesus" marker="">...</q>
    3) WoC highlighted text is repeated within each verse.

Container element change:
    Authors of OSIS texts are geard toward BSP (Book/Section/Paragraph).
    Every SWORD application is geared toward BCV (Book/Chapter/Verse) 
    osis2mod did very little to bridge this gap.
    With this change BSP container elements are changed to their 
milestone form.
    One thing to note, I've used "genX" as the sID/eID value (where X is 
unique to the pair). This allows for reverse engineering in mod2osis.

Chris would you mind testing this with the beta modules? And if it works 
like you want, would you make a Windows build available?

In His Service,

More information about the sword-devel mailing list