[sword-devel] osis2mod complains about mid-verse <lg>

DM Smith dmsmith555 at yahoo.com
Fri May 9 12:22:15 MST 2008


hockpa2e at myway.com wrote:
>
> Hello All,
>
>
>
> I couldn't find this addressed on the wiki page or in the archives: It seems osis2mod does not like the case where an <lg> starts in the middle of a verse.
>
>
>
> Here is an OSIS encoding of Mark 6:6-7: 
>
>
>
> 		<verse sID="Mark.7.6" osisID="Mark.7.6"/>He replied, "Isaiah was right when he prophesied about you hypocrites; as it is written: <l type="x-br"/><lg><l>" 'These people honor me with their mouths, </l><l type="x-indent">but their hearts are far from me. </l><verse eID="Mark.7.6"/>
>
>
>
> 		<verse sID="Mark.7.7" osisID="Mark.7.7"/><l>They worship me in vain; </l><l type="x-indent">their teachings are nothing but man-made rules.'<note type="crossReference">Isaiah 29:13</note> </l><verse eID="Mark.7.7"/></lg>
>
>
>
> The poetic section starts in the middle of verse 6, so that's where I put the opening <lg>. Previously, I had used the milestoned <lg/> at the beginning and end, but I wanted to start moving away from milestoned tags. As I understand OSIS, as long as <verse> and <chapter> are milestoned, using the container forms of <p> and <lg> in a non-overlapping way should work fine. 
>
>
>
> But osis2mod complains that verse 6 is not well-formed. Verse 7 is accepted as long as </lg> is outside the verse tag. When I look at the output in the frontends, BibleCS still puts the linebreaks where they should be, but BibleDesktop gets confused and loses all the linebreaks and even the cross-reference. Do I have to be stuck using the milestoned version of <lg> for this case? I kind of suspect the same thing would happen for <p></p>.
>
>
>
> I'm using osis2mod rev. 2090.
>   

This is just a warning. It means that the module may work in some 
front-ends but not in others.

Most front-ends, such as the BibleTool, GnomeSword, BibleTime and 
BibleDesktop handle verses individually in some contexts, such as 
putting the content of a verse in a table cell for a parallel view.

If we suppose that <lg> is transformed into HTML as <blockquote> then 
having a parallel view of your passage and another version (KJV) would 
result in something like this:
<tr>
    <td>
        He replied, "Isaiah was right when he prophesied about you 
hypocrites; as it is written: <br/><blockquote>" 'These people honor me 
with their mouths, <br/>but their hearts are far from me. <br/>
    </td>
    <td>
        He answered and said unto them,  <font class='jesus'>Well hath 
Esaias prophesied of you hypocrites, as it is written, This people 
honoureth me with <em>their</em> lips, but their heart is far from 
me.</font>
    </td>
</tr>
<tr>
    <td>
       They worship me in vain; <br/>their teachings are nothing but 
man-made rules.'</blockquote>
    </td>
    <td>
        <font class='jesus'>Howbeit in vain do they worship me, teaching 
<em>for</em> doctrines the commandments of men. </font>
    </td>
</tr>

There is no way that this can be rendered correctly in HTML.

A couple of comments about your OSIS:
types of the form x-name are unexpected by Sword and will be ignored. So 
x-br and x-indent are meaningless.
<l type="x-br"/> should probably be replaced with the  <lb/> element.

WRT <p>, these don't have the same problem as <lg>. These are the only 
structural container in OSIS that does not have a milestoned form. 
osis2mod recognizes this and transforms this into <lb 
type="x-begin-paragraph"/> and <lb type="x-end-paragraph"/>. Again Sword 
ignores the type attribute here because these are x-. These are encoded 
in this fashion so that one can reconstruct the original input from the 
module.

Here at Sword we fall into two camps regarding how OSIS should be marked up.
1) Verses are a relatively recent imposition on the text. They do not 
coincide at all times with document structure such as quotations, 
paragraphs and poetic line groups. The text should be marked up to 
reflect the structure of the document and verses should be milestoned to 
produce well-formed XML.
2) That doesn't matter. What matters is that all Sword based software 
can correctly, quickly and easily handle the content of the module. 
Parallel view is a very important feature to the user's of the 
front-ends and for that sake alone, we do what we can to make it work.

There are several ways we can go about this:
1) Build the module as you have it, with all it's problems.
2) Use milestoned container elements for elements that cross verse 
boundaries. (osis2mod complains about elements that cross verse boundaries.)
3) Change osis2mod to transform <lg> and </lg>. Since <lg> can only 
contain a very limited set and since the only possible interpretation of 
<lg> would be some kind of indentation (which would fail in all the HTML 
based parallel viewers), it would be safe to replace it with <milestone 
type="x-begin-lg"/> and <milestone type="x-end-lg"/> or something 
similar, perhaps <lb type="x-begin-lg"/> and </lg> gets the 
<milestone/>. This preserves in a recoverable manner.
4) There might be other ways.....

If we decide to do 3), I'll be glad to make the change.

In Him,
    DM






More information about the sword-devel mailing list