Indeed, there shouldn't necessarily need to be a dom to apply xsls. I guess it would only make sense to have a dom if you're going to go backwards and forwards looking for things. <div><br></div><div>Both BibleDesktop and STEP would have to pass through the document at least twice at the moment, because for notes feature, they are matched at the beginning of the stylesheet, and then also as you go through. I guess we'd have to rework those bits and those similar to those.<br>
<div><br></div><div>Chris</div><div><br><br><div class="gmail_quote">On 4 September 2012 12:42, Martin Denham <span dir="ltr"><<a href="mailto:mjdenham@gmail.com" target="_blank">mjdenham@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Douglas, here is a quick overview of And Bible's approach:</div><div><br></div>And Bible gets the raw content of a page from the book by using <a href="https://github.com/mjdenham/and-bible/blob/master/AndBible/src/net/bible/service/format/OSISInputStream.java" target="_blank">OsisInputStream</a>, and feeds it into an <a href="https://github.com/mjdenham/and-bible/blob/master/AndBible/src/net/bible/service/format/osistohtml/OsisToHtmlSaxHandler.java" target="_blank">OsisToHtmlSaxHandler</a> that converts OSIS tags to HTML and any other changes required. Controlling logic is in <a href="https://github.com/mjdenham/and-bible/blob/master/AndBible/src/net/bible/service/sword/SwordContentFacade.java" target="_blank">SwordContentFacade</a> in the <span style="line-height:16px;color:rgb(153,0,0);font-size:12px;white-space:pre-wrap;font-family:Consolas,'Liberation Mono',Courier,monospace;margin:0px;font-weight:bold;border:0px;padding:0px">readHtmlTextOptimizedZTextOsis</span><span style="line-height:16px;color:rgb(51,51,51);font-size:12px;white-space:pre-wrap;font-family:Consolas,'Liberation Mono',Courier,monospace;margin:0px;font-weight:bold;border:0px;padding:0px">(</span><span style="line-height:16px;color:rgb(51,51,51);font-size:12px;white-space:pre-wrap;font-family:Consolas,'Liberation Mono',Courier,monospace;margin:0px;border:0px;padding:0px">Book</span><span style="line-height:16px;color:rgb(51,51,51);font-size:12px;white-space:pre-wrap;font-family:Consolas,'Liberation Mono',Courier,monospace"> </span><span style="line-height:16px;color:rgb(51,51,51);font-size:12px;white-space:pre-wrap;font-family:Consolas,'Liberation Mono',Courier,monospace;margin:0px;border:0px;padding:0px">book</span><span style="line-height:16px;color:rgb(51,51,51);font-size:12px;white-space:pre-wrap;font-family:Consolas,'Liberation Mono',Courier,monospace;margin:0px;font-weight:bold;border:0px;padding:0px">,</span><span style="line-height:16px;color:rgb(51,51,51);font-size:12px;white-space:pre-wrap;font-family:Consolas,'Liberation Mono',Courier,monospace"> </span><span style="line-height:16px;color:rgb(51,51,51);font-size:12px;white-space:pre-wrap;font-family:Consolas,'Liberation Mono',Courier,monospace;margin:0px;border:0px;padding:0px">Key</span><span style="line-height:16px;color:rgb(51,51,51);font-size:12px;white-space:pre-wrap;font-family:Consolas,'Liberation Mono',Courier,monospace"> </span><span style="line-height:16px;color:rgb(51,51,51);font-size:12px;white-space:pre-wrap;font-family:Consolas,'Liberation Mono',Courier,monospace;margin:0px;border:0px;padding:0px">key</span><span style="line-height:16px;color:rgb(51,51,51);font-size:12px;white-space:pre-wrap;font-family:Consolas,'Liberation Mono',Courier,monospace;margin:0px;font-weight:bold;border:0px;padding:0px">) </span>method.<div>
<div><br></div></div><div>To improve performance there is no DOM tree created in the above process. All xml manipulation is done in the SAX handler or helper classes. This approach might be a bit lightweight for a general framework like JSword but worked well for And Bible's requirements.<div>
<br></div><div>And Bible does not use the optimised approach for non-OSIS documents for which the XXXFilter classes, e.g. GBFFilter, in JSword are required to convert the XXX format to OSIS tags. And Bible's approach could be extended to chain together SAX Filters to incorporate the code in XXXFilter classes.</div>
<div><br></div><div>I have never used StAX but have been googling to find if Woodstox is supported on Android and can find nothing - anybody?</div><div><br></div><div><div><div><div><div><div>Chris, most JSword users seem to use xslt so that would need to be supported but doesn't xslt merely require an InputSource rather than a full DOM tree.</div>
<span class="HOEnZb"><font color="#888888">
<div><br></div><div>Martin</div></font></span><div><div class="h5"><div><br><div class="gmail_quote">On 4 September 2012 10:26, Chris Burrell <span dir="ltr"><<a href="mailto:chris@burrell.me.uk" target="_blank">chris@burrell.me.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">To put in a argument for the other side, I use quite a few xslts to transform the XML to HTML directly. I have a few highly-paremeterized stylesheets to allow for lots of cool displays. Given I'm developing mainly a webapp in a browser, running the XSL on the server and outputting straight HTML is a big win for us.<span><font color="#888888"><div>
<br></div><div>Chris</div></font></span><div><div><div><br><br><div class="gmail_quote">On 4 September 2012 10:15, Joe Walker <span dir="ltr"><<a href="mailto:joe@eireneh.com" target="_blank">joe@eireneh.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word"><div><br></div><div>Sigh - I think the document model in JSword is one of the things I most consistently got wrong. If I remember correctly we started with a standard API, then JAXB then JDOM.</div>
<div>At the time XML seemed like The Future, however there seems to be more and more that argues against that vision for JSword:</div><div>- Android display works around the JSword API to avoid XML</div><div>- Swing uses the horribly broken JEditorPane (?) and its display is probably the worse for it</div>
<div>- Even using XML for JSword on the web, which should be a sweet spot, has (had?) problems like getting reliable XSLT in browsers.</div><div><br></div><div>We're going to need some sort of document object model, and given the existence of OSIS, some sort of ability to serialise it to XML makes some sense, but perhaps we should consider an object model that is somewhat closer to the storage model than the display model.</div>
<span><font color="#888888"><div><br></div><div>Joe.</div></font></span><div><div><br><div><div>On 3 Sep 2012, at 22:20, DM Smith <<a href="mailto:dmsmith@crosswire.org" target="_blank">dmsmith@crosswire.org</a>> wrote:</div>
<br><blockquote type="cite"><div style="word-wrap:break-word">Looks like from your notes that there is more opportunity than just replacing JDOM, but rather not building a DOM at all. Maybe you and Douglas can collaborate?<div>
<br></div><div>In Him,</div><div><span style="white-space:pre-wrap">        </span>DM</div><div><br><div><div>On Sep 3, 2012, at 11:25 AM, Martin Denham <<a href="mailto:mjdenham@gmail.com" target="_blank">mjdenham@gmail.com</a>> wrote:</div>
<br><blockquote type="cite">It would be good to remove JDOM. When working on the first versions of And Bible I had to bypass the JDOM DOM creation to improve performance on low powered Android devices, but my simple workaround only worked for simple, well structured OSIS bibles.<div>
<br></div><div>I made a <a href="http://code.google.com/p/and-bible/wiki/AmendmentsToJSwordForAndroid" target="_blank">few rough notes</a> on it at the time.</div><div><br></div><div>I don't think Android includes a StAX library, but it does include a similar efficient XML Pull library and it would probably be possible to include a StAX library with And Bible. I could do some investigation and experiments if this approach was seriously under consideration.</div>
<div><br></div><div>Martin</div><br><div class="gmail_quote">On 3 September 2012 15:35, Douglas Campos <span dir="ltr"><<a href="mailto:qmx@qmx.me" target="_blank">qmx@qmx.me</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Howdy!<br>
<br>
I was talking with DM wrt removing jdom and using org.w3c.* APIs instead (more portable, less deps), and he asked me to post it here :)<br>
<br>
Any objections? (I'm assuming I'll fix BD too)<br>
<br>
Blessings,<br>
-- qmx<br>
<br>
<br>
_______________________________________________<br>
jsword-devel mailing list<br>
<a href="mailto:jsword-devel@crosswire.org" target="_blank">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>
_______________________________________________<br>jsword-devel mailing list<br><a href="mailto:jsword-devel@crosswire.org" target="_blank">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></div></div>_______________________________________________<br>jsword-devel mailing list<br><a href="mailto:jsword-devel@crosswire.org" target="_blank">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></div></div></div><br>_______________________________________________<br>
jsword-devel mailing list<br>
<a href="mailto:jsword-devel@crosswire.org" target="_blank">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>
<br></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
jsword-devel mailing list<br>
<a href="mailto:jsword-devel@crosswire.org" target="_blank">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>
<br></blockquote></div><br></div></div></div></div></div></div></div></div></div>
<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>
<br></blockquote></div><br></div></div>