> On Mar 17, 2019, at 10:07 AM, Karl Kleinpaste <k...@kleinpaste.org> wrote:
> 
> However, for this purpose, the deeper problem is that Sword erroneously 
> generates self-closing <div> tags, which do not work. Search "html 
> self-closing div" and discover all the conflicting noise over it. My solution 
> in Xiphos was simply to obliterate these tags in introductory material; they 
> have no visual manifestation and I don't know why the XHTML filters pass them 
> in the 1st place. They look like
> 
> <div sID="gen34165" type="introduction"/>
> 
> and they caused my .introMaterial change to bleed throughout the chapter 
> until I implemented the obliteration. See 
> https://github.com/crosswire/xiphos/issues/845 
> <https://github.com/crosswire/xiphos/issues/845>

I don’t know why the OSIS->XHTML renderer passes the self-closing divs from 
OSIS to XHTML. I do know why they are that way in OSIS. OSIS’s schema allows a 
div to be milestoned, meaning it has an sID or an eID and is self-closing.

At this time <div type=“colophon”>…</div> is the only container div in the OSIS 
document that osis2mod preserves. All others are converted to milestoned divs.

SWORD’s OSIS->XHTML filter can be changed to output OSIS’s milestoned, 
self-closed divs as empty but not self closing, e.g. <div sID=“xyz”></div>.

As to why they are passed, they can be styled with top and bottom margin and 
padding.

The fundamental reason is that a module defines the addressable verse as the 
presentation unit. This notion of a verse is more than just the marked up 
content of the verse but also includes all the markup between verses. So that 
unit has to be well-formed xml. The only way is for structural elements that 
span verses to be milestoned when the module is built.

The largest front-end use case is that a chapter is displayed all at once. In 
this case, the chapter needs to be well-formed and it could be composed of 
verses that are not well-formed.

The other front-end use case is the rendering of search hits, where a search 
hit is an individual verse. In this case, it needs to be well-formed or 
presented differently.

JSword uses an XML parser to parse each verse as XML to build the DOM for it. 
An XML parser requires well-formed XML to parse.

In Him,
        DM

_______________________________________________
sword-devel mailing list: sword-devel@crosswire.org
http://www.crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page

Reply via email to