[jsword-devel] XSLT and enrichment of OSIS Text...
Chris Burrell
chris at burrell.me.uk
Thu Nov 4 05:03:39 MST 2010
Hi All
I have a requirement to to take some OSIS xml, enrich it, and then transform
it to HTML. I want to keep the enrichment as flexible as possible, in terms
of the data I add. But one example would be adding the original Greek/Hebrew
text to every word that is annotated with a Strong/Morph combination
(optional Morph).
Originally, I parsed the XML out into POJOS, iterate through the POJOS to
add the information, and then iterated through again to output some HTML.
I've had a rethink, and believe either of the three ways provided below
might be a better way of doing things... Perhaps, this might also be of
interest to integrate to the existing JSword libraries (or perhaps it can
already do that?).
I have seen some code in Bible Desktop and the core JSword libraries to do
XSLT transformation, so it would make sense to reuse that since it does a
very good job. So the question is
1- is it easy enough to add attributes to the XML (before I send it down
to the SAX provider/XSLT converter).
or 2- Even better, it's probably possible to have the transformation itself
(XSLT file) call a Java function as it goes through.
or 3- perhaps I can provide a map of all the relevant data that needs to be
inserted, down to the transformation and reference it as a template?
I guess I'm after both advice, and if it's already been done, then some code
samples!? There seem to be a bunch of resources on the internet talking
about extending XSLT with java functions. However, given I'm not very
familiar with JSword XML implementations (or with the inner working of XSL),
I would keen to find out if anyone has envisaged it, and if I would be able
to reuse the existing jsword framework for it?
Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/jsword-devel/attachments/20101104/d9f6487a/attachment.html>
More information about the jsword-devel
mailing list