[jsword-devel] Clarke Commentary ScripRef references

DM Smith dmsmith at crosswire.org
Thu Jan 8 17:00:13 MST 2015

It is not a problem of double spaces but that one or more spaces are used to separate multiple references.

Here is what the ThML documentation (http://www.ccel.org/ThML/ThML1.02.pdf <http://www.ccel.org/ThML/ThML1.02.pdf>) says:
> The passage attribute is a list of scripture references separated by commas or semicolons. Each reference may consist of a book name (or abbreviation), a chapter, and a verse. The chapter and verse are separated by a semicolon or period. If two references are separated by a dash, all of the intermediary verses are included as well. In the case of books with only one chapter, a reference consists of a book name or abbreviation and a verse. Book names should be as they appear in the version in use or a unique prefix of at least two letters of the name. Abbreviations that are not prefixes may also be accepted by programs that process ThML documents.7 

It requires semi-colon or commas between multiple references.

As you noted the place where it is encountering the problem is in JSword in o.c.j.book.filter.thml.ScripRefTag.

I don’t think it would be easy to change JSword to handle it.

JSword assumes that multiple references are able to be split into a list on designated separators. Then each reference is split on that which can be expected to separate parts of a reference. If the reference has too many parts then it doesn’t work.

If a tokenizer were used to return the tokens as a stream, a parser would be able to stop processing one reference when it saw enough and start the next reference.

— DM

> On Jan 8, 2015, at 4:45 PM, Martin Denham <mjdenham at gmail.com> wrote:
> Clarke commentary has many occurrences of ScripRef tags like the following from Gen 1:3 which Xiphos/Sword handles well but JSword fails:
> <scripRef passage="2Sa 22:35  Job 20:24  Ps 18:34">2Sa 22:35  Job 20:24  Ps 18:34</scripRef>
> JSword fails because the references are separated by 2 spaces rather than semi-colons or commas.
> JSword ScripRefTag converts it into: <reference osisRef="2Sam Job-Ps">... .
> If a semi-colon is added between each reference then JSword interprets the whole reference correctly.
> Is this a problem that needs to be fixed in the module or in JSword?  I thought initially it was a module problem but Xiphos/Sword handles the double-space-separator without problems.
> I don't know if this same problem occurs in other thml commentaries.
> Thanks
> Martin
> _______________________________________________
> jsword-devel mailing list
> jsword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/jsword-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/jsword-devel/attachments/20150108/ec5f9ab2/attachment.html>

More information about the jsword-devel mailing list