-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adjusting the OSIS to avoid orphaned verse tags in SWORD? #82
Comments
Matters arising:
|
This actually sounds more like a frontend issue to me rather than an osis formatting problem. One of the reasons I formatted the osis in this manner was to ensure that tags were properly nested so as to avoid display issues with orphaned verses. Before I tried ensuring that there was proper nesting of tags, I had issues with how bibles were displayed in some sword frontends. Adjusting the tags to try to ensure proper nesting eliminated the display issues for me in all of the frontends that I use. |
Is Xiphos one of the front-ends that you use for module testing?
How do you understand "nesting" in the context of the milestone versions of verse and chapter elements? |
I should add that my workaround does not cause osis2mod to report any NESTING errors. Nor does it cause the OSIS to fail to validate to the .DTD schema. |
I test using xiphos, bibletime, and AndBible. They are the only frontends that I can use at this time. Bibletime never had problems but I think it does it's own formatting. I understand nesting with milestone tags the same as with other tags. The only difference being they can cross boundaries since they are milestones. |
FWIW, I've just developed a new experimental TextPipe filter that seeks to fix all possible contexts. This uses a pattern that does not make use of the paragraph p element. Here's the pseudo-code for my new method:
Aside: Using a tilde simply ensures that the processing does not miss 50% of the verses. Observations:
For the latter, it indicates that I could edit the SFM file to remove some spurious extra Joy, pure joy!TextPipe is a superb tool for trying out new algorithms. I wouldn't be without it. |
My workaround is based on the notion that there should not be any content between
This ensures that all module content can be referenced by SWORD. Nesting
|
FIO: Here is a clipboard copy of my new TextPipe filter. Clipboard copy of Fix OSIS verse eID milestones.txt
|
Any further thoughts on this issue? |
Orphaned verse tags can occur in a number of contexts, some simple to describe and some rather more complex. This issue will initially focus on the simpler contexts in Bibles that are paragraphed.
To make things clearer to follow, the XML layout has been re-arranged in the snippets that are provided as examples, but this is only the same kind of cosmetic change that you can obtain using
xmllint
.An orphaned verse tag is where the displayed verse tag is alone on one line and the verse text is displayed on the next line. It looks sloppy when the module is viewed in a SWORD front-end and especially so when there are lots of these in the same module.
Example:
Observe that the verse eID milestone is before the paragraph break. This causes an orphaned verse tag for verse 23. Here's the fix:
Here, the verse eID milestone has been moved into the next paragraph. This eliminates the display problem in SWORD front-ends.
Workaround:
For this simple scenario it's feasible to fix all the similar locations by a PCRE search and replace.
Here's a tab delimited single line replace list that does that.
Harder cases:
The more complex contexts that give rise to orphans are harder to deal with, but the principle is the same. Here's a partial list of possible scenarios.
Conclusion:
My view is that tackling the simplest and most common context first should
The text was updated successfully, but these errors were encountered: