[jsword-devel] Handling of titles

Chris Burrell chris at burrell.me.uk
Thu Apr 11 12:15:13 MST 2013


If I understand the original correctly, titles now no longer appear in the
verse... So the actual OSIS output for existing modules has changed. For
example "The Beginning of Creation" is no longer part of verse 1?

Therefore the following is now different but correct? :

<div><title type="x-gen">Genesis 0</title><title type="x-gen">Genesis
1</title><div osisID="Gen.1.0" type="x-gen"><lb type="x-begin-paragraph"
/></div><title subType="x-preverse" type="section">The Beginning of
Creation</title><verse osisID="Gen.1.1">In the .......

I used to rely on the titles being inside for some searches, but i guess
I'll have to rewrite that bit if we're sticking with these changes.


On 10 April 2013 18:37, DM Smith <dmsmith at crosswire.org> wrote:

> That's the last piece of "intros" that bleeds through.
> The ultimate problem is that we convert from Passage to string and
> back. Before handling introductions, there was no chapter or verse 0. We
> were able to freely marshal between the string and the Passage. Not having
> the zero makes that a lossy trip.
> I've recently made a change that greatly reduces the number of round
> trips. (It used to be that when VerseRange was cast to a Passage, it was
> converted to a string and then to a Passage. Now it is converted directly
> to a Passage.)
> I'm still thinking on how to distinguish between internal string
> representation (such as saved verse lists, which needs to be lossless) and
> external string representation (what we show to the user, which can be
> lossy.)  You don't want to show the user the introduction one time and not
> another when they think they are seeing the same thing.
> Ideas are appreciated.
> Generated titles are program output and can be anything that we think
> makes sense. Showing 0 does not make sense (unless the user deliberately
> entered it.)
> Related (assuming that the user is being shown titles, intros, headings)
> is how to handle user input in a non-suprising manner:
> When a user enters Exod 4, should the intro be shown?
> When a user enters Exod 4:1-31 should the intro be shown (i.e. does that
> include Exod 4:0)?
> Right now:
> Exod 4 includes the intro and Exod 4:1-31 does not. This is because Exod 4
> is the same as Exod 4:0-31.
> And
> Exod 5:1-12 does not include the intro to chapter 5, but Exod 5:0-12 does.
> I'm wondering whether we should use the word "Intro" instead of "0" so
> that it is clear.
> The xsl for Bible Desktop is under SVN at
> jsword/trunk/bibledesktop/src/main/resources/xsl.cswing/simple.xsl.
> In Him,
> DM
> On Apr 9, 2013, at 5:05 PM, Chris Burrell <chris at burrell.me.uk> wrote:
> Hi DM
> I've updated against the latest version, but JSword still seems to be
> outputting xgen titles with the verse 0 inside. For example, for  Exo
> 3:5-5:12
> I get the following titles in the OSIS:
> <title type="x-gen">Exodus 3:5-22</title>
> <title type="x-gen">Exodus 4</title>
> <title type="x-gen">Exodus 5:0-12</title>
> Can you point me to where you made a change around this? Also, any chance
> you can point me to the commit/patch for simple.xsl. I'll have to integrate
> that to STEP as well.
> Chris
> On 28 February 2013 13:57, DM Smith <dmsmith at crosswire.org> wrote:
>> 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
>> _______________________________________________
>> jsword-devel mailing list
>> jsword-devel at crosswire.org
>> http://www.crosswire.org/mailman/listinfo/jsword-devel
> _______________________________________________
> 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/20130411/e4763170/attachment.html>

More information about the jsword-devel mailing list