[sword-devel] OSIS tagging paragraph which span chapter ?
DM Smith
dmsmith at crosswire.org
Mon Apr 20 07:49:50 MST 2009
Tonny Kohar wrote:
> Hi,
>
> On Mon, Apr 20, 2009 at 6:43 PM, DM Smith <dmsmith at crosswire.org> wrote:
>
>> On Apr 20, 2009, at 2:48 AM, Tonny Kohar wrote:
>>
>>
>>> Hi,
>>>
>>> Does anyone know how to tagging paragraph which span chapter eg: Mark
>>> 7:31-Mark 8:9 ?
>>>
>>> Because I got an error using osis2mod when tagging such paragraph.
>>>
>> Tonny,
>>
>> I am assuming that you verified that your input is valid OSIS by running it
>> through an XML validator?
>>
>
>
> This is the error which is thrown by XML validator
> "The element type "p" must be terminated by the matching end-tag
> "</p>". [5,632] "
>
You'll need to fix this first. If you need help identifying the problem,
post the paragraph here, obscuring any copyrighted text.
> This is the error which is thrown by osis2mod (libsword6, version 1.5.9-8ubuntu1
> "Error: Mark 8:9: Expected chapter found p"
>
Internally, osis2mod has a couple of stacks that it uses to do semantic
validation of the input. OSIS allows two overlapping models of markup,
either document structure (aka BSP) or verse structure (aka BCV). It has
a stack for each of these. One of the problems with using milestone
elements is that it allows a free-for-all approach to markup. The check
is merely to ensure that a BSP element follows strict XML nesting
requirements. Likewise for BCV.
If the validator reports a nesting error (as it did), then osis2mod
should also.
>
>
>> My suggestion is that you write your OSIS file without trying to work around
>> the shortcomings of osis2mod. If need be, use xslt to modify it to an
>> intermediate form that works around the problem.
>>
>> Based upon your description, the paragraph marks should be between the
>> verses.
>>
>> <verse eID="Mark.7.30"/>
>> <p>
>> <verse osisID="Mark.7.31" sID="Mark.7.31"/>
>> ...
>> <verse eID="Mark.8.9">
>>
This should have ended with /> not >.
>> </p>
>> <verse osisID="Mark.8.10" sID="Mark.8.10"/>
>>
>
> Yes, the above exactly the tagging I use (only without sID and eID
> attribute) and it throws error for the xml validator and osis2mod
>
>
>> When you say error, are you saying that the program stops unexpectedly or
>> that the program reports an error and keeps on going? If it is the latter,
>> it really is a "strong" warning.
>>
>
> for the xml validator, it stop validating and waiting for me to fix the tag.
> for the osis2mod, it just print the above error message on console and
> then quit.
>
My guess is that you are using the container and not the milestone form
of the <chapter> element.
You'll need to use
<chapter sID="Mark.7" osisID="Mark.7"/>
...
<p>
...
<chapter eID="Mark.7"/>
<chapter sID="Mark.8" osisID="Mark.8"/>
...
</p>
...
<chapter eID="Mark.8"/>
>
>> The goal of our development of osis2mod is to allow all well-written (see
>> wiki for these best practices),
>>
>
> So far I am always use the following crosswire wiki as the reference
> http://crosswire.org/wiki/OSIS_Bibles (is this the same wiki you mentioned ?)
> and the OSIS 2.1.1 User Manual 06March2006.pdf
>
Yes, that is what I meant.
> The above 2 reference does not show how to tag paragraph which span
> chapter.
The wiki only discusses what we have encountered so far. Once you get it
working, either add what you figured out, or let us know what worked for
you and we'll add it.
> They have some description regarding milestone things, but it
> is not clear for me on how to applied to my case. Besides the
> reference text KJV (which I use) is using the following <milestone
> type="x-p" marker="¶"/> for paragraph.
>
That is peculiar (some would say very peculiar) to the KJV. Don't use
it. The KJV does not have true paragraphs, but only a character at the
beginning of some paragraphs.
> So, what is the recommended way to tagging such paragraph ?
> 1) using <div type="x-preverse" sID="xxx"/> ... <div eID="xxx"/>
> 2) or using <lb type="x-begin-paragraph"/>..<lb
> type="x-end-paragraph"/> directly instead of <p>..</p>
> I tested this approach and it works for BD and Alkitab.
> 3) or any other ways ?
>
The recommended way is to use:
<p>
...
</p>
And use milestoned chapters and verses.
Osis2mod will transform the <p> and </p> into <lb> as noted above. This
will be changing to <div type="paragraph">...</div> (which will
subsequently be transformed into it's milestoned form.
Hope this helps,
DM Smith
More information about the sword-devel
mailing list