[sword-devel] Are individual verses in a module "well formed"

Troy A. Griffitts scribe at crosswire.org
Wed Apr 20 11:52:45 MST 2005

	No, SWORD currently does no work to promise any retrievable segment of 
text as valid markup.  I have talked with a few XML experts and have had 
a number of ideas brewing for the past few years how we might offer such 
information, as it is a necessary obstacle to overcome.

	The question, more generally, really is:

	How can one package and send a segment of an XML document.  Steve 
DeRose has pointed me to at least one project/standard which tries to 
address this issue.  I need to review my email archives and study their 
solution.  My ideas, very generally are either:

With each retrieved segment of text from the API, provide a context tag 
stack object which described the tag context at the start of the segment.


Do the actual work of returning valid XML for a segment of text, and 
provide an attribute in all supplied markup to designate it as such:

<verse osisID="Mat.6.10"><q who="Jesus" level="1" sID="Mat.5.3.q1" 
misc="phantom" /><q who="Jesus" level="2" sID="Mat.6.9.q1" 
misc="phantom" />Your kingdom come. Your will be done, On earth as it is 
in heaven<q eID="Mat.6.9.q1" misc="phantom" /><q eID="Mat.5.3.q1" 
misc="phantom" /></verse>

Note that this last example doesn't really supply any REQUIRED FOR XML 
VALIDITY, but does provide the more important tags required to represent 
the text correctly.  And also not that any 'phantom' TRUE END TAGS will 
not be identifiable, as we cannot supply an attributed.

I think the first option works best for our engine design.  When a 
client iterates a chapter, making 1 call for each verse, they aren't 
concerned with valid XML for each verse, but rather, they want any 
context when they start the segment (chapter in our example) and then 
they may want to close any remaining open tags when done rendering.

But it's all still just rumbling around in my mind, so any ideas are 
very welcome.


  DM Smith wrote:

> I asked this earlier on another thread, but it was lost in the noise of 
> that thread.
> Does Sword, in making a module, ensure (or try to ensure) that each 
> verse is well formed? That is, for every begin feature marker, there is 
> a corresponding end feature marker. In XML and ThML it would be a 
> <tag>...</tag> or <tag/> but in gbf it might be a matched pair <TAG> <tAG>.
> If not, is there some boundary (e.g. chapter) that is guaranteed to be a 
> well-formed unit?
> And any suggestions on how to manage individual verses that are not well 
> formed?
> _______________________________________________
> 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

More information about the sword-devel mailing list