Greg has nailed it. <br><br>Practically I try and work out first is the file follows any kind of pattern or is just a pile of junk. Too often latter is the case and life has become too short to bother. <br><br>If there is a pattern then the pattern maybe expressed in CSS, in html tags in combinations. And some are maybe only in the actual text.<br><br>My approach has always been to recognise as many as I can find and then nuke the rest. And then use any technology I know of, regex, xsl whatever to.transform each bit into something useful in OSIS. <br><br>Usually this is an iterative process with some patterns only emerging as I go along. And others not as clear as thought originally. <br><br>Peter<br><br>Sent from my mobile. Please forgive shortness, typos and weird autocorrects.<div class="quote" style="line-height: 1.5"><br><br>-------- Original Message --------<br>Subject: Re: [sword-devel] Tool for convertion html to osis<br>From: Greg Hellings <greg.hellings@gmail.com><br>To: SWORD Developers' Collaboration Forum <sword-devel@crosswire.org><br>CC: <br><br><br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>On its surface, this is a very straightforward process.</div><div><br></div><div>1. Convert the HTML (which is a specific set of defined tags using the SGML grammar) into XML (not specifically targeting XHTML, as that&#39;s a slightly different grammar, but all HTML in places where it violates XML rules can be rendered into XML-compatible forms as long as it is well-formed, since XML is just a strict subset of SGML that requires certain things that SGML leaves as optional).</div><div><br></div><div>There might be other tools to do this specifically, but you can get by with the command line tool `osx` from the Open Jade[0] framework. If you use Fedora this is available from the &quot;opensp&quot; package. I presume other Linux distributions have it similarly packaged.</div><div><br></div><div>2. Convert the XML version of the HTML into OSIS using an XSLT.</div><div><br></div><div>Although the technical outline of this is relatively straightforward, that doesn&#39;t mean the actual implementation is. Step 1 is pretty simple as long as you start from a well-formed HTML document. Step 2 sounds deceptively simple. If the HTML embeds CSS or, worse yet, references an external CSS document, then you might need to consider that. If there is active JavaScript in the document, then you&#39;ll need to figure out if that does anything important to the text that needs to be preserved.</div><div><br></div><div>Additionally, HTML is a presentation format, despite some peoples&#39; efforts to push it away from that. They&#39;ve pretty much failed at that endeavor. So you&#39;ll have to figure out what the presentation markup means and convert that into OSIS. As an example, a superscript number might always be a verse number. But it might not. Encountering &quot;&lt;sup&gt;1&lt;/sup&gt;&quot; might be easily translated to a meaning in your OSIS document, but it also might not, because it might be used by both the verses and the footnotes. Of course, those might be delimited by `&lt;sup class=&quot;verse&quot;&gt;1&lt;/sup&gt;` and `&lt;sup class=&quot;footnote&quot;&gt;1&lt;/sup&gt;` but it&#39;s equally possible that the difference is `&lt;sup style=&quot;color: green&quot;&gt;1&lt;/sup&gt;` and `&lt;sup style=&quot;color: blue&quot;&gt;1&lt;/sup&gt;` and now what does THAT mean? Of course, they might have gone with `&lt;span style=&quot;vertical-align: super; font-size: 50%; color: blue; cursor: pointer&quot; onclick=&quot;show_box();&quot;&gt;1&lt;/span&gt;` and now you&#39;ve got to parse the value of `show_box` defined in JavaScript somewhere to figure out what&#39;s been done and what type of character this is.</div><div><br></div><div>So the simplicity of #2 really boils down to the nature of the HTML you&#39;re dealing with, and if it is exceedingly complex in its own right, how much of its own information you need to preserve in the OSIS that you&#39;re getting out the other end. And without any visibility into the file, none of the rest of us can begin to guess at the complexity of that process. But it CAN be automated. Like John, I&#39;ve invested a lot of time back in the day on converting Logos XML to OSIS, and I&#39;m happy to say these things are possible (just not always easy).<br></div><div><br></div><div>There are a number of people on this list who are and could be qualified to assist you if there was a lot more information to fill in all the details of what I&#39;ve just described above. However, whether you can engage us will depend on the nature of the text you have, the way you&#39;ve been given it, and any distribution requirements and rights that it&#39;s held under.</div><div><br></div><div>--Greg<br></div><div><br></div><div>[0] <a href="http://openjade.sourceforge.net/">http://openjade.sourceforge.net/</a><br></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Feb 1, 2019 at 10:27 AM Cyrille &lt;<a href="mailto:lafricain79@gmail.com">lafricain79@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,<br>
All is in the title, someone have a Linux tool to convert html files to<br>
osis?<br>
In this case it is for the KD module. I download the html source files<br>
but I want not to work  a lot on it. First I will work on bible issues<br>
and not commentary. But if someone have a tool to do quickly the job...<br>
<br>
_______________________________________________<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" rel="noreferrer" target="_blank">http://www.crosswire.org/mailman/listinfo/sword-devel</a><br>
Instructions to unsubscribe/change your settings at above page<br>
</blockquote></div>
</blockquote></div>