<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. <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. </div><div><br><div dir="ltr">— DM Smith</div><div dir="ltr"><br>On Feb 9, 2019, at 9:56 AM, David Haslam <<a href="mailto:dfhdfh@protonmail.com">dfhdfh@protonmail.com</a>> wrote:<br><br></div><blockquote type="cite"><div dir="ltr"> <div>Thanks DM.</div><div><br></div><div>Very helpful. </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. </div><div><br></div><div>And equally so, a space should never be inadvertently inserted just before a note. </div><div><br></div><div>I suspect some XML prettifiers may break one or both of these rules. </div><div><br></div><div>Best regards </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 <<a href="mailto:dmsmith@crosswire.org" class="">dmsmith@crosswire.org</a>> 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 <div>, <p>, <br> 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><?xml version="1.0" ?><br><List name="Fruit List"><br>        <Item>Apple</Item><br>        <Item>Banana</Item><br>        <Item>Pear</Item><br></List><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><?xml version="1.0" ?><br><List name="Fruit List"<br>        ><Item>Apple</Item<br>        ><Item>Banana</Item<br>        ><Item>Pear</Item<br>></List><br><br>3b) Some pretty printers will introduce spaces at the beginning of text.<br><?xml version="1.0" ?><br><List name="Fruit List"><br>        <Item><br>                Apple<br>        </Item><br>        <Item><br>                Banana<br>        </Item><br>        <Item><br>                Pear<br>        </Item><br></List><br>If the pretty printing put the newlines and spaces within the element it would not have introduced extra content.<br><?xml version="1.0" ?><br><List name="Fruit List"<br>        ><Item<br>                >Apple</Item<br>        ><Item<br>                >Banana</Item<br>        ><Item<br>                >Pear</Item<br>></List><br><br>Best advice for an OSIS module:<br>Verse per line.<br>Don’t put spaces or new lines after an opening <div>.<br><br>In Him,<br>        DM<br><br>> On Feb 8, 2019, at 2:02 PM, David Haslam <<a href="mailto:dfhdfh@protonmail.com">dfhdfh@protonmail.com</a>> wrote:<br>><br>> Here's a question that I'd like our OSIS experts to ponder.<br>><br>> In XML, there's a longstanding topic relating to whitespace.<br>><br>> See <a href="http://usingxml.com/Basics/XmlSpace">http://usingxml.com/Basics/XmlSpace</a><br>><br>> 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>><br>> E.g. Might we inadvertently get a space inserted between a tagged word and a note tag?<br>><br>> i.e. As maybe the result of performing a "pretty print" operation on the OSIS source text.<br>><br>> cf. I'm sure you can think of other potential areas of interest.<br>><br>> AFAIK, this has never been discussed before among us.<br>><br>> 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>><br>><br>> Best regards,<br>><br>> David<br>><br>> Sent with ProtonMail Secure Email.<br>><br>><br>><br>> _______________________________________________<br>> sword-devel mailing list: <a href="mailto:sword-devel@crosswire.org">sword-devel@crosswire.org</a><br>> <a href="http://www.crosswire.org/mailman/listinfo/sword-devel">http://www.crosswire.org/mailman/listinfo/sword-devel</a><br>> 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>