<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">That's the last piece of "intros" that bleeds through.<div><br><div>The ultimate problem is that we convert from Passage to string and back.&nbsp;Before handling introductions, there was no chapter or verse 0. We were able to freely marshal between the string and the Passage.&nbsp;Not having the zero makes that a lossy trip.</div><div><br></div><div>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.)</div><div><br></div><div>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.) &nbsp;You don't want to show the user the introduction one time and not another when they think they are seeing the same thing.</div><div><br></div><div>Ideas are appreciated.</div><div><br></div><div>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.)</div><div><br></div><div>Related (assuming that the user is being shown titles, intros, headings) is how to handle user input in a non-suprising manner:</div><div>When a user enters Exod 4, should the intro be shown?</div><div>When a user enters Exod 4:1-31 should the intro be shown (i.e. does that include Exod 4:0)?</div><div><br></div><div>Right now:</div><div>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.</div><div>And</div><div>Exod 5:1-12 does not include the intro to chapter 5, but Exod 5:0-12 does.</div><div><br></div><div>I'm wondering whether we should use the word "Intro" instead of "0" so that it is clear.</div><div><br></div><div>The xsl for Bible Desktop is under SVN at jsword/trunk/bibledesktop/src/main/resources/xsl.cswing/simple.xsl.</div><div><br></div><div>In Him,</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>DM</div><div><br></div><div><div><div>On Apr 9, 2013, at 5:05 PM, Chris Burrell &lt;<a href="mailto:chris@burrell.me.uk">chris@burrell.me.uk</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Hi DM<div><br></div><div style="">I've updated against the latest version, but JSword still seems to be outputting xgen titles with the verse 0 inside. For example, for &nbsp;Exo 3:5-5:12</div><div style=""><br></div>
<div style="">I get the following titles in the OSIS:</div><div style="">&lt;title type="x-gen"&gt;Exodus 3:5-22&lt;/title&gt;<br></div><div style="">&lt;title type="x-gen"&gt;Exodus 4&lt;/title&gt;<br></div><div style="">
&lt;title type="x-gen"&gt;Exodus 5:0-12&lt;/title&gt;<br></div><div style=""><br></div><div style="">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.</div>
<div style=""><br></div><div style="">Chris</div><div style=""><br></div><div style=""><br></div><div style=""><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 28 February 2013 13:57, DM Smith <span dir="ltr">&lt;<a href="mailto:dmsmith@crosswire.org" target="_blank">dmsmith@crosswire.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The OSIS module builder, osis2mod, creates markup for material that stands before the verse number. JSword needed to be changed to handle this.<br>

<br>
FYI, a module does not have the &lt;verse&gt; 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.<br>

<br>
I changed how JSword figures out where to put the verse tag.<br>
<br>
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.<br>
<br>
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.<br>
<br>
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.<br>

<br>
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.<br>
<br>
The upshot of this is that the xslt can now be simpler. It can handle the title directly, not within the verse container.<br>
<br>
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.<br>
<br>
So you may want to grab a new copy of simple.xsl from Bible Desktop. It has a number of other improvements as well.<br>
<br>
In Him,<br>
&nbsp; &nbsp; &nbsp; &nbsp; DM<br>
_______________________________________________<br>
jsword-devel mailing list<br>
<a href="mailto:jsword-devel@crosswire.org">jsword-devel@crosswire.org</a><br>
<a href="http://www.crosswire.org/mailman/listinfo/jsword-devel" target="_blank">http://www.crosswire.org/mailman/listinfo/jsword-devel</a><br>
</blockquote></div><br></div>
_______________________________________________<br>jsword-devel mailing list<br><a href="mailto:jsword-devel@crosswire.org">jsword-devel@crosswire.org</a><br>http://www.crosswire.org/mailman/listinfo/jsword-devel<br></blockquote></div><br></div></div></body></html>