<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto">Regarding ws and notes, it depends. Some modules put the marker before the item so don’t follow that w a space but precede with one if appropriate. Most follow the item and then don’t precede with one but follow if appropriate.&nbsp;<div><br></div><div>In the print 1769 KJV many have markers with surrounding whitespace. This poses a problem w RTF renderers when markers are not shown as it show 2 spaces at that point. It’ll be fine in most HTML contexts. If CSS merely hides the marker then it’d may show 2 spaces.&nbsp;</div><div><br><div dir="ltr">— DM Smith</div><div dir="ltr"><br>On Feb 9, 2019, at 9:56 AM, David Haslam &lt;<a href="mailto:dfhdfh@protonmail.com">dfhdfh@protonmail.com</a>&gt; wrote:<br><br></div><blockquote type="cite"><div dir="ltr">   <div>Thanks DM.</div><div><br></div><div>Very helpful.&nbsp;</div><div><br></div><div>Any thoughts about XML ws before or after a note element ?</div><div><br></div><div>Clearly, a space just after a note should never be inadvertently removed.&nbsp;</div><div><br></div><div>And equally so, a space should never be inadvertently inserted just before a note.&nbsp;</div><div><br></div><div>I suspect some XML prettifiers may break one or both of these rules.&nbsp;</div><div><br></div><div>Best regards&nbsp;</div><div><br></div><div>David</div><div><br></div><div id="protonmail_mobile_signature_block">Sent from ProtonMail Mobile</div> <div><br></div><div><br></div>On Sat, Feb 9, 2019 at 14:41, DM Smith &lt;<a href="mailto:dmsmith@crosswire.org" class="">dmsmith@crosswire.org</a>&gt; wrote:<blockquote class="protonmail_quote" type="cite">  There are several things in play wrt to whitespace in an OSIS document as it pertains to a CrossWire module rendered by SWORD or JSword to a frontend.<br>1) osis2mod’s handling of whitespace.<br>1a) The parser that osis2mod uses to read the OSIS document is not a validating parser. This means that whitespace between elements is always considered important.<br>1b) Newlines
 are replaced by a space. Note: carriage returns
 which are part of a Windows style document are not permitted in valid XML. Nor are tabs. If present they are passed as is.<br>1c) Multiple spaces are folded into a single space.<br>1d) Verses are trimmed of leading and trailing space.<br>1e) Verses in the index have a trailing dos newline, even if not present in the input.<br><br>2) Rendering<br>2a) The parser that SWORD uses to render an OSIS module is not a validating parser. This means that whitespace between elements is always considered important.<br>2b) HTML and RTF are different beasts. In HTML elements such as &lt;div&gt;, &lt;p&gt;, &lt;br&gt; produce newlines in the output which are rendered by CSS, perhaps implicit. RTF is precise and controlled by the document.<br><br>3) Pretty print of an OSIS XML document.<br>3a) Nearly all pretty printers will introduce spaces between elements.<br>&lt;?xml version="1.0" ?&gt;<br>&lt;List name="Fruit List"&gt;<br>        &lt;Item&gt;Apple&lt;/Item&gt;<br>        &lt;Item&gt;Banana&lt;/Item&gt;<br>        &lt;Item&gt;Pear&lt;/Item&gt;<br>&lt;/List&gt;<br>This introduces text.<br>If the pretty printing put the newlines and spaces within the element it would not have introduced extra content.<br>&lt;?xml version="1.0" ?&gt;<br>&lt;List name="Fruit List"<br>        &gt;&lt;Item&gt;Apple&lt;/Item<br>        &gt;&lt;Item&gt;Banana&lt;/Item<br>        &gt;&lt;Item&gt;Pear&lt;/Item<br>&gt;&lt;/List&gt;<br><br>3b) Some pretty printers will introduce spaces at the beginning of text.<br>&lt;?xml version="1.0" ?&gt;<br>&lt;List name="Fruit List"&gt;<br>        &lt;Item&gt;<br>                Apple<br>        &lt;/Item&gt;<br>        &lt;Item&gt;<br>                Banana<br>        &lt;/Item&gt;<br>        &lt;Item&gt;<br>                Pear<br>        &lt;/Item&gt;<br>&lt;/List&gt;<br>If the pretty printing put the newlines and spaces within the element it would not have introduced extra content.<br>&lt;?xml version="1.0" ?&gt;<br>&lt;List name="Fruit List"<br>        &gt;&lt;Item<br>                &gt;Apple&lt;/Item<br>        &gt;&lt;Item<br>                &gt;Banana&lt;/Item<br>        &gt;&lt;Item<br>                &gt;Pear&lt;/Item<br>&gt;&lt;/List&gt;<br><br>Best advice for an OSIS module:<br>Verse per line.<br>Don’t put spaces or new lines after an opening &lt;div&gt;.<br><br>In Him,<br>        DM<br><br>&gt; On Feb 8, 2019, at 2:02 PM, David Haslam &lt;<a href="mailto:dfhdfh@protonmail.com">dfhdfh@protonmail.com</a>&gt; wrote:<br>&gt;<br>&gt; Here's a question that I'd like our OSIS experts to ponder.<br>&gt;<br>&gt; In XML, there's a longstanding topic relating to whitespace.<br>&gt;<br>&gt; See <a href="http://usingxml.com/Basics/XmlSpace">http://usingxml.com/Basics/XmlSpace</a><br>&gt;<br>&gt; When we make a module from an OSIS file, are there any aspects of XML whitespace that can make a significant difference to how the module displays text or features?<br>&gt;<br>&gt; E.g. Might we inadvertently get a space inserted between a tagged word and a note tag?<br>&gt;<br>&gt; i.e. As maybe the result of performing a "pretty print" operation on the OSIS source text.<br>&gt;<br>&gt; cf. I'm sure you can think of other potential areas of interest.<br>&gt;<br>&gt; AFAIK, this has never been discussed before among us.<br>&gt;<br>&gt; With various software tools available for making "innocuous" changes to XML files, it's certainly the case that there's nothing to dissuade module providers from using them to "prettify" the OSIS file, even though there might - theoretically at least - be consequences.<br>&gt;<br>&gt;<br>&gt; Best regards,<br>&gt;<br>&gt; David<br>&gt;<br>&gt; Sent with ProtonMail Secure Email.<br>&gt;<br>&gt;<br>&gt;<br>&gt; _______________________________________________<br>&gt; sword-devel mailing list: <a href="mailto:sword-devel@crosswire.org">sword-devel@crosswire.org</a><br>&gt; <a href="http://www.crosswire.org/mailman/listinfo/sword-devel">http://www.crosswire.org/mailman/listinfo/sword-devel</a><br>&gt; Instructions to unsubscribe/change your settings at above page<br><br></blockquote><div><br></div><div><br></div></div></blockquote><blockquote type="cite"><div dir="ltr"><span>_______________________________________________</span><br><span>sword-devel mailing list: <a href="mailto:sword-devel@crosswire.org">sword-devel@crosswire.org</a></span><br><span><a href="http://www.crosswire.org/mailman/listinfo/sword-devel">http://www.crosswire.org/mailman/listinfo/sword-devel</a></span><br><span>Instructions to unsubscribe/change your settings at above page</span></div></blockquote></div></body></html>