[sword-devel] Osis2mod change
dmsmith at crosswire.org
Tue Apr 28 09:54:47 MST 2009
Everyone, but especially module developers.
I have just checked in (svn revision 2358) a significant change to
osis2mod. The API is the same, but it generates modules that require 1.6.
Here are the changes: (I mentioned them as an aside in an email
yesterday. Here I'll go into more depth on some.)
[ Note: by verse osis2mod means an indexable unit of module text. ]
1) All tags are retained in the module. (Note: the OSIS header is not kept.)
2) Inter-verse tags are not re-ordered.
This is a big boon to module writers as the module's whitespace is
as they define it.
3) Inter-verse material is handled in a well-defined predictable manner:
a) Everything from the book element up to the first chapter element
goes into the book introduction.
This is what the old code attempted to do.
b) Starting with the chapter element, everything is put into the
until one of the following conditions is met:
i) A section div is found.
ii) A title that does not have a type of "main" or "chapter".
Once that is found, it is marked "pre-verse" (see below) and
attached to the following verse.
Note: we may need to tune this. I think it fits with the OSIS
texts I have seen. Feedback welcomed.
c) Between verses, the first start or empty tag defines the boundary
between the two verses.
This does not include empty, milestoned end tags of the form
4) Inter-verse material that is deemed to be pre-verse will be marked up
in the following fashion:
<div type="x-milestone" subType="x-preverse" sID="pvXXX"/>
.... All the elements that are deemed to be preverse ...
<div type="x-milestone" subType="x-preverse" eID="pvXXX"/>
Where XXX is a number that follows the sID/eID rules.
5) The code handling the preverse material is significantly simpler and
is now commented well.
In doing this code, I realized that osis2mod does not handle module
introductions or testament introductions. Perhaps we should add it someday.
I'd appreciate people trying it out and giving feedback. For linux and
mac, you'll have to compile it from SVN.
Maybe Chris will make a Windows version?
I hope to redo the KJV and ESV modules using it. When/if I do, I'll put
them in beta.
More information about the sword-devel