[jsword-devel] Handling of titles

DM Smith dmsmith at crosswire.org
Thu Feb 28 06:57:17 MST 2013


The OSIS module builder, osis2mod, creates markup for material that stands before the verse number. JSword needed to be changed to handle this.

FYI, a module does not have the <verse> tag in it. It is the responsibility of the engine (SWORD/JSword) to support the frontend in putting in that number. SWORD and JSword handle it differently. In JSword, we put back in the verse number. In SWORD, they split the content into two parts that can be retrieved independently.

I changed how JSword figures out where to put the verse tag.

In the past, JSword merely wrapped the content from the module (having been converted to OSIS) with a verse element. Then the xslt when handling the verse element, pulled titles and put them before the verse.

Now, JSword iterates through the OSIS content looking for the best place to split the content. Basically, it looks for the last element to have subType="x-preverse" to be the split.

In looking at this, I examined all Bible modules in all repositories and looked at Psalm 3:0-2 for misplaced verse markers. The reason for this is that Psalm titles are canonical and are not marked up well in modules. The reason to include 0 and 2 is that some modules put the title in verse 0. Others have the title as verse 1.

I found that titles marked type="psalm" may not have been marked subType="x-preverse" and canonical="true". I adjusted the code to update these if there were not conflict.

The upshot of this is that the xslt can now be simpler. It can handle the title directly, not within the verse container.

Doing that fixes an existing bug in the stylesheet. It would not show titles in verse 0 if they were marked x-preverse. There were a lot of these.

So you may want to grab a new copy of simple.xsl from Bible Desktop. It has a number of other improvements as well.

In Him,
	DM


More information about the jsword-devel mailing list