[jsword-devel] Suggestion

Read, James C K0434995 at kingston.ac.uk
Mon Feb 28 08:08:20 MST 2005




 
http://www.crosswire.org/jsword/java2html/org/crosswire/jsword/examples/APIExamples.java.html
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 2938 bytes
Desc: not available
Url : http://www.crosswire.org/pipermail/jsword-devel/attachments/20050228/5bb19db4/attachment.bin


More information about the jsword-devel mailing list