[sword-devel] Bug / unexpected behavior in osis2mod

DM Smith dmsmith at crosswire.org
Sun Jan 26 09:02:25 EST 2025


Dear Pinoaffe,

See below for embedded.

> On Dec 2, 2023, at 7:05 AM, pinoaffe <pinoaffe at gmail.com> wrote:
> 
> Hi folks,
> 
> as of late, i've been playing around with various digital bibles, and in
> doing so, I encountered some issues with ~osis2mod~:
> 
> 
> 
> when an osis-encoded bible-book has more chapters than it should have
> according to the versification, osis2mod seems to loop infinitely or at
> least for quite a long time
> 
> I think it would be neat if osis2mod could instead output some sort of
> warning instead, just like it does when there are additional books - it
> could of course also merge any additional chapters into the last verse
> of the previous chapter, but that seems somewhat excessive to me.

I agree that it should output a diagnostic that the chapter is outside the v11n. And that it should either append the content to the last verse of the last chapter in the book within the v11n or pitch it.

It is in keeping with the design of osis2mod that all content in the input is placed within the module.

> 
> 
> 
> Another issue I've encountered: when I convert a text of the following
> shape into a sword module using osis2mod and open it in andbible, the
> verse numbers are placed incorrectly and the verse "body/text" of the
> last verse is not recognized as being part of said verse
> 
> #+begin_src xml
> <div type="chapter">
>    <verse osisID="Fictional.1.999">
>        This is the last verse in a chapter
>    </verse>
>    <lb/>
> </div>
> #+end_src
> 
> I think that either osis2mod or andbible cannot deal with nodes being
> placed outside the last verse but within the chapter, but I'm not sure
> whether that's the cause, and I'm not sufficiently familiar with the
> internals of osis2mod or andbible to figure out what the cause is
> 
> Does anyone else know what's going on?

Is “Fictional” a book in the Bible within the v11n that has already been seen? Is chapter 1 representative of any chapter that is actually within the v11n or do you mean chapter 1?

If I remember correctly (I’ve worked on osis2mod but haven’t looked at it for over 10 years), within SWORD, Genesis 1:999 is converted into the 999th verse within Genesis. if it were Gen 2:999. It would be the 999th verse after the start of Genesis 2. The mechanism of index retrieval, is to get the position of the chapter start, add the number of verses to it to produce the spot in the index to where the verse should be stored.

I haven’t looked at how JSword handles Gen 2.999 for many years, but from memory, it constrains a verse reference to within the named chapter. Might toss an error. That is it diverges from how SWORD handles the difference.

> 
> 
> 
> Another (minor) issue is that osis2mod doesn't seem to be able to deal
> with OSIS documents that use an XML namespace prefixes, so a document
> that starts as seen below will not be recognized/parsed properly by
> osis2mod
> 
> #+begin_src xml
> <osis:osis
> xmlns:osis="http://www.bibletechnologies.net/2003/OSIS/namespace"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://www.bibletechnologies.net/2003/OSIS/namespace
> http://www.bibltechnolgologies.net/OSIS/osisCore.2.1.1.xsd">
> <osis:osisText xml:lang="nl" osisRefWork="defaultReferenceScheme>
> <osis:header>
> .....
> #+end_src

SWORD does not use an XML parser. It has its own parsing mechanism built for speed and not according to the spec and namespaces are not supported.

> 
> 
> 
> And finally: 
> A while ago, someone posted on the mailing list that they encountered
> weird behaviour/bugs/issues when milestoned verses intersected itemized
> lists, I have noticed similar issues, and will try to take a look at how
> osis2mod deals with milestoned verses

A requirement of osis2mod is that it can transform OSIS to well-formed XML, verse by verse. SWORD and JSword are built for researching rather than merely reading Bibles. The smallest unit of display is the verse.

This is probably an instance of where the transformation was not done, or couldn’t be done.

FYI, Each verse is split into 2 parts, pre-verse and verse. The pre-verse is not output if it is empty. It contains things like titles and introductions and markup between verses.

If you can find an example, we can look at it.

> 
> I can't seem to find the specific message in the archives anymore,
> otherwise I would have linked to it
> 
> May God bless you,
> pinoaffe
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page



More information about the sword-devel mailing list