[bt-devel] [ bibletime-Bugs-1596526 ] Improper link handling in bt_osishtml.cpp

SourceForge.net noreply at sourceforge.net
Sat May 17 02:15:42 MST 2008


Bugs item #1596526, was opened at 2006-11-14 20:30
Message generated for change (Comment added) made by mgruner
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=100954&aid=1596526&group_id=954

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Frontend / Links
Group: new bug
Status: Open
Resolution: None
>Priority: 2
Private: No
Submitted By: Dung (dunghopper)
>Assigned to: Martin Gruner (mgruner)
Summary: Improper link handling in bt_osishtml.cpp

Initial Comment:
In Bibletime 1.6, the osis-to-html converter (bt_osishtml.cpp) makes some questionable assumptions regarding the 'osisRef' attribute of <reference> elements.

** 1 **
Unqualified osisRef's (i.e. no osisWork prefix) are linked into the users preferred standard bible.  This is contrary to the osis specifications; an unqualified reference should refer to another point in the same work, and any external reference requires a prefix.

Specifically, if I have an osis-ecoded GenericBook with a reference:
<reference osisRef="Chap1.Sec2">...</reference>, referring to it's own Chapter 1 and Section 2
BibleTime tries to link that to sword:/KJV/Chap1.Sec2, where KJV is my preferred bible.

If there are many modules that make this same incorrect assumption (by leaving bilblical references un-prefixed, and prefixing all other references), then to fix this bug would break those modules.  If that is the case, it would probably be better to advise module creators to ALWAYS prefix their osisRef's, even if they are internal.

** 2 **
When a prefix IS specified in the osisRef
( i.e. osisRef=[module]:[key]" )
it is assumed that the last character of [module] and the first character of [key] are letters.  However, modules may end, and keys may begin with numbers or slashes, and possibly other characters. (For example, in GenericBooks ALL keys begin with '/')

** 3 **
It is also expected that the prefix of the osisRef is a module name, and the the osisID (after the colon) is a key to that module.  Neither of these are safe assumptions, but I don't know of any better way to handle it.  The main problem arises from the fact that Sword's xml2gbs converter converts from osisID's (I.am.a.key) to GBS keys (/I/am/a/key), but doesn't change the osisRefs at all (so the cross-references are now pointing to non-existant osisID's, but the module is keyed with GBS keys).

In my opinion, the best short-term solution that wouldn't require any changes to sword would be:

if (reference has prefix && prefix is module)
 type = type of prefixed module;
 if (type is GenericBook)
  convert osisRef from I.am.a.key to \/I\/am\/a\/key
 else if (type is Bible)
  etc...

This bug report got bigger than I expected.  Sorry for my wordiness.  I'd be happy to discuss this on the mailing list as well.

----------------------------------------------------------------------

>Comment By: Martin Gruner (mgruner)
Date: 2008-05-17 11:15

Message:
Logged In: YES 
user_id=169722
Originator: NO

Reassigning for now. We need to discuss this in future.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=100954&aid=1596526&group_id=954



More information about the bt-devel mailing list