<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
I think your suggestion is a distinct possibility for the future. But I
don't think we are there yet. Before we could use JSword's engine to
transform the module in other formats into OSIS as a mechanism to
migrate the modules, I think we will need to do very extensive
certification of the process and the resulting modules.<br>
<br>
Also, OSIS is a moving target. When I started, we were conforming to
1.1.1 and shortly after that we upgraded to 1.5. At that time 2.0 was a
draft proposal. Now it is final. I just added support for a few more
elements in 2.x.<br>
<br>
Once we migrate to 2.x (post JSword 1.0), we will probably revisit the
mapping of GBF and ThML to OSIS to make sure that our transformation is
not lossy (we do get all the verse text out, but do we get all other
markup? Don't know. For example, if anything is marked up as italic or
bold, we don't support that) and that the transformations make sense
(Some of the verses look ugly after our transformations and sometimes
there is a lot of extra whitespace).<br>
<br>
That said, it takes a lot to parse OSIS as text into OSIS as JDom
elements and then transform that. Currently the performance is about
the same or just a bit slower than other formats. So it would not be a
big win. We do need to look at directly using the OSIS text, but that
is scheduled post 1.0.<br>
<br>
Read, James C wrote:
<blockquote
cite="mid6B84A53BD25BCA46B070A05DD8C8C9F813A299@KUDBEX01.kuds.kingston.ac.uk"
type="cite">
<pre wrap="">
<a class="moz-txt-link-freetext" href="http://www.crosswire.org/jsword/java2html/org/crosswire/jsword/examples/APIExamples.java.html">http://www.crosswire.org/jsword/java2html/org/crosswire/jsword/examples/APIExamples.java.html</a>
These are good examples.
To get OSIS from a Bible module you will do something like the following:
// Get a list of all the installed books
Books books = Books.installed();
// Get a particular installed book
Book bible = books.getBookMetaData("KJV");
// Create a range of what you want
Key key = bible.getKey("Gen-Rev");
// Get the data
BookData data = bible.getData(key);
// Get a SAX stream for the OSIS document
SAXEventProvider osissep = data.getSAXEventProvider();
// Write the OSIS to a string
String wholeBible = XMLUtil.writeToString(osissep);
// Print it out
System.out.println(wholeBible );
Thank you. :) That's just what I needed.
One humble suggestion though. Seeing as all the basic operations with the modules seem
to involve first converting them into OSIS why don't we convert all the modules to
OSIS for the JSword package and save the end user the waiting time for such a
conversion and us the repetition of code.
This email has been scanned for all viruses by the MessageLabs Email
Security System.</pre>
<pre wrap="">
<hr size="4" width="90%">
_______________________________________________
jsword-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:jsword-devel@crosswire.org">jsword-devel@crosswire.org</a>
<a class="moz-txt-link-freetext" href="http://www.crosswire.org/mailman/listinfo/jsword-devel">http://www.crosswire.org/mailman/listinfo/jsword-devel</a>
</pre>
</blockquote>
</body>
</html>