[jsword-devel] osis and jaxb

Joe Walker jsword-devel@crosswire.org
Sun, 05 Jan 2003 09:59:19 +0000

Eric Galluzzo wrote:

>On Thu, 2003-01-02 at 18:54, Joe Walker wrote:
>>Currently JSword uses its own XML format to represent Bible data before 
>>it gets to the view (to use MVC terms)
>>I've always thought that it would be better to use a standard and it 
>>would seem that OSIS is it. I've read through the schema, and it seems 
>>to do just what we need.
>Yep, OSIS seems like the perfect format for JSword data to me.  It
>should also be easy-ish to write a converter from GBL to OSIS, and then
>one can write an XSLT stylesheet to convert OSIS into most anything
JSword currently works in exactly that way except that in place of OSIS 
is a format I invented because OSIS didn't exist at the time.

>>I fancy taking some short cuts by using JAX-B to generate a parser and 
>>some Java classes to help us work with OSIS data.
>Sounds reasonable, although I usually distrust autogenerated bindings
>(or autogenerated anything else) until I've seen how good they are. :)
The good thing about jaxb is that you can give the schema compiler a 
binding customization document. So we ought to be able to get just what 
we want.

>One big disadvantage to this sort of thing is that adding business
>methods to those classes is impossible if one ever wants to regenerate
>the classes.  A friend of mine is working on a technique to make this
>possible, but it's not quite proven yet, and even when it is, it may not
>work for JAXB.
Yes, although in this case I hope we don't need much in the way of 
business methods. The point of using OSIS is very much data based - to 
allow the bits of code that know about generating textual data to pass 
it on to the bits of code that know how to display it.
So I guess the most likely things we would want to add would be 
something along the lines of "merge the contents of these 2 documents" 
(although there is a better way of doing even that). I wouldn't mind 
having a utility class for that sort of thing.

>>Troy, do you have any string feelings about how we should generate 
>>classes to represent OSIS data?
>>I've also generated some HTML and word docs from the OSIS spec to make 
>>it easier to navigate because I couldn't find anything at 
>>http://www.bibletechnologies.net. Are you interested?
>I'm definitely interested.  Also, I've got a work-in-progress stylesheet
>to convert OSIS to HTML for viewing (requires a Xalan-specific extension
>in order to break long documents up).  The only kinda cool feature is
>that it hyperlinks each word (with color: black; text-decoration: none,
>so that it doesn't look like a link) to the appropriate Strong's
>definition.  I don't really know who I should give this to, but would
>anyone on this list be interested?
Very interested. In theory all I need to do to enable OSIS support is to 
make the various modules create jaxb generate OSIS trees rather than my 
hand-written version of the same. And from what I have glanced at so far 
there is a virtually 1-1 corresponsance between the two.

However I'm working on polishing off Dict/Conc support which is more 
important so I'm not going to do anything with it for a few days.