[sword-devel] How to deal with invalid markup?

Tobias Klein contact at tklein.info
Wed Jul 17 23:00:57 MST 2019

I just checked how the "plaintext" version of engNET2016eb Exodus 3:22 
looks like.

Whereas all the other verses are actually returned with no markup, this 
particular verse is still returned like this (using module->stripText()):

Every woman will ask her neighbor and the one who happens to be staying 
in her house for items of silver and gold and for clothing. You will put 
these articles on your sons and daughters – thus you will plunder 
Egypt!”‘span class=”footnote” id=”footnote-65”’‘span class=”key”’65‘a 
href=”#note-65” class=”backref”’3:19‘/a’‘span class=”text”’ *tn*: *Heb* 
“and not with a mighty hand.” This expression (וְלֹא בְּיָד חֲזָקָה, 
vÿlo’ vÿyad khazaqa) is unclear, since v. 20 says that God will stretch 
out his hand and do his wonders. Some have taken v. 19b to refer to 
God’s mighty hand also, meaning that the king would not let them go 
unless a mighty hand compels him (NIV). The expression “mighty hand” is 
used of God’s rescuing Israel elsewhere ( Exod 6:1, 13:9, 32:11; but 
note also Num 20:20). This idea is a rather general interpretation of 
the words; it owes much to the LXX, which has “except by a mighty hand,” 
though “and not with” does not have the meaning of “except” or “unless” 
in other places. In view of these difficulties, others have suggested 
that v. 19b means “strong [threats]” from the Israelites (as in 4:24ff. 
and 5:3; see B. Jacob, *Exodus*, 81). This does not seem as convincing 
as the first view. Another possibility is that the phrase conveys 
Pharaoh’s point of view and intention; the Lord knows that Pharaoh plans 
to resist letting the Israelites go, regardless of the exercise of a 
strong hand against him (P. Addinall, “Exodus III 19B and the 
Interpretation of Biblical Narrative,” *VT* 49 [1999]: 289-300; see also 
the construction “and not with” in Num 12:8; 1 Sam 20:15 and elsewhere). 
If that is the case, v. 20 provides an ironic and pointed contradiction 
to Pharaoh’s plans as the Lord announces the effect that his hand will 
have. At any rate, Pharaoh will have to be forced to let Israel go.

I guess the SWORD engine is not able to filter out the markup in this 
particular case.
Using plaintext as a fallback option may not be sufficient.

Best regards,

On 17.07.19 22:12, Tobias Klein wrote:
> Thanks, good advice! Especially the idea about dynamically validating 
> markup text and then going for the plain text version as a fallback. 
> I'll think about using that option in node-sword-interface (Ezra 
> Project's SWORD integration library).
> Best regards,
> Tobias
> On 17.07.19 13:59, Peter Von Kaehne wrote:
>> 1) The best way is to recognise it and either fall back to something 
>> sane or refuse to deal with the module without crashing. You could 
>> presumably if an xml chunk is delivered by the engine to you and is 
>> not internally valid ask the engine to re-render it plainly and spit 
>> out some message to that effect on the terminal. Then a use may be in 
>> the position to see this and send a bug report to whoever is 
>> responsible for the dodgy module.
>> 2) CrossWire modules are for teh last 10 years or so always tested 
>> and validated before they are published but other repositories are 
>> subject to their own rules. The module you reference is from eBible 
>> and not CrossWire. But - admittedly - we have in CrossWire still a 
>> lot of old modules which may well have bugs which only show up slowly.
>> Peter
>> *Gesendet:* Mittwoch, 17. Juli 2019 um 07:13 Uhr
>> *Von:* "Tobias Klein" <contact at tklein.info>
>> *An:* "SWORD Developers' Collaboration Forum" <sword-devel at crosswire.org>
>> *Betreff:* [sword-devel] How to deal with invalid markup?
>> Hi everyone,
>> Is there a recommended way on how to deal with invalid markup (in a 
>> frontend) when using the text from a Sword module?
>> To me invalid markup is basically invalid XML.
>> You find an example below (Exodus 3:22 / engNET2016eb).
>> Are Sword modules validated with standard XML validation tools before 
>> being published?
>> Best regards,
>> Tobias
>> Module: engNET2016eb
>> Mark-up text of Exodus 3:22 (module->getRawEntry()):
>> <w lemma="strong:H802">Every</w> <w lemma="strong:H802">woman</w> <w 
>> lemma="strong:H7592">will ask</w> <w lemma="strong:H7934">her 
>> neighbor</w> <w lemma="strong:H1481">and the one who happens to be  
>> staying</w> <w lemma="strong:H1004">in her house</w> <w 
>> lemma="strong:H3627">for items</w> <w lemma="strong:H3701">of 
>> silver</w> <w lemma="strong:H2091">and gold</w> <w 
>> lemma="strong:H8071">and for clothing</w>. <w 
>> lemma="strong:H7760">You will put</w> <w lemma="strong:H3627">these 
>> articles</w> <w lemma="strong:H5921">on</w> <w 
>> lemma="strong:H1121">your sons</w> <w lemma="strong:H1323">and 
>> daughters</w> <w lemma="strong:H5337">– thus you</w>
>> INVALID section starts here:
>> <w lemma="strong:H4713">will plunder Egypt</w>*!” ‘*span 
>> class=”footnote” id=”footnote-65”*’‘*span class=”key”’65‘
>> <w lemma="strong:H7760">a</w>**href=”#note-65” 
>> class=”backref”’*3:19‘/a’‘*span class=”text”’ <hi 
>> type="italic">tn</hi>: <hi type="italic">Heb</hi> “
>> <w lemma="strong:H1121">and</w> <w lemma="strong:H1121">not</w> <w 
>> lemma="strong:H1004">with</w> <w lemma="strong:H7760">a</w> mighty hand.”
>> ...
>> _______________________________________________ sword-devel mailing 
>> list: sword-devel at crosswire.org 
>> http://www.crosswire.org/mailman/listinfo/sword-devel Instructions to 
>> unsubscribe/change your settings at above page
>> _______________________________________________
>> sword-devel mailing list:sword-devel at crosswire.org
>> http://www.crosswire.org/mailman/listinfo/sword-devel
>> Instructions to unsubscribe/change your settings at above page
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/sword-devel/attachments/20190718/0a2a4742/attachment-0001.html>

More information about the sword-devel mailing list