[sword-devel] osis2mod debugging/titles

DM Smith dmsmith at crosswire.org
Wed Nov 17 11:40:10 MST 2010


On 11/17/2010 01:25 PM, David Haslam wrote:
> "The practical nature of it is that the SWORD engine won't hide titles marked
> canonical. The encoder needs to decide. "
>
> Really? - then please cite a module which demonstrates that this is so.
>
> The KJV module hides 'canonical acrostic titles' for Psalm 119 when (using
> Xiphos) module option Show headings is unticked.
> Admittedly, they are not assigned the attribute type="acrostic", but this is
> secondary to the claim in question.
>
> Here's what the markup looks like (as output using MOD2IMP).
> $$$Psalms 119:0
> <title type="chapter">PSALM 119.</title>
> $$$Psalms 119:1
> <title canonical="true" subType="x-preverse" type="section"><foreign
> n="א">ALEPH.</foreign></title><w lemma="strong:H0835">Blessed</w>
> <transChange type="added">are</transChange>  <w lemma="strong:H08549">the
> undefiled</w>  <w lemma="strong:H01870">in the way</w>,<w
> lemma="strong:H01980" morph="strongMorph:TH8802">who walk</w>  <w
> lemma="strong:H08451">in the law</w>  <w lemma="strong:H03068">of the
> <seg><divineName>Lord</divineName></seg></w>.<note type="study">undefiled:
> or, perfect, or, sincere</note>
> $$$Psalms 119:2
> <w lemma="strong:H0835">Blessed</w>  <transChange
> type="added">are</transChange>  <w lemma="strong:H05341"
> morph="strongMorph:TH8802">they that keep</w>  <w lemma="strong:H05713">his
> testimonies</w>,<transChange type="added">and that</transChange>  <w
> lemma="strong:H01875" morph="strongMorph:TH8799">seek</w>  <w
> lemma="strong:H03820">him with the whole heart</w>.As you can see, the ALEPH
> is with canonical="true".
>
> David
>
Then it is a bug in the code (or perhaps Xiphos does not use the OSIS 
Headings filter):
Here is the code (I've changed the indent for readability). It's clear 
that the intention is that canonical does not hide the heading.

if ( !tag.isEndTag(pvDID) && (withinPreverseDiv
      || (tag.getAttribute("subType") && 
!stricmp(tag.getAttribute("subType"), "x-preverse"))
      || (tag.getAttribute("subtype") && 
!stricmp(tag.getAttribute("subtype"), "x-preverse")) // deprecated
           )) {
      hide = true;
      preverse = true;
      header = "";
      canonical = (tag.getAttribute("canonical") && 
(!stricmp(tag.getAttribute("canonical"), "true")));
      continue;
}
if (!tag.isEndTag(pvDID)) { //start tag
      hide = true;
      header = "";
      if (option || canonical) {      // we want the tag in the text
           text.append('<');
           text.append(token);
           text.append('>');
      }
      continue;
}
if (hide && tag.isEndTag(pvDID)) {
      if (module->isProcessEntryAttributes() && ((option || canonical) 
|| (!preverse))) {
           if (preverse) {
                sprintf(buf, "%i", pvHeaderNum++);
                module->getEntryAttributes()["Heading"]["Preverse"][buf] 
= header;
           }
           else {
                sprintf(buf, "%i", headerNum++);
                
module->getEntryAttributes()["Heading"]["Interverse"][buf] = header;
                if (option || canonical) {      // we want the tag in 
the text
                     text.append(header);
                }
           }

           StringList attributes = startTag.getAttributeNames();
           for (StringList::const_iterator it = attributes.begin(); it 
!= attributes.end(); it++) {
                
module->getEntryAttributes()["Heading"][buf][it->c_str()] = 
startTag.getAttribute(it->c_str());
           }
      }
      hide = false;
      if (!(option || canonical) || preverse) {       // we don't want 
the tag in the text anymore
           preverse = false;
           continue;
      }
      preverse = false;
      pvDID = 0;
}




More information about the sword-devel mailing list