[sword-devel] Small problem with section headers in an OSIS module
DM Smith
dmsmith555 at yahoo.com
Sun Nov 30 07:07:35 MST 2008
On Nov 29, 2008, at 10:34 PM, Tom Cornell wrote:
> I have managed to get section headers to work in an OSIS module I am
> hacking together, to the extent that they show up, at least. And the
> very first one, at the beginning of a chapter (after the chapter
> title), actually shows up properly. But all of the section headers
> after that are causing the following verse number to appear by itself
> on a line.
Your OSIS is fine.
This is probably a shortcoming in osis2mod and in the SWORD engine.
Our goal with osis2mod is to accept all well-written, valid OSIS and
produce a SWORD module that works well in the core front-ends.
However, there is a problem with what I call interverse material. A
Bible module only consists of verses. Interverse material is marked as
"pre-verse" and prepended to the verse. The SWORD engine know that the
verse number is placed after the pre-verse material. Currently the
SWORD engine can only handle <title> (generically called headings) as
pre-verse. All other interverse material is either appended to the
prior verse or put after the "pre-verse" in the verse.
So, osis2mod will keep all interverse material and append some to the
prior verse and pre-append the rest to the following verse, but in pre-
appending it makes the title come first. My guess is that the <div>
has been moved after the <title>.
Our plan is to change the SWORD engine to allow a robust "pre-verse"
consisting of most of the material between verses. The interverse
material will be split into two parts: what should be appended to the
prior verse (mostly ending tags) and what should go with the next
verse. All the material that should go with the next verse should be
in a pre-verse section.
What I have suggested to others is to continue to write good OSIS and
use xslt to transform it to something that osis2mod can create a good
module from. In your case, I'm guessing that the <div type="section">
and corresponding </div> tag is causing the problem. The <p> tags will
have the same problem. Use xslt to delete those tags.
I also don't think that <div> should cause a change in whitespace. As
an HTML element it does, because it is a block element. However, OSIS
does not create that distinction. In OSIS we have other elements to do
that, such as <p>, <lg>, <title>.
In Him,
DM
>
>
> So I'm getting:
>
> Section Header
> 28
> Text of verse 28
>
> Instead of:
>
> Section Header
> 28 Text of verse 28
>
> I'm using BibleTime 1.6.5.1, compiled with (I'm pretty sure) Sword
> 1.5.11. I don't think the problem can be in the front end, because the
> ESV module behaves just fine in this regard. So I'm pretty sure there
> is a wrinkle in the OSIS code that the ESV compilers got right and I
> have gotten wrong.
>
> My markup looks like this, basically:
>
> ...
> </div>
> <div type="section">
> <title>The Section Title</title>
> <verse sID="..." .../>...<verse eID="..."/>
> ...
> </div>
>
> I've tried adding type="section title" to the <title> tag: it makes no
> difference. Nor does wrapping the section verses in a <p> element.
>
> Hopefully there's something obvious that I'm missing here that others
> can pick up.
>
> -Tom Cornell
>
> _______________________________________________
> 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 sword-devel
mailing list