[jsword-devel] Verse markup in OSIS modules

DM Smith dmsmith555 at yahoo.com
Fri Aug 6 15:29:31 MST 2004


I thought of another way. I don't think it is the right way, but I think 
it would be the simplest. In the xsl, ignore a verse if it is a parent 
of a verse, but transform it's content.

DM Smith wrote:

> I see that there are two basic ways that the fix could go. Currently, 
> PassageAbstractData constructs an OSIS document containing a title and a 
> list of verses and it attaches to the verses the results of each call to 
> getFilter().toOSIS(verseElement, rawdata);
> (Actually, it is inside the toOSIS that the transformed data is attached 
> to verseElement).
> 
> I see two different ways to solve it and I would like feedback as to 
> which is better.
> 1) Modify the OSISFilter to strip out the verse if it is present. This 
> will require iterating over the list of elements to see if any are verse 
> elements and removing it and saving its children in its place.
> 
> 2) Modify PassageAbstractBook to not create the verse element if it is 
> present in the results of toOSIS. This would entail creating a dummy 
> element and then analyzing the descendants of that element to see if any 
> have an osisID containing the expected verse reference. If it is not 
> found then that dummy element is replaced/transformed into a verse 
> element and then appended to the div element. If it is found then all 
> the children of the dummy element are appended to the div element.
> 
> The reason to look for an osisID is that <verse> is not the only way to 
> specify a verse according to OSIS 2.0. The various filters should not 
> care whether the data came from a Sword module or from some other system.
> 
> I noticed that in bugs.txt that having a pass-through for OSIS is listed 
> as a post 1.0 activity. I'm not sure what this means exactly but it 
> seems that it allows for any valid OSIS to be returned as is. This would 
> be good for books that have verse markers between verses, that have 
> non-verse text before verses, that have multiple verses for a single 
> verse, that split verses into parts and have multiple markers per verse, 
> .... All of which are allowed in OSIS.
> 
> Anyway, I am inclined to do #2 as I think that the call to toOSIS should 
> not be lossy. This will allow for a pass-through mode. And I think that 
> it will allow for multiple verses to be gotten at the same time from a 
> fully marked up OSIS module.
> 
> I did some more reading of the sword-devel archives and it seems that 
> there is a bit of disagreement on whether the stored text should contain 
> verse markup.
> 
> If WLS is any indication on the final disposition of that disagreement, 
> then the OSIS modules should be fully marked up.
> 
> 
> 
> DM Smith wrote:
> 
>> So as not to bury the lead, I am putting my question at the beginning 
>> of the e-mail: How should I determine whether an OSIS module has verse 
>> markup or not? I am cross posting this (please let me know if this is 
>> not appropriate)
>>
>> I have read some posts on sword-devel for information on verse markup 
>> and I noted some discussion on how verses should be marked.
>>
>> I am working on J-Sword (the java port of the Sword Engine) and I 
>> loaded WLS, the BHS replacement, and J-Sword started to display the 
>> verse numbers twice.
>>
>> I looked into the module and the verses are all marked up in the 
>> following fashion (This is English markup around Hebrew text and the 
>> Hebrew may not survive the posting):
>> <verse osisID="Gen.1.1">בְּרֵאשִׁ֖ית בָּרָ֣א אֱלֹהִ֑ים אֵ֥ת הַשָּׁמַ֖יִם וְאֵ֥ת הָאָֽרֶץ׃</verse>
>>
>> In KJV w/ Strongs it is not surrounded with <verse> markup:
>> <w lemma="x-Strongs:H07225">In the beginning</w> <w 
>> lemma="x-Strongs:H0430">God</w> <w morph="x-StrongsMorph:TH8804" 
>> lemma="x-Strongs:H0853|x-Strongs:H01254">created</w> <w 
>> lemma="x-Strongs:H08064">the heaven</w> <w 
>> lemma="x-Strongs:H0853">and</w> <w lemma="x-Strongs:H0776">the earth</w>.
>>
>> At first I thought that the indexing of KJV was a bit lossy and did 
>> not include the <verse> markup in the indexing, but I decompressed the 
>> entirety of Genesis and found that there were no verse markers.
>>
>> Anyway JSword assumes that the module does not contain verse markers 
>> and adds them. When it comes to WLS, it is in there twice.
>>
>> Chris Little wrote in a thread on sword-devel:
>>  > Just check the OSISVersion entry in the .conf.  The new modules are
>>  > tagged with OSISVersion=2.0.1.  Other OSIS modules won't have this tag
>>  > at all and most of them would be tagged as OSISVersion=1.1.1, if we
>>  > went back and added the metadata to them.  So you can assume that if
>>  > OSISVersion >= 2 then ALL tags from the OSIS document are supposed to
>>  > be in the Sword module, including <verse> tags.
>>
>> I don't see that attribute in the conf for WLS. I saw that Sword 
>> handles  WLS and KJV correctly.
>>
>> With J-Sword, we build OSIS and render it with XSLT into HTML. I guess 
>> we could parse the text to see if it contains verse markup and not add 
>> it if it does. Any suggestions?
>>
>> _______________________________________________
>> 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
> 



More information about the jsword-devel mailing list