Hi Matthew <div><br></div><div>As far as I understand, JSword reads the OSIS xml, and then the developer can do what he wants with it. So this is some of the code I've used to use an XSLT: (in the example below, xslConversionDefinition is the name/path to the XSLT file you choose).</div>
<div><br></div><div><div> final Book currentBook = Books.installed().getBook(version);</div><div> final BookData bookData = new BookData(currentBook, currentBook.getKey(reference));</div><div><br></div>
<div> final SAXEventProvider osissep = bookData.getSAXEventProvider();</div><div> final TransformingSAXEventProvider htmlsep = (TransformingSAXEventProvider) new Converter() {</div><div><br></div><div>
public SAXEventProvider convert(final SAXEventProvider provider) throws TransformerException {</div><div> try {</div><div> final TransformingSAXEventProvider tsep = new TransformingSAXEventProvider(getClass()</div>
<div> .getResource(JSwordServiceImpl.this.xslConversionDefinition).toURI(), osissep);</div><div><br></div><div> // set parameters here</div><div> tsep.setParameter("Strongs", true);</div>
<div> tsep.setParameter("Morph", true);</div><div><br></div><div> // then return</div><div> return tsep;</div><div> } catch (final URISyntaxException e) {</div>
<div> throw new StepInternalException("Failed to load resource correctly", e);</div><div> }</div><div> }</div><div> }.convert(osissep);</div></div>
<div> return XMLUtil.writeToString(htmlsep)</div><div><br></div><div>In the example below, you can get the XML out, and then the developer can do whatever he chooses to do:</div><div>public void getOsisAsXML(version, reference) {</div>
<div> final Book currentBook = Books.installed().getBook(version);</div><div><div> final BookData bookData = new BookData(currentBook, currentBook.getKey(reference));</div><div> final Element osisFragment = bookData.getOsisFragment();</div>
<div> return osisFragment;<br>}</div></div><div><br></div><div>I think there are some examples in the JSword code base on how to get the text straight out without transformation</div><div>Hope that helps</div><div>
Chris</div><br><div class="gmail_quote">On 6 November 2010 08:17, Matthew Talbert <span dir="ltr"><<a href="mailto:ransom1982@gmail.com">ransom1982@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
My understanding is that jsword converts everything to OSIS<br>
internally, then uses an xslt stylesheet to convert to html. I've<br>
found the xslt, but where is the other conversion done?<br>
<br>
Thanks,<br>
Matthew<br>
<br>
_______________________________________________<br>
jsword-devel mailing list<br>
<a href="mailto:jsword-devel@crosswire.org">jsword-devel@crosswire.org</a><br>
<a href="http://www.crosswire.org/mailman/listinfo/jsword-devel" target="_blank">http://www.crosswire.org/mailman/listinfo/jsword-devel</a><br>
</blockquote></div><br>