[jsword-devel] [sword-devel] Log error suggest a module issue?

DM Smith dmsmith at crosswire.org
Tue Apr 16 04:55:14 MST 2013


There is no issue with UKJV, per se.

osis2mod preserves all module markup, perhaps transformed, except the <verse> element. Earlier versions of osis2mod did not transform the <chapter> element to its milestoned version.

This should be considered JSword's problem to deal with, which is what JSword is doing. Whenever JSword encounters a "verse" (in this case verse 0) it uses an xml parser to convert the text into DOM. All xml parsers require well-formed xml and are required to fail when otherwise. When JSword encounters an error in its assumption, it reports it and then strips xml from it.

We have an open issue to do a better job with the handling of broken xml.

There are a couple of improvements:
Gather the text to display and convert all of it, instead of converting each verse one at a time. This recognizes that a tag opened in one verse may be closed in another. However, it does not work for "verse in isolation" (search results, lookups, parallel viewing, ...)

Use a "lenient" xml parser (by definition there is no such thing) to repair text to be well-formed. I found Flying Saucer and jsoup, which look promising.

The other possibility is to not use an xml parser at all to create the DOM but to do it with our own parsing (like we do for GBF and ThML).

I'll cross-post this to Sword-devel, as that is where this started.

In Him,

On Apr 15, 2013, at 4:15 PM, Chris Burrell  wrote:

> Hi all
> There is perhaps an issue with the UKJV module. My logs show me:
> 2013-04-15 20:31:30,236 INFO   - UKJV:Exo 21:0: Parse UKJV(Exo 21:0) failed: Error on line 1: The element type "chapter" must be terminated by the matching end-tag "</chapter>".
> Cheers,
> Chris
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page

More information about the jsword-devel mailing list