[jsword-devel] Help with APIExamples

DM Smith dmsmith at crosswire.org
Tue Dec 26 08:51:55 MST 2017


Just migrated the xslt from BibleDesktop into JSword.

The converter that the ConverterFactory uses is now org.crosswire.jsword.xml.ConfigurableConverter.java

The xslt is a resource of the same path.

I’m in the process of updating the xslt to HTML5. If you don’t like it or it doesn’t work for you you can revert to simple.xsl. Or continue whatever you are using.

In Him,
	DM

> On Dec 23, 2017, at 9:46 AM, DM Smith <dmsmith at crosswire.org> wrote:
> 
> Configuration is done via reflection using config.xml. Config.xml brings in a couple of classes in BibleDesktop for converting via xslt. I’ve begun to look into migrating it to JSword. Problem is that I have to break the dependency on Font which is in AWT.
> 
> The converter reflects to a class in BibleDesktop which looks for xsl/cswing/simple.xsl as a resource. If that resource is not found via classpath it fails.
> 
> The resources are in the BibleDesktop project. Just copy xsl/cswing/simple.xsl to the resource folder of JSword. Or add the BibleDesktop resource folder to the APIExamples classpath.
> 
> The only execution problem I found is that ESV has been renamed. So I’ll change the example to KLV (the Klingon Bible) as that won’t change.
> 
> DM
> 
>> On Dec 21, 2017, at 7:22 AM, Tim Hawes <trhawes at althusius.net <mailto:trhawes at althusius.net>> wrote:
>> 
>> Thank you so much for looking into this! But, no, I don't think that's it. If I comment out the call to readStyledText(), I get this exception instead:
>> 
>> Exception in thread "main" java.util.MissingResourceException: Cannot find resource: xsl/cswing/simple.xsl
>>         at org.crosswire.common.util.ResourceUtil.getResource(ResourceUtil.java:75)
>>         at org.crosswire.common.util.ResourceUtil.getResource(ResourceUtil.java:57)
>>         at com.selfdidactic.APIExamples.searchAndShow(APIExamples.java:286)
>>         at com.selfdidactic.APIExamples.main(APIExamples.java:465)
>> 
>> That error does go away when I add that stylesheet from bibledesktop. So that should probably still be moved to jsword. But is seemingly unrelated to the NullPointerException I am getting when I call readStyledText() in the APIExamples.java
>> 
>> I've searched for other references for ConverterFactory.getConverter() in bibledesktop. I can see where it is being called, but am clueless why it seems to work for bibledesktop and not for the API examples.
>> 
>> ---- On Wed, 20 Dec 2017 23:20:54 -0500 DM Smith <dmsmith at crosswire.org <mailto:dmsmith at crosswire.org>> wrote ----
>> 
>> I’ll check it out. I think that JSword’s example uses the xslt from BibleDesktop. I’ve been working on that. 
>> 
>> I should move it into JSword. 
>> 
>> — DM Smith
>> 
>> 
>> On Dec 20, 2017, at 7:54 PM, Tim Hawes <trhawes at althusius.net <mailto:trhawes at althusius.net>> wrote:
>> 
>> _______________________________________________
>> jsword-devel mailing list
>> jsword-devel at crosswire.org <mailto:jsword-devel at crosswire.org>
>> http://www.crosswire.org/mailman/listinfo/jsword-devel <http://www.crosswire.org/mailman/listinfo/jsword-devel>
>> _______________________________________________ 
>> jsword-devel mailing list 
>> jsword-devel at crosswire.org <mailto:jsword-devel at crosswire.org> 
>> http://www.crosswire.org/mailman/listinfo/jsword-devel <http://www.crosswire.org/mailman/listinfo/jsword-devel> 
>> When trying to run the APIExamples.java for JSword, it throws this exception:
>> 
>> Exception in thread "main" java.lang.NullPointerException
>> at org.crosswire.jsword.util.ConverterFactory.getConverter(ConverterFactory.java:51)
>> at com.selfdidactic.APIExamples.readStyledText(APIExamples.java:163)
>> at com.selfdidactic.APIExamples.main(APIExamples.java:461)
>> 
>> It is happening in the readStyledText method where...
>> 
>> Converter styler = ConverterFactory.getConverter();
>> 
>> 
>> Has JSword changed without updating the API examples?
>> 
>> 
>> 
>> 
>> _______________________________________________
>> jsword-devel mailing list
>> jsword-devel at crosswire.org <mailto:jsword-devel at crosswire.org>
>> http://www.crosswire.org/mailman/listinfo/jsword-devel
> 
> _______________________________________________
> jsword-devel mailing list
> jsword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/jsword-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/jsword-devel/attachments/20171226/80ba6601/attachment.html>


More information about the jsword-devel mailing list