<div dir="ltr">Off the cuff here, it seems the issue is the difference in semantics of &lt;div&gt; between OSIS - where it marks a structural division within a text which can be of many different levels and layers and in XHTML where it represents a box of block-style layout which defaults to being the full width of its container.<div>
<br></div><div>Producing &quot;proper&quot; output seems like it is only feasible if we are handling a block of output. The sample you have contains 3 sID and 1 eID attributes on div elements. And they are self-closing elements, which will typically render as vertical whitespace in XHTML. Ideally, any with sID=&quot;...&quot; would be rendered with &lt;div&gt; and any with eID=&quot;...&quot; would be rendered with &lt;/div&gt;.</div>
<div><br></div><div>The problem becomes rendering a list of 30 (or however many) verses, if each is rendered separately by our filters. If &lt;div sID=&quot;gen1&quot;/&gt; is within Gen.0.0 but &lt;div eID=&quot;gen1&quot;/&gt; is at the end of the chapter, which appears to be the case here, then we don&#39;t properly want to generate something like<br>
&lt;div&gt;</div><div> Gen.0.0</div><div style>&lt;/div&gt;</div><div> Gen.1.0</div><div> Gen.1.1</div><div> Gen.1.2</div><div> ...</div><div>But rather we want something like</div><div>&lt;div&gt;</div><div> Gen.0.0</div>
<div> Gen.1.0</div><div> Gen.1.1</div><div> Gen.1.2</div><div> ...</div><div>&lt;/div&gt;<br><div class="gmail_extra" style>At least when not dealing with inter-linear versions, we do.</div><div class="gmail_extra" style>
<br></div><div class="gmail_extra" style>In BibleTime we have discussed how to properly handle this and came up with an interesting solution that we engineered but never implemented. Our thought was to store information along with each verse which includes a pre- and post- verse markup. This would need to become part of the OSIS import process, and it would track the &quot;semantically&quot; open elements such as &lt;div sID=&quot;gen1&quot; /&gt; which, by XML standards are no longer open but the OSIS semantics designate that div is open until &lt;div eID=&quot;gen1&quot; /&gt; is encountered. This would be in addition to the actually open XML elements.</div>
<div class="gmail_extra" style><br></div><div class="gmail_extra" style>Every verse entry would then keep a store of the open elements at its start and those still open at the end of the entry. Then, when an arbitrary range is selected for rendering - say, Genesis 1:15-25 - a single, complete OSIS document could be generated by taking Gen.1.15.pre and appending that to the text of Gen.1.15-Gen.1.25 and then appending Gen.1.25.post. Then a proper filter can operate on the entire block of text to generate correctly wrapping &lt;div&gt; ... &lt;/div&gt; and other markup.</div>
<div class="gmail_extra" style><br></div><div class="gmail_extra" style>Perhaps I overstepped the answer of what the above markup _should_ be, but I just wanted to toss out the solution that the BT folks have put brain power on to address the problem of stray open-and-close &lt;div&gt; elements. These seem to be the main problem in the sample you have presented. Again, there was never an implementation of this, as it would need to essentially re-import Sword module data to generate the pre- and post- data, and that went beyond the scope of any work heretofore on BibleTime.</div>
<div class="gmail_extra" style><br></div><div class="gmail_extra" style>--Greg</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 8, 2013 at 2:31 PM, Troy A. Griffitts <span dir="ltr">&lt;<a href="mailto:scribe@crosswire.org" target="_blank">scribe@crosswire.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">OK guys,<br>
<br>
I&#39;m starting work on this. I&#39;ve setup a test in our testsuite for whitespace against our OSIS reference doc. Here are the links:<br>
<br>
test:<br>
<a href="http://crosswire.org/svn/sword/trunk/tests/osistest.cpp" target="_blank">http://crosswire.org/svn/<u></u>sword/trunk/tests/osistest.cpp</a><br>
(whitespace test added at the end)<br>
<br>
OSIS Reference Document:<br>
<a href="http://crosswire.org/svn/sword/trunk/tests/testsuite/osisReference.xml" target="_blank">http://crosswire.org/svn/<u></u>sword/trunk/tests/testsuite/<u></u>osisReference.xml</a><br>
<br>
Before I start any work, I want to show what output we get currently. It is obviously seriously messed up.<br>
<br>
This is from the new XHTML filter set (which is based on the HTMLHREF filter set). The first obvious issue is the passthru of the OSIS &lt;div&gt; elements as-is. Anyone like to suggest exactly WHAT they would like as output from the XHTML filterset from the OSIS Reference document here? Current output below:<br>

<br>
<br>
&lt;div sID=&quot;gen1&quot; type=&quot;bookGroup&quot;/&gt; &lt;h3&gt;Old Testament&lt;/h3&gt; &lt;div osisID=&quot;Gen&quot; sID=&quot;gen2&quot; type=&quot;book&quot;/&gt; &lt;h3&gt;THE FIRST BOOK OF MOSES CALLED GENESIS&lt;/h3&gt; &lt;div sID=&quot;gen3&quot; type=&quot;section&quot;/&gt; &lt;h3&gt;Introduction and Outline&lt;/h3&gt; &lt;br /&gt; This is the &lt;b&gt;Book of Genesis&lt;/b&gt;, the &lt;i&gt;first&lt;/i&gt; book in the Bible. It may be outlined as follows: &lt;br /&gt;&lt;br /&gt; &lt;ul&gt; &lt;li&gt;&lt;i&gt;1&lt;/i&gt;Creation of Heaven and Earth, 1:1-2:4a&lt;/li&gt; &lt;li&gt;&lt;i&gt;2&lt;/i&gt;Creation of Man and Woman, 2:4b-25&lt;/li&gt; &lt;li&gt;&lt;i&gt;3&lt;/i&gt;Fall, 3:1-24&lt;/li&gt; &lt;li&gt;...&lt;/li&gt; &lt;/ul&gt; &lt;br /&gt;&lt;br /&gt; Tables work like this: &lt;b&gt;Column 1 Label&lt;/b&gt; &lt;b&gt;Column 2 Label&lt;/b&gt; Column 1, Row 1 Column 2, Row 1 Column 1, Row 2 Column 2, Row 2 &lt;br /&gt;&lt;div eID=&quot;gen3&quot; type=&quot;section&quot;/&gt;<br>

&lt;div sID=&quot;gen7&quot; type=&quot;majorSection&quot;/&gt; &lt;h3&gt;From Creation to Abraham (1:1–11:9)&lt;/h3&gt;<br>
[ Genesis 1:1 ] In the beginning God created the heaven and the earth. &lt;br /&gt;<br>
[ Genesis 1:2 ] Text of verse 2.<br>
<br>
<br>
<br>
<br>
______________________________<u></u>_________________<br>
sword-devel mailing list: <a href="mailto:sword-devel@crosswire.org" target="_blank">sword-devel@crosswire.org</a><br>
<a href="http://www.crosswire.org/mailman/listinfo/sword-devel" target="_blank">http://www.crosswire.org/<u></u>mailman/listinfo/sword-devel</a><br>
Instructions to unsubscribe/change your settings at above page<br>
</blockquote></div><br></div></div></div>